aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig124
-rw-r--r--arch/arm/Kconfig.debug121
-rw-r--r--arch/arm/Makefile6
-rw-r--r--arch/arm/boot/Makefile4
-rw-r--r--arch/arm/boot/compressed/decompress.c2
-rw-r--r--arch/arm/boot/dts/Makefile28
-rw-r--r--arch/arm/boot/dts/am33xx.dtsi14
-rw-r--r--arch/arm/boot/dts/animeo_ip.dts4
-rw-r--r--arch/arm/boot/dts/armada-370-db.dts35
-rw-r--r--arch/arm/boot/dts/armada-370-mirabox.dts18
-rw-r--r--arch/arm/boot/dts/armada-370-rd.dts68
-rw-r--r--arch/arm/boot/dts/armada-370-xp.dtsi55
-rw-r--r--arch/arm/boot/dts/armada-370.dtsi21
-rw-r--r--arch/arm/boot/dts/armada-xp-db.dts31
-rw-r--r--arch/arm/boot/dts/armada-xp-gp.dts113
-rw-r--r--arch/arm/boot/dts/armada-xp-mv78230.dtsi6
-rw-r--r--arch/arm/boot/dts/armada-xp-mv78260.dtsi6
-rw-r--r--arch/arm/boot/dts/armada-xp-mv78460.dtsi6
-rw-r--r--arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts18
-rw-r--r--arch/arm/boot/dts/armada-xp.dtsi19
-rw-r--r--arch/arm/boot/dts/at91rm9200.dtsi158
-rw-r--r--arch/arm/boot/dts/at91rm9200ek.dts5
-rw-r--r--arch/arm/boot/dts/at91sam9n12.dtsi11
-rw-r--r--arch/arm/boot/dts/at91sam9n12ek.dts5
-rw-r--r--arch/arm/boot/dts/at91sam9x5.dtsi14
-rw-r--r--arch/arm/boot/dts/at91sam9x5cm.dtsi5
-rw-r--r--arch/arm/boot/dts/bcm2835-rpi-b.dts16
-rw-r--r--arch/arm/boot/dts/bcm2835.dtsi44
-rw-r--r--arch/arm/boot/dts/da850-evm.dts20
-rw-r--r--arch/arm/boot/dts/da850.dtsi70
-rw-r--r--arch/arm/boot/dts/dbx5x0.dtsi10
-rw-r--r--arch/arm/boot/dts/dove-cubox.dts28
-rw-r--r--arch/arm/boot/dts/dove.dtsi26
-rw-r--r--arch/arm/boot/dts/emev2-kzm9d.dts2
-rw-r--r--arch/arm/boot/dts/emev2.dtsi7
-rw-r--r--arch/arm/boot/dts/exynos4210.dtsi6
-rw-r--r--arch/arm/boot/dts/exynos4x12-pinctrl.dtsi2
-rw-r--r--arch/arm/boot/dts/exynos4x12.dtsi8
-rw-r--r--arch/arm/boot/dts/exynos5250-smdk5250.dts27
-rw-r--r--arch/arm/boot/dts/exynos5250.dtsi56
-rw-r--r--arch/arm/boot/dts/exynos5440.dtsi4
-rw-r--r--arch/arm/boot/dts/highbank.dts10
-rw-r--r--arch/arm/boot/dts/imx23.dtsi2
-rw-r--r--arch/arm/boot/dts/imx25-karo-tx25.dts30
-rw-r--r--arch/arm/boot/dts/imx25-pdk.dts36
-rw-r--r--arch/arm/boot/dts/imx25.dtsi2
-rw-r--r--arch/arm/boot/dts/imx27-apf27.dts82
-rw-r--r--arch/arm/boot/dts/imx27-pdk.dts (renamed from arch/arm/boot/dts/imx27-3ds.dts)24
-rw-r--r--arch/arm/boot/dts/imx28-cfa10037.dts77
-rw-r--r--arch/arm/boot/dts/imx28-cfa10049.dts214
-rw-r--r--arch/arm/boot/dts/imx28-m28evk.dts1
-rw-r--r--arch/arm/boot/dts/imx28.dtsi10
-rw-r--r--arch/arm/boot/dts/imx31-bug.dts12
-rw-r--r--arch/arm/boot/dts/imx31.dtsi17
-rw-r--r--arch/arm/boot/dts/imx51-apf51.dts52
-rw-r--r--arch/arm/boot/dts/imx51-babbage.dts478
-rw-r--r--arch/arm/boot/dts/imx51.dtsi53
-rw-r--r--arch/arm/boot/dts/imx53-ard.dts126
-rw-r--r--arch/arm/boot/dts/imx53-evk.dts194
-rw-r--r--arch/arm/boot/dts/imx53-mba53.dts130
-rw-r--r--arch/arm/boot/dts/imx53-qsb.dts380
-rw-r--r--arch/arm/boot/dts/imx53-smd.dts294
-rw-r--r--arch/arm/boot/dts/imx53-tqma53.dtsi172
-rw-r--r--arch/arm/boot/dts/imx53.dtsi68
-rw-r--r--arch/arm/boot/dts/imx6dl.dtsi59
-rw-r--r--arch/arm/boot/dts/imx6q-arm2.dts124
-rw-r--r--arch/arm/boot/dts/imx6q-sabreauto.dts64
-rw-r--r--arch/arm/boot/dts/imx6q-sabrelite.dts216
-rw-r--r--arch/arm/boot/dts/imx6q-sabresd.dts102
-rw-r--r--arch/arm/boot/dts/imx6q.dtsi796
-rw-r--r--arch/arm/boot/dts/imx6qdl.dtsi800
-rw-r--r--arch/arm/boot/dts/kirkwood-6282.dtsi17
-rw-r--r--arch/arm/boot/dts/kirkwood-dreamplug.dts7
-rw-r--r--arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts94
-rw-r--r--arch/arm/boot/dts/kirkwood-mplcec4.dts11
-rw-r--r--arch/arm/boot/dts/kirkwood-ns2-common.dtsi6
-rw-r--r--arch/arm/boot/dts/kirkwood-nsa310.dts126
-rw-r--r--arch/arm/boot/dts/kirkwood-openblocks_a6.dts116
-rw-r--r--arch/arm/boot/dts/kirkwood-topkick.dts102
-rw-r--r--arch/arm/boot/dts/kirkwood.dtsi8
-rw-r--r--arch/arm/boot/dts/marco-evb.dts54
-rw-r--r--arch/arm/boot/dts/marco.dtsi756
-rw-r--r--arch/arm/boot/dts/mmp2-brownstone.dts158
-rw-r--r--arch/arm/boot/dts/mmp2.dtsi4
-rw-r--r--arch/arm/boot/dts/prima2.dtsi31
-rw-r--r--arch/arm/boot/dts/r8a7740-armadillo800eva.dts6
-rw-r--r--arch/arm/boot/dts/sh7372-mackerel.dts6
-rw-r--r--arch/arm/boot/dts/sh73a0-kzm9g.dts6
-rw-r--r--arch/arm/boot/dts/sh73a0-reference.dtsi24
-rw-r--r--arch/arm/boot/dts/sh73a0.dtsi100
-rw-r--r--arch/arm/boot/dts/socfpga.dtsi22
-rw-r--r--arch/arm/boot/dts/socfpga_cyclone5.dts34
-rw-r--r--arch/arm/boot/dts/socfpga_vt.dts64
-rw-r--r--arch/arm/boot/dts/ste-nomadik-s8815.dts30
-rw-r--r--arch/arm/boot/dts/ste-nomadik-stn8815.dtsi256
-rw-r--r--arch/arm/boot/dts/sun4i-a10-hackberry.dts30
-rw-r--r--arch/arm/boot/dts/sun4i-a10.dtsi30
-rw-r--r--arch/arm/boot/dts/sun5i-a13-olinuxino.dts2
-rw-r--r--arch/arm/boot/dts/sun5i-a13.dtsi23
-rw-r--r--arch/arm/boot/dts/tegra114-dalmore.dts21
-rw-r--r--arch/arm/boot/dts/tegra114-pluto.dts21
-rw-r--r--arch/arm/boot/dts/tegra114.dtsi153
-rw-r--r--arch/arm/boot/dts/tegra20-colibri-512.dtsi491
-rw-r--r--arch/arm/boot/dts/tegra20-harmony.dts124
-rw-r--r--arch/arm/boot/dts/tegra20-iris-512.dts89
-rw-r--r--arch/arm/boot/dts/tegra20-paz00.dts28
-rw-r--r--arch/arm/boot/dts/tegra20-seaboard.dts162
-rw-r--r--arch/arm/boot/dts/tegra20-tamonten.dtsi1
-rw-r--r--arch/arm/boot/dts/tegra20-trimslice.dts15
-rw-r--r--arch/arm/boot/dts/tegra20-ventana.dts27
-rw-r--r--arch/arm/boot/dts/tegra20-whistler.dts15
-rw-r--r--arch/arm/boot/dts/tegra20.dtsi163
-rw-r--r--arch/arm/boot/dts/tegra30-beaver.dts373
-rw-r--r--arch/arm/boot/dts/tegra30-cardhu.dtsi15
-rw-r--r--arch/arm/boot/dts/tegra30.dtsi152
-rw-r--r--arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts2
-rw-r--r--arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts2
-rw-r--r--arch/arm/boot/dts/vt8500.dtsi40
-rw-r--r--arch/arm/boot/dts/wm8505.dtsi60
-rw-r--r--arch/arm/boot/dts/wm8650.dtsi20
-rw-r--r--arch/arm/boot/dts/wm8850-w70v2.dts47
-rw-r--r--arch/arm/boot/dts/wm8850.dtsi224
-rw-r--r--arch/arm/boot/dts/zynq-7000.dtsi4
-rw-r--r--arch/arm/common/Kconfig23
-rw-r--r--arch/arm/common/Makefile2
-rw-r--r--arch/arm/common/gic.c811
-rw-r--r--arch/arm/common/vic.c464
-rw-r--r--arch/arm/configs/armadillo800eva_defconfig10
-rw-r--r--arch/arm/configs/at91sam9263_defconfig1
-rw-r--r--arch/arm/configs/bcm2835_defconfig43
-rw-r--r--arch/arm/configs/da8xx_omapl_defconfig4
-rw-r--r--arch/arm/configs/davinci_all_defconfig3
-rw-r--r--arch/arm/configs/dove_defconfig28
-rw-r--r--arch/arm/configs/imx_v4_v5_defconfig3
-rw-r--r--arch/arm/configs/imx_v6_v7_defconfig10
-rw-r--r--arch/arm/configs/kirkwood_defconfig1
-rw-r--r--arch/arm/configs/kota2_defconfig2
-rw-r--r--arch/arm/configs/kzm9d_defconfig4
-rw-r--r--arch/arm/configs/kzm9g_defconfig4
-rw-r--r--arch/arm/configs/mackerel_defconfig3
-rw-r--r--arch/arm/configs/marzen_defconfig1
-rw-r--r--arch/arm/configs/multi_v7_defconfig2
-rw-r--r--arch/arm/configs/mvebu_defconfig28
-rw-r--r--arch/arm/configs/mxs_defconfig64
-rw-r--r--arch/arm/configs/omap2plus_defconfig31
-rw-r--r--arch/arm/configs/prima2_defconfig3
-rw-r--r--arch/arm/configs/pxa910_defconfig8
-rw-r--r--arch/arm/configs/shark_defconfig1
-rw-r--r--arch/arm/configs/tegra_defconfig6
-rw-r--r--arch/arm/configs/u8500_defconfig6
-rw-r--r--arch/arm/crypto/aes-armv4.S64
-rw-r--r--arch/arm/crypto/sha1-armv4-large.S24
-rw-r--r--arch/arm/include/asm/arch_timer.h109
-rw-r--r--arch/arm/include/asm/assembler.h10
-rw-r--r--arch/arm/include/asm/cputype.h33
-rw-r--r--arch/arm/include/asm/cti.h10
-rw-r--r--arch/arm/include/asm/delay.h1
-rw-r--r--arch/arm/include/asm/device.h6
-rw-r--r--arch/arm/include/asm/dma-iommu.h2
-rw-r--r--arch/arm/include/asm/dma.h2
-rw-r--r--arch/arm/include/asm/hardware/coresight.h6
-rw-r--r--arch/arm/include/asm/hardware/gic.h57
-rw-r--r--arch/arm/include/asm/hardware/pl080.h146
-rw-r--r--arch/arm/include/asm/hardware/sp810.h64
-rw-r--r--arch/arm/include/asm/hardware/vic.h57
-rw-r--r--arch/arm/include/asm/hw_breakpoint.h3
-rw-r--r--arch/arm/include/asm/idmap.h1
-rw-r--r--arch/arm/include/asm/kvm_arch_timer.h85
-rw-r--r--arch/arm/include/asm/kvm_arm.h214
-rw-r--r--arch/arm/include/asm/kvm_asm.h83
-rw-r--r--arch/arm/include/asm/kvm_coproc.h47
-rw-r--r--arch/arm/include/asm/kvm_emulate.h72
-rw-r--r--arch/arm/include/asm/kvm_host.h184
-rw-r--r--arch/arm/include/asm/kvm_mmio.h56
-rw-r--r--arch/arm/include/asm/kvm_mmu.h50
-rw-r--r--arch/arm/include/asm/kvm_psci.h23
-rw-r--r--arch/arm/include/asm/kvm_vgic.h221
-rw-r--r--arch/arm/include/asm/mach/arch.h3
-rw-r--r--arch/arm/include/asm/mach/irq.h1
-rw-r--r--arch/arm/include/asm/mach/pci.h1
-rw-r--r--arch/arm/include/asm/mach/time.h30
-rw-r--r--arch/arm/include/asm/memory.h12
-rw-r--r--arch/arm/include/asm/opcodes-sec.h24
-rw-r--r--arch/arm/include/asm/opcodes.h1
-rw-r--r--arch/arm/include/asm/outercache.h1
-rw-r--r--arch/arm/include/asm/pgtable-3level-hwdef.h5
-rw-r--r--arch/arm/include/asm/pgtable-3level.h18
-rw-r--r--arch/arm/include/asm/pgtable.h10
-rw-r--r--arch/arm/include/asm/psci.h36
-rw-r--r--arch/arm/include/asm/signal.h18
-rw-r--r--arch/arm/include/asm/smp_scu.h25
-rw-r--r--arch/arm/include/asm/spinlock.h16
-rw-r--r--arch/arm/include/asm/unistd.h2
-rw-r--r--arch/arm/include/asm/virt.h4
-rw-r--r--arch/arm/include/asm/xen/events.h22
-rw-r--r--arch/arm/include/asm/xen/page.h4
-rw-r--r--arch/arm/include/debug/imx-uart.h88
-rw-r--r--arch/arm/include/debug/imx.S29
-rw-r--r--arch/arm/include/debug/omap2plus.S (renamed from arch/arm/mach-omap2/include/mach/debug-macro.S)137
-rw-r--r--arch/arm/include/debug/vt8500.S (renamed from arch/arm/mach-vt8500/include/mach/debug-macro.S)24
-rw-r--r--arch/arm/include/uapi/asm/kvm.h180
-rw-r--r--arch/arm/kernel/Makefile1
-rw-r--r--arch/arm/kernel/arch_timer.c505
-rw-r--r--arch/arm/kernel/asm-offsets.c43
-rw-r--r--arch/arm/kernel/bios32.c9
-rw-r--r--arch/arm/kernel/calls.S2
-rw-r--r--arch/arm/kernel/entry-common.S5
-rw-r--r--arch/arm/kernel/hw_breakpoint.c61
-rw-r--r--arch/arm/kernel/irq.c10
-rw-r--r--arch/arm/kernel/kprobes.c6
-rw-r--r--arch/arm/kernel/perf_event.c16
-rw-r--r--arch/arm/kernel/perf_event_cpu.c51
-rw-r--r--arch/arm/kernel/perf_event_v6.c4
-rw-r--r--arch/arm/kernel/perf_event_v7.c18
-rw-r--r--arch/arm/kernel/perf_event_xscale.c2
-rw-r--r--arch/arm/kernel/process.c13
-rw-r--r--arch/arm/kernel/psci.c211
-rw-r--r--arch/arm/kernel/sched_clock.c4
-rw-r--r--arch/arm/kernel/signal.c160
-rw-r--r--arch/arm/kernel/smp.c52
-rw-r--r--arch/arm/kernel/smp_scu.c2
-rw-r--r--arch/arm/kernel/smp_twd.c54
-rw-r--r--arch/arm/kernel/time.c53
-rw-r--r--arch/arm/kernel/traps.c2
-rw-r--r--arch/arm/kernel/vmlinux.lds.S6
-rw-r--r--arch/arm/kvm/Kconfig72
-rw-r--r--arch/arm/kvm/Makefile23
-rw-r--r--arch/arm/kvm/arch_timer.c271
-rw-r--r--arch/arm/kvm/arm.c1169
-rw-r--r--arch/arm/kvm/coproc.c1050
-rw-r--r--arch/arm/kvm/coproc.h153
-rw-r--r--arch/arm/kvm/coproc_a15.c162
-rw-r--r--arch/arm/kvm/emulate.c373
-rw-r--r--arch/arm/kvm/guest.c222
-rw-r--r--arch/arm/kvm/init.S114
-rw-r--r--arch/arm/kvm/interrupts.S484
-rw-r--r--arch/arm/kvm/interrupts_head.S605
-rw-r--r--arch/arm/kvm/mmio.c156
-rw-r--r--arch/arm/kvm/mmu.c782
-rw-r--r--arch/arm/kvm/psci.c108
-rw-r--r--arch/arm/kvm/reset.c74
-rw-r--r--arch/arm/kvm/trace.h235
-rw-r--r--arch/arm/kvm/vgic.c1506
-rw-r--r--arch/arm/lib/delay.c1
-rw-r--r--arch/arm/mach-at91/Kconfig6
-rw-r--r--arch/arm/mach-at91/Makefile1
-rw-r--r--arch/arm/mach-at91/at91rm9200.c2
-rw-r--r--arch/arm/mach-at91/at91rm9200_time.c12
-rw-r--r--arch/arm/mach-at91/at91sam926x_time.c53
-rw-r--r--arch/arm/mach-at91/at91x40_time.c13
-rw-r--r--arch/arm/mach-at91/board-1arm.c2
-rw-r--r--arch/arm/mach-at91/board-afeb-9260v1.c2
-rw-r--r--arch/arm/mach-at91/board-cam60.c2
-rw-r--r--arch/arm/mach-at91/board-carmeva.c2
-rw-r--r--arch/arm/mach-at91/board-cpu9krea.c2
-rw-r--r--arch/arm/mach-at91/board-cpuat91.c2
-rw-r--r--arch/arm/mach-at91/board-csb337.c2
-rw-r--r--arch/arm/mach-at91/board-csb637.c2
-rw-r--r--arch/arm/mach-at91/board-dt.c2
-rw-r--r--arch/arm/mach-at91/board-eb01.c2
-rw-r--r--arch/arm/mach-at91/board-eb9200.c2
-rw-r--r--arch/arm/mach-at91/board-ecbat91.c2
-rw-r--r--arch/arm/mach-at91/board-eco920.c2
-rw-r--r--arch/arm/mach-at91/board-flexibity.c2
-rw-r--r--arch/arm/mach-at91/board-foxg20.c2
-rw-r--r--arch/arm/mach-at91/board-gsia18s.c2
-rw-r--r--arch/arm/mach-at91/board-kafa.c2
-rw-r--r--arch/arm/mach-at91/board-kb9202.c2
-rw-r--r--arch/arm/mach-at91/board-neocore926.c387
-rw-r--r--arch/arm/mach-at91/board-pcontrol-g20.c2
-rw-r--r--arch/arm/mach-at91/board-picotux200.c2
-rw-r--r--arch/arm/mach-at91/board-qil-a9260.c2
-rw-r--r--arch/arm/mach-at91/board-rm9200-dt.c2
-rw-r--r--arch/arm/mach-at91/board-rm9200dk.c2
-rw-r--r--arch/arm/mach-at91/board-rm9200ek.c2
-rw-r--r--arch/arm/mach-at91/board-rsi-ews.c2
-rw-r--r--arch/arm/mach-at91/board-sam9-l9260.c2
-rw-r--r--arch/arm/mach-at91/board-sam9260ek.c2
-rw-r--r--arch/arm/mach-at91/board-sam9261ek.c2
-rw-r--r--arch/arm/mach-at91/board-sam9263ek.c2
-rw-r--r--arch/arm/mach-at91/board-sam9g20ek.c4
-rw-r--r--arch/arm/mach-at91/board-sam9m10g45ek.c2
-rw-r--r--arch/arm/mach-at91/board-sam9rlek.c2
-rw-r--r--arch/arm/mach-at91/board-snapper9260.c2
-rw-r--r--arch/arm/mach-at91/board-stamp9g20.c4
-rw-r--r--arch/arm/mach-at91/board-usb-a926x.c6
-rw-r--r--arch/arm/mach-at91/board-yl-9200.c2
-rw-r--r--arch/arm/mach-at91/generic.h7
-rw-r--r--arch/arm/mach-at91/include/mach/uncompress.h2
-rw-r--r--arch/arm/mach-bcm/Kconfig1
-rw-r--r--arch/arm/mach-bcm/board_bcm.c22
-rw-r--r--arch/arm/mach-bcm2835/bcm2835.c32
-rw-r--r--arch/arm/mach-bcm2835/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-clps711x/board-autcpu12.c2
-rw-r--r--arch/arm/mach-clps711x/board-cdb89712.c2
-rw-r--r--arch/arm/mach-clps711x/board-clep7312.c2
-rw-r--r--arch/arm/mach-clps711x/board-edb7211.c2
-rw-r--r--arch/arm/mach-clps711x/board-fortunet.c2
-rw-r--r--arch/arm/mach-clps711x/board-p720t.c2
-rw-r--r--arch/arm/mach-clps711x/common.c6
-rw-r--r--arch/arm/mach-clps711x/common.h4
-rw-r--r--arch/arm/mach-clps711x/include/mach/uncompress.h2
-rw-r--r--arch/arm/mach-cns3xxx/cns3420vb.c4
-rw-r--r--arch/arm/mach-cns3xxx/core.c21
-rw-r--r--arch/arm/mach-cns3xxx/core.h2
-rw-r--r--arch/arm/mach-cns3xxx/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-davinci/Kconfig1
-rw-r--r--arch/arm/mach-davinci/board-da830-evm.c11
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c126
-rw-r--r--arch/arm/mach-davinci/board-dm355-evm.c2
-rw-r--r--arch/arm/mach-davinci/board-dm355-leopard.c2
-rw-r--r--arch/arm/mach-davinci/board-dm365-evm.c2
-rw-r--r--arch/arm/mach-davinci/board-dm644x-evm.c10
-rw-r--r--arch/arm/mach-davinci/board-dm646x-evm.c4
-rw-r--r--arch/arm/mach-davinci/board-mityomapl138.c11
-rw-r--r--arch/arm/mach-davinci/board-neuros-osd2.c2
-rw-r--r--arch/arm/mach-davinci/board-omapl138-hawk.c32
-rw-r--r--arch/arm/mach-davinci/board-sffsdr.c2
-rw-r--r--arch/arm/mach-davinci/board-tnetv107x-evm.c2
-rw-r--r--arch/arm/mach-davinci/clock.c39
-rw-r--r--arch/arm/mach-davinci/clock.h3
-rw-r--r--arch/arm/mach-davinci/cpuidle.c84
-rw-r--r--arch/arm/mach-davinci/da850.c17
-rw-r--r--arch/arm/mach-davinci/da8xx-dt.c11
-rw-r--r--arch/arm/mach-davinci/devices-da8xx.c28
-rw-r--r--arch/arm/mach-davinci/dm644x.c10
-rw-r--r--arch/arm/mach-davinci/include/mach/clock.h3
-rw-r--r--arch/arm/mach-davinci/include/mach/common.h4
-rw-r--r--arch/arm/mach-davinci/include/mach/da8xx.h5
-rw-r--r--arch/arm/mach-davinci/include/mach/psc.h3
-rw-r--r--arch/arm/mach-davinci/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-davinci/psc.c29
-rw-r--r--arch/arm/mach-davinci/time.c7
-rw-r--r--arch/arm/mach-dove/Kconfig7
-rw-r--r--arch/arm/mach-dove/Makefile4
-rw-r--r--arch/arm/mach-dove/board-dt.c92
-rw-r--r--arch/arm/mach-dove/cm-a510.c2
-rw-r--r--arch/arm/mach-dove/common.c120
-rw-r--r--arch/arm/mach-dove/common.h2
-rw-r--r--arch/arm/mach-dove/dove-db-setup.c2
-rw-r--r--arch/arm/mach-dove/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-ebsa110/core.c15
-rw-r--r--arch/arm/mach-ebsa110/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-ep93xx/adssphere.c4
-rw-r--r--arch/arm/mach-ep93xx/core.c38
-rw-r--r--arch/arm/mach-ep93xx/edb93xx.c25
-rw-r--r--arch/arm/mach-ep93xx/gesbc9312.c4
-rw-r--r--arch/arm/mach-ep93xx/include/mach/platform.h2
-rw-r--r--arch/arm/mach-ep93xx/include/mach/uncompress.h2
-rw-r--r--arch/arm/mach-ep93xx/micro9.c13
-rw-r--r--arch/arm/mach-ep93xx/simone.c4
-rw-r--r--arch/arm/mach-ep93xx/snappercl15.c4
-rw-r--r--arch/arm/mach-ep93xx/ts72xx.c4
-rw-r--r--arch/arm/mach-ep93xx/vision_ep9307.c4
-rw-r--r--arch/arm/mach-exynos/Kconfig7
-rw-r--r--arch/arm/mach-exynos/Makefile1
-rw-r--r--arch/arm/mach-exynos/clock-exynos4.c41
-rw-r--r--arch/arm/mach-exynos/clock-exynos4210.c9
-rw-r--r--arch/arm/mach-exynos/clock-exynos4212.c23
-rw-r--r--arch/arm/mach-exynos/clock-exynos5.c62
-rw-r--r--arch/arm/mach-exynos/common.c233
-rw-r--r--arch/arm/mach-exynos/common.h25
-rw-r--r--arch/arm/mach-exynos/cpuidle.c3
-rw-r--r--arch/arm/mach-exynos/dev-audio.c3
-rw-r--r--arch/arm/mach-exynos/dev-sysmmu.c274
-rw-r--r--arch/arm/mach-exynos/include/mach/cpufreq.h36
-rw-r--r--arch/arm/mach-exynos/include/mach/pmu.h34
-rw-r--r--arch/arm/mach-exynos/include/mach/regs-audss.h18
-rw-r--r--arch/arm/mach-exynos/include/mach/regs-irq.h2
-rw-r--r--arch/arm/mach-exynos/include/mach/sysmmu.h66
-rw-r--r--arch/arm/mach-exynos/mach-armlex4210.c4
-rw-r--r--arch/arm/mach-exynos/mach-exynos4-dt.c38
-rw-r--r--arch/arm/mach-exynos/mach-exynos5-dt.c40
-rw-r--r--arch/arm/mach-exynos/mach-nuri.c12
-rw-r--r--arch/arm/mach-exynos/mach-origen.c4
-rw-r--r--arch/arm/mach-exynos/mach-smdk4x12.c7
-rw-r--r--arch/arm/mach-exynos/mach-smdkv310.c7
-rw-r--r--arch/arm/mach-exynos/mach-universal_c210.c12
-rw-r--r--arch/arm/mach-exynos/mct.c25
-rw-r--r--arch/arm/mach-exynos/platsmp.c6
-rw-r--r--arch/arm/mach-exynos/pm.c9
-rw-r--r--arch/arm/mach-exynos/pmu.c3
-rw-r--r--arch/arm/mach-footbridge/cats-hw.c2
-rw-r--r--arch/arm/mach-footbridge/common.h4
-rw-r--r--arch/arm/mach-footbridge/dc21285-timer.c12
-rw-r--r--arch/arm/mach-footbridge/ebsa285.c2
-rw-r--r--arch/arm/mach-footbridge/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-footbridge/isa-timer.c6
-rw-r--r--arch/arm/mach-footbridge/netwinder-hw.c2
-rw-r--r--arch/arm/mach-footbridge/personal.c2
-rw-r--r--arch/arm/mach-gemini/board-nas4220b.c6
-rw-r--r--arch/arm/mach-gemini/board-rut1xx.c6
-rw-r--r--arch/arm/mach-gemini/board-wbd111.c6
-rw-r--r--arch/arm/mach-gemini/board-wbd222.c6
-rw-r--r--arch/arm/mach-gemini/include/mach/uncompress.h2
-rw-r--r--arch/arm/mach-h720x/common.c6
-rw-r--r--arch/arm/mach-h720x/common.h6
-rw-r--r--arch/arm/mach-h720x/cpu-h7201.c9
-rw-r--r--arch/arm/mach-h720x/cpu-h7202.c9
-rw-r--r--arch/arm/mach-h720x/h7201-eval.c2
-rw-r--r--arch/arm/mach-h720x/h7202-eval.c2
-rw-r--r--arch/arm/mach-h720x/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-highbank/Kconfig4
-rw-r--r--arch/arm/mach-highbank/core.h1
-rw-r--r--arch/arm/mach-highbank/highbank.c23
-rw-r--r--arch/arm/mach-highbank/platsmp.c6
-rw-r--r--arch/arm/mach-highbank/sysregs.h4
-rw-r--r--arch/arm/mach-imx/Kconfig38
-rw-r--r--arch/arm/mach-imx/Makefile9
-rw-r--r--arch/arm/mach-imx/Makefile.boot4
-rw-r--r--arch/arm/mach-imx/clk-imx25.c3
-rw-r--r--arch/arm/mach-imx/clk-imx27.c16
-rw-r--r--arch/arm/mach-imx/clk-imx31.c15
-rw-r--r--arch/arm/mach-imx/clk-imx35.c4
-rw-r--r--arch/arm/mach-imx/clk-imx51-imx53.c4
-rw-r--r--arch/arm/mach-imx/clk-imx6q.c38
-rw-r--r--arch/arm/mach-imx/common.h15
-rw-r--r--arch/arm/mach-imx/cpu-imx5.c39
-rw-r--r--arch/arm/mach-imx/cpuidle-imx6q.c95
-rw-r--r--arch/arm/mach-imx/cpuidle.h5
-rw-r--r--arch/arm/mach-imx/devices-imx50.h33
-rw-r--r--arch/arm/mach-imx/devices/Kconfig2
-rw-r--r--arch/arm/mach-imx/devices/platform-fec.c6
-rw-r--r--arch/arm/mach-imx/devices/platform-imx-i2c.c10
-rw-r--r--arch/arm/mach-imx/devices/platform-imx-uart.c12
-rw-r--r--arch/arm/mach-imx/epit.c15
-rw-r--r--arch/arm/mach-imx/gpc.c7
-rw-r--r--arch/arm/mach-imx/hardware.h6
-rw-r--r--arch/arm/mach-imx/headsmp.S47
-rw-r--r--arch/arm/mach-imx/imx25-dt.c11
-rw-r--r--arch/arm/mach-imx/imx27-dt.c16
-rw-r--r--arch/arm/mach-imx/imx31-dt.c33
-rw-r--r--arch/arm/mach-imx/imx51-dt.c16
-rw-r--r--arch/arm/mach-imx/iomux-mx50.h977
-rw-r--r--arch/arm/mach-imx/lluart.c47
-rw-r--r--arch/arm/mach-imx/mach-apf9328.c6
-rw-r--r--arch/arm/mach-imx/mach-armadillo5x0.c6
-rw-r--r--arch/arm/mach-imx/mach-bug.c6
-rw-r--r--arch/arm/mach-imx/mach-cpuimx27.c6
-rw-r--r--arch/arm/mach-imx/mach-cpuimx35.c6
-rw-r--r--arch/arm/mach-imx/mach-cpuimx51sd.c6
-rw-r--r--arch/arm/mach-imx/mach-eukrea_cpuimx25.c6
-rw-r--r--arch/arm/mach-imx/mach-imx27_visstrim_m10.c6
-rw-r--r--arch/arm/mach-imx/mach-imx27ipcam.c6
-rw-r--r--arch/arm/mach-imx/mach-imx27lite.c6
-rw-r--r--arch/arm/mach-imx/mach-imx53.c16
-rw-r--r--arch/arm/mach-imx/mach-imx6q.c98
-rw-r--r--arch/arm/mach-imx/mach-kzm_arm11_01.c6
-rw-r--r--arch/arm/mach-imx/mach-mx1ads.c8
-rw-r--r--arch/arm/mach-imx/mach-mx21ads.c6
-rw-r--r--arch/arm/mach-imx/mach-mx25_3ds.c6
-rw-r--r--arch/arm/mach-imx/mach-mx27_3ds.c6
-rw-r--r--arch/arm/mach-imx/mach-mx27ads.c6
-rw-r--r--arch/arm/mach-imx/mach-mx31_3ds.c6
-rw-r--r--arch/arm/mach-imx/mach-mx31ads.c6
-rw-r--r--arch/arm/mach-imx/mach-mx31lilly.c6
-rw-r--r--arch/arm/mach-imx/mach-mx31lite.c6
-rw-r--r--arch/arm/mach-imx/mach-mx31moboard.c6
-rw-r--r--arch/arm/mach-imx/mach-mx35_3ds.c6
-rw-r--r--arch/arm/mach-imx/mach-mx50_rdp.c225
-rw-r--r--arch/arm/mach-imx/mach-mx51_3ds.c178
-rw-r--r--arch/arm/mach-imx/mach-mx51_babbage.c6
-rw-r--r--arch/arm/mach-imx/mach-mxt_td60.c6
-rw-r--r--arch/arm/mach-imx/mach-pca100.c6
-rw-r--r--arch/arm/mach-imx/mach-pcm037.c6
-rw-r--r--arch/arm/mach-imx/mach-pcm038.c6
-rw-r--r--arch/arm/mach-imx/mach-pcm043.c6
-rw-r--r--arch/arm/mach-imx/mach-qong.c6
-rw-r--r--arch/arm/mach-imx/mach-scb9328.c6
-rw-r--r--arch/arm/mach-imx/mach-vpr200.c6
-rw-r--r--arch/arm/mach-imx/mm-imx5.c48
-rw-r--r--arch/arm/mach-imx/mx50.h290
-rw-r--r--arch/arm/mach-imx/mxc.h13
-rw-r--r--arch/arm/mach-imx/platsmp.c14
-rw-r--r--arch/arm/mach-imx/pm-imx5.c7
-rw-r--r--arch/arm/mach-imx/time.c18
-rw-r--r--arch/arm/mach-integrator/common.h5
-rw-r--r--arch/arm/mach-integrator/core.c2
-rw-r--r--arch/arm/mach-integrator/include/mach/uncompress.h2
-rw-r--r--arch/arm/mach-integrator/integrator_ap.c20
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c18
-rw-r--r--arch/arm/mach-iop13xx/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-iop13xx/iq81340mc.c6
-rw-r--r--arch/arm/mach-iop13xx/iq81340sc.c6
-rw-r--r--arch/arm/mach-iop32x/em7210.c6
-rw-r--r--arch/arm/mach-iop32x/glantank.c6
-rw-r--r--arch/arm/mach-iop32x/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-iop32x/iq31244.c8
-rw-r--r--arch/arm/mach-iop32x/iq80321.c6
-rw-r--r--arch/arm/mach-iop32x/n2100.c6
-rw-r--r--arch/arm/mach-iop33x/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-iop33x/iq80331.c6
-rw-r--r--arch/arm/mach-iop33x/iq80332.c6
-rw-r--r--arch/arm/mach-ixp4xx/avila-setup.c4
-rw-r--r--arch/arm/mach-ixp4xx/common.c15
-rw-r--r--arch/arm/mach-ixp4xx/coyote-setup.c4
-rw-r--r--arch/arm/mach-ixp4xx/dsmg600-setup.c6
-rw-r--r--arch/arm/mach-ixp4xx/fsg-setup.c2
-rw-r--r--arch/arm/mach-ixp4xx/gateway7001-setup.c2
-rw-r--r--arch/arm/mach-ixp4xx/goramo_mlr.c2
-rw-r--r--arch/arm/mach-ixp4xx/gtwx5715-setup.c2
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/platform.h3
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/uncompress.h2
-rw-r--r--arch/arm/mach-ixp4xx/ixdp425-setup.c8
-rw-r--r--arch/arm/mach-ixp4xx/nas100d-setup.c2
-rw-r--r--arch/arm/mach-ixp4xx/nslu2-setup.c6
-rw-r--r--arch/arm/mach-ixp4xx/omixp-setup.c6
-rw-r--r--arch/arm/mach-ixp4xx/vulcan-setup.c2
-rw-r--r--arch/arm/mach-ixp4xx/wg302v2-setup.c2
-rw-r--r--arch/arm/mach-kirkwood/Kconfig7
-rw-r--r--arch/arm/mach-kirkwood/Makefile2
-rw-r--r--arch/arm/mach-kirkwood/board-dreamplug.c6
-rw-r--r--arch/arm/mach-kirkwood/board-dt.c20
-rw-r--r--arch/arm/mach-kirkwood/board-guruplug.c39
-rw-r--r--arch/arm/mach-kirkwood/board-ib62x0.c1
-rw-r--r--arch/arm/mach-kirkwood/board-mplcec4.c8
-rw-r--r--arch/arm/mach-kirkwood/board-ns2.c14
-rw-r--r--arch/arm/mach-kirkwood/board-nsa310.c78
-rw-r--r--arch/arm/mach-kirkwood/board-openblocks_a6.c44
-rw-r--r--arch/arm/mach-kirkwood/board-usi_topkick.c48
-rw-r--r--arch/arm/mach-kirkwood/common.c29
-rw-r--r--arch/arm/mach-kirkwood/common.h14
-rw-r--r--arch/arm/mach-kirkwood/cpuidle.c73
-rw-r--r--arch/arm/mach-kirkwood/d2net_v2-setup.c2
-rw-r--r--arch/arm/mach-kirkwood/db88f6281-bp-setup.c2
-rw-r--r--arch/arm/mach-kirkwood/dockstar-setup.c3
-rw-r--r--arch/arm/mach-kirkwood/guruplug-setup.c2
-rw-r--r--arch/arm/mach-kirkwood/include/mach/kirkwood.h3
-rw-r--r--arch/arm/mach-kirkwood/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c2
-rw-r--r--arch/arm/mach-kirkwood/netspace_v2-setup.c6
-rw-r--r--arch/arm/mach-kirkwood/netxbig_v2-setup.c4
-rw-r--r--arch/arm/mach-kirkwood/openrd-setup.c6
-rw-r--r--arch/arm/mach-kirkwood/pcie.c10
-rw-r--r--arch/arm/mach-kirkwood/rd88f6192-nas-setup.c2
-rw-r--r--arch/arm/mach-kirkwood/rd88f6281-setup.c2
-rw-r--r--arch/arm/mach-kirkwood/sheevaplug-setup.c4
-rw-r--r--arch/arm/mach-kirkwood/t5325-setup.c2
-rw-r--r--arch/arm/mach-kirkwood/ts219-setup.c2
-rw-r--r--arch/arm/mach-kirkwood/ts41x-setup.c2
-rw-r--r--arch/arm/mach-ks8695/board-acs5k.c2
-rw-r--r--arch/arm/mach-ks8695/board-dsm320.c2
-rw-r--r--arch/arm/mach-ks8695/board-micrel.c2
-rw-r--r--arch/arm/mach-ks8695/board-og.c10
-rw-r--r--arch/arm/mach-ks8695/board-sg.c6
-rw-r--r--arch/arm/mach-ks8695/generic.h2
-rw-r--r--arch/arm/mach-ks8695/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-ks8695/time.c6
-rw-r--r--arch/arm/mach-lpc32xx/common.h2
-rw-r--r--arch/arm/mach-lpc32xx/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-lpc32xx/phy3250.c2
-rw-r--r--arch/arm/mach-lpc32xx/timer.c16
-rw-r--r--arch/arm/mach-mmp/aspenite.c4
-rw-r--r--arch/arm/mach-mmp/avengers_lite.c2
-rw-r--r--arch/arm/mach-mmp/brownstone.c2
-rw-r--r--arch/arm/mach-mmp/common.h2
-rw-r--r--arch/arm/mach-mmp/flint.c2
-rw-r--r--arch/arm/mach-mmp/gplugd.c2
-rw-r--r--arch/arm/mach-mmp/include/mach/mmp2.h4
-rw-r--r--arch/arm/mach-mmp/include/mach/pxa168.h4
-rw-r--r--arch/arm/mach-mmp/include/mach/pxa910.h9
-rw-r--r--arch/arm/mach-mmp/include/mach/uncompress.h6
-rw-r--r--arch/arm/mach-mmp/jasper.c2
-rw-r--r--arch/arm/mach-mmp/mmp-dt.c8
-rw-r--r--arch/arm/mach-mmp/mmp2-dt.c6
-rw-r--r--arch/arm/mach-mmp/mmp2.c6
-rw-r--r--arch/arm/mach-mmp/pxa168.c6
-rw-r--r--arch/arm/mach-mmp/pxa910.c9
-rw-r--r--arch/arm/mach-mmp/tavorevb.c2
-rw-r--r--arch/arm/mach-mmp/teton_bga.c2
-rw-r--r--arch/arm/mach-mmp/time.c7
-rw-r--r--arch/arm/mach-mmp/ttc_dkb.c94
-rw-r--r--arch/arm/mach-msm/board-dt-8660.c18
-rw-r--r--arch/arm/mach-msm/board-dt-8960.c18
-rw-r--r--arch/arm/mach-msm/board-halibut.c2
-rw-r--r--arch/arm/mach-msm/board-mahimahi.c4
-rw-r--r--arch/arm/mach-msm/board-msm7x30.c6
-rw-r--r--arch/arm/mach-msm/board-qsd8x50.c4
-rw-r--r--arch/arm/mach-msm/board-sapphire.c4
-rw-r--r--arch/arm/mach-msm/board-trout.c2
-rw-r--r--arch/arm/mach-msm/common.h8
-rw-r--r--arch/arm/mach-msm/include/mach/uncompress.h4
-rw-r--r--arch/arm/mach-msm/platsmp.c6
-rw-r--r--arch/arm/mach-msm/proc_comm.h2
-rw-r--r--arch/arm/mach-msm/timer.c31
-rw-r--r--arch/arm/mach-mv78xx0/buffalo-wxl-setup.c2
-rw-r--r--arch/arm/mach-mv78xx0/common.c6
-rw-r--r--arch/arm/mach-mv78xx0/common.h2
-rw-r--r--arch/arm/mach-mv78xx0/db78x00-bp-setup.c2
-rw-r--r--arch/arm/mach-mv78xx0/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-mv78xx0/rd78x00-masa-setup.c2
-rw-r--r--arch/arm/mach-mvebu/Makefile5
-rw-r--r--arch/arm/mach-mvebu/armada-370-xp.c6
-rw-r--r--arch/arm/mach-mvebu/irq-armada-370-xp.c87
-rw-r--r--arch/arm/mach-mxs/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-mxs/mach-mxs.c42
-rw-r--r--arch/arm/mach-mxs/timer.c34
-rw-r--r--arch/arm/mach-netx/generic.c2
-rw-r--r--arch/arm/mach-netx/generic.h3
-rw-r--r--arch/arm/mach-netx/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-netx/nxdb500.c4
-rw-r--r--arch/arm/mach-netx/nxdkn.c4
-rw-r--r--arch/arm/mach-netx/nxeb500hmi.c4
-rw-r--r--arch/arm/mach-netx/time.c16
-rw-r--r--arch/arm/mach-nomadik/Kconfig10
-rw-r--r--arch/arm/mach-nomadik/Makefile6
-rw-r--r--arch/arm/mach-nomadik/board-nhk8815.c359
-rw-r--r--arch/arm/mach-nomadik/cpu-8815.c358
-rw-r--r--arch/arm/mach-nomadik/cpu-8815.h4
-rw-r--r--arch/arm/mach-nomadik/i2c-8815nhk.c88
-rw-r--r--arch/arm/mach-nomadik/include/mach/hardware.h90
-rw-r--r--arch/arm/mach-nomadik/include/mach/irqs.h2
-rw-r--r--arch/arm/mach-nomadik/include/mach/uncompress.h3
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c2
-rw-r--r--arch/arm/mach-omap1/board-fsample.c2
-rw-r--r--arch/arm/mach-omap1/board-generic.c2
-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.c2
-rw-r--r--arch/arm/mach-omap1/board-innovator.c2
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c45
-rw-r--r--arch/arm/mach-omap1/board-osk.c2
-rw-r--r--arch/arm/mach-omap1/board-palmte.c2
-rw-r--r--arch/arm/mach-omap1/board-palmtt.c2
-rw-r--r--arch/arm/mach-omap1/board-palmz71.c2
-rw-r--r--arch/arm/mach-omap1/board-perseus2.c2
-rw-r--r--arch/arm/mach-omap1/board-sx1.c2
-rw-r--r--arch/arm/mach-omap1/board-voiceblue.c2
-rw-r--r--arch/arm/mach-omap1/common.h2
-rw-r--r--arch/arm/mach-omap1/dma.c18
-rw-r--r--arch/arm/mach-omap1/i2c.c6
-rw-r--r--arch/arm/mach-omap1/include/mach/uncompress.h5
-rw-r--r--arch/arm/mach-omap1/time.c17
-rw-r--r--arch/arm/mach-omap1/timer32k.c12
-rw-r--r--arch/arm/mach-omap2/Kconfig33
-rw-r--r--arch/arm/mach-omap2/Makefile7
-rw-r--r--arch/arm/mach-omap2/am33xx-restart.c34
-rw-r--r--arch/arm/mach-omap2/am35xx-emac.c3
-rw-r--r--arch/arm/mach-omap2/board-2430sdp.c4
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c26
-rw-r--r--arch/arm/mach-omap2/board-3630sdp.c4
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c37
-rw-r--r--arch/arm/mach-omap2/board-am3517crane.c63
-rw-r--r--arch/arm/mach-omap2/board-am3517evm.c4
-rw-r--r--arch/arm/mach-omap2/board-apollon.c342
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c10
-rw-r--r--arch/arm/mach-omap2/board-cm-t3517.c31
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c8
-rw-r--r--arch/arm/mach-omap2/board-generic.c18
-rw-r--r--arch/arm/mach-omap2/board-h4.c2
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c28
-rw-r--r--arch/arm/mach-omap2/board-ldp.c4
-rw-r--r--arch/arm/mach-omap2/board-n8x0.c6
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c49
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c18
-rw-r--r--arch/arm/mach-omap2/board-omap3logic.c6
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c6
-rw-r--r--arch/arm/mach-omap2/board-omap3stalker.c6
-rw-r--r--arch/arm/mach-omap2/board-omap3touchbook.c6
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c9
-rw-r--r--arch/arm/mach-omap2/board-overo.c8
-rw-r--r--arch/arm/mach-omap2/board-rm680.c6
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c30
-rw-r--r--arch/arm/mach-omap2/board-rx51-video.c3
-rw-r--r--arch/arm/mach-omap2/board-rx51.c2
-rw-r--r--arch/arm/mach-omap2/board-ti8168evm.c4
-rw-r--r--arch/arm/mach-omap2/board-zoom-display.c14
-rw-r--r--arch/arm/mach-omap2/board-zoom-peripherals.c41
-rw-r--r--arch/arm/mach-omap2/board-zoom.c6
-rw-r--r--arch/arm/mach-omap2/cclock2420_data.c16
-rw-r--r--arch/arm/mach-omap2/cclock2430_data.c16
-rw-r--r--arch/arm/mach-omap2/cclock33xx_data.c10
-rw-r--r--arch/arm/mach-omap2/cclock3xxx_data.c10
-rw-r--r--arch/arm/mach-omap2/cclock44xx_data.c591
-rw-r--r--arch/arm/mach-omap2/clock.h11
-rw-r--r--arch/arm/mach-omap2/clock2xxx.c2
-rw-r--r--arch/arm/mach-omap2/clock3xxx.c2
-rw-r--r--arch/arm/mach-omap2/clockdomain.c569
-rw-r--r--arch/arm/mach-omap2/clockdomain.h17
-rw-r--r--arch/arm/mach-omap2/cm2xxx.c33
-rw-r--r--arch/arm/mach-omap2/cm33xx.c3
-rw-r--r--arch/arm/mach-omap2/cm33xx.h9
-rw-r--r--arch/arm/mach-omap2/cm3xxx.c14
-rw-r--r--arch/arm/mach-omap2/cminst44xx.c2
-rw-r--r--arch/arm/mach-omap2/common.h22
-rw-r--r--arch/arm/mach-omap2/cpuidle34xx.c79
-rw-r--r--arch/arm/mach-omap2/devices.c76
-rw-r--r--arch/arm/mach-omap2/display.c2
-rw-r--r--arch/arm/mach-omap2/dma.c25
-rw-r--r--arch/arm/mach-omap2/dpll3xxx.c5
-rw-r--r--arch/arm/mach-omap2/drm.c5
-rw-r--r--arch/arm/mach-omap2/emu.c2
-rw-r--r--arch/arm/mach-omap2/fb.c4
-rw-r--r--arch/arm/mach-omap2/gpio.c8
-rw-r--r--arch/arm/mach-omap2/gpmc-nand.c15
-rw-r--r--arch/arm/mach-omap2/gpmc-onenand.c2
-rw-r--r--arch/arm/mach-omap2/gpmc.c249
-rw-r--r--arch/arm/mach-omap2/hdq1w.c5
-rw-r--r--arch/arm/mach-omap2/hsmmc.c2
-rw-r--r--arch/arm/mach-omap2/hwspinlock.c6
-rw-r--r--arch/arm/mach-omap2/i2c.c8
-rw-r--r--arch/arm/mach-omap2/id.c14
-rw-r--r--arch/arm/mach-omap2/include/mach/serial.h37
-rw-r--r--arch/arm/mach-omap2/include/mach/uncompress.h176
-rw-r--r--arch/arm/mach-omap2/mcbsp.c5
-rw-r--r--arch/arm/mach-omap2/msdi.c2
-rw-r--r--arch/arm/mach-omap2/omap-iommu.c6
-rw-r--r--arch/arm/mach-omap2/omap-mpuss-lowpower.c44
-rw-r--r--arch/arm/mach-omap2/omap-smp.c8
-rw-r--r--arch/arm/mach-omap2/omap-wakeupgen.c17
-rw-r--r--arch/arm/mach-omap2/omap2-restart.c3
-rw-r--r--arch/arm/mach-omap2/omap4-common.c15
-rw-r--r--arch/arm/mach-omap2/omap44xx.h1
-rw-r--r--arch/arm/mach-omap2/omap_device.c542
-rw-r--r--arch/arm/mach-omap2/omap_device.h79
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c33
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.h17
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2420_data.c7
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_33xx_data.c443
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c7
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_44xx_data.c163
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_reset.c53
-rw-r--r--arch/arm/mach-omap2/omap_phy_internal.c2
-rw-r--r--arch/arm/mach-omap2/opp3xxx_data.c2
-rw-r--r--arch/arm/mach-omap2/opp4xxx_data.c2
-rw-r--r--arch/arm/mach-omap2/pm-debug.c8
-rw-r--r--arch/arm/mach-omap2/pm.c91
-rw-r--r--arch/arm/mach-omap2/pm.h1
-rw-r--r--arch/arm/mach-omap2/pm24xx.c53
-rw-r--r--arch/arm/mach-omap2/pm34xx.c2
-rw-r--r--arch/arm/mach-omap2/pm44xx.c21
-rw-r--r--arch/arm/mach-omap2/pmu.c5
-rw-r--r--arch/arm/mach-omap2/powerdomain.c232
-rw-r--r--arch/arm/mach-omap2/powerdomain.h52
-rw-r--r--arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c4
-rw-r--r--arch/arm/mach-omap2/powerdomains2xxx_data.c9
-rw-r--r--arch/arm/mach-omap2/powerdomains3xxx_data.c44
-rw-r--r--arch/arm/mach-omap2/prm2xxx_3xxx.c3
-rw-r--r--arch/arm/mach-omap2/prm33xx.c11
-rw-r--r--arch/arm/mach-omap2/prm33xx.h4
-rw-r--r--arch/arm/mach-omap2/prm3xxx.c2
-rw-r--r--arch/arm/mach-omap2/prm44xx.c2
-rw-r--r--arch/arm/mach-omap2/serial.c5
-rw-r--r--arch/arm/mach-omap2/sleep24xx.S19
-rw-r--r--arch/arm/mach-omap2/smartreflex-class3.c3
-rw-r--r--arch/arm/mach-omap2/soc.h30
-rw-r--r--arch/arm/mach-omap2/sr_device.c3
-rw-r--r--arch/arm/mach-omap2/timer.c42
-rw-r--r--arch/arm/mach-omap2/twl-common.c20
-rw-r--r--arch/arm/mach-omap2/twl-common.h3
-rw-r--r--arch/arm/mach-omap2/usb-host.c41
-rw-r--r--arch/arm/mach-omap2/usb-musb.c5
-rw-r--r--arch/arm/mach-omap2/usb.h20
-rw-r--r--arch/arm/mach-omap2/wd_timer.c5
-rw-r--r--arch/arm/mach-orion5x/board-dt.c2
-rw-r--r--arch/arm/mach-orion5x/common.c6
-rw-r--r--arch/arm/mach-orion5x/common.h2
-rw-r--r--arch/arm/mach-orion5x/d2net-setup.c4
-rw-r--r--arch/arm/mach-orion5x/db88f5281-setup.c2
-rw-r--r--arch/arm/mach-orion5x/dns323-setup.c2
-rw-r--r--arch/arm/mach-orion5x/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-orion5x/kurobox_pro-setup.c4
-rw-r--r--arch/arm/mach-orion5x/ls-chl-setup.c2
-rw-r--r--arch/arm/mach-orion5x/ls_hgl-setup.c2
-rw-r--r--arch/arm/mach-orion5x/lsmini-setup.c2
-rw-r--r--arch/arm/mach-orion5x/mss2-setup.c2
-rw-r--r--arch/arm/mach-orion5x/mv2120-setup.c2
-rw-r--r--arch/arm/mach-orion5x/net2big-setup.c2
-rw-r--r--arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c2
-rw-r--r--arch/arm/mach-orion5x/rd88f5181l-ge-setup.c2
-rw-r--r--arch/arm/mach-orion5x/rd88f5182-setup.c2
-rw-r--r--arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c2
-rw-r--r--arch/arm/mach-orion5x/terastation_pro2-setup.c2
-rw-r--r--arch/arm/mach-orion5x/ts209-setup.c2
-rw-r--r--arch/arm/mach-orion5x/ts409-setup.c2
-rw-r--r--arch/arm/mach-orion5x/ts78xx-setup.c2
-rw-r--r--arch/arm/mach-orion5x/wnr854t-setup.c2
-rw-r--r--arch/arm/mach-orion5x/wrt350n-v2-setup.c2
-rw-r--r--arch/arm/mach-picoxcell/Kconfig1
-rw-r--r--arch/arm/mach-picoxcell/common.c17
-rw-r--r--arch/arm/mach-picoxcell/common.h2
-rw-r--r--arch/arm/mach-prima2/Kconfig10
-rw-r--r--arch/arm/mach-prima2/Makefile5
-rw-r--r--arch/arm/mach-prima2/common.c33
-rw-r--r--arch/arm/mach-prima2/common.h15
-rw-r--r--arch/arm/mach-prima2/headsmp.S40
-rw-r--r--arch/arm/mach-prima2/hotplug.c41
-rw-r--r--arch/arm/mach-prima2/include/mach/irqs.h4
-rw-r--r--arch/arm/mach-prima2/include/mach/uart.h6
-rw-r--r--arch/arm/mach-prima2/include/mach/uncompress.h5
-rw-r--r--arch/arm/mach-prima2/irq.c16
-rw-r--r--arch/arm/mach-prima2/l2x0.c29
-rw-r--r--arch/arm/mach-prima2/platsmp.c157
-rw-r--r--arch/arm/mach-prima2/rstc.c45
-rw-r--r--arch/arm/mach-prima2/rtciobrg.c1
-rw-r--r--arch/arm/mach-prima2/timer-marco.c316
-rw-r--r--arch/arm/mach-prima2/timer-prima2.c (renamed from arch/arm/mach-prima2/timer.c)18
-rw-r--r--arch/arm/mach-pxa/balloon3.c2
-rw-r--r--arch/arm/mach-pxa/capc7117.c2
-rw-r--r--arch/arm/mach-pxa/cm-x2xx.c2
-rw-r--r--arch/arm/mach-pxa/cm-x300.c2
-rw-r--r--arch/arm/mach-pxa/colibri-pxa270.c4
-rw-r--r--arch/arm/mach-pxa/colibri-pxa300.c2
-rw-r--r--arch/arm/mach-pxa/colibri-pxa320.c2
-rw-r--r--arch/arm/mach-pxa/corgi.c6
-rw-r--r--arch/arm/mach-pxa/csb726.c2
-rw-r--r--arch/arm/mach-pxa/em-x270.c4
-rw-r--r--arch/arm/mach-pxa/eseries.c12
-rw-r--r--arch/arm/mach-pxa/ezx.c12
-rw-r--r--arch/arm/mach-pxa/generic.h3
-rw-r--r--arch/arm/mach-pxa/gumstix.c2
-rw-r--r--arch/arm/mach-pxa/h5000.c2
-rw-r--r--arch/arm/mach-pxa/himalaya.c2
-rw-r--r--arch/arm/mach-pxa/hx4700.c2
-rw-r--r--arch/arm/mach-pxa/icontrol.c2
-rw-r--r--arch/arm/mach-pxa/idp.c2
-rw-r--r--arch/arm/mach-pxa/include/mach/palmtreo.h5
-rw-r--r--arch/arm/mach-pxa/include/mach/smemc.h1
-rw-r--r--arch/arm/mach-pxa/include/mach/uncompress.h5
-rw-r--r--arch/arm/mach-pxa/littleton.c2
-rw-r--r--arch/arm/mach-pxa/lpd270.c2
-rw-r--r--arch/arm/mach-pxa/lubbock.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/mp900.c2
-rw-r--r--arch/arm/mach-pxa/palmld.c2
-rw-r--r--arch/arm/mach-pxa/palmt5.c2
-rw-r--r--arch/arm/mach-pxa/palmtc.c2
-rw-r--r--arch/arm/mach-pxa/palmte2.c2
-rw-r--r--arch/arm/mach-pxa/palmtreo.c105
-rw-r--r--arch/arm/mach-pxa/palmtx.c2
-rw-r--r--arch/arm/mach-pxa/palmz72.c2
-rw-r--r--arch/arm/mach-pxa/pcm027.c2
-rw-r--r--arch/arm/mach-pxa/poodle.c2
-rw-r--r--arch/arm/mach-pxa/pxa-dt.c2
-rw-r--r--arch/arm/mach-pxa/pxa27x.c21
-rw-r--r--arch/arm/mach-pxa/raumfeld.c6
-rw-r--r--arch/arm/mach-pxa/saar.c2
-rw-r--r--arch/arm/mach-pxa/smemc.c15
-rw-r--r--arch/arm/mach-pxa/spitz.c10
-rw-r--r--arch/arm/mach-pxa/stargate2.c4
-rw-r--r--arch/arm/mach-pxa/tavorevb.c2
-rw-r--r--arch/arm/mach-pxa/time.c76
-rw-r--r--arch/arm/mach-pxa/tosa.c8
-rw-r--r--arch/arm/mach-pxa/trizeps4.c4
-rw-r--r--arch/arm/mach-pxa/viper.c2
-rw-r--r--arch/arm/mach-pxa/vpac270.c2
-rw-r--r--arch/arm/mach-pxa/xcep.c2
-rw-r--r--arch/arm/mach-pxa/z2.c2
-rw-r--r--arch/arm/mach-pxa/zeus.c2
-rw-r--r--arch/arm/mach-pxa/zylonite.c2
-rw-r--r--arch/arm/mach-realview/core.c1
-rw-r--r--arch/arm/mach-realview/include/mach/irqs-eb.h2
-rw-r--r--arch/arm/mach-realview/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-realview/platsmp.c3
-rw-r--r--arch/arm/mach-realview/realview_eb.c9
-rw-r--r--arch/arm/mach-realview/realview_pb1176.c9
-rw-r--r--arch/arm/mach-realview/realview_pb11mp.c9
-rw-r--r--arch/arm/mach-realview/realview_pba8.c9
-rw-r--r--arch/arm/mach-realview/realview_pbx.c9
-rw-r--r--arch/arm/mach-rpc/include/mach/uncompress.h5
-rw-r--r--arch/arm/mach-rpc/riscpc.c4
-rw-r--r--arch/arm/mach-rpc/time.c13
-rw-r--r--arch/arm/mach-s3c2410/Kconfig20
-rw-r--r--arch/arm/mach-s3c2410/Makefile14
-rw-r--r--arch/arm/mach-s3c2412/Kconfig13
-rw-r--r--arch/arm/mach-s3c2412/Makefile12
-rw-r--r--arch/arm/mach-s3c2412/gpio.c62
-rw-r--r--arch/arm/mach-s3c2440/Kconfig37
-rw-r--r--arch/arm/mach-s3c2440/Makefile17
-rw-r--r--arch/arm/mach-s3c2440/dsc.c54
-rw-r--r--arch/arm/mach-s3c24xx/Kconfig166
-rw-r--r--arch/arm/mach-s3c24xx/Makefile24
-rw-r--r--arch/arm/mach-s3c24xx/anubis.h53
-rw-r--r--arch/arm/mach-s3c24xx/bast-ide.c18
-rw-r--r--arch/arm/mach-s3c24xx/bast-irq.c19
-rw-r--r--arch/arm/mach-s3c24xx/bast.h197
-rw-r--r--arch/arm/mach-s3c24xx/clock-dclk.c (renamed from arch/arm/plat-s3c24xx/clock-dclk.c)3
-rw-r--r--arch/arm/mach-s3c24xx/clock-s3c2410.c (renamed from arch/arm/plat-s3c24xx/s3c2410-clock.c)3
-rw-r--r--arch/arm/mach-s3c24xx/common-s3c2443.c2
-rw-r--r--arch/arm/mach-s3c24xx/common.c2
-rw-r--r--arch/arm/mach-s3c24xx/common.h2
-rw-r--r--arch/arm/mach-s3c24xx/cpufreq-debugfs.c (renamed from arch/arm/plat-s3c24xx/cpu-freq-debugfs.c)3
-rw-r--r--arch/arm/mach-s3c24xx/cpufreq-s3c2410.c (renamed from arch/arm/mach-s3c2410/cpu-freq.c)7
-rw-r--r--arch/arm/mach-s3c24xx/cpufreq-s3c2412.c (renamed from arch/arm/mach-s3c2412/cpu-freq.c)9
-rw-r--r--arch/arm/mach-s3c24xx/cpufreq-s3c2440.c (renamed from arch/arm/mach-s3c2440/s3c2440-cpufreq.c)4
-rw-r--r--arch/arm/mach-s3c24xx/cpufreq-utils.c (renamed from arch/arm/plat-s3c24xx/s3c2410-cpufreq-utils.c)6
-rw-r--r--arch/arm/mach-s3c24xx/cpufreq.c (renamed from arch/arm/plat-s3c24xx/cpu-freq.c)3
-rw-r--r--arch/arm/mach-s3c24xx/dma-s3c2410.c1
-rw-r--r--arch/arm/mach-s3c24xx/dma-s3c2412.c1
-rw-r--r--arch/arm/mach-s3c24xx/dma-s3c2440.c1
-rw-r--r--arch/arm/mach-s3c24xx/dma-s3c2443.c1
-rw-r--r--arch/arm/mach-s3c24xx/dma.c (renamed from arch/arm/plat-s3c24xx/dma.c)3
-rw-r--r--arch/arm/mach-s3c24xx/gta02.h (renamed from arch/arm/mach-s3c24xx/include/mach/gta02.h)14
-rw-r--r--arch/arm/mach-s3c24xx/h1940-bluetooth.c6
-rw-r--r--arch/arm/mach-s3c24xx/h1940.h (renamed from arch/arm/mach-s3c24xx/include/mach/h1940-latch.h)22
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/anubis-cpld.h25
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/anubis-irq.h21
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/anubis-map.h38
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/bast-cpld.h53
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/bast-irq.h29
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/bast-map.h146
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/debug-macro.S12
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/entry-macro.S4
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/gpio-fns.h1
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/gpio-nrs.h97
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/gpio-track.h33
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/gpio.h87
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/h1940.h24
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/hardware.h6
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/idle.h24
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/osiris-cpld.h30
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/regs-gpio.h2
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/regs-mem.h202
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/regs-power.h40
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/regs-s3c2412-mem.h48
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/regs-s3c2412.h23
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/regs-s3c2416-mem.h30
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/regs-s3c2416.h24
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/vr1000-cpld.h18
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/vr1000-irq.h26
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/vr1000-map.h110
-rw-r--r--arch/arm/mach-s3c24xx/iotiming-s3c2410.c (renamed from arch/arm/plat-s3c24xx/s3c2410-iotiming.c)6
-rw-r--r--arch/arm/mach-s3c24xx/iotiming-s3c2412.c (renamed from arch/arm/plat-s3c24xx/s3c2412-iotiming.c)7
-rw-r--r--arch/arm/mach-s3c24xx/irq-pm.c41
-rw-r--r--arch/arm/mach-s3c24xx/irq-s3c2412.c3
-rw-r--r--arch/arm/mach-s3c24xx/irq-s3c2416.c348
-rw-r--r--arch/arm/mach-s3c24xx/irq-s3c2443.c281
-rw-r--r--arch/arm/mach-s3c24xx/irq.c822
-rw-r--r--arch/arm/mach-s3c24xx/mach-amlm5900.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-anubis.c16
-rw-r--r--arch/arm/mach-s3c24xx/mach-at2440evb.c4
-rw-r--r--arch/arm/mach-s3c24xx/mach-bast.c53
-rw-r--r--arch/arm/mach-s3c24xx/mach-gta02.c60
-rw-r--r--arch/arm/mach-s3c24xx/mach-h1940.c39
-rw-r--r--arch/arm/mach-s3c24xx/mach-jive.c6
-rw-r--r--arch/arm/mach-s3c24xx/mach-mini2440.c3
-rw-r--r--arch/arm/mach-s3c24xx/mach-n30.c4
-rw-r--r--arch/arm/mach-s3c24xx/mach-nexcoder.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-osiris.c30
-rw-r--r--arch/arm/mach-s3c24xx/mach-otom.c22
-rw-r--r--arch/arm/mach-s3c24xx/mach-qt2410.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-rx1950.c33
-rw-r--r--arch/arm/mach-s3c24xx/mach-rx3715.c18
-rw-r--r--arch/arm/mach-s3c24xx/mach-smdk2410.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-smdk2413.c7
-rw-r--r--arch/arm/mach-s3c24xx/mach-smdk2416.c5
-rw-r--r--arch/arm/mach-s3c24xx/mach-smdk2440.c3
-rw-r--r--arch/arm/mach-s3c24xx/mach-smdk2443.c5
-rw-r--r--arch/arm/mach-s3c24xx/mach-tct_hammer.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-vr1000.c39
-rw-r--r--arch/arm/mach-s3c24xx/mach-vstms.c3
-rw-r--r--arch/arm/mach-s3c24xx/osiris.h (renamed from arch/arm/mach-s3c24xx/include/mach/osiris-map.h)23
-rw-r--r--arch/arm/mach-s3c24xx/otom.h (renamed from arch/arm/mach-s3c24xx/include/mach/otom-map.h)20
-rw-r--r--arch/arm/mach-s3c24xx/pll-s3c2410.c (renamed from arch/arm/mach-s3c2410/pll.c)5
-rw-r--r--arch/arm/mach-s3c24xx/pll-s3c2440-12000000.c (renamed from arch/arm/mach-s3c2440/s3c2440-pll-12000000.c)5
-rw-r--r--arch/arm/mach-s3c24xx/pll-s3c2440-16934400.c (renamed from arch/arm/mach-s3c2440/s3c2440-pll-16934400.c)5
-rw-r--r--arch/arm/mach-s3c24xx/pm-h1940.S2
-rw-r--r--arch/arm/mach-s3c24xx/pm-s3c2410.c6
-rw-r--r--arch/arm/mach-s3c24xx/pm-s3c2412.c11
-rw-r--r--arch/arm/mach-s3c24xx/pm-s3c2416.c6
-rw-r--r--arch/arm/mach-s3c24xx/pm.c3
-rw-r--r--arch/arm/mach-s3c24xx/regs-dsc.h (renamed from arch/arm/mach-s3c24xx/include/mach/regs-dsc.h)0
-rw-r--r--arch/arm/mach-s3c24xx/regs-mem.h54
-rw-r--r--arch/arm/mach-s3c24xx/s3c2410.c4
-rw-r--r--arch/arm/mach-s3c24xx/s3c2412-power.h37
-rw-r--r--arch/arm/mach-s3c24xx/s3c2412.c32
-rw-r--r--arch/arm/mach-s3c24xx/s3c2412.h26
-rw-r--r--arch/arm/mach-s3c24xx/s3c2416.c4
-rw-r--r--arch/arm/mach-s3c24xx/s3c2440.c4
-rw-r--r--arch/arm/mach-s3c24xx/s3c2442.c4
-rw-r--r--arch/arm/mach-s3c24xx/s3c244x.c3
-rw-r--r--arch/arm/mach-s3c24xx/simtec-audio.c5
-rw-r--r--arch/arm/mach-s3c24xx/simtec-nor.c3
-rw-r--r--arch/arm/mach-s3c24xx/simtec-pm.c3
-rw-r--r--arch/arm/mach-s3c24xx/simtec-usb.c8
-rw-r--r--arch/arm/mach-s3c24xx/sleep-s3c2410.S15
-rw-r--r--arch/arm/mach-s3c24xx/sleep-s3c2412.S12
-rw-r--r--arch/arm/mach-s3c24xx/sleep.S1
-rw-r--r--arch/arm/mach-s3c24xx/vr1000.h118
-rw-r--r--arch/arm/mach-s3c64xx/clock.c3
-rw-r--r--arch/arm/mach-s3c64xx/common.c2
-rw-r--r--arch/arm/mach-s3c64xx/cpuidle.c4
-rw-r--r--arch/arm/mach-s3c64xx/crag6410.h (renamed from arch/arm/mach-s3c64xx/include/mach/crag6410.h)0
-rw-r--r--arch/arm/mach-s3c64xx/dma.c5
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/regs-irq.h1
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/regs-sys.h31
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/tick.h2
-rw-r--r--arch/arm/mach-s3c64xx/mach-anw6410.c6
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410-module.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410.c13
-rw-r--r--arch/arm/mach-s3c64xx/mach-hmt.c4
-rw-r--r--arch/arm/mach-s3c64xx/mach-mini6410.c8
-rw-r--r--arch/arm/mach-s3c64xx/mach-ncp.c4
-rw-r--r--arch/arm/mach-s3c64xx/mach-real6410.c8
-rw-r--r--arch/arm/mach-s3c64xx/mach-smartq.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-smartq5.c4
-rw-r--r--arch/arm/mach-s3c64xx/mach-smartq7.c4
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6400.c4
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6410.c10
-rw-r--r--arch/arm/mach-s3c64xx/pm.c12
-rw-r--r--arch/arm/mach-s3c64xx/regs-gpio-memport.h (renamed from arch/arm/mach-s3c64xx/include/mach/regs-gpio-memport.h)9
-rw-r--r--arch/arm/mach-s3c64xx/regs-modem.h (renamed from arch/arm/mach-s3c64xx/include/mach/regs-modem.h)11
-rw-r--r--arch/arm/mach-s3c64xx/regs-srom.h (renamed from arch/arm/mach-s3c64xx/include/mach/regs-srom.h)11
-rw-r--r--arch/arm/mach-s3c64xx/regs-sys.h30
-rw-r--r--arch/arm/mach-s3c64xx/regs-syscon-power.h (renamed from arch/arm/mach-s3c64xx/include/mach/regs-syscon-power.h)9
-rw-r--r--arch/arm/mach-s3c64xx/setup-usb-phy.c3
-rw-r--r--arch/arm/mach-s5p64x0/clock-s5p6440.c2
-rw-r--r--arch/arm/mach-s5p64x0/clock-s5p6450.c2
-rw-r--r--arch/arm/mach-s5p64x0/clock.h (renamed from arch/arm/mach-s5p64x0/include/mach/s5p64x0-clock.h)9
-rw-r--r--arch/arm/mach-s5p64x0/gpiolib.c508
-rw-r--r--arch/arm/mach-s5p64x0/i2c.h (renamed from arch/arm/mach-s5p64x0/include/mach/i2c.h)3
-rw-r--r--arch/arm/mach-s5p64x0/include/mach/regs-irq.h1
-rw-r--r--arch/arm/mach-s5p64x0/include/mach/tick.h29
-rw-r--r--arch/arm/mach-s5p64x0/include/mach/uncompress.h28
-rw-r--r--arch/arm/mach-s5p64x0/mach-smdk6440.c6
-rw-r--r--arch/arm/mach-s5p64x0/mach-smdk6450.c6
-rw-r--r--arch/arm/mach-s5p64x0/pm.c4
-rw-r--r--arch/arm/mach-s5p64x0/setup-i2c0.c2
-rw-r--r--arch/arm/mach-s5p64x0/setup-i2c1.c2
-rw-r--r--arch/arm/mach-s5pc100/include/mach/regs-irq.h1
-rw-r--r--arch/arm/mach-s5pc100/include/mach/tick.h2
-rw-r--r--arch/arm/mach-s5pc100/mach-smdkc100.c4
-rw-r--r--arch/arm/mach-s5pv210/dev-audio.c3
-rw-r--r--arch/arm/mach-s5pv210/include/mach/regs-audss.h18
-rw-r--r--arch/arm/mach-s5pv210/include/mach/regs-irq.h1
-rw-r--r--arch/arm/mach-s5pv210/include/mach/regs-sys.h15
-rw-r--r--arch/arm/mach-s5pv210/include/mach/tick.h26
-rw-r--r--arch/arm/mach-s5pv210/include/mach/uncompress.h2
-rw-r--r--arch/arm/mach-s5pv210/mach-aquila.c4
-rw-r--r--arch/arm/mach-s5pv210/mach-goni.c10
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkc110.c4
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkv210.c4
-rw-r--r--arch/arm/mach-s5pv210/mach-torbreck.c4
-rw-r--r--arch/arm/mach-s5pv210/pm.c4
-rw-r--r--arch/arm/mach-s5pv210/setup-usb-phy.c7
-rw-r--r--arch/arm/mach-sa1100/assabet.c3
-rw-r--r--arch/arm/mach-sa1100/badge4.c2
-rw-r--r--arch/arm/mach-sa1100/cerf.c2
-rw-r--r--arch/arm/mach-sa1100/collie.c2
-rw-r--r--arch/arm/mach-sa1100/generic.h4
-rw-r--r--arch/arm/mach-sa1100/h3100.c2
-rw-r--r--arch/arm/mach-sa1100/h3600.c2
-rw-r--r--arch/arm/mach-sa1100/hackkit.c2
-rw-r--r--arch/arm/mach-sa1100/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-sa1100/jornada720.c2
-rw-r--r--arch/arm/mach-sa1100/lart.c5
-rw-r--r--arch/arm/mach-sa1100/nanoengine.c2
-rw-r--r--arch/arm/mach-sa1100/pleb.c2
-rw-r--r--arch/arm/mach-sa1100/shannon.c2
-rw-r--r--arch/arm/mach-sa1100/simpad.c2
-rw-r--r--arch/arm/mach-sa1100/time.c72
-rw-r--r--arch/arm/mach-shark/core.c6
-rw-r--r--arch/arm/mach-shark/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-shmobile/Makefile11
-rw-r--r--arch/arm/mach-shmobile/board-ag5evm.c27
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c81
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c106
-rw-r--r--arch/arm/mach-shmobile/board-bonito.c12
-rw-r--r--arch/arm/mach-shmobile/board-kota2.c14
-rw-r--r--arch/arm/mach-shmobile/board-kzm9d.c4
-rw-r--r--arch/arm/mach-shmobile/board-kzm9g.c47
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c64
-rw-r--r--arch/arm/mach-shmobile/board-marzen.c4
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7740.c6
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7779.c1
-rw-r--r--arch/arm/mach-shmobile/clock-sh7372.c9
-rw-r--r--arch/arm/mach-shmobile/clock-sh73a0.c35
-rw-r--r--arch/arm/mach-shmobile/headsmp-sh73a0.S50
-rw-r--r--arch/arm/mach-shmobile/headsmp.S48
-rw-r--r--arch/arm/mach-shmobile/hotplug.c6
-rw-r--r--arch/arm/mach-shmobile/include/mach/common.h14
-rw-r--r--arch/arm/mach-shmobile/include/mach/uncompress.h2
-rw-r--r--arch/arm/mach-shmobile/intc-r8a7779.c2
-rw-r--r--arch/arm/mach-shmobile/intc-sh73a0.c18
-rw-r--r--arch/arm/mach-shmobile/pfc-r8a7740.c2617
-rw-r--r--arch/arm/mach-shmobile/pfc-r8a7779.c2645
-rw-r--r--arch/arm/mach-shmobile/pfc-sh7372.c1663
-rw-r--r--arch/arm/mach-shmobile/pfc-sh73a0.c2803
-rw-r--r--arch/arm/mach-shmobile/platsmp.c3
-rw-r--r--arch/arm/mach-shmobile/pm-r8a7740.c22
-rw-r--r--arch/arm/mach-shmobile/pm-sh73a0.c32
-rw-r--r--arch/arm/mach-shmobile/setup-emev2.c19
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7740.c165
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7779.c48
-rw-r--r--arch/arm/mach-shmobile/setup-sh7372.c72
-rw-r--r--arch/arm/mach-shmobile/setup-sh73a0.c121
-rw-r--r--arch/arm/mach-shmobile/sleep-sh7372.S12
-rw-r--r--arch/arm/mach-shmobile/smp-emev2.c4
-rw-r--r--arch/arm/mach-shmobile/smp-r8a7779.c2
-rw-r--r--arch/arm/mach-shmobile/smp-sh73a0.c70
-rw-r--r--arch/arm/mach-shmobile/timer.c9
-rw-r--r--arch/arm/mach-socfpga/core.h4
-rw-r--r--arch/arm/mach-socfpga/headsmp.S16
-rw-r--r--arch/arm/mach-socfpga/platsmp.c21
-rw-r--r--arch/arm/mach-socfpga/socfpga.c23
-rw-r--r--arch/arm/mach-spear13xx/include/mach/generic.h3
-rw-r--r--arch/arm/mach-spear13xx/platsmp.c4
-rw-r--r--arch/arm/mach-spear13xx/spear1310.c7
-rw-r--r--arch/arm/mach-spear13xx/spear1340.c7
-rw-r--r--arch/arm/mach-spear13xx/spear13xx.c19
-rw-r--r--arch/arm/mach-spear3xx/include/mach/generic.h3
-rw-r--r--arch/arm/mach-spear3xx/spear300.c7
-rw-r--r--arch/arm/mach-spear3xx/spear310.c7
-rw-r--r--arch/arm/mach-spear3xx/spear320.c7
-rw-r--r--arch/arm/mach-spear3xx/spear3xx.c23
-rw-r--r--arch/arm/mach-spear6xx/spear6xx.c26
-rw-r--r--arch/arm/mach-sunxi/Kconfig1
-rw-r--r--arch/arm/mach-sunxi/sunxi.c23
-rw-r--r--arch/arm/mach-tegra/Kconfig19
-rw-r--r--arch/arm/mach-tegra/Makefile15
-rw-r--r--arch/arm/mach-tegra/apbio.c2
-rw-r--r--arch/arm/mach-tegra/board-dt-tegra114.c46
-rw-r--r--arch/arm/mach-tegra/board-dt-tegra20.c76
-rw-r--r--arch/arm/mach-tegra/board-dt-tegra30.c67
-rw-r--r--arch/arm/mach-tegra/board.h3
-rw-r--r--arch/arm/mach-tegra/clock.c166
-rw-r--r--arch/arm/mach-tegra/clock.h153
-rw-r--r--arch/arm/mach-tegra/common.c80
-rw-r--r--arch/arm/mach-tegra/common.h1
-rw-r--r--arch/arm/mach-tegra/cpu-tegra.c43
-rw-r--r--arch/arm/mach-tegra/cpuidle-tegra114.c61
-rw-r--r--arch/arm/mach-tegra/cpuidle-tegra20.c197
-rw-r--r--arch/arm/mach-tegra/cpuidle-tegra30.c8
-rw-r--r--arch/arm/mach-tegra/cpuidle.c3
-rw-r--r--arch/arm/mach-tegra/cpuidle.h6
-rw-r--r--arch/arm/mach-tegra/flowctrl.c42
-rw-r--r--arch/arm/mach-tegra/flowctrl.h4
-rw-r--r--arch/arm/mach-tegra/fuse.c8
-rw-r--r--arch/arm/mach-tegra/fuse.h1
-rw-r--r--arch/arm/mach-tegra/headsmp.S264
-rw-r--r--arch/arm/mach-tegra/hotplug.c23
-rw-r--r--arch/arm/mach-tegra/include/mach/clk.h44
-rw-r--r--arch/arm/mach-tegra/include/mach/uncompress.h4
-rw-r--r--arch/arm/mach-tegra/iomap.h9
-rw-r--r--arch/arm/mach-tegra/irq.c18
-rw-r--r--arch/arm/mach-tegra/irq.h22
-rw-r--r--arch/arm/mach-tegra/pcie.c2
-rw-r--r--arch/arm/mach-tegra/platsmp.c72
-rw-r--r--arch/arm/mach-tegra/pm.c9
-rw-r--r--arch/arm/mach-tegra/powergate.c2
-rw-r--r--arch/arm/mach-tegra/reset-handler.S239
-rw-r--r--arch/arm/mach-tegra/reset.c2
-rw-r--r--arch/arm/mach-tegra/sleep-tegra20.S203
-rw-r--r--arch/arm/mach-tegra/sleep-tegra30.S3
-rw-r--r--arch/arm/mach-tegra/sleep.S23
-rw-r--r--arch/arm/mach-tegra/sleep.h27
-rw-r--r--arch/arm/mach-tegra/tegra20_clocks.c1623
-rw-r--r--arch/arm/mach-tegra/tegra20_clocks.h42
-rw-r--r--arch/arm/mach-tegra/tegra20_clocks_data.c1143
-rw-r--r--arch/arm/mach-tegra/tegra2_emc.c8
-rw-r--r--arch/arm/mach-tegra/tegra30_clocks.c2506
-rw-r--r--arch/arm/mach-tegra/tegra30_clocks.h54
-rw-r--r--arch/arm/mach-tegra/tegra30_clocks_data.c1425
-rw-r--r--arch/arm/mach-tegra/tegra_cpu_car.h124
-rw-r--r--arch/arm/mach-tegra/timer.c292
-rw-r--r--arch/arm/mach-u300/core.c1092
-rw-r--r--arch/arm/mach-u300/dma_channels.h60
-rw-r--r--arch/arm/mach-u300/include/mach/coh901318.h267
-rw-r--r--arch/arm/mach-u300/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-u300/spi.c3
-rw-r--r--arch/arm/mach-u300/timer.c10
-rw-r--r--arch/arm/mach-u300/timer.h2
-rw-r--r--arch/arm/mach-ux500/Kconfig6
-rw-r--r--arch/arm/mach-ux500/board-mop500-uib.c1
-rw-r--r--arch/arm/mach-ux500/board-mop500.c52
-rw-r--r--arch/arm/mach-ux500/cache-l2x0.c3
-rw-r--r--arch/arm/mach-ux500/cpu-db8500.c15
-rw-r--r--arch/arm/mach-ux500/cpu.c17
-rw-r--r--arch/arm/mach-ux500/cpuidle.c4
-rw-r--r--arch/arm/mach-ux500/devices-db8500.c44
-rw-r--r--arch/arm/mach-ux500/devices-db8500.h5
-rw-r--r--arch/arm/mach-ux500/id.c2
-rw-r--r--arch/arm/mach-ux500/id.h (renamed from arch/arm/mach-ux500/include/mach/id.h)21
-rw-r--r--arch/arm/mach-ux500/include/mach/hardware.h1
-rw-r--r--arch/arm/mach-ux500/include/mach/irqs-board-mop500.h10
-rw-r--r--arch/arm/mach-ux500/include/mach/setup.h3
-rw-r--r--arch/arm/mach-ux500/include/mach/uncompress.h2
-rw-r--r--arch/arm/mach-ux500/platsmp.c9
-rw-r--r--arch/arm/mach-ux500/timer.c15
-rw-r--r--arch/arm/mach-versatile/Kconfig5
-rw-r--r--arch/arm/mach-versatile/core.c26
-rw-r--r--arch/arm/mach-versatile/core.h2
-rw-r--r--arch/arm/mach-versatile/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-versatile/pci.c11
-rw-r--r--arch/arm/mach-versatile/versatile_ab.c4
-rw-r--r--arch/arm/mach-versatile/versatile_dt.c4
-rw-r--r--arch/arm/mach-versatile/versatile_pb.c4
-rw-r--r--arch/arm/mach-vexpress/ct-ca9x4.c4
-rw-r--r--arch/arm/mach-vexpress/platsmp.c3
-rw-r--r--arch/arm/mach-vexpress/v2m.c28
-rw-r--r--arch/arm/mach-virt/Kconfig10
-rw-r--r--arch/arm/mach-virt/Makefile6
-rw-r--r--arch/arm/mach-virt/platsmp.c58
-rw-r--r--arch/arm/mach-virt/virt.c54
-rw-r--r--arch/arm/mach-vt8500/Kconfig30
-rw-r--r--arch/arm/mach-vt8500/Makefile2
-rw-r--r--arch/arm/mach-vt8500/common.h1
-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/timer.c184
-rw-r--r--arch/arm/mach-vt8500/vt8500.c9
-rw-r--r--arch/arm/mach-w90x900/include/mach/entry-macro.S4
-rw-r--r--arch/arm/mach-w90x900/include/mach/uncompress.h2
-rw-r--r--arch/arm/mach-w90x900/mach-nuc910evb.c2
-rw-r--r--arch/arm/mach-w90x900/mach-nuc950evb.c2
-rw-r--r--arch/arm/mach-w90x900/mach-nuc960evb.c2
-rw-r--r--arch/arm/mach-w90x900/nuc9xx.h3
-rw-r--r--arch/arm/mach-w90x900/time.c16
-rw-r--r--arch/arm/mach-zynq/common.c29
-rw-r--r--arch/arm/mach-zynq/common.h2
-rw-r--r--arch/arm/mach-zynq/timer.c150
-rw-r--r--arch/arm/mm/Kconfig10
-rw-r--r--arch/arm/mm/Makefile2
-rw-r--r--arch/arm/mm/alignment.c11
-rw-r--r--arch/arm/mm/cache-v7.S46
-rw-r--r--arch/arm/mm/context.c3
-rw-r--r--arch/arm/mm/dma-mapping.c110
-rw-r--r--arch/arm/mm/idmap.c55
-rw-r--r--arch/arm/mm/ioremap.c135
-rw-r--r--arch/arm/mm/mm.h12
-rw-r--r--arch/arm/mm/mmu.c58
-rw-r--r--arch/arm/mm/proc-macros.S5
-rw-r--r--arch/arm/mm/proc-v6.S2
-rw-r--r--arch/arm/mm/proc-v7-2level.S2
-rw-r--r--arch/arm/mm/proc-v7-3level.S2
-rw-r--r--arch/arm/mm/vmregion.c205
-rw-r--r--arch/arm/mm/vmregion.h31
-rw-r--r--arch/arm/net/bpf_jit_32.c15
-rw-r--r--arch/arm/plat-iop/time.c9
-rw-r--r--arch/arm/plat-omap/Kconfig41
-rw-r--r--arch/arm/plat-omap/Makefile2
-rw-r--r--arch/arm/plat-omap/dma.c2
-rw-r--r--arch/arm/plat-omap/dmtimer.c8
-rw-r--r--arch/arm/plat-omap/i2c.c3
-rw-r--r--arch/arm/plat-omap/include/plat/i2c.h6
-rw-r--r--arch/arm/plat-omap/include/plat/timex.h8
-rw-r--r--arch/arm/plat-orion/mpp.c2
-rw-r--r--arch/arm/plat-orion/time.c6
-rw-r--r--arch/arm/plat-s3c24xx/Kconfig116
-rw-r--r--arch/arm/plat-s3c24xx/Makefile27
-rw-r--r--arch/arm/plat-s3c24xx/irq.c676
-rw-r--r--arch/arm/plat-samsung/adc.c8
-rw-r--r--arch/arm/plat-samsung/dma-ops.c10
-rw-r--r--arch/arm/plat-samsung/include/plat/adc.h1
-rw-r--r--arch/arm/plat-samsung/include/plat/cpu.h3
-rw-r--r--arch/arm/plat-samsung/include/plat/debug-macro.S18
-rw-r--r--arch/arm/plat-samsung/include/plat/dma-ops.h3
-rw-r--r--arch/arm/plat-samsung/include/plat/fimc-core.h2
-rw-r--r--arch/arm/plat-samsung/include/plat/gpio-core.h13
-rw-r--r--arch/arm/plat-samsung/include/plat/gpio-fns.h1
-rw-r--r--arch/arm/plat-samsung/include/plat/pm.h6
-rw-r--r--arch/arm/plat-samsung/include/plat/s3c2416.h1
-rw-r--r--arch/arm/plat-samsung/include/plat/s3c2443.h2
-rw-r--r--arch/arm/plat-samsung/include/plat/s5p-time.h2
-rw-r--r--arch/arm/plat-samsung/include/plat/sdhci.h2
-rw-r--r--arch/arm/plat-samsung/include/plat/uncompress.h28
-rw-r--r--arch/arm/plat-samsung/pm.c7
-rw-r--r--arch/arm/plat-samsung/s3c-dma-ops.c3
-rw-r--r--arch/arm/plat-samsung/s5p-irq-eint.c3
-rw-r--r--arch/arm/plat-samsung/s5p-irq.c3
-rw-r--r--arch/arm/plat-samsung/s5p-time.c15
-rw-r--r--arch/arm/plat-samsung/time.c20
-rw-r--r--arch/arm/plat-spear/Kconfig1
-rw-r--r--arch/arm/plat-spear/include/plat/uncompress.h1
-rw-r--r--arch/arm/plat-spear/restart.c2
-rw-r--r--arch/arm/plat-spear/time.c8
-rw-r--r--arch/arm/plat-versatile/platsmp.c4
-rw-r--r--arch/arm/vfp/vfphw.S36
-rw-r--r--arch/arm/vfp/vfpmodule.c2
-rw-r--r--arch/arm/xen/enlighten.c8
1272 files changed, 28215 insertions, 38284 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index e04c7793f47e..dedf02b6f322 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -4,6 +4,7 @@ config ARM
4 select ARCH_BINFMT_ELF_RANDOMIZE_PIE 4 select ARCH_BINFMT_ELF_RANDOMIZE_PIE
5 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE 5 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
6 select ARCH_HAVE_CUSTOM_GPIO_H 6 select ARCH_HAVE_CUSTOM_GPIO_H
7 select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
7 select ARCH_WANT_IPC_PARSE_VERSION 8 select ARCH_WANT_IPC_PARSE_VERSION
8 select BUILDTIME_EXTABLE_SORT if MMU 9 select BUILDTIME_EXTABLE_SORT if MMU
9 select CPU_PM if (SUSPEND || CPU_IDLE) 10 select CPU_PM if (SUSPEND || CPU_IDLE)
@@ -36,7 +37,6 @@ config ARM
36 select HAVE_GENERIC_HARDIRQS 37 select HAVE_GENERIC_HARDIRQS
37 select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7)) 38 select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
38 select HAVE_IDE if PCI || ISA || PCMCIA 39 select HAVE_IDE if PCI || ISA || PCMCIA
39 select HAVE_IRQ_WORK
40 select HAVE_KERNEL_GZIP 40 select HAVE_KERNEL_GZIP
41 select HAVE_KERNEL_LZMA 41 select HAVE_KERNEL_LZMA
42 select HAVE_KERNEL_LZO 42 select HAVE_KERNEL_LZO
@@ -49,6 +49,7 @@ config ARM
49 select HAVE_REGS_AND_STACK_ACCESS_API 49 select HAVE_REGS_AND_STACK_ACCESS_API
50 select HAVE_SYSCALL_TRACEPOINTS 50 select HAVE_SYSCALL_TRACEPOINTS
51 select HAVE_UID16 51 select HAVE_UID16
52 select HAVE_VIRT_TO_BUS
52 select KTIME_SCALAR 53 select KTIME_SCALAR
53 select PERF_USE_VMALLOC 54 select PERF_USE_VMALLOC
54 select RTC_LIB 55 select RTC_LIB
@@ -56,6 +57,8 @@ config ARM
56 select HAVE_MOD_ARCH_SPECIFIC if ARM_UNWIND 57 select HAVE_MOD_ARCH_SPECIFIC if ARM_UNWIND
57 select MODULES_USE_ELF_REL 58 select MODULES_USE_ELF_REL
58 select CLONE_BACKWARDS 59 select CLONE_BACKWARDS
60 select OLD_SIGSUSPEND3
61 select OLD_SIGACTION
59 help 62 help
60 The ARM series is a line of low-power-consumption RISC chip designs 63 The ARM series is a line of low-power-consumption RISC chip designs
61 licensed by ARM Ltd and targeted at embedded applications and 64 licensed by ARM Ltd and targeted at embedded applications and
@@ -75,6 +78,27 @@ config ARM_DMA_USE_IOMMU
75 select ARM_HAS_SG_CHAIN 78 select ARM_HAS_SG_CHAIN
76 select NEED_SG_DMA_LENGTH 79 select NEED_SG_DMA_LENGTH
77 80
81if ARM_DMA_USE_IOMMU
82
83config ARM_DMA_IOMMU_ALIGNMENT
84 int "Maximum PAGE_SIZE order of alignment for DMA IOMMU buffers"
85 range 4 9
86 default 8
87 help
88 DMA mapping framework by default aligns all buffers to the smallest
89 PAGE_SIZE order which is greater than or equal to the requested buffer
90 size. This works well for buffers up to a few hundreds kilobytes, but
91 for larger buffers it just a waste of address space. Drivers which has
92 relatively small addressing window (like 64Mib) might run out of
93 virtual space with just a few allocations.
94
95 With this parameter you can specify the maximum PAGE_SIZE order for
96 DMA IOMMU buffers. Larger buffers will be aligned only to this
97 specified order. The order is expressed as a power of two multiplied
98 by the PAGE_SIZE.
99
100endif
101
78config HAVE_PWM 102config HAVE_PWM
79 bool 103 bool
80 104
@@ -261,7 +285,8 @@ config MMU
261# 285#
262choice 286choice
263 prompt "ARM system type" 287 prompt "ARM system type"
264 default ARCH_MULTIPLATFORM 288 default ARCH_VERSATILE if !MMU
289 default ARCH_MULTIPLATFORM if MMU
265 290
266config ARCH_MULTIPLATFORM 291config ARCH_MULTIPLATFORM
267 bool "Allow multiple platforms to be selected" 292 bool "Allow multiple platforms to be selected"
@@ -344,10 +369,10 @@ config ARCH_BCM2835
344 select ARM_ERRATA_411920 369 select ARM_ERRATA_411920
345 select ARM_TIMER_SP804 370 select ARM_TIMER_SP804
346 select CLKDEV_LOOKUP 371 select CLKDEV_LOOKUP
372 select CLKSRC_OF
347 select COMMON_CLK 373 select COMMON_CLK
348 select CPU_V6 374 select CPU_V6
349 select GENERIC_CLOCKEVENTS 375 select GENERIC_CLOCKEVENTS
350 select GENERIC_GPIO
351 select MULTI_IRQ_HANDLER 376 select MULTI_IRQ_HANDLER
352 select PINCTRL 377 select PINCTRL
353 select PINCTRL_BCM2835 378 select PINCTRL_BCM2835
@@ -393,6 +418,7 @@ config ARCH_GEMINI
393config ARCH_SIRF 418config ARCH_SIRF
394 bool "CSR SiRF" 419 bool "CSR SiRF"
395 select ARCH_REQUIRE_GPIOLIB 420 select ARCH_REQUIRE_GPIOLIB
421 select AUTO_ZRELADDR
396 select COMMON_CLK 422 select COMMON_CLK
397 select GENERIC_CLOCKEVENTS 423 select GENERIC_CLOCKEVENTS
398 select GENERIC_IRQ_CHIP 424 select GENERIC_IRQ_CHIP
@@ -640,11 +666,12 @@ config ARCH_LPC32XX
640config ARCH_TEGRA 666config ARCH_TEGRA
641 bool "NVIDIA Tegra" 667 bool "NVIDIA Tegra"
642 select ARCH_HAS_CPUFREQ 668 select ARCH_HAS_CPUFREQ
669 select ARCH_REQUIRE_GPIOLIB
643 select CLKDEV_LOOKUP 670 select CLKDEV_LOOKUP
644 select CLKSRC_MMIO 671 select CLKSRC_MMIO
672 select CLKSRC_OF
645 select COMMON_CLK 673 select COMMON_CLK
646 select GENERIC_CLOCKEVENTS 674 select GENERIC_CLOCKEVENTS
647 select GENERIC_GPIO
648 select HAVE_CLK 675 select HAVE_CLK
649 select HAVE_SMP 676 select HAVE_SMP
650 select MIGHT_HAVE_CACHE_L2X0 677 select MIGHT_HAVE_CACHE_L2X0
@@ -698,6 +725,7 @@ config ARCH_SHMOBILE
698 select MULTI_IRQ_HANDLER 725 select MULTI_IRQ_HANDLER
699 select NEED_MACH_MEMORY_H 726 select NEED_MACH_MEMORY_H
700 select NO_IOPORT 727 select NO_IOPORT
728 select PINCTRL
701 select PM_GENERIC_DOMAINS if PM 729 select PM_GENERIC_DOMAINS if PM
702 select SPARSE_IRQ 730 select SPARSE_IRQ
703 help 731 help
@@ -744,7 +772,6 @@ config ARCH_S3C24XX
744 select ARCH_HAS_CPUFREQ 772 select ARCH_HAS_CPUFREQ
745 select ARCH_USES_GETTIMEOFFSET 773 select ARCH_USES_GETTIMEOFFSET
746 select CLKDEV_LOOKUP 774 select CLKDEV_LOOKUP
747 select GENERIC_GPIO
748 select HAVE_CLK 775 select HAVE_CLK
749 select HAVE_S3C2410_I2C if I2C 776 select HAVE_S3C2410_I2C if I2C
750 select HAVE_S3C2410_WATCHDOG if WATCHDOG 777 select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@ -787,7 +814,6 @@ config ARCH_S5P64X0
787 select CLKSRC_MMIO 814 select CLKSRC_MMIO
788 select CPU_V6 815 select CPU_V6
789 select GENERIC_CLOCKEVENTS 816 select GENERIC_CLOCKEVENTS
790 select GENERIC_GPIO
791 select HAVE_CLK 817 select HAVE_CLK
792 select HAVE_S3C2410_I2C if I2C 818 select HAVE_S3C2410_I2C if I2C
793 select HAVE_S3C2410_WATCHDOG if WATCHDOG 819 select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@ -802,7 +828,6 @@ config ARCH_S5PC100
802 select ARCH_USES_GETTIMEOFFSET 828 select ARCH_USES_GETTIMEOFFSET
803 select CLKDEV_LOOKUP 829 select CLKDEV_LOOKUP
804 select CPU_V7 830 select CPU_V7
805 select GENERIC_GPIO
806 select HAVE_CLK 831 select HAVE_CLK
807 select HAVE_S3C2410_I2C if I2C 832 select HAVE_S3C2410_I2C if I2C
808 select HAVE_S3C2410_WATCHDOG if WATCHDOG 833 select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@ -820,7 +845,6 @@ config ARCH_S5PV210
820 select CLKSRC_MMIO 845 select CLKSRC_MMIO
821 select CPU_V7 846 select CPU_V7
822 select GENERIC_CLOCKEVENTS 847 select GENERIC_CLOCKEVENTS
823 select GENERIC_GPIO
824 select HAVE_CLK 848 select HAVE_CLK
825 select HAVE_S3C2410_I2C if I2C 849 select HAVE_S3C2410_I2C if I2C
826 select HAVE_S3C2410_WATCHDOG if WATCHDOG 850 select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@ -838,7 +862,6 @@ config ARCH_EXYNOS
838 select CLKDEV_LOOKUP 862 select CLKDEV_LOOKUP
839 select CPU_V7 863 select CPU_V7
840 select GENERIC_CLOCKEVENTS 864 select GENERIC_CLOCKEVENTS
841 select GENERIC_GPIO
842 select HAVE_CLK 865 select HAVE_CLK
843 select HAVE_S3C2410_I2C if I2C 866 select HAVE_S3C2410_I2C if I2C
844 select HAVE_S3C2410_WATCHDOG if WATCHDOG 867 select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@ -873,7 +896,6 @@ config ARCH_U300
873 select COMMON_CLK 896 select COMMON_CLK
874 select CPU_ARM926T 897 select CPU_ARM926T
875 select GENERIC_CLOCKEVENTS 898 select GENERIC_CLOCKEVENTS
876 select GENERIC_GPIO
877 select HAVE_TCM 899 select HAVE_TCM
878 select SPARSE_IRQ 900 select SPARSE_IRQ
879 help 901 help
@@ -899,10 +921,12 @@ config ARCH_NOMADIK
899 select ARCH_REQUIRE_GPIOLIB 921 select ARCH_REQUIRE_GPIOLIB
900 select ARM_AMBA 922 select ARM_AMBA
901 select ARM_VIC 923 select ARM_VIC
924 select CLKSRC_NOMADIK_MTU
902 select COMMON_CLK 925 select COMMON_CLK
903 select CPU_ARM926T 926 select CPU_ARM926T
904 select GENERIC_CLOCKEVENTS 927 select GENERIC_CLOCKEVENTS
905 select MIGHT_HAVE_CACHE_L2X0 928 select MIGHT_HAVE_CACHE_L2X0
929 select USE_OF
906 select PINCTRL 930 select PINCTRL
907 select PINCTRL_STN8815 931 select PINCTRL_STN8815
908 select SPARSE_IRQ 932 select SPARSE_IRQ
@@ -937,33 +961,24 @@ config ARCH_DAVINCI
937 help 961 help
938 Support for TI's DaVinci platform. 962 Support for TI's DaVinci platform.
939 963
940config ARCH_OMAP 964config ARCH_OMAP1
941 bool "TI OMAP" 965 bool "TI OMAP1"
942 depends on MMU 966 depends on MMU
943 select ARCH_HAS_CPUFREQ 967 select ARCH_HAS_CPUFREQ
944 select ARCH_HAS_HOLES_MEMORYMODEL 968 select ARCH_HAS_HOLES_MEMORYMODEL
945 select ARCH_REQUIRE_GPIOLIB 969 select ARCH_OMAP
946 select CLKSRC_MMIO
947 select GENERIC_CLOCKEVENTS
948 select HAVE_CLK
949 help
950 Support for TI's OMAP platform (OMAP1/2/3/4).
951
952config ARCH_VT8500_SINGLE
953 bool "VIA/WonderMedia 85xx"
954 select ARCH_HAS_CPUFREQ
955 select ARCH_REQUIRE_GPIOLIB 970 select ARCH_REQUIRE_GPIOLIB
956 select CLKDEV_LOOKUP 971 select CLKDEV_LOOKUP
957 select COMMON_CLK 972 select CLKSRC_MMIO
958 select CPU_ARM926T
959 select GENERIC_CLOCKEVENTS 973 select GENERIC_CLOCKEVENTS
960 select GENERIC_GPIO 974 select GENERIC_IRQ_CHIP
961 select HAVE_CLK 975 select HAVE_CLK
962 select MULTI_IRQ_HANDLER 976 select HAVE_IDE
963 select SPARSE_IRQ 977 select IRQ_DOMAIN
964 select USE_OF 978 select NEED_MACH_IO_H if PCCARD
979 select NEED_MACH_MEMORY_H
965 help 980 help
966 Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip. 981 Support for older TI OMAP1 (omap7xx, omap15xx or omap16xx)
967 982
968endchoice 983endchoice
969 984
@@ -1086,17 +1101,12 @@ source "arch/arm/mach-realview/Kconfig"
1086source "arch/arm/mach-sa1100/Kconfig" 1101source "arch/arm/mach-sa1100/Kconfig"
1087 1102
1088source "arch/arm/plat-samsung/Kconfig" 1103source "arch/arm/plat-samsung/Kconfig"
1089source "arch/arm/plat-s3c24xx/Kconfig"
1090 1104
1091source "arch/arm/mach-socfpga/Kconfig" 1105source "arch/arm/mach-socfpga/Kconfig"
1092 1106
1093source "arch/arm/plat-spear/Kconfig" 1107source "arch/arm/plat-spear/Kconfig"
1094 1108
1095source "arch/arm/mach-s3c24xx/Kconfig" 1109source "arch/arm/mach-s3c24xx/Kconfig"
1096if ARCH_S3C24XX
1097source "arch/arm/mach-s3c2412/Kconfig"
1098source "arch/arm/mach-s3c2440/Kconfig"
1099endif
1100 1110
1101if ARCH_S3C64XX 1111if ARCH_S3C64XX
1102source "arch/arm/mach-s3c64xx/Kconfig" 1112source "arch/arm/mach-s3c64xx/Kconfig"
@@ -1127,6 +1137,8 @@ source "arch/arm/mach-versatile/Kconfig"
1127source "arch/arm/mach-vexpress/Kconfig" 1137source "arch/arm/mach-vexpress/Kconfig"
1128source "arch/arm/plat-versatile/Kconfig" 1138source "arch/arm/plat-versatile/Kconfig"
1129 1139
1140source "arch/arm/mach-virt/Kconfig"
1141
1130source "arch/arm/mach-vt8500/Kconfig" 1142source "arch/arm/mach-vt8500/Kconfig"
1131 1143
1132source "arch/arm/mach-w90x900/Kconfig" 1144source "arch/arm/mach-w90x900/Kconfig"
@@ -1450,6 +1462,10 @@ config ISA_DMA
1450 bool 1462 bool
1451 select ISA_DMA_API 1463 select ISA_DMA_API
1452 1464
1465config ARCH_NO_VIRT_TO_BUS
1466 def_bool y
1467 depends on !ARCH_RPC && !ARCH_NETWINDER && !ARCH_SHARK
1468
1453# Select ISA DMA interface 1469# Select ISA DMA interface
1454config ISA_DMA_API 1470config ISA_DMA_API
1455 bool 1471 bool
@@ -1531,7 +1547,6 @@ config SMP
1531 1547
1532config SMP_ON_UP 1548config SMP_ON_UP
1533 bool "Allow booting SMP kernel on uniprocessor systems (EXPERIMENTAL)" 1549 bool "Allow booting SMP kernel on uniprocessor systems (EXPERIMENTAL)"
1534 depends on EXPERIMENTAL
1535 depends on SMP && !XIP_KERNEL 1550 depends on SMP && !XIP_KERNEL
1536 default y 1551 default y
1537 help 1552 help
@@ -1572,9 +1587,10 @@ config HAVE_ARM_SCU
1572 help 1587 help
1573 This option enables support for the ARM system coherency unit 1588 This option enables support for the ARM system coherency unit
1574 1589
1575config ARM_ARCH_TIMER 1590config HAVE_ARM_ARCH_TIMER
1576 bool "Architected timer support" 1591 bool "Architected timer support"
1577 depends on CPU_V7 1592 depends on CPU_V7
1593 select ARM_ARCH_TIMER
1578 help 1594 help
1579 This option enables support for the ARM architected timer 1595 This option enables support for the ARM architected timer
1580 1596
@@ -1620,6 +1636,16 @@ config HOTPLUG_CPU
1620 Say Y here to experiment with turning CPUs off and on. CPUs 1636 Say Y here to experiment with turning CPUs off and on. CPUs
1621 can be controlled through /sys/devices/system/cpu. 1637 can be controlled through /sys/devices/system/cpu.
1622 1638
1639config ARM_PSCI
1640 bool "Support for the ARM Power State Coordination Interface (PSCI)"
1641 depends on CPU_V7
1642 help
1643 Say Y here if you want Linux to communicate with system firmware
1644 implementing the PSCI specification for CPU-centric power
1645 management operations described in ARM document number ARM DEN
1646 0022A ("Power State Coordination Interface System Software on
1647 ARM processors").
1648
1623config LOCAL_TIMERS 1649config LOCAL_TIMERS
1624 bool "Use local timer interrupts" 1650 bool "Use local timer interrupts"
1625 depends on SMP 1651 depends on SMP
@@ -1637,7 +1663,7 @@ config ARCH_NR_GPIO
1637 default 355 if ARCH_U8500 1663 default 355 if ARCH_U8500
1638 default 264 if MACH_H4700 1664 default 264 if MACH_H4700
1639 default 512 if SOC_OMAP5 1665 default 512 if SOC_OMAP5
1640 default 288 if ARCH_VT8500 1666 default 288 if ARCH_VT8500 || ARCH_SUNXI
1641 default 0 1667 default 0
1642 help 1668 help
1643 Maximum number of GPIOs in the system. 1669 Maximum number of GPIOs in the system.
@@ -1650,11 +1676,13 @@ config HZ
1650 int 1676 int
1651 default 200 if ARCH_EBSA110 || ARCH_S3C24XX || ARCH_S5P64X0 || \ 1677 default 200 if ARCH_EBSA110 || ARCH_S3C24XX || ARCH_S5P64X0 || \
1652 ARCH_S5PV210 || ARCH_EXYNOS4 1678 ARCH_S5PV210 || ARCH_EXYNOS4
1653 default OMAP_32K_TIMER_HZ if ARCH_OMAP && OMAP_32K_TIMER
1654 default AT91_TIMER_HZ if ARCH_AT91 1679 default AT91_TIMER_HZ if ARCH_AT91
1655 default SHMOBILE_TIMER_HZ if ARCH_SHMOBILE 1680 default SHMOBILE_TIMER_HZ if ARCH_SHMOBILE
1656 default 100 1681 default 100
1657 1682
1683config SCHED_HRTICK
1684 def_bool HIGH_RES_TIMERS
1685
1658config THUMB2_KERNEL 1686config THUMB2_KERNEL
1659 bool "Compile the kernel in Thumb-2 mode" if !CPU_THUMBONLY 1687 bool "Compile the kernel in Thumb-2 mode" if !CPU_THUMBONLY
1660 depends on CPU_V7 && !CPU_V6 && !CPU_V6K 1688 depends on CPU_V7 && !CPU_V6 && !CPU_V6K
@@ -1720,7 +1748,7 @@ config AEABI
1720 1748
1721config OABI_COMPAT 1749config OABI_COMPAT
1722 bool "Allow old ABI binaries to run with this kernel (EXPERIMENTAL)" 1750 bool "Allow old ABI binaries to run with this kernel (EXPERIMENTAL)"
1723 depends on AEABI && EXPERIMENTAL && !THUMB2_KERNEL 1751 depends on AEABI && !THUMB2_KERNEL
1724 default y 1752 default y
1725 help 1753 help
1726 This option preserves the old syscall interface along with the 1754 This option preserves the old syscall interface along with the
@@ -1844,7 +1872,6 @@ config SECCOMP
1844 1872
1845config CC_STACKPROTECTOR 1873config CC_STACKPROTECTOR
1846 bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)" 1874 bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
1847 depends on EXPERIMENTAL
1848 help 1875 help
1849 This option turns on the -fstack-protector GCC feature. This 1876 This option turns on the -fstack-protector GCC feature. This
1850 feature puts, at the beginning of functions, a canary value on 1877 feature puts, at the beginning of functions, a canary value on
@@ -1861,7 +1888,7 @@ config XEN_DOM0
1861 1888
1862config XEN 1889config XEN
1863 bool "Xen guest support on ARM (EXPERIMENTAL)" 1890 bool "Xen guest support on ARM (EXPERIMENTAL)"
1864 depends on EXPERIMENTAL && ARM && OF 1891 depends on ARM && OF
1865 depends on CPU_V7 && !CPU_V6 1892 depends on CPU_V7 && !CPU_V6
1866 help 1893 help
1867 Say Y if you want to run Linux in a Virtual Machine on Xen on ARM. 1894 Say Y if you want to run Linux in a Virtual Machine on Xen on ARM.
@@ -1930,7 +1957,7 @@ config ZBOOT_ROM
1930 1957
1931choice 1958choice
1932 prompt "Include SD/MMC loader in zImage (EXPERIMENTAL)" 1959 prompt "Include SD/MMC loader in zImage (EXPERIMENTAL)"
1933 depends on ZBOOT_ROM && ARCH_SH7372 && EXPERIMENTAL 1960 depends on ZBOOT_ROM && ARCH_SH7372
1934 default ZBOOT_ROM_NONE 1961 default ZBOOT_ROM_NONE
1935 help 1962 help
1936 Include experimental SD/MMC loading code in the ROM-able zImage. 1963 Include experimental SD/MMC loading code in the ROM-able zImage.
@@ -1959,7 +1986,7 @@ endchoice
1959 1986
1960config ARM_APPENDED_DTB 1987config ARM_APPENDED_DTB
1961 bool "Use appended device tree blob to zImage (EXPERIMENTAL)" 1988 bool "Use appended device tree blob to zImage (EXPERIMENTAL)"
1962 depends on OF && !ZBOOT_ROM && EXPERIMENTAL 1989 depends on OF && !ZBOOT_ROM
1963 help 1990 help
1964 With this option, the boot code will look for a device tree binary 1991 With this option, the boot code will look for a device tree binary
1965 (DTB) appended to zImage 1992 (DTB) appended to zImage
@@ -2077,7 +2104,7 @@ config XIP_PHYS_ADDR
2077 2104
2078config KEXEC 2105config KEXEC
2079 bool "Kexec system call (EXPERIMENTAL)" 2106 bool "Kexec system call (EXPERIMENTAL)"
2080 depends on EXPERIMENTAL && (!SMP || HOTPLUG_CPU) 2107 depends on (!SMP || HOTPLUG_CPU)
2081 help 2108 help
2082 kexec is a system call that implements the ability to shutdown your 2109 kexec is a system call that implements the ability to shutdown your
2083 current kernel, and to start another kernel. It is like a reboot 2110 current kernel, and to start another kernel. It is like a reboot
@@ -2099,7 +2126,6 @@ config ATAGS_PROC
2099 2126
2100config CRASH_DUMP 2127config CRASH_DUMP
2101 bool "Build kdump crash kernel (EXPERIMENTAL)" 2128 bool "Build kdump crash kernel (EXPERIMENTAL)"
2102 depends on EXPERIMENTAL
2103 help 2129 help
2104 Generate crash dump after being started by kexec. This should 2130 Generate crash dump after being started by kexec. This should
2105 be normally only set in special crash dump kernels which are 2131 be normally only set in special crash dump kernels which are
@@ -2166,7 +2192,7 @@ config CPU_FREQ_S3C
2166 2192
2167config CPU_FREQ_S3C24XX 2193config CPU_FREQ_S3C24XX
2168 bool "CPUfreq driver for Samsung S3C24XX series CPUs (EXPERIMENTAL)" 2194 bool "CPUfreq driver for Samsung S3C24XX series CPUs (EXPERIMENTAL)"
2169 depends on ARCH_S3C24XX && CPU_FREQ && EXPERIMENTAL 2195 depends on ARCH_S3C24XX && CPU_FREQ
2170 select CPU_FREQ_S3C 2196 select CPU_FREQ_S3C
2171 help 2197 help
2172 This enables the CPUfreq driver for the Samsung S3C24XX family 2198 This enables the CPUfreq driver for the Samsung S3C24XX family
@@ -2178,7 +2204,7 @@ config CPU_FREQ_S3C24XX
2178 2204
2179config CPU_FREQ_S3C24XX_PLL 2205config CPU_FREQ_S3C24XX_PLL
2180 bool "Support CPUfreq changing of PLL frequency (EXPERIMENTAL)" 2206 bool "Support CPUfreq changing of PLL frequency (EXPERIMENTAL)"
2181 depends on CPU_FREQ_S3C24XX && EXPERIMENTAL 2207 depends on CPU_FREQ_S3C24XX
2182 help 2208 help
2183 Compile in support for changing the PLL frequency from the 2209 Compile in support for changing the PLL frequency from the
2184 S3C24XX series CPUfreq driver. The PLL takes time to settle 2210 S3C24XX series CPUfreq driver. The PLL takes time to settle
@@ -2241,7 +2267,7 @@ config FPE_NWFPE_XP
2241 2267
2242config FPE_FASTFPE 2268config FPE_FASTFPE
2243 bool "FastFPE math emulation (EXPERIMENTAL)" 2269 bool "FastFPE math emulation (EXPERIMENTAL)"
2244 depends on (!AEABI || OABI_COMPAT) && !CPU_32v3 && EXPERIMENTAL 2270 depends on (!AEABI || OABI_COMPAT) && !CPU_32v3
2245 ---help--- 2271 ---help---
2246 Say Y here to include the FAST floating point emulator in the kernel. 2272 Say Y here to include the FAST floating point emulator in the kernel.
2247 This is an experimental much faster emulator which now also has full 2273 This is an experimental much faster emulator which now also has full
@@ -2323,3 +2349,5 @@ source "security/Kconfig"
2323source "crypto/Kconfig" 2349source "crypto/Kconfig"
2324 2350
2325source "lib/Kconfig" 2351source "lib/Kconfig"
2352
2353source "arch/arm/kvm/Kconfig"
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 661030d6bc6c..acddddac7ee4 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -32,7 +32,7 @@ config FRAME_POINTER
32 32
33config ARM_UNWIND 33config ARM_UNWIND
34 bool "Enable stack unwinding support (EXPERIMENTAL)" 34 bool "Enable stack unwinding support (EXPERIMENTAL)"
35 depends on AEABI && EXPERIMENTAL 35 depends on AEABI
36 default y 36 default y
37 help 37 help
38 This option enables stack unwinding support in the kernel 38 This option enables stack unwinding support in the kernel
@@ -205,12 +205,19 @@ choice
205 Say Y here if you want kernel low-level debugging support 205 Say Y here if you want kernel low-level debugging support
206 on i.MX28. 206 on i.MX28.
207 207
208 config DEBUG_IMX31_IMX35_UART 208 config DEBUG_IMX31_UART
209 bool "i.MX31 and i.MX35 Debug UART" 209 bool "i.MX31 Debug UART"
210 depends on SOC_IMX31 || SOC_IMX35 210 depends on SOC_IMX31
211 help 211 help
212 Say Y here if you want kernel low-level debugging support 212 Say Y here if you want kernel low-level debugging support
213 on i.MX31 or i.MX35. 213 on i.MX31.
214
215 config DEBUG_IMX35_UART
216 bool "i.MX35 Debug UART"
217 depends on SOC_IMX35
218 help
219 Say Y here if you want kernel low-level debugging support
220 on i.MX35.
214 221
215 config DEBUG_IMX51_UART 222 config DEBUG_IMX51_UART
216 bool "i.MX51 Debug UART" 223 bool "i.MX51 Debug UART"
@@ -219,12 +226,12 @@ choice
219 Say Y here if you want kernel low-level debugging support 226 Say Y here if you want kernel low-level debugging support
220 on i.MX51. 227 on i.MX51.
221 228
222 config DEBUG_IMX50_IMX53_UART 229 config DEBUG_IMX53_UART
223 bool "i.MX50 and i.MX53 Debug UART" 230 bool "i.MX53 Debug UART"
224 depends on SOC_IMX50 || SOC_IMX53 231 depends on SOC_IMX53
225 help 232 help
226 Say Y here if you want kernel low-level debugging support 233 Say Y here if you want kernel low-level debugging support
227 on i.MX50 or i.MX53. 234 on i.MX53.
228 235
229 config DEBUG_IMX6Q_UART 236 config DEBUG_IMX6Q_UART
230 bool "i.MX6Q Debug UART" 237 bool "i.MX6Q Debug UART"
@@ -291,6 +298,13 @@ choice
291 Say Y here if you want kernel low-level debugging support 298 Say Y here if you want kernel low-level debugging support
292 on MVEBU based platforms. 299 on MVEBU based platforms.
293 300
301 config DEBUG_OMAP2PLUS_UART
302 bool "Kernel low-level debugging messages via OMAP2PLUS UART"
303 depends on ARCH_OMAP2PLUS
304 help
305 Say Y here if you want kernel low-level debugging support
306 on OMAP2PLUS based platforms.
307
294 config DEBUG_PICOXCELL_UART 308 config DEBUG_PICOXCELL_UART
295 depends on ARCH_PICOXCELL 309 depends on ARCH_PICOXCELL
296 bool "Use PicoXcell UART for low-level debug" 310 bool "Use PicoXcell UART for low-level debug"
@@ -386,6 +400,20 @@ choice
386 Say Y here if you want kernel low-level debugging support 400 Say Y here if you want kernel low-level debugging support
387 on Tegra based platforms. 401 on Tegra based platforms.
388 402
403 config DEBUG_SIRFPRIMA2_UART1
404 bool "Kernel low-level debugging messages via SiRFprimaII UART1"
405 depends on ARCH_PRIMA2
406 help
407 Say Y here if you want the debug print routines to direct
408 their output to the uart1 port on SiRFprimaII devices.
409
410 config DEBUG_SIRFMARCO_UART1
411 bool "Kernel low-level debugging messages via SiRFmarco UART1"
412 depends on ARCH_MARCO
413 help
414 Say Y here if you want the debug print routines to direct
415 their output to the uart1 port on SiRFmarco devices.
416
389 config DEBUG_VEXPRESS_UART0_DETECT 417 config DEBUG_VEXPRESS_UART0_DETECT
390 bool "Autodetect UART0 on Versatile Express Cortex-A core tiles" 418 bool "Autodetect UART0 on Versatile Express Cortex-A core tiles"
391 depends on ARCH_VEXPRESS && CPU_CP15_MMU 419 depends on ARCH_VEXPRESS && CPU_CP15_MMU
@@ -412,6 +440,13 @@ choice
412 of the tiles using the RS1 memory map, including all new A-class 440 of the tiles using the RS1 memory map, including all new A-class
413 core tiles, FPGA-based SMMs and software models. 441 core tiles, FPGA-based SMMs and software models.
414 442
443 config DEBUG_VT8500_UART0
444 bool "Use UART0 on VIA/Wondermedia SoCs"
445 depends on ARCH_VT8500
446 help
447 This option selects UART0 on VIA/Wondermedia System-on-a-chip
448 devices, including VT8500, WM8505, WM8650 and WM8850.
449
415 config DEBUG_LL_UART_NONE 450 config DEBUG_LL_UART_NONE
416 bool "No low-level debugging UART" 451 bool "No low-level debugging UART"
417 depends on !ARCH_MULTIPLATFORM 452 depends on !ARCH_MULTIPLATFORM
@@ -450,17 +485,70 @@ choice
450 485
451endchoice 486endchoice
452 487
453config DEBUG_IMX6Q_UART_PORT 488config DEBUG_IMX_UART_PORT
454 int "i.MX6Q Debug UART Port (1-5)" if DEBUG_IMX6Q_UART 489 int "i.MX Debug UART Port Selection" if DEBUG_IMX1_UART || \
455 range 1 5 490 DEBUG_IMX25_UART || \
491 DEBUG_IMX21_IMX27_UART || \
492 DEBUG_IMX31_UART || \
493 DEBUG_IMX35_UART || \
494 DEBUG_IMX51_UART || \
495 DEBUG_IMX50_IMX53_UART || \
496 DEBUG_IMX6Q_UART
456 default 1 497 default 1
457 depends on SOC_IMX6Q
458 help 498 help
459 Choose UART port on which kernel low-level debug messages 499 Choose UART port on which kernel low-level debug messages
460 should be output. 500 should be output.
461 501
462choice 502choice
463 prompt "Low-level debug console UART" 503 prompt "Low-level debug console UART"
504 depends on DEBUG_OMAP2PLUS_UART
505
506 config DEBUG_OMAP2UART1
507 bool "OMAP2/3/4 UART1 (omap2/3 sdp boards and some omap3 boards)"
508 help
509 This covers at least h4, 2430sdp, 3430sdp, 3630sdp,
510 omap3 torpedo and 3530 lv som.
511
512 config DEBUG_OMAP2UART2
513 bool "OMAP2/3/4 UART2"
514
515 config DEBUG_OMAP2UART3
516 bool "OMAP2 UART3 (n8x0)"
517
518 config DEBUG_OMAP3UART3
519 bool "OMAP3 UART3 (most omap3 boards)"
520 help
521 This covers at least cm_t3x, beagle, crane, devkit8000,
522 igep00x0, ldp, n900, n9(50), pandora, overo, touchbook,
523 and 3517evm.
524
525 config DEBUG_OMAP4UART3
526 bool "OMAP4/5 UART3 (omap4 blaze, panda, omap5 sevm)"
527
528 config DEBUG_OMAP3UART4
529 bool "OMAP36XX UART4"
530
531 config DEBUG_OMAP4UART4
532 bool "OMAP4/5 UART4"
533
534 config DEBUG_TI81XXUART1
535 bool "TI81XX UART1 (ti8148evm)"
536
537 config DEBUG_TI81XXUART2
538 bool "TI81XX UART2"
539
540 config DEBUG_TI81XXUART3
541 bool "TI81XX UART3 (ti8168evm)"
542
543 config DEBUG_AM33XXUART1
544 bool "AM33XX UART1"
545
546 config DEBUG_ZOOM_UART
547 bool "Zoom2/3 UART"
548endchoice
549
550choice
551 prompt "Low-level debug console UART"
464 depends on DEBUG_LL && DEBUG_TEGRA_UART 552 depends on DEBUG_LL && DEBUG_TEGRA_UART
465 553
466 config TEGRA_DEBUG_UART_AUTO_ODMDATA 554 config TEGRA_DEBUG_UART_AUTO_ODMDATA
@@ -495,17 +583,20 @@ config DEBUG_LL_INCLUDE
495 default "debug/imx.S" if DEBUG_IMX1_UART || \ 583 default "debug/imx.S" if DEBUG_IMX1_UART || \
496 DEBUG_IMX25_UART || \ 584 DEBUG_IMX25_UART || \
497 DEBUG_IMX21_IMX27_UART || \ 585 DEBUG_IMX21_IMX27_UART || \
498 DEBUG_IMX31_IMX35_UART || \ 586 DEBUG_IMX31_UART || \
587 DEBUG_IMX35_UART || \
499 DEBUG_IMX51_UART || \ 588 DEBUG_IMX51_UART || \
500 DEBUG_IMX50_IMX53_UART ||\ 589 DEBUG_IMX53_UART ||\
501 DEBUG_IMX6Q_UART 590 DEBUG_IMX6Q_UART
502 default "debug/highbank.S" if DEBUG_HIGHBANK_UART 591 default "debug/highbank.S" if DEBUG_HIGHBANK_UART
503 default "debug/mvebu.S" if DEBUG_MVEBU_UART 592 default "debug/mvebu.S" if DEBUG_MVEBU_UART
593 default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART
504 default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART 594 default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART
505 default "debug/socfpga.S" if DEBUG_SOCFPGA_UART 595 default "debug/socfpga.S" if DEBUG_SOCFPGA_UART
506 default "debug/sunxi.S" if DEBUG_SUNXI_UART0 || DEBUG_SUNXI_UART1 596 default "debug/sunxi.S" if DEBUG_SUNXI_UART0 || DEBUG_SUNXI_UART1
507 default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \ 597 default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \
508 DEBUG_VEXPRESS_UART0_CA9 || DEBUG_VEXPRESS_UART0_RS1 598 DEBUG_VEXPRESS_UART0_CA9 || DEBUG_VEXPRESS_UART0_RS1
599 default "debug/vt8500.S" if DEBUG_VT8500_UART0
509 default "debug/tegra.S" if DEBUG_TEGRA_UART 600 default "debug/tegra.S" if DEBUG_TEGRA_UART
510 default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1 601 default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1
511 default "mach/debug-macro.S" 602 default "mach/debug-macro.S"
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 30c443c406f3..ee4605f400b0 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -173,7 +173,7 @@ machine-$(CONFIG_ARCH_PRIMA2) += prima2
173machine-$(CONFIG_ARCH_PXA) += pxa 173machine-$(CONFIG_ARCH_PXA) += pxa
174machine-$(CONFIG_ARCH_REALVIEW) += realview 174machine-$(CONFIG_ARCH_REALVIEW) += realview
175machine-$(CONFIG_ARCH_RPC) += rpc 175machine-$(CONFIG_ARCH_RPC) += rpc
176machine-$(CONFIG_ARCH_S3C24XX) += s3c24xx s3c2412 s3c2440 176machine-$(CONFIG_ARCH_S3C24XX) += s3c24xx
177machine-$(CONFIG_ARCH_S3C64XX) += s3c64xx 177machine-$(CONFIG_ARCH_S3C64XX) += s3c64xx
178machine-$(CONFIG_ARCH_S5P64X0) += s5p64x0 178machine-$(CONFIG_ARCH_S5P64X0) += s5p64x0
179machine-$(CONFIG_ARCH_S5PC100) += s5pc100 179machine-$(CONFIG_ARCH_S5PC100) += s5pc100
@@ -194,6 +194,7 @@ machine-$(CONFIG_ARCH_SOCFPGA) += socfpga
194machine-$(CONFIG_ARCH_SPEAR13XX) += spear13xx 194machine-$(CONFIG_ARCH_SPEAR13XX) += spear13xx
195machine-$(CONFIG_ARCH_SPEAR3XX) += spear3xx 195machine-$(CONFIG_ARCH_SPEAR3XX) += spear3xx
196machine-$(CONFIG_MACH_SPEAR600) += spear6xx 196machine-$(CONFIG_MACH_SPEAR600) += spear6xx
197machine-$(CONFIG_ARCH_VIRT) += virt
197machine-$(CONFIG_ARCH_ZYNQ) += zynq 198machine-$(CONFIG_ARCH_ZYNQ) += zynq
198machine-$(CONFIG_ARCH_SUNXI) += sunxi 199machine-$(CONFIG_ARCH_SUNXI) += sunxi
199 200
@@ -204,7 +205,7 @@ plat-$(CONFIG_ARCH_S3C64XX) += samsung
204plat-$(CONFIG_PLAT_IOP) += iop 205plat-$(CONFIG_PLAT_IOP) += iop
205plat-$(CONFIG_PLAT_ORION) += orion 206plat-$(CONFIG_PLAT_ORION) += orion
206plat-$(CONFIG_PLAT_PXA) += pxa 207plat-$(CONFIG_PLAT_PXA) += pxa
207plat-$(CONFIG_PLAT_S3C24XX) += s3c24xx samsung 208plat-$(CONFIG_PLAT_S3C24XX) += samsung
208plat-$(CONFIG_PLAT_S5P) += samsung 209plat-$(CONFIG_PLAT_S5P) += samsung
209plat-$(CONFIG_PLAT_SPEAR) += spear 210plat-$(CONFIG_PLAT_SPEAR) += spear
210plat-$(CONFIG_PLAT_VERSATILE) += versatile 211plat-$(CONFIG_PLAT_VERSATILE) += versatile
@@ -252,6 +253,7 @@ core-$(CONFIG_FPE_NWFPE) += arch/arm/nwfpe/
252core-$(CONFIG_FPE_FASTFPE) += $(FASTFPE_OBJ) 253core-$(CONFIG_FPE_FASTFPE) += $(FASTFPE_OBJ)
253core-$(CONFIG_VFP) += arch/arm/vfp/ 254core-$(CONFIG_VFP) += arch/arm/vfp/
254core-$(CONFIG_XEN) += arch/arm/xen/ 255core-$(CONFIG_XEN) += arch/arm/xen/
256core-$(CONFIG_KVM_ARM_HOST) += arch/arm/kvm/
255 257
256# If we have a machine-specific directory, then include it in the build. 258# If we have a machine-specific directory, then include it in the build.
257core-y += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/ 259core-y += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index abfce280f57b..71768b8a1ab9 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -68,8 +68,8 @@ else
68endif 68endif
69 69
70check_for_multiple_loadaddr = \ 70check_for_multiple_loadaddr = \
71if [ $(words $(UIMAGE_LOADADDR)) -gt 1 ]; then \ 71if [ $(words $(UIMAGE_LOADADDR)) -ne 1 ]; then \
72 echo 'multiple load addresses: $(UIMAGE_LOADADDR)'; \ 72 echo 'multiple (or no) load addresses: $(UIMAGE_LOADADDR)'; \
73 echo 'This is incompatible with uImages'; \ 73 echo 'This is incompatible with uImages'; \
74 echo 'Specify LOADADDR on the commandline to build an uImage'; \ 74 echo 'Specify LOADADDR on the commandline to build an uImage'; \
75 false; \ 75 false; \
diff --git a/arch/arm/boot/compressed/decompress.c b/arch/arm/boot/compressed/decompress.c
index 9deb56a702ce..24b0475cb8bf 100644
--- a/arch/arm/boot/compressed/decompress.c
+++ b/arch/arm/boot/compressed/decompress.c
@@ -13,8 +13,6 @@ extern void error(char *);
13#define STATIC static 13#define STATIC static
14#define STATIC_RW_DATA /* non-static please */ 14#define STATIC_RW_DATA /* non-static please */
15 15
16#define ARCH_HAS_DECOMP_WDOG
17
18/* Diagnostic functions */ 16/* Diagnostic functions */
19#ifdef DEBUG 17#ifdef DEBUG
20# define Assert(cond,msg) {if(!(cond)) error(msg);} 18# define Assert(cond,msg) {if(!(cond)) error(msg);}
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 5ebb44fe826a..9c6255884cbb 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -56,6 +56,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \
56 kirkwood-dockstar.dtb \ 56 kirkwood-dockstar.dtb \
57 kirkwood-dreamplug.dtb \ 57 kirkwood-dreamplug.dtb \
58 kirkwood-goflexnet.dtb \ 58 kirkwood-goflexnet.dtb \
59 kirkwood-guruplug-server-plus.dtb \
59 kirkwood-ib62x0.dtb \ 60 kirkwood-ib62x0.dtb \
60 kirkwood-iconnect.dtb \ 61 kirkwood-iconnect.dtb \
61 kirkwood-iomega_ix2_200.dtb \ 62 kirkwood-iomega_ix2_200.dtb \
@@ -73,15 +74,26 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \
73 kirkwood-ts219-6281.dtb \ 74 kirkwood-ts219-6281.dtb \
74 kirkwood-ts219-6282.dtb \ 75 kirkwood-ts219-6282.dtb \
75 kirkwood-openblocks_a6.dtb 76 kirkwood-openblocks_a6.dtb
77dtb-$(CONFIG_ARCH_MARCO) += marco-evb.dtb
76dtb-$(CONFIG_ARCH_MSM) += msm8660-surf.dtb \ 78dtb-$(CONFIG_ARCH_MSM) += msm8660-surf.dtb \
77 msm8960-cdp.dtb 79 msm8960-cdp.dtb
78dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \ 80dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \
79 armada-370-mirabox.dtb \ 81 armada-370-mirabox.dtb \
82 armada-370-rd.dtb \
80 armada-xp-db.dtb \ 83 armada-xp-db.dtb \
84 armada-xp-gp.dtb \
81 armada-xp-openblocks-ax3-4.dtb 85 armada-xp-openblocks-ax3-4.dtb
82dtb-$(CONFIG_ARCH_MXC) += imx51-babbage.dtb \ 86dtb-$(CONFIG_ARCH_MXC) += \
87 imx25-karo-tx25.dtb \
88 imx25-pdk.dtb \
89 imx27-apf27.dtb \
90 imx27-pdk.dtb \
91 imx31-bug.dtb \
92 imx51-apf51.dtb \
93 imx51-babbage.dtb \
83 imx53-ard.dtb \ 94 imx53-ard.dtb \
84 imx53-evk.dtb \ 95 imx53-evk.dtb \
96 imx53-mba53.dtb \
85 imx53-qsb.dtb \ 97 imx53-qsb.dtb \
86 imx53-smd.dtb \ 98 imx53-smd.dtb \
87 imx6q-arm2.dtb \ 99 imx6q-arm2.dtb \
@@ -95,11 +107,13 @@ dtb-$(CONFIG_ARCH_MXS) += imx23-evk.dtb \
95 imx28-apf28dev.dtb \ 107 imx28-apf28dev.dtb \
96 imx28-apx4devkit.dtb \ 108 imx28-apx4devkit.dtb \
97 imx28-cfa10036.dtb \ 109 imx28-cfa10036.dtb \
110 imx28-cfa10037.dtb \
98 imx28-cfa10049.dtb \ 111 imx28-cfa10049.dtb \
99 imx28-evk.dtb \ 112 imx28-evk.dtb \
100 imx28-m28evk.dtb \ 113 imx28-m28evk.dtb \
101 imx28-sps1.dtb \ 114 imx28-sps1.dtb \
102 imx28-tx28.dtb 115 imx28-tx28.dtb
116dtb-$(CONFIG_ARCH_NOMADIK) += ste-nomadik-s8815.dtb
103dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \ 117dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
104 omap3-beagle.dtb \ 118 omap3-beagle.dtb \
105 omap3-beagle-xm.dtb \ 119 omap3-beagle-xm.dtb \
@@ -124,6 +138,8 @@ dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
124 r8a7740-armadillo800eva.dtb \ 138 r8a7740-armadillo800eva.dtb \
125 sh73a0-kzm9g.dtb \ 139 sh73a0-kzm9g.dtb \
126 sh7372-mackerel.dtb 140 sh7372-mackerel.dtb
141dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_cyclone5.dtb \
142 socfpga_vt.dtb
127dtb-$(CONFIG_ARCH_SPEAR13XX) += spear1310-evb.dtb \ 143dtb-$(CONFIG_ARCH_SPEAR13XX) += spear1310-evb.dtb \
128 spear1340-evb.dtb 144 spear1340-evb.dtb
129dtb-$(CONFIG_ARCH_SPEAR3XX)+= spear300-evb.dtb \ 145dtb-$(CONFIG_ARCH_SPEAR3XX)+= spear300-evb.dtb \
@@ -132,8 +148,10 @@ dtb-$(CONFIG_ARCH_SPEAR3XX)+= spear300-evb.dtb \
132 spear320-hmi.dtb 148 spear320-hmi.dtb
133dtb-$(CONFIG_ARCH_SPEAR6XX)+= spear600-evb.dtb 149dtb-$(CONFIG_ARCH_SPEAR6XX)+= spear600-evb.dtb
134dtb-$(CONFIG_ARCH_SUNXI) += sun4i-a10-cubieboard.dtb \ 150dtb-$(CONFIG_ARCH_SUNXI) += sun4i-a10-cubieboard.dtb \
151 sun4i-a10-hackberry.dtb \
135 sun5i-a13-olinuxino.dtb 152 sun5i-a13-olinuxino.dtb
136dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \ 153dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \
154 tegra20-iris-512.dtb \
137 tegra20-medcom-wide.dtb \ 155 tegra20-medcom-wide.dtb \
138 tegra20-paz00.dtb \ 156 tegra20-paz00.dtb \
139 tegra20-plutux.dtb \ 157 tegra20-plutux.dtb \
@@ -142,8 +160,11 @@ dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \
142 tegra20-trimslice.dtb \ 160 tegra20-trimslice.dtb \
143 tegra20-ventana.dtb \ 161 tegra20-ventana.dtb \
144 tegra20-whistler.dtb \ 162 tegra20-whistler.dtb \
163 tegra30-beaver.dtb \
145 tegra30-cardhu-a02.dtb \ 164 tegra30-cardhu-a02.dtb \
146 tegra30-cardhu-a04.dtb 165 tegra30-cardhu-a04.dtb \
166 tegra114-dalmore.dtb \
167 tegra114-pluto.dtb
147dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2p-ca5s.dtb \ 168dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2p-ca5s.dtb \
148 vexpress-v2p-ca9.dtb \ 169 vexpress-v2p-ca9.dtb \
149 vexpress-v2p-ca15-tc1.dtb \ 170 vexpress-v2p-ca15-tc1.dtb \
@@ -151,7 +172,8 @@ dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2p-ca5s.dtb \
151 xenvm-4.2.dtb 172 xenvm-4.2.dtb
152dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07.dtb \ 173dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07.dtb \
153 wm8505-ref.dtb \ 174 wm8505-ref.dtb \
154 wm8650-mid.dtb 175 wm8650-mid.dtb \
176 wm8850-w70v2.dtb
155dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb 177dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb
156 178
157targets += dtbs 179targets += dtbs
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index c2f14e875eb6..0957645b73af 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -385,5 +385,19 @@
385 mac-address = [ 00 00 00 00 00 00 ]; 385 mac-address = [ 00 00 00 00 00 00 ];
386 }; 386 };
387 }; 387 };
388
389 ocmcram: ocmcram@40300000 {
390 compatible = "ti,am3352-ocmcram";
391 reg = <0x40300000 0x10000>;
392 ti,hwmods = "ocmcram";
393 ti,no_idle_on_suspend;
394 };
395
396 wkup_m3: wkup_m3@44d00000 {
397 compatible = "ti,am3353-wkup-m3";
398 reg = <0x44d00000 0x4000 /* M3 UMEM */
399 0x44d80000 0x2000>; /* M3 DMEM */
400 ti,hwmods = "wkup_m3";
401 };
388 }; 402 };
389}; 403};
diff --git a/arch/arm/boot/dts/animeo_ip.dts b/arch/arm/boot/dts/animeo_ip.dts
index 74d92cd29d87..5160210f74da 100644
--- a/arch/arm/boot/dts/animeo_ip.dts
+++ b/arch/arm/boot/dts/animeo_ip.dts
@@ -78,6 +78,10 @@
78 bus-width = <4>; 78 bus-width = <4>;
79 }; 79 };
80 }; 80 };
81
82 watchdog@fffffd40 {
83 status = "okay";
84 };
81 }; 85 };
82 86
83 nand0: nand@40000000 { 87 nand0: nand@40000000 {
diff --git a/arch/arm/boot/dts/armada-370-db.dts b/arch/arm/boot/dts/armada-370-db.dts
index 9b82facb2561..e34b280ce6ec 100644
--- a/arch/arm/boot/dts/armada-370-db.dts
+++ b/arch/arm/boot/dts/armada-370-db.dts
@@ -59,5 +59,40 @@
59 phy = <&phy1>; 59 phy = <&phy1>;
60 phy-mode = "rgmii-id"; 60 phy-mode = "rgmii-id";
61 }; 61 };
62
63 mvsdio@d00d4000 {
64 pinctrl-0 = <&sdio_pins1>;
65 pinctrl-names = "default";
66 /*
67 * This device is disabled by default, because
68 * using the SD card connector requires
69 * changing the default CON40 connector
70 * "DB-88F6710_MPP_2xRGMII_DEVICE_Jumper" to a
71 * different connector
72 * "DB-88F6710_MPP_RGMII_SD_Jumper".
73 */
74 status = "disabled";
75 /* No CD or WP GPIOs */
76 };
77
78 usb@d0050000 {
79 status = "okay";
80 };
81
82 usb@d0051000 {
83 status = "okay";
84 };
85
86 spi0: spi@d0010600 {
87 status = "okay";
88
89 spi-flash@0 {
90 #address-cells = <1>;
91 #size-cells = <1>;
92 compatible = "mx25l25635e";
93 reg = <0>; /* Chip select 0 */
94 spi-max-frequency = <50000000>;
95 };
96 };
62 }; 97 };
63}; 98};
diff --git a/arch/arm/boot/dts/armada-370-mirabox.dts b/arch/arm/boot/dts/armada-370-mirabox.dts
index 3b4071336599..dd0c57dd9f30 100644
--- a/arch/arm/boot/dts/armada-370-mirabox.dts
+++ b/arch/arm/boot/dts/armada-370-mirabox.dts
@@ -52,5 +52,23 @@
52 phy = <&phy1>; 52 phy = <&phy1>;
53 phy-mode = "rgmii-id"; 53 phy-mode = "rgmii-id";
54 }; 54 };
55
56 mvsdio@d00d4000 {
57 pinctrl-0 = <&sdio_pins2>;
58 pinctrl-names = "default";
59 status = "okay";
60 /*
61 * No CD or WP GPIOs: SDIO interface used for
62 * Wifi/Bluetooth chip
63 */
64 };
65
66 usb@d0050000 {
67 status = "okay";
68 };
69
70 usb@d0051000 {
71 status = "okay";
72 };
55 }; 73 };
56}; 74};
diff --git a/arch/arm/boot/dts/armada-370-rd.dts b/arch/arm/boot/dts/armada-370-rd.dts
new file mode 100644
index 000000000000..f8e4855bc9a5
--- /dev/null
+++ b/arch/arm/boot/dts/armada-370-rd.dts
@@ -0,0 +1,68 @@
1/*
2 * Device Tree file for Marvell Armada 370 Reference Design board
3 * (RD-88F6710-A1)
4 *
5 * Copied from arch/arm/boot/dts/armada-370-db.dts
6 *
7 * Copyright (C) 2013 Florian Fainelli <florian@openwrt.org>
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/dts-v1/;
15/include/ "armada-370.dtsi"
16
17/ {
18 model = "Marvell Armada 370 Reference Design";
19 compatible = "marvell,a370-rd", "marvell,armada370", "marvell,armada-370-xp";
20
21 chosen {
22 bootargs = "console=ttyS0,115200 earlyprintk";
23 };
24
25 memory {
26 device_type = "memory";
27 reg = <0x00000000 0x20000000>; /* 512 MB */
28 };
29
30 soc {
31 serial@d0012000 {
32 clock-frequency = <200000000>;
33 status = "okay";
34 };
35 sata@d00a0000 {
36 nr-ports = <2>;
37 status = "okay";
38 };
39
40 mdio {
41 phy0: ethernet-phy@0 {
42 reg = <0>;
43 };
44
45 phy1: ethernet-phy@1 {
46 reg = <1>;
47 };
48 };
49
50 ethernet@d0070000 {
51 status = "okay";
52 phy = <&phy0>;
53 phy-mode = "sgmii";
54 };
55 ethernet@d0074000 {
56 status = "okay";
57 phy = <&phy1>;
58 phy-mode = "rgmii-id";
59 };
60
61 mvsdio@d00d4000 {
62 pinctrl-0 = <&sdio_pins1>;
63 pinctrl-names = "default";
64 status = "okay";
65 /* No CD or WP GPIOs */
66 };
67 };
68};
diff --git a/arch/arm/boot/dts/armada-370-xp.dtsi b/arch/arm/boot/dts/armada-370-xp.dtsi
index 4c0abe85405f..6f1acc75e155 100644
--- a/arch/arm/boot/dts/armada-370-xp.dtsi
+++ b/arch/arm/boot/dts/armada-370-xp.dtsi
@@ -68,8 +68,9 @@
68 68
69 timer@d0020300 { 69 timer@d0020300 {
70 compatible = "marvell,armada-370-xp-timer"; 70 compatible = "marvell,armada-370-xp-timer";
71 reg = <0xd0020300 0x30>; 71 reg = <0xd0020300 0x30>,
72 interrupts = <37>, <38>, <39>, <40>; 72 <0xd0021040 0x30>;
73 interrupts = <37>, <38>, <39>, <40>, <5>, <6>;
73 clocks = <&coreclk 2>; 74 clocks = <&coreclk 2>;
74 }; 75 };
75 76
@@ -131,6 +132,56 @@
131 clocks = <&coreclk 0>; 132 clocks = <&coreclk 0>;
132 status = "disabled"; 133 status = "disabled";
133 }; 134 };
135
136 rtc@10300 {
137 compatible = "marvell,orion-rtc";
138 reg = <0xd0010300 0x20>;
139 interrupts = <50>;
140 };
141
142 mvsdio@d00d4000 {
143 compatible = "marvell,orion-sdio";
144 reg = <0xd00d4000 0x200>;
145 interrupts = <54>;
146 clocks = <&gateclk 17>;
147 status = "disabled";
148 };
149
150 usb@d0050000 {
151 compatible = "marvell,orion-ehci";
152 reg = <0xd0050000 0x500>;
153 interrupts = <45>;
154 status = "disabled";
155 };
156
157 usb@d0051000 {
158 compatible = "marvell,orion-ehci";
159 reg = <0xd0051000 0x500>;
160 interrupts = <46>;
161 status = "disabled";
162 };
163
164 spi0: spi@d0010600 {
165 compatible = "marvell,orion-spi";
166 reg = <0xd0010600 0x28>;
167 #address-cells = <1>;
168 #size-cells = <0>;
169 cell-index = <0>;
170 interrupts = <30>;
171 clocks = <&coreclk 0>;
172 status = "disabled";
173 };
174
175 spi1: spi@d0010680 {
176 compatible = "marvell,orion-spi";
177 reg = <0xd0010680 0x28>;
178 #address-cells = <1>;
179 #size-cells = <0>;
180 cell-index = <1>;
181 interrupts = <92>;
182 clocks = <&coreclk 0>;
183 status = "disabled";
184 };
134 }; 185 };
135}; 186};
136 187
diff --git a/arch/arm/boot/dts/armada-370.dtsi b/arch/arm/boot/dts/armada-370.dtsi
index 636cf7d4009e..8188d138020e 100644
--- a/arch/arm/boot/dts/armada-370.dtsi
+++ b/arch/arm/boot/dts/armada-370.dtsi
@@ -47,6 +47,18 @@
47 pinctrl { 47 pinctrl {
48 compatible = "marvell,mv88f6710-pinctrl"; 48 compatible = "marvell,mv88f6710-pinctrl";
49 reg = <0xd0018000 0x38>; 49 reg = <0xd0018000 0x38>;
50
51 sdio_pins1: sdio-pins1 {
52 marvell,pins = "mpp9", "mpp11", "mpp12",
53 "mpp13", "mpp14", "mpp15";
54 marvell,function = "sd0";
55 };
56
57 sdio_pins2: sdio-pins2 {
58 marvell,pins = "mpp47", "mpp48", "mpp49",
59 "mpp50", "mpp51", "mpp52";
60 marvell,function = "sd0";
61 };
50 }; 62 };
51 63
52 gpio0: gpio@d0018100 { 64 gpio0: gpio@d0018100 {
@@ -132,5 +144,14 @@
132 dmacap,memset; 144 dmacap,memset;
133 }; 145 };
134 }; 146 };
147
148 usb@d0050000 {
149 clocks = <&coreclk 0>;
150 };
151
152 usb@d0051000 {
153 clocks = <&coreclk 0>;
154 };
155
135 }; 156 };
136}; 157};
diff --git a/arch/arm/boot/dts/armada-xp-db.dts b/arch/arm/boot/dts/armada-xp-db.dts
index 8e53b25b5508..e83505e4c236 100644
--- a/arch/arm/boot/dts/armada-xp-db.dts
+++ b/arch/arm/boot/dts/armada-xp-db.dts
@@ -90,5 +90,36 @@
90 phy = <&phy3>; 90 phy = <&phy3>;
91 phy-mode = "sgmii"; 91 phy-mode = "sgmii";
92 }; 92 };
93
94 mvsdio@d00d4000 {
95 pinctrl-0 = <&sdio_pins>;
96 pinctrl-names = "default";
97 status = "okay";
98 /* No CD or WP GPIOs */
99 };
100
101 usb@d0050000 {
102 status = "okay";
103 };
104
105 usb@d0051000 {
106 status = "okay";
107 };
108
109 usb@d0052000 {
110 status = "okay";
111 };
112
113 spi0: spi@d0010600 {
114 status = "okay";
115
116 spi-flash@0 {
117 #address-cells = <1>;
118 #size-cells = <1>;
119 compatible = "m25p64";
120 reg = <0>; /* Chip select 0 */
121 spi-max-frequency = <20000000>;
122 };
123 };
93 }; 124 };
94}; 125};
diff --git a/arch/arm/boot/dts/armada-xp-gp.dts b/arch/arm/boot/dts/armada-xp-gp.dts
new file mode 100644
index 000000000000..1c8afe2ffebc
--- /dev/null
+++ b/arch/arm/boot/dts/armada-xp-gp.dts
@@ -0,0 +1,113 @@
1/*
2 * Device Tree file for Marvell Armada XP development board
3 * (DB-MV784MP-GP)
4 *
5 * Copyright (C) 2013 Marvell
6 *
7 * Lior Amsalem <alior@marvell.com>
8 * Gregory CLEMENT <gregory.clement@free-electrons.com>
9 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
10 *
11 * This file is licensed under the terms of the GNU General Public
12 * License version 2. This program is licensed "as is" without any
13 * warranty of any kind, whether express or implied.
14 */
15
16/dts-v1/;
17/include/ "armada-xp-mv78460.dtsi"
18
19/ {
20 model = "Marvell Armada XP Development Board DB-MV784MP-GP";
21 compatible = "marvell,axp-gp", "marvell,armadaxp-mv78460", "marvell,armadaxp", "marvell,armada-370-xp";
22
23 chosen {
24 bootargs = "console=ttyS0,115200 earlyprintk";
25 };
26
27 memory {
28 device_type = "memory";
29
30 /*
31 * 4 GB of plug-in RAM modules by default but only 3GB
32 * are visible, the amount of memory available can be
33 * changed by the bootloader according the size of the
34 * module actually plugged
35 */
36 reg = <0x00000000 0xC0000000>;
37 };
38
39 soc {
40 serial@d0012000 {
41 clock-frequency = <250000000>;
42 status = "okay";
43 };
44 serial@d0012100 {
45 clock-frequency = <250000000>;
46 status = "okay";
47 };
48 serial@d0012200 {
49 clock-frequency = <250000000>;
50 status = "okay";
51 };
52 serial@d0012300 {
53 clock-frequency = <250000000>;
54 status = "okay";
55 };
56
57 sata@d00a0000 {
58 nr-ports = <2>;
59 status = "okay";
60 };
61
62 mdio {
63 phy0: ethernet-phy@0 {
64 reg = <16>;
65 };
66
67 phy1: ethernet-phy@1 {
68 reg = <17>;
69 };
70
71 phy2: ethernet-phy@2 {
72 reg = <18>;
73 };
74
75 phy3: ethernet-phy@3 {
76 reg = <19>;
77 };
78 };
79
80 ethernet@d0070000 {
81 status = "okay";
82 phy = <&phy0>;
83 phy-mode = "rgmii-id";
84 };
85 ethernet@d0074000 {
86 status = "okay";
87 phy = <&phy1>;
88 phy-mode = "rgmii-id";
89 };
90 ethernet@d0030000 {
91 status = "okay";
92 phy = <&phy2>;
93 phy-mode = "rgmii-id";
94 };
95 ethernet@d0034000 {
96 status = "okay";
97 phy = <&phy3>;
98 phy-mode = "rgmii-id";
99 };
100
101 spi0: spi@d0010600 {
102 status = "okay";
103
104 spi-flash@0 {
105 #address-cells = <1>;
106 #size-cells = <1>;
107 compatible = "n25q128a13";
108 reg = <0>; /* Chip select 0 */
109 spi-max-frequency = <108000000>;
110 };
111 };
112 };
113};
diff --git a/arch/arm/boot/dts/armada-xp-mv78230.dtsi b/arch/arm/boot/dts/armada-xp-mv78230.dtsi
index e041f42ed711..f56c40599f5b 100644
--- a/arch/arm/boot/dts/armada-xp-mv78230.dtsi
+++ b/arch/arm/boot/dts/armada-xp-mv78230.dtsi
@@ -47,6 +47,12 @@
47 pinctrl { 47 pinctrl {
48 compatible = "marvell,mv78230-pinctrl"; 48 compatible = "marvell,mv78230-pinctrl";
49 reg = <0xd0018000 0x38>; 49 reg = <0xd0018000 0x38>;
50
51 sdio_pins: sdio-pins {
52 marvell,pins = "mpp30", "mpp31", "mpp32",
53 "mpp33", "mpp34", "mpp35";
54 marvell,function = "sd0";
55 };
50 }; 56 };
51 57
52 gpio0: gpio@d0018100 { 58 gpio0: gpio@d0018100 {
diff --git a/arch/arm/boot/dts/armada-xp-mv78260.dtsi b/arch/arm/boot/dts/armada-xp-mv78260.dtsi
index 9e23bd8c9536..f8f2b787d2b0 100644
--- a/arch/arm/boot/dts/armada-xp-mv78260.dtsi
+++ b/arch/arm/boot/dts/armada-xp-mv78260.dtsi
@@ -48,6 +48,12 @@
48 pinctrl { 48 pinctrl {
49 compatible = "marvell,mv78260-pinctrl"; 49 compatible = "marvell,mv78260-pinctrl";
50 reg = <0xd0018000 0x38>; 50 reg = <0xd0018000 0x38>;
51
52 sdio_pins: sdio-pins {
53 marvell,pins = "mpp30", "mpp31", "mpp32",
54 "mpp33", "mpp34", "mpp35";
55 marvell,function = "sd0";
56 };
51 }; 57 };
52 58
53 gpio0: gpio@d0018100 { 59 gpio0: gpio@d0018100 {
diff --git a/arch/arm/boot/dts/armada-xp-mv78460.dtsi b/arch/arm/boot/dts/armada-xp-mv78460.dtsi
index 965966110e38..936c25dc32b0 100644
--- a/arch/arm/boot/dts/armada-xp-mv78460.dtsi
+++ b/arch/arm/boot/dts/armada-xp-mv78460.dtsi
@@ -63,6 +63,12 @@
63 pinctrl { 63 pinctrl {
64 compatible = "marvell,mv78460-pinctrl"; 64 compatible = "marvell,mv78460-pinctrl";
65 reg = <0xd0018000 0x38>; 65 reg = <0xd0018000 0x38>;
66
67 sdio_pins: sdio-pins {
68 marvell,pins = "mpp30", "mpp31", "mpp32",
69 "mpp33", "mpp34", "mpp35";
70 marvell,function = "sd0";
71 };
66 }; 72 };
67 73
68 gpio0: gpio@d0018100 { 74 gpio0: gpio@d0018100 {
diff --git a/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts b/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
index b42652fd3d8c..3818a82176a2 100644
--- a/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
+++ b/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
@@ -66,6 +66,18 @@
66 }; 66 };
67 }; 67 };
68 68
69 gpio_keys {
70 compatible = "gpio-keys";
71 #address-cells = <1>;
72 #size-cells = <0>;
73
74 button@1 {
75 label = "Init Button";
76 linux,code = <116>;
77 gpios = <&gpio1 28 0>;
78 };
79 };
80
69 mdio { 81 mdio {
70 phy0: ethernet-phy@0 { 82 phy0: ethernet-phy@0 {
71 reg = <0>; 83 reg = <0>;
@@ -121,5 +133,11 @@
121 nr-ports = <2>; 133 nr-ports = <2>;
122 status = "okay"; 134 status = "okay";
123 }; 135 };
136 usb@d0050000 {
137 status = "okay";
138 };
139 usb@d0051000 {
140 status = "okay";
141 };
124 }; 142 };
125}; 143};
diff --git a/arch/arm/boot/dts/armada-xp.dtsi b/arch/arm/boot/dts/armada-xp.dtsi
index 2e37ef101c90..1443949c165e 100644
--- a/arch/arm/boot/dts/armada-xp.dtsi
+++ b/arch/arm/boot/dts/armada-xp.dtsi
@@ -30,7 +30,7 @@
30 }; 30 };
31 31
32 mpic: interrupt-controller@d0020000 { 32 mpic: interrupt-controller@d0020000 {
33 reg = <0xd0020a00 0x1d0>, 33 reg = <0xd0020a00 0x2d0>,
34 <0xd0021070 0x58>; 34 <0xd0021070 0x58>;
35 }; 35 };
36 36
@@ -134,5 +134,22 @@
134 dmacap,memset; 134 dmacap,memset;
135 }; 135 };
136 }; 136 };
137
138 usb@d0050000 {
139 clocks = <&gateclk 18>;
140 };
141
142 usb@d0051000 {
143 clocks = <&gateclk 19>;
144 };
145
146 usb@d0052000 {
147 compatible = "marvell,orion-ehci";
148 reg = <0xd0052000 0x500>;
149 interrupts = <47>;
150 clocks = <&gateclk 20>;
151 status = "disabled";
152 };
153
137 }; 154 };
138}; 155};
diff --git a/arch/arm/boot/dts/at91rm9200.dtsi b/arch/arm/boot/dts/at91rm9200.dtsi
index 222047f1ece9..b0268a5f4b4e 100644
--- a/arch/arm/boot/dts/at91rm9200.dtsi
+++ b/arch/arm/boot/dts/at91rm9200.dtsi
@@ -29,6 +29,9 @@
29 gpio3 = &pioD; 29 gpio3 = &pioD;
30 tcb0 = &tcb0; 30 tcb0 = &tcb0;
31 tcb1 = &tcb1; 31 tcb1 = &tcb1;
32 ssc0 = &ssc0;
33 ssc1 = &ssc1;
34 ssc2 = &ssc2;
32 }; 35 };
33 cpus { 36 cpus {
34 cpu@0 { 37 cpu@0 {
@@ -88,6 +91,52 @@
88 interrupts = <20 4 0 21 4 0 22 4 0>; 91 interrupts = <20 4 0 21 4 0 22 4 0>;
89 }; 92 };
90 93
94 mmc0: mmc@fffb4000 {
95 compatible = "atmel,hsmci";
96 reg = <0xfffb4000 0x4000>;
97 interrupts = <10 4 0>;
98 #address-cells = <1>;
99 #size-cells = <0>;
100 status = "disabled";
101 };
102
103 ssc0: ssc@fffd0000 {
104 compatible = "atmel,at91rm9200-ssc";
105 reg = <0xfffd0000 0x4000>;
106 interrupts = <14 4 5>;
107 pinctrl-names = "default";
108 pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
109 status = "disable";
110 };
111
112 ssc1: ssc@fffd4000 {
113 compatible = "atmel,at91rm9200-ssc";
114 reg = <0xfffd4000 0x4000>;
115 interrupts = <15 4 5>;
116 pinctrl-names = "default";
117 pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>;
118 status = "disable";
119 };
120
121 ssc2: ssc@fffd8000 {
122 compatible = "atmel,at91rm9200-ssc";
123 reg = <0xfffd8000 0x4000>;
124 interrupts = <16 4 5>;
125 pinctrl-names = "default";
126 pinctrl-0 = <&pinctrl_ssc2_tx &pinctrl_ssc2_rx>;
127 status = "disable";
128 };
129
130 macb0: ethernet@fffbc000 {
131 compatible = "cdns,at91rm9200-emac", "cdns,emac";
132 reg = <0xfffbc000 0x4000>;
133 interrupts = <24 4 3>;
134 phy-mode = "rmii";
135 pinctrl-names = "default";
136 pinctrl-0 = <&pinctrl_macb_rmii>;
137 status = "disabled";
138 };
139
91 pinctrl@fffff400 { 140 pinctrl@fffff400 {
92 #address-cells = <1>; 141 #address-cells = <1>;
93 #size-cells = <1>; 142 #size-cells = <1>;
@@ -207,6 +256,115 @@
207 }; 256 };
208 }; 257 };
209 258
259 macb {
260 pinctrl_macb_rmii: macb_rmii-0 {
261 atmel,pins =
262 <0 7 0x1 0x0 /* PA7 periph A */
263 0 8 0x1 0x0 /* PA8 periph A */
264 0 9 0x1 0x0 /* PA9 periph A */
265 0 10 0x1 0x0 /* PA10 periph A */
266 0 11 0x1 0x0 /* PA11 periph A */
267 0 12 0x1 0x0 /* PA12 periph A */
268 0 13 0x1 0x0 /* PA13 periph A */
269 0 14 0x1 0x0 /* PA14 periph A */
270 0 15 0x1 0x0 /* PA15 periph A */
271 0 16 0x1 0x0>; /* PA16 periph A */
272 };
273
274 pinctrl_macb_rmii_mii: macb_rmii_mii-0 {
275 atmel,pins =
276 <1 12 0x2 0x0 /* PB12 periph B */
277 1 13 0x2 0x0 /* PB13 periph B */
278 1 14 0x2 0x0 /* PB14 periph B */
279 1 15 0x2 0x0 /* PB15 periph B */
280 1 16 0x2 0x0 /* PB16 periph B */
281 1 17 0x2 0x0 /* PB17 periph B */
282 1 18 0x2 0x0 /* PB18 periph B */
283 1 19 0x2 0x0>; /* PB19 periph B */
284 };
285 };
286
287 mmc0 {
288 pinctrl_mmc0_clk: mmc0_clk-0 {
289 atmel,pins =
290 <0 27 0x1 0x0>; /* PA27 periph A */
291 };
292
293 pinctrl_mmc0_slot0_cmd_dat0: mmc0_slot0_cmd_dat0-0 {
294 atmel,pins =
295 <0 28 0x1 0x1 /* PA28 periph A with pullup */
296 0 29 0x1 0x1>; /* PA29 periph A with pullup */
297 };
298
299 pinctrl_mmc0_slot0_dat1_3: mmc0_slot0_dat1_3-0 {
300 atmel,pins =
301 <1 3 0x2 0x1 /* PB3 periph B with pullup */
302 1 4 0x2 0x1 /* PB4 periph B with pullup */
303 1 5 0x2 0x1>; /* PB5 periph B with pullup */
304 };
305
306 pinctrl_mmc0_slot1_cmd_dat0: mmc0_slot1_cmd_dat0-0 {
307 atmel,pins =
308 <0 8 0x2 0x1 /* PA8 periph B with pullup */
309 0 9 0x2 0x1>; /* PA9 periph B with pullup */
310 };
311
312 pinctrl_mmc0_slot1_dat1_3: mmc0_slot1_dat1_3-0 {
313 atmel,pins =
314 <0 10 0x2 0x1 /* PA10 periph B with pullup */
315 0 11 0x2 0x1 /* PA11 periph B with pullup */
316 0 12 0x2 0x1>; /* PA12 periph B with pullup */
317 };
318 };
319
320 ssc0 {
321 pinctrl_ssc0_tx: ssc0_tx-0 {
322 atmel,pins =
323 <1 0 0x1 0x0 /* PB0 periph A */
324 1 1 0x1 0x0 /* PB1 periph A */
325 1 2 0x1 0x0>; /* PB2 periph A */
326 };
327
328 pinctrl_ssc0_rx: ssc0_rx-0 {
329 atmel,pins =
330 <1 3 0x1 0x0 /* PB3 periph A */
331 1 4 0x1 0x0 /* PB4 periph A */
332 1 5 0x1 0x0>; /* PB5 periph A */
333 };
334 };
335
336 ssc1 {
337 pinctrl_ssc1_tx: ssc1_tx-0 {
338 atmel,pins =
339 <1 6 0x1 0x0 /* PB6 periph A */
340 1 7 0x1 0x0 /* PB7 periph A */
341 1 8 0x1 0x0>; /* PB8 periph A */
342 };
343
344 pinctrl_ssc1_rx: ssc1_rx-0 {
345 atmel,pins =
346 <1 9 0x1 0x0 /* PB9 periph A */
347 1 10 0x1 0x0 /* PB10 periph A */
348 1 11 0x1 0x0>; /* PB11 periph A */
349 };
350 };
351
352 ssc2 {
353 pinctrl_ssc2_tx: ssc2_tx-0 {
354 atmel,pins =
355 <1 12 0x1 0x0 /* PB12 periph A */
356 1 13 0x1 0x0 /* PB13 periph A */
357 1 14 0x1 0x0>; /* PB14 periph A */
358 };
359
360 pinctrl_ssc2_rx: ssc2_rx-0 {
361 atmel,pins =
362 <1 15 0x1 0x0 /* PB15 periph A */
363 1 16 0x1 0x0 /* PB16 periph A */
364 1 17 0x1 0x0>; /* PB17 periph A */
365 };
366 };
367
210 pioA: gpio@fffff400 { 368 pioA: gpio@fffff400 {
211 compatible = "atmel,at91rm9200-gpio"; 369 compatible = "atmel,at91rm9200-gpio";
212 reg = <0xfffff400 0x200>; 370 reg = <0xfffff400 0x200>;
diff --git a/arch/arm/boot/dts/at91rm9200ek.dts b/arch/arm/boot/dts/at91rm9200ek.dts
index 8aa48931e0a2..e586d85f8e23 100644
--- a/arch/arm/boot/dts/at91rm9200ek.dts
+++ b/arch/arm/boot/dts/at91rm9200ek.dts
@@ -44,6 +44,11 @@
44 status = "okay"; 44 status = "okay";
45 }; 45 };
46 46
47 macb0: ethernet@fffbc000 {
48 phy-mode = "rmii";
49 status = "okay";
50 };
51
47 usb1: gadget@fffb0000 { 52 usb1: gadget@fffb0000 {
48 atmel,vbus-gpio = <&pioD 4 0>; 53 atmel,vbus-gpio = <&pioD 4 0>;
49 status = "okay"; 54 status = "okay";
diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi
index 80e29c605d4e..7750f98dd764 100644
--- a/arch/arm/boot/dts/at91sam9n12.dtsi
+++ b/arch/arm/boot/dts/at91sam9n12.dtsi
@@ -324,8 +324,6 @@
324 compatible = "atmel,at91sam9260-usart"; 324 compatible = "atmel,at91sam9260-usart";
325 reg = <0xf801c000 0x4000>; 325 reg = <0xf801c000 0x4000>;
326 interrupts = <5 4 5>; 326 interrupts = <5 4 5>;
327 atmel,use-dma-rx;
328 atmel,use-dma-tx;
329 pinctrl-names = "default"; 327 pinctrl-names = "default";
330 pinctrl-0 = <&pinctrl_usart0>; 328 pinctrl-0 = <&pinctrl_usart0>;
331 status = "disabled"; 329 status = "disabled";
@@ -335,8 +333,6 @@
335 compatible = "atmel,at91sam9260-usart"; 333 compatible = "atmel,at91sam9260-usart";
336 reg = <0xf8020000 0x4000>; 334 reg = <0xf8020000 0x4000>;
337 interrupts = <6 4 5>; 335 interrupts = <6 4 5>;
338 atmel,use-dma-rx;
339 atmel,use-dma-tx;
340 pinctrl-names = "default"; 336 pinctrl-names = "default";
341 pinctrl-0 = <&pinctrl_usart1>; 337 pinctrl-0 = <&pinctrl_usart1>;
342 status = "disabled"; 338 status = "disabled";
@@ -346,8 +342,6 @@
346 compatible = "atmel,at91sam9260-usart"; 342 compatible = "atmel,at91sam9260-usart";
347 reg = <0xf8024000 0x4000>; 343 reg = <0xf8024000 0x4000>;
348 interrupts = <7 4 5>; 344 interrupts = <7 4 5>;
349 atmel,use-dma-rx;
350 atmel,use-dma-tx;
351 pinctrl-names = "default"; 345 pinctrl-names = "default";
352 pinctrl-0 = <&pinctrl_usart2>; 346 pinctrl-0 = <&pinctrl_usart2>;
353 status = "disabled"; 347 status = "disabled";
@@ -357,8 +351,6 @@
357 compatible = "atmel,at91sam9260-usart"; 351 compatible = "atmel,at91sam9260-usart";
358 reg = <0xf8028000 0x4000>; 352 reg = <0xf8028000 0x4000>;
359 interrupts = <8 4 5>; 353 interrupts = <8 4 5>;
360 atmel,use-dma-rx;
361 atmel,use-dma-tx;
362 pinctrl-names = "default"; 354 pinctrl-names = "default";
363 pinctrl-0 = <&pinctrl_usart3>; 355 pinctrl-0 = <&pinctrl_usart3>;
364 status = "disabled"; 356 status = "disabled";
@@ -390,8 +382,9 @@
390 reg = < 0x40000000 0x10000000 382 reg = < 0x40000000 0x10000000
391 0xffffe000 0x00000600 383 0xffffe000 0x00000600
392 0xffffe600 0x00000200 384 0xffffe600 0x00000200
393 0x00100000 0x00100000 385 0x00108000 0x00018000
394 >; 386 >;
387 atmel,pmecc-lookup-table-offset = <0x0 0x8000>;
395 atmel,nand-addr-offset = <21>; 388 atmel,nand-addr-offset = <21>;
396 atmel,nand-cmd-offset = <22>; 389 atmel,nand-cmd-offset = <22>;
397 pinctrl-names = "default"; 390 pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/at91sam9n12ek.dts b/arch/arm/boot/dts/at91sam9n12ek.dts
index 0376bf4fd66b..d400f8de4387 100644
--- a/arch/arm/boot/dts/at91sam9n12ek.dts
+++ b/arch/arm/boot/dts/at91sam9n12ek.dts
@@ -71,7 +71,10 @@
71 71
72 nand0: nand@40000000 { 72 nand0: nand@40000000 {
73 nand-bus-width = <8>; 73 nand-bus-width = <8>;
74 nand-ecc-mode = "soft"; 74 nand-ecc-mode = "hw";
75 atmel,has-pmecc;
76 atmel,pmecc-cap = <2>;
77 atmel,pmecc-sector-size = <512>;
75 nand-on-flash-bbt; 78 nand-on-flash-bbt;
76 status = "okay"; 79 status = "okay";
77 }; 80 };
diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi
index 8ecca6948d81..aa98e641931f 100644
--- a/arch/arm/boot/dts/at91sam9x5.dtsi
+++ b/arch/arm/boot/dts/at91sam9x5.dtsi
@@ -197,9 +197,9 @@
197 }; 197 };
198 198
199 usart3 { 199 usart3 {
200 pinctrl_uart3: usart3-0 { 200 pinctrl_usart3: usart3-0 {
201 atmel,pins = 201 atmel,pins =
202 <2 23 0x2 0x1 /* PC22 periph B with pullup */ 202 <2 22 0x2 0x1 /* PC22 periph B with pullup */
203 2 23 0x2 0x0>; /* PC23 periph B */ 203 2 23 0x2 0x0>; /* PC23 periph B */
204 }; 204 };
205 205
@@ -402,8 +402,6 @@
402 compatible = "atmel,at91sam9260-usart"; 402 compatible = "atmel,at91sam9260-usart";
403 reg = <0xf801c000 0x200>; 403 reg = <0xf801c000 0x200>;
404 interrupts = <5 4 5>; 404 interrupts = <5 4 5>;
405 atmel,use-dma-rx;
406 atmel,use-dma-tx;
407 pinctrl-names = "default"; 405 pinctrl-names = "default";
408 pinctrl-0 = <&pinctrl_usart0>; 406 pinctrl-0 = <&pinctrl_usart0>;
409 status = "disabled"; 407 status = "disabled";
@@ -413,8 +411,6 @@
413 compatible = "atmel,at91sam9260-usart"; 411 compatible = "atmel,at91sam9260-usart";
414 reg = <0xf8020000 0x200>; 412 reg = <0xf8020000 0x200>;
415 interrupts = <6 4 5>; 413 interrupts = <6 4 5>;
416 atmel,use-dma-rx;
417 atmel,use-dma-tx;
418 pinctrl-names = "default"; 414 pinctrl-names = "default";
419 pinctrl-0 = <&pinctrl_usart1>; 415 pinctrl-0 = <&pinctrl_usart1>;
420 status = "disabled"; 416 status = "disabled";
@@ -424,8 +420,6 @@
424 compatible = "atmel,at91sam9260-usart"; 420 compatible = "atmel,at91sam9260-usart";
425 reg = <0xf8024000 0x200>; 421 reg = <0xf8024000 0x200>;
426 interrupts = <7 4 5>; 422 interrupts = <7 4 5>;
427 atmel,use-dma-rx;
428 atmel,use-dma-tx;
429 pinctrl-names = "default"; 423 pinctrl-names = "default";
430 pinctrl-0 = <&pinctrl_usart2>; 424 pinctrl-0 = <&pinctrl_usart2>;
431 status = "disabled"; 425 status = "disabled";
@@ -518,7 +512,11 @@
518 #address-cells = <1>; 512 #address-cells = <1>;
519 #size-cells = <1>; 513 #size-cells = <1>;
520 reg = <0x40000000 0x10000000 514 reg = <0x40000000 0x10000000
515 0xffffe000 0x600 /* PMECC Registers */
516 0xffffe600 0x200 /* PMECC Error Location Registers */
517 0x00108000 0x18000 /* PMECC looup table in ROM code */
521 >; 518 >;
519 atmel,pmecc-lookup-table-offset = <0x0 0x8000>;
522 atmel,nand-addr-offset = <21>; 520 atmel,nand-addr-offset = <21>;
523 atmel,nand-cmd-offset = <22>; 521 atmel,nand-cmd-offset = <22>;
524 pinctrl-names = "default"; 522 pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/at91sam9x5cm.dtsi b/arch/arm/boot/dts/at91sam9x5cm.dtsi
index 31e7be23703d..4027ac7e4502 100644
--- a/arch/arm/boot/dts/at91sam9x5cm.dtsi
+++ b/arch/arm/boot/dts/at91sam9x5cm.dtsi
@@ -26,7 +26,10 @@
26 ahb { 26 ahb {
27 nand0: nand@40000000 { 27 nand0: nand@40000000 {
28 nand-bus-width = <8>; 28 nand-bus-width = <8>;
29 nand-ecc-mode = "soft"; 29 nand-ecc-mode = "hw";
30 atmel,has-pmecc; /* Enable PMECC */
31 atmel,pmecc-cap = <2>;
32 atmel,pmecc-sector-size = <512>;
30 nand-on-flash-bbt; 33 nand-on-flash-bbt;
31 status = "okay"; 34 status = "okay";
32 35
diff --git a/arch/arm/boot/dts/bcm2835-rpi-b.dts b/arch/arm/boot/dts/bcm2835-rpi-b.dts
index 9b72054a0bc0..aafda174a605 100644
--- a/arch/arm/boot/dts/bcm2835-rpi-b.dts
+++ b/arch/arm/boot/dts/bcm2835-rpi-b.dts
@@ -1,5 +1,4 @@
1/dts-v1/; 1/dts-v1/;
2/memreserve/ 0x0c000000 0x04000000;
3/include/ "bcm2835.dtsi" 2/include/ "bcm2835.dtsi"
4 3
5/ { 4/ {
@@ -25,3 +24,18 @@
25 brcm,function = <7>; /* alt3 */ 24 brcm,function = <7>; /* alt3 */
26 }; 25 };
27}; 26};
27
28&i2c0 {
29 status = "okay";
30 clock-frequency = <100000>;
31};
32
33&i2c1 {
34 status = "okay";
35 clock-frequency = <100000>;
36};
37
38&sdhci {
39 status = "okay";
40 bus-width = <4>;
41};
diff --git a/arch/arm/boot/dts/bcm2835.dtsi b/arch/arm/boot/dts/bcm2835.dtsi
index 8917550fd1bb..4bf2a8774aa7 100644
--- a/arch/arm/boot/dts/bcm2835.dtsi
+++ b/arch/arm/boot/dts/bcm2835.dtsi
@@ -63,5 +63,49 @@
63 interrupt-controller; 63 interrupt-controller;
64 #interrupt-cells = <2>; 64 #interrupt-cells = <2>;
65 }; 65 };
66
67 i2c0: i2c@20205000 {
68 compatible = "brcm,bcm2835-i2c";
69 reg = <0x7e205000 0x1000>;
70 interrupts = <2 21>;
71 clocks = <&clk_i2c>;
72 status = "disabled";
73 };
74
75 i2c1: i2c@20804000 {
76 compatible = "brcm,bcm2835-i2c";
77 reg = <0x7e804000 0x1000>;
78 interrupts = <2 21>;
79 clocks = <&clk_i2c>;
80 status = "disabled";
81 };
82
83 sdhci: sdhci {
84 compatible = "brcm,bcm2835-sdhci";
85 reg = <0x7e300000 0x100>;
86 interrupts = <2 30>;
87 clocks = <&clk_mmc>;
88 status = "disabled";
89 };
90 };
91
92 clocks {
93 compatible = "simple-bus";
94 #address-cells = <1>;
95 #size-cells = <0>;
96
97 clk_mmc: mmc {
98 compatible = "fixed-clock";
99 reg = <0>;
100 #clock-cells = <0>;
101 clock-frequency = <100000000>;
102 };
103
104 clk_i2c: i2c {
105 compatible = "fixed-clock";
106 reg = <1>;
107 #clock-cells = <0>;
108 clock-frequency = <150000000>;
109 };
66 }; 110 };
67}; 111};
diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
index 37dc5a3243b8..f712fb607a42 100644
--- a/arch/arm/boot/dts/da850-evm.dts
+++ b/arch/arm/boot/dts/da850-evm.dts
@@ -15,6 +15,9 @@
15 model = "DA850/AM1808/OMAP-L138 EVM"; 15 model = "DA850/AM1808/OMAP-L138 EVM";
16 16
17 soc { 17 soc {
18 pmx_core: pinmux@1c14120 {
19 status = "okay";
20 };
18 serial0: serial@1c42000 { 21 serial0: serial@1c42000 {
19 status = "okay"; 22 status = "okay";
20 }; 23 };
@@ -24,5 +27,22 @@
24 serial2: serial@1d0d000 { 27 serial2: serial@1d0d000 {
25 status = "okay"; 28 status = "okay";
26 }; 29 };
30 rtc0: rtc@1c23000 {
31 status = "okay";
32 };
33 i2c0: i2c@1c22000 {
34 status = "okay";
35 clock-frequency = <100000>;
36 pinctrl-names = "default";
37 pinctrl-0 = <&i2c0_pins>;
38 };
39 wdt: wdt@1c21000 {
40 status = "okay";
41 };
42 };
43 nand_cs3@62000000 {
44 status = "okay";
45 pinctrl-names = "default";
46 pinctrl-0 = <&nand_cs3_pins>;
27 }; 47 };
28}; 48};
diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
index 640ab75c20db..3ec1bda64356 100644
--- a/arch/arm/boot/dts/da850.dtsi
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -28,14 +28,47 @@
28 #address-cells = <1>; 28 #address-cells = <1>;
29 #size-cells = <1>; 29 #size-cells = <1>;
30 ranges = <0x0 0x01c00000 0x400000>; 30 ranges = <0x0 0x01c00000 0x400000>;
31 interrupt-parent = <&intc>;
31 32
33 pmx_core: pinmux@1c14120 {
34 compatible = "pinctrl-single";
35 reg = <0x14120 0x50>;
36 #address-cells = <1>;
37 #size-cells = <0>;
38 pinctrl-single,bit-per-mux;
39 pinctrl-single,register-width = <32>;
40 pinctrl-single,function-mask = <0xffffffff>;
41 status = "disabled";
42
43 nand_cs3_pins: pinmux_nand_pins {
44 pinctrl-single,bits = <
45 /* EMA_OE, EMA_WE */
46 0x1c 0x00110000 0x00ff0000
47 /* EMA_CS[4],EMA_CS[3]*/
48 0x1c 0x00000110 0x00000ff0
49 /*
50 * EMA_D[0], EMA_D[1], EMA_D[2],
51 * EMA_D[3], EMA_D[4], EMA_D[5],
52 * EMA_D[6], EMA_D[7]
53 */
54 0x24 0x11111111 0xffffffff
55 /* EMA_A[1], EMA_A[2] */
56 0x30 0x01100000 0x0ff00000
57 >;
58 };
59 i2c0_pins: pinmux_i2c0_pins {
60 pinctrl-single,bits = <
61 /* I2C0_SDA,I2C0_SCL */
62 0x10 0x00002200 0x0000ff00
63 >;
64 };
65 };
32 serial0: serial@1c42000 { 66 serial0: serial@1c42000 {
33 compatible = "ns16550a"; 67 compatible = "ns16550a";
34 reg = <0x42000 0x100>; 68 reg = <0x42000 0x100>;
35 clock-frequency = <150000000>; 69 clock-frequency = <150000000>;
36 reg-shift = <2>; 70 reg-shift = <2>;
37 interrupts = <25>; 71 interrupts = <25>;
38 interrupt-parent = <&intc>;
39 status = "disabled"; 72 status = "disabled";
40 }; 73 };
41 serial1: serial@1d0c000 { 74 serial1: serial@1d0c000 {
@@ -44,7 +77,6 @@
44 clock-frequency = <150000000>; 77 clock-frequency = <150000000>;
45 reg-shift = <2>; 78 reg-shift = <2>;
46 interrupts = <53>; 79 interrupts = <53>;
47 interrupt-parent = <&intc>;
48 status = "disabled"; 80 status = "disabled";
49 }; 81 };
50 serial2: serial@1d0d000 { 82 serial2: serial@1d0d000 {
@@ -53,8 +85,40 @@
53 clock-frequency = <150000000>; 85 clock-frequency = <150000000>;
54 reg-shift = <2>; 86 reg-shift = <2>;
55 interrupts = <61>; 87 interrupts = <61>;
56 interrupt-parent = <&intc>;
57 status = "disabled"; 88 status = "disabled";
58 }; 89 };
90 rtc0: rtc@1c23000 {
91 compatible = "ti,da830-rtc";
92 reg = <0x23000 0x1000>;
93 interrupts = <19
94 19>;
95 status = "disabled";
96 };
97 i2c0: i2c@1c22000 {
98 compatible = "ti,davinci-i2c";
99 reg = <0x22000 0x1000>;
100 interrupts = <15>;
101 #address-cells = <1>;
102 #size-cells = <0>;
103 status = "disabled";
104 };
105 wdt: wdt@1c21000 {
106 compatible = "ti,davinci-wdt";
107 reg = <0x21000 0x1000>;
108 status = "disabled";
109 };
110 };
111 nand_cs3@62000000 {
112 compatible = "ti,davinci-nand";
113 reg = <0x62000000 0x807ff
114 0x68000000 0x8000>;
115 ti,davinci-chipselect = <1>;
116 ti,davinci-mask-ale = <0>;
117 ti,davinci-mask-cle = <0>;
118 ti,davinci-mask-chipsel = <0>;
119 ti,davinci-ecc-mode = "hw";
120 ti,davinci-ecc-bits = <4>;
121 ti,davinci-nand-use-bbt;
122 status = "disabled";
59 }; 123 };
60}; 124};
diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi
index 63f2fbcfe819..69140ba99f46 100644
--- a/arch/arm/boot/dts/dbx5x0.dtsi
+++ b/arch/arm/boot/dts/dbx5x0.dtsi
@@ -170,10 +170,9 @@
170 gpio-bank = <8>; 170 gpio-bank = <8>;
171 }; 171 };
172 172
173 pinctrl@80157000 { 173 pinctrl {
174 // This is actually the PRCMU base address 174 compatible = "stericsson,nmk-pinctrl";
175 reg = <0x80157000 0x2000>; 175 prcm = <&prcmu>;
176 compatible = "stericsson,nmk_pinctrl";
177 }; 176 };
178 177
179 usb@a03e0000 { 178 usb@a03e0000 {
@@ -190,9 +189,10 @@
190 interrupts = <0 25 0x4>; 189 interrupts = <0 25 0x4>;
191 }; 190 };
192 191
193 prcmu@80157000 { 192 prcmu: prcmu@80157000 {
194 compatible = "stericsson,db8500-prcmu"; 193 compatible = "stericsson,db8500-prcmu";
195 reg = <0x80157000 0x1000>; 194 reg = <0x80157000 0x1000>;
195 reg-names = "prcmu";
196 interrupts = <0 47 0x4>; 196 interrupts = <0 47 0x4>;
197 #address-cells = <1>; 197 #address-cells = <1>;
198 #size-cells = <1>; 198 #size-cells = <1>;
diff --git a/arch/arm/boot/dts/dove-cubox.dts b/arch/arm/boot/dts/dove-cubox.dts
index cdee96fca6e2..7e3065abd751 100644
--- a/arch/arm/boot/dts/dove-cubox.dts
+++ b/arch/arm/boot/dts/dove-cubox.dts
@@ -17,12 +17,33 @@
17 17
18 leds { 18 leds {
19 compatible = "gpio-leds"; 19 compatible = "gpio-leds";
20 pinctrl-0 = <&pmx_gpio_18>;
21 pinctrl-names = "default";
22
20 power { 23 power {
21 label = "Power"; 24 label = "Power";
22 gpios = <&gpio0 18 1>; 25 gpios = <&gpio0 18 1>;
23 linux,default-trigger = "default-on"; 26 linux,default-trigger = "default-on";
24 }; 27 };
25 }; 28 };
29
30 regulators {
31 compatible = "simple-bus";
32 #address-cells = <1>;
33 #size-cells = <0>;
34
35 usb_power: regulator@1 {
36 compatible = "regulator-fixed";
37 reg = <1>;
38 regulator-name = "USB Power";
39 regulator-min-microvolt = <5000000>;
40 regulator-max-microvolt = <5000000>;
41 enable-active-high;
42 regulator-always-on;
43 regulator-boot-on;
44 gpio = <&gpio0 1 0>;
45 };
46 };
26}; 47};
27 48
28&uart0 { status = "okay"; }; 49&uart0 { status = "okay"; };
@@ -47,9 +68,14 @@
47}; 68};
48 69
49&pinctrl { 70&pinctrl {
50 pinctrl-0 = <&pmx_gpio_12 &pmx_gpio_18>; 71 pinctrl-0 = <&pmx_gpio_1 &pmx_gpio_12>;
51 pinctrl-names = "default"; 72 pinctrl-names = "default";
52 73
74 pmx_gpio_1: pmx-gpio-1 {
75 marvell,pins = "mpp1";
76 marvell,function = "gpio";
77 };
78
53 pmx_gpio_12: pmx-gpio-12 { 79 pmx_gpio_12: pmx-gpio-12 {
54 marvell,pins = "mpp12"; 80 marvell,pins = "mpp12";
55 marvell,function = "gpio"; 81 marvell,function = "gpio";
diff --git a/arch/arm/boot/dts/dove.dtsi b/arch/arm/boot/dts/dove.dtsi
index 42eac1ff3cc8..67dbe20868a2 100644
--- a/arch/arm/boot/dts/dove.dtsi
+++ b/arch/arm/boot/dts/dove.dtsi
@@ -55,7 +55,7 @@
55 reg = <0x12000 0x100>; 55 reg = <0x12000 0x100>;
56 reg-shift = <2>; 56 reg-shift = <2>;
57 interrupts = <7>; 57 interrupts = <7>;
58 clock-frequency = <166666667>; 58 clocks = <&core_clk 0>;
59 status = "disabled"; 59 status = "disabled";
60 }; 60 };
61 61
@@ -64,7 +64,7 @@
64 reg = <0x12100 0x100>; 64 reg = <0x12100 0x100>;
65 reg-shift = <2>; 65 reg-shift = <2>;
66 interrupts = <8>; 66 interrupts = <8>;
67 clock-frequency = <166666667>; 67 clocks = <&core_clk 0>;
68 status = "disabled"; 68 status = "disabled";
69 }; 69 };
70 70
@@ -73,7 +73,7 @@
73 reg = <0x12000 0x100>; 73 reg = <0x12000 0x100>;
74 reg-shift = <2>; 74 reg-shift = <2>;
75 interrupts = <9>; 75 interrupts = <9>;
76 clock-frequency = <166666667>; 76 clocks = <&core_clk 0>;
77 status = "disabled"; 77 status = "disabled";
78 }; 78 };
79 79
@@ -82,7 +82,7 @@
82 reg = <0x12100 0x100>; 82 reg = <0x12100 0x100>;
83 reg-shift = <2>; 83 reg-shift = <2>;
84 interrupts = <10>; 84 interrupts = <10>;
85 clock-frequency = <166666667>; 85 clocks = <&core_clk 0>;
86 status = "disabled"; 86 status = "disabled";
87 }; 87 };
88 88
@@ -93,6 +93,7 @@
93 reg = <0xd0400 0x20>; 93 reg = <0xd0400 0x20>;
94 ngpios = <32>; 94 ngpios = <32>;
95 interrupt-controller; 95 interrupt-controller;
96 #interrupt-cells = <2>;
96 interrupts = <12>, <13>, <14>, <60>; 97 interrupts = <12>, <13>, <14>, <60>;
97 }; 98 };
98 99
@@ -103,6 +104,7 @@
103 reg = <0xd0420 0x20>; 104 reg = <0xd0420 0x20>;
104 ngpios = <32>; 105 ngpios = <32>;
105 interrupt-controller; 106 interrupt-controller;
107 #interrupt-cells = <2>;
106 interrupts = <61>; 108 interrupts = <61>;
107 }; 109 };
108 110
@@ -154,6 +156,22 @@
154 status = "disabled"; 156 status = "disabled";
155 }; 157 };
156 158
159 ehci0: usb-host@50000 {
160 compatible = "marvell,orion-ehci";
161 reg = <0x50000 0x1000>;
162 interrupts = <24>;
163 clocks = <&gate_clk 0>;
164 status = "okay";
165 };
166
167 ehci1: usb-host@51000 {
168 compatible = "marvell,orion-ehci";
169 reg = <0x51000 0x1000>;
170 interrupts = <25>;
171 clocks = <&gate_clk 1>;
172 status = "okay";
173 };
174
157 sdio0: sdio@92000 { 175 sdio0: sdio@92000 {
158 compatible = "marvell,dove-sdhci"; 176 compatible = "marvell,dove-sdhci";
159 reg = <0x92000 0x100>; 177 reg = <0x92000 0x100>;
diff --git a/arch/arm/boot/dts/emev2-kzm9d.dts b/arch/arm/boot/dts/emev2-kzm9d.dts
index 297e3baba71c..b9b3241f173b 100644
--- a/arch/arm/boot/dts/emev2-kzm9d.dts
+++ b/arch/arm/boot/dts/emev2-kzm9d.dts
@@ -21,6 +21,6 @@
21 }; 21 };
22 22
23 chosen { 23 chosen {
24 bootargs = "console=ttyS1,115200n81"; 24 bootargs = "console=tty0 console=ttyS1,115200n81 earlyprintk=serial8250-em.1,115200n81 mem=128M@0x40000000 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096";
25 }; 25 };
26}; 26};
diff --git a/arch/arm/boot/dts/emev2.dtsi b/arch/arm/boot/dts/emev2.dtsi
index eb504a6c0f4a..c8a8c08b48dd 100644
--- a/arch/arm/boot/dts/emev2.dtsi
+++ b/arch/arm/boot/dts/emev2.dtsi
@@ -15,11 +15,18 @@
15 interrupt-parent = <&gic>; 15 interrupt-parent = <&gic>;
16 16
17 cpus { 17 cpus {
18 #address-cells = <1>;
19 #size-cells = <0>;
20
18 cpu@0 { 21 cpu@0 {
22 device_type = "cpu";
19 compatible = "arm,cortex-a9"; 23 compatible = "arm,cortex-a9";
24 reg = <0>;
20 }; 25 };
21 cpu@1 { 26 cpu@1 {
27 device_type = "cpu";
22 compatible = "arm,cortex-a9"; 28 compatible = "arm,cortex-a9";
29 reg = <1>;
23 }; 30 };
24 }; 31 };
25 32
diff --git a/arch/arm/boot/dts/exynos4210.dtsi b/arch/arm/boot/dts/exynos4210.dtsi
index e31bfc4a6f09..2feffc70814c 100644
--- a/arch/arm/boot/dts/exynos4210.dtsi
+++ b/arch/arm/boot/dts/exynos4210.dtsi
@@ -48,13 +48,13 @@
48 }; 48 };
49 49
50 pinctrl_0: pinctrl@11400000 { 50 pinctrl_0: pinctrl@11400000 {
51 compatible = "samsung,pinctrl-exynos4210"; 51 compatible = "samsung,exynos4210-pinctrl";
52 reg = <0x11400000 0x1000>; 52 reg = <0x11400000 0x1000>;
53 interrupts = <0 47 0>; 53 interrupts = <0 47 0>;
54 }; 54 };
55 55
56 pinctrl_1: pinctrl@11000000 { 56 pinctrl_1: pinctrl@11000000 {
57 compatible = "samsung,pinctrl-exynos4210"; 57 compatible = "samsung,exynos4210-pinctrl";
58 reg = <0x11000000 0x1000>; 58 reg = <0x11000000 0x1000>;
59 interrupts = <0 46 0>; 59 interrupts = <0 46 0>;
60 60
@@ -66,7 +66,7 @@
66 }; 66 };
67 67
68 pinctrl_2: pinctrl@03860000 { 68 pinctrl_2: pinctrl@03860000 {
69 compatible = "samsung,pinctrl-exynos4210"; 69 compatible = "samsung,exynos4210-pinctrl";
70 reg = <0x03860000 0x1000>; 70 reg = <0x03860000 0x1000>;
71 }; 71 };
72 72
diff --git a/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi b/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
index 8e6115adcd97..099cec79e2ae 100644
--- a/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
@@ -661,7 +661,7 @@
661 661
662 sd4_bus8: sd4-bus-width8 { 662 sd4_bus8: sd4-bus-width8 {
663 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6"; 663 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
664 samsung,pin-function = <3>; 664 samsung,pin-function = <4>;
665 samsung,pin-pud = <4>; 665 samsung,pin-pud = <4>;
666 samsung,pin-drv = <3>; 666 samsung,pin-drv = <3>;
667 }; 667 };
diff --git a/arch/arm/boot/dts/exynos4x12.dtsi b/arch/arm/boot/dts/exynos4x12.dtsi
index 179a62e46c9d..9a8780694909 100644
--- a/arch/arm/boot/dts/exynos4x12.dtsi
+++ b/arch/arm/boot/dts/exynos4x12.dtsi
@@ -37,13 +37,13 @@
37 }; 37 };
38 38
39 pinctrl_0: pinctrl@11400000 { 39 pinctrl_0: pinctrl@11400000 {
40 compatible = "samsung,pinctrl-exynos4x12"; 40 compatible = "samsung,exynos4x12-pinctrl";
41 reg = <0x11400000 0x1000>; 41 reg = <0x11400000 0x1000>;
42 interrupts = <0 47 0>; 42 interrupts = <0 47 0>;
43 }; 43 };
44 44
45 pinctrl_1: pinctrl@11000000 { 45 pinctrl_1: pinctrl@11000000 {
46 compatible = "samsung,pinctrl-exynos4x12"; 46 compatible = "samsung,exynos4x12-pinctrl";
47 reg = <0x11000000 0x1000>; 47 reg = <0x11000000 0x1000>;
48 interrupts = <0 46 0>; 48 interrupts = <0 46 0>;
49 49
@@ -55,14 +55,14 @@
55 }; 55 };
56 56
57 pinctrl_2: pinctrl@03860000 { 57 pinctrl_2: pinctrl@03860000 {
58 compatible = "samsung,pinctrl-exynos4x12"; 58 compatible = "samsung,exynos4x12-pinctrl";
59 reg = <0x03860000 0x1000>; 59 reg = <0x03860000 0x1000>;
60 interrupt-parent = <&combiner>; 60 interrupt-parent = <&combiner>;
61 interrupts = <10 0>; 61 interrupts = <10 0>;
62 }; 62 };
63 63
64 pinctrl_3: pinctrl@106E0000 { 64 pinctrl_3: pinctrl@106E0000 {
65 compatible = "samsung,pinctrl-exynos4x12"; 65 compatible = "samsung,exynos4x12-pinctrl";
66 reg = <0x106E0000 0x1000>; 66 reg = <0x106E0000 0x1000>;
67 interrupts = <0 72 0>; 67 interrupts = <0 72 0>;
68 }; 68 };
diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts b/arch/arm/boot/dts/exynos5250-smdk5250.dts
index e05b18f3c33d..1b8d4106d338 100644
--- a/arch/arm/boot/dts/exynos5250-smdk5250.dts
+++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts
@@ -49,6 +49,11 @@
49 compatible = "samsung,s524ad0xd1"; 49 compatible = "samsung,s524ad0xd1";
50 reg = <0x51>; 50 reg = <0x51>;
51 }; 51 };
52
53 wm8994: wm8994@1a {
54 compatible = "wlf,wm8994";
55 reg = <0x1a>;
56 };
52 }; 57 };
53 58
54 i2c@121D0000 { 59 i2c@121D0000 {
@@ -146,6 +151,7 @@
146 reg = <0>; 151 reg = <0>;
147 bus-width = <4>; 152 bus-width = <4>;
148 samsung,cd-pinmux-gpio = <&gpc3 2 2 3 3>; 153 samsung,cd-pinmux-gpio = <&gpc3 2 2 3 3>;
154 disable-wp;
149 gpios = <&gpc3 0 2 0 3>, <&gpc3 1 2 0 3>, 155 gpios = <&gpc3 0 2 0 3>, <&gpc3 1 2 0 3>,
150 <&gpc3 3 2 3 3>, <&gpc3 4 2 3 3>, 156 <&gpc3 3 2 3 3>, <&gpc3 4 2 3 3>,
151 <&gpc3 5 2 3 3>, <&gpc3 6 2 3 3>, 157 <&gpc3 5 2 3 3>, <&gpc3 6 2 3 3>,
@@ -204,4 +210,25 @@
204 samsung,mfc-r = <0x43000000 0x800000>; 210 samsung,mfc-r = <0x43000000 0x800000>;
205 samsung,mfc-l = <0x51000000 0x800000>; 211 samsung,mfc-l = <0x51000000 0x800000>;
206 }; 212 };
213
214 i2s0: i2s@03830000 {
215 gpios = <&gpz 0 2 0 0>, <&gpz 1 2 0 0>, <&gpz 2 2 0 0>,
216 <&gpz 3 2 0 0>, <&gpz 4 2 0 0>, <&gpz 5 2 0 0>,
217 <&gpz 6 2 0 0>;
218 };
219
220 i2s1: i2s@12D60000 {
221 status = "disabled";
222 };
223
224 i2s2: i2s@12D70000 {
225 status = "disabled";
226 };
227
228 sound {
229 compatible = "samsung,smdk-wm8994";
230
231 samsung,i2s-controller = <&i2s0>;
232 samsung,audio-codec = <&wm8994>;
233 };
207}; 234};
diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 3acf594ea60b..b1ac73e21c80 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -211,8 +211,9 @@
211 compatible = "samsung,exynos4210-spi"; 211 compatible = "samsung,exynos4210-spi";
212 reg = <0x12d20000 0x100>; 212 reg = <0x12d20000 0x100>;
213 interrupts = <0 66 0>; 213 interrupts = <0 66 0>;
214 tx-dma-channel = <&pdma0 5>; /* preliminary */ 214 dmas = <&pdma0 5
215 rx-dma-channel = <&pdma0 4>; /* preliminary */ 215 &pdma0 4>;
216 dma-names = "tx", "rx";
216 #address-cells = <1>; 217 #address-cells = <1>;
217 #size-cells = <0>; 218 #size-cells = <0>;
218 }; 219 };
@@ -221,8 +222,9 @@
221 compatible = "samsung,exynos4210-spi"; 222 compatible = "samsung,exynos4210-spi";
222 reg = <0x12d30000 0x100>; 223 reg = <0x12d30000 0x100>;
223 interrupts = <0 67 0>; 224 interrupts = <0 67 0>;
224 tx-dma-channel = <&pdma1 5>; /* preliminary */ 225 dmas = <&pdma1 5
225 rx-dma-channel = <&pdma1 4>; /* preliminary */ 226 &pdma1 4>;
227 dma-names = "tx", "rx";
226 #address-cells = <1>; 228 #address-cells = <1>;
227 #size-cells = <0>; 229 #size-cells = <0>;
228 }; 230 };
@@ -231,8 +233,9 @@
231 compatible = "samsung,exynos4210-spi"; 233 compatible = "samsung,exynos4210-spi";
232 reg = <0x12d40000 0x100>; 234 reg = <0x12d40000 0x100>;
233 interrupts = <0 68 0>; 235 interrupts = <0 68 0>;
234 tx-dma-channel = <&pdma0 7>; /* preliminary */ 236 dmas = <&pdma0 7
235 rx-dma-channel = <&pdma0 6>; /* preliminary */ 237 &pdma0 6>;
238 dma-names = "tx", "rx";
236 #address-cells = <1>; 239 #address-cells = <1>;
237 #size-cells = <0>; 240 #size-cells = <0>;
238 }; 241 };
@@ -269,6 +272,35 @@
269 #size-cells = <0>; 272 #size-cells = <0>;
270 }; 273 };
271 274
275 i2s0: i2s@03830000 {
276 compatible = "samsung,i2s-v5";
277 reg = <0x03830000 0x100>;
278 dmas = <&pdma0 10
279 &pdma0 9
280 &pdma0 8>;
281 dma-names = "tx", "rx", "tx-sec";
282 samsung,supports-6ch;
283 samsung,supports-rstclr;
284 samsung,supports-secdai;
285 samsung,idma-addr = <0x03000000>;
286 };
287
288 i2s1: i2s@12D60000 {
289 compatible = "samsung,i2s-v5";
290 reg = <0x12D60000 0x100>;
291 dmas = <&pdma1 12
292 &pdma1 11>;
293 dma-names = "tx", "rx";
294 };
295
296 i2s2: i2s@12D70000 {
297 compatible = "samsung,i2s-v5";
298 reg = <0x12D70000 0x100>;
299 dmas = <&pdma0 12
300 &pdma0 11>;
301 dma-names = "tx", "rx";
302 };
303
272 amba { 304 amba {
273 #address-cells = <1>; 305 #address-cells = <1>;
274 #size-cells = <1>; 306 #size-cells = <1>;
@@ -280,24 +312,36 @@
280 compatible = "arm,pl330", "arm,primecell"; 312 compatible = "arm,pl330", "arm,primecell";
281 reg = <0x121A0000 0x1000>; 313 reg = <0x121A0000 0x1000>;
282 interrupts = <0 34 0>; 314 interrupts = <0 34 0>;
315 #dma-cells = <1>;
316 #dma-channels = <8>;
317 #dma-requests = <32>;
283 }; 318 };
284 319
285 pdma1: pdma@121B0000 { 320 pdma1: pdma@121B0000 {
286 compatible = "arm,pl330", "arm,primecell"; 321 compatible = "arm,pl330", "arm,primecell";
287 reg = <0x121B0000 0x1000>; 322 reg = <0x121B0000 0x1000>;
288 interrupts = <0 35 0>; 323 interrupts = <0 35 0>;
324 #dma-cells = <1>;
325 #dma-channels = <8>;
326 #dma-requests = <32>;
289 }; 327 };
290 328
291 mdma0: mdma@10800000 { 329 mdma0: mdma@10800000 {
292 compatible = "arm,pl330", "arm,primecell"; 330 compatible = "arm,pl330", "arm,primecell";
293 reg = <0x10800000 0x1000>; 331 reg = <0x10800000 0x1000>;
294 interrupts = <0 33 0>; 332 interrupts = <0 33 0>;
333 #dma-cells = <1>;
334 #dma-channels = <8>;
335 #dma-requests = <1>;
295 }; 336 };
296 337
297 mdma1: mdma@11C10000 { 338 mdma1: mdma@11C10000 {
298 compatible = "arm,pl330", "arm,primecell"; 339 compatible = "arm,pl330", "arm,primecell";
299 reg = <0x11C10000 0x1000>; 340 reg = <0x11C10000 0x1000>;
300 interrupts = <0 124 0>; 341 interrupts = <0 124 0>;
342 #dma-cells = <1>;
343 #dma-channels = <8>;
344 #dma-requests = <1>;
301 }; 345 };
302 }; 346 };
303 347
diff --git a/arch/arm/boot/dts/exynos5440.dtsi b/arch/arm/boot/dts/exynos5440.dtsi
index 024269de8ee5..5f3562ad6746 100644
--- a/arch/arm/boot/dts/exynos5440.dtsi
+++ b/arch/arm/boot/dts/exynos5440.dtsi
@@ -86,7 +86,7 @@
86 }; 86 };
87 87
88 pinctrl { 88 pinctrl {
89 compatible = "samsung,pinctrl-exynos5440"; 89 compatible = "samsung,exynos5440-pinctrl";
90 reg = <0xE0000 0x1000>; 90 reg = <0xE0000 0x1000>;
91 interrupt-controller; 91 interrupt-controller;
92 #interrupt-cells = <2>; 92 #interrupt-cells = <2>;
@@ -154,6 +154,6 @@
154 rtc { 154 rtc {
155 compatible = "samsung,s3c6410-rtc"; 155 compatible = "samsung,s3c6410-rtc";
156 reg = <0x130000 0x1000>; 156 reg = <0x130000 0x1000>;
157 interrupts = <0 16 0>, <0 17 0>; 157 interrupts = <0 17 0>, <0 16 0>;
158 }; 158 };
159}; 159};
diff --git a/arch/arm/boot/dts/highbank.dts b/arch/arm/boot/dts/highbank.dts
index 5927a8df5625..6aad34ad9517 100644
--- a/arch/arm/boot/dts/highbank.dts
+++ b/arch/arm/boot/dts/highbank.dts
@@ -37,6 +37,16 @@
37 next-level-cache = <&L2>; 37 next-level-cache = <&L2>;
38 clocks = <&a9pll>; 38 clocks = <&a9pll>;
39 clock-names = "cpu"; 39 clock-names = "cpu";
40 operating-points = <
41 /* kHz ignored */
42 1300000 1000000
43 1200000 1000000
44 1100000 1000000
45 800000 1000000
46 400000 1000000
47 200000 1000000
48 >;
49 clock-latency = <100000>;
40 }; 50 };
41 51
42 cpu@901 { 52 cpu@901 {
diff --git a/arch/arm/boot/dts/imx23.dtsi b/arch/arm/boot/dts/imx23.dtsi
index 65415c598a5e..56afcf41aae0 100644
--- a/arch/arm/boot/dts/imx23.dtsi
+++ b/arch/arm/boot/dts/imx23.dtsi
@@ -391,7 +391,9 @@
391 }; 391 };
392 392
393 lradc@80050000 { 393 lradc@80050000 {
394 compatible = "fsl,imx23-lradc";
394 reg = <0x80050000 0x2000>; 395 reg = <0x80050000 0x2000>;
396 interrupts = <36 37 38 39 40 41 42 43 44>;
395 status = "disabled"; 397 status = "disabled";
396 }; 398 };
397 399
diff --git a/arch/arm/boot/dts/imx25-karo-tx25.dts b/arch/arm/boot/dts/imx25-karo-tx25.dts
index d81f8a0b9794..1a9d0491cdce 100644
--- a/arch/arm/boot/dts/imx25-karo-tx25.dts
+++ b/arch/arm/boot/dts/imx25-karo-tx25.dts
@@ -19,26 +19,18 @@
19 memory { 19 memory {
20 reg = <0x80000000 0x02000000 0x90000000 0x02000000>; 20 reg = <0x80000000 0x02000000 0x90000000 0x02000000>;
21 }; 21 };
22};
22 23
23 soc { 24&uart1 {
24 aips@43f00000 { 25 status = "okay";
25 uart1: serial@43f90000 { 26};
26 status = "okay";
27 };
28 };
29 27
30 spba@50000000 { 28&fec {
31 fec: ethernet@50038000 { 29 phy-mode = "rmii";
32 status = "okay"; 30 status = "okay";
33 phy-mode = "rmii"; 31};
34 };
35 };
36 32
37 emi@80000000 { 33&nfc {
38 nand@bb000000 { 34 nand-on-flash-bbt;
39 nand-on-flash-bbt; 35 status = "okay";
40 status = "okay";
41 };
42 };
43 };
44}; 36};
diff --git a/arch/arm/boot/dts/imx25-pdk.dts b/arch/arm/boot/dts/imx25-pdk.dts
new file mode 100644
index 000000000000..a02a860afd18
--- /dev/null
+++ b/arch/arm/boot/dts/imx25-pdk.dts
@@ -0,0 +1,36 @@
1/*
2 * Copyright 2013 Freescale Semiconductor, Inc.
3 *
4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License
6 * Version 2 or later at the following locations:
7 *
8 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html
10 */
11
12/dts-v1/;
13/include/ "imx25.dtsi"
14
15/ {
16 model = "Freescale i.MX25 Product Development Kit";
17 compatible = "fsl,imx25-pdk", "fsl,imx25";
18
19 memory {
20 reg = <0x80000000 0x4000000>;
21 };
22};
23
24&uart1 {
25 status = "okay";
26};
27
28&fec {
29 phy-mode = "rmii";
30 status = "okay";
31};
32
33&nfc {
34 nand-on-flash-bbt;
35 status = "okay";
36};
diff --git a/arch/arm/boot/dts/imx25.dtsi b/arch/arm/boot/dts/imx25.dtsi
index e1b13ebc96d6..94f33059158a 100644
--- a/arch/arm/boot/dts/imx25.dtsi
+++ b/arch/arm/boot/dts/imx25.dtsi
@@ -499,7 +499,7 @@
499 reg = <0x80000000 0x3b002000>; 499 reg = <0x80000000 0x3b002000>;
500 ranges; 500 ranges;
501 501
502 nand@bb000000 { 502 nfc: nand@bb000000 {
503 #address-cells = <1>; 503 #address-cells = <1>;
504 #size-cells = <1>; 504 #size-cells = <1>;
505 505
diff --git a/arch/arm/boot/dts/imx27-apf27.dts b/arch/arm/boot/dts/imx27-apf27.dts
index c0327c054de2..b464c807d8d9 100644
--- a/arch/arm/boot/dts/imx27-apf27.dts
+++ b/arch/arm/boot/dts/imx27-apf27.dts
@@ -32,58 +32,54 @@
32 clock-frequency = <0>; 32 clock-frequency = <0>;
33 }; 33 };
34 }; 34 };
35};
35 36
36 soc { 37&uart1 {
37 aipi@10000000 { 38 status = "okay";
38 serial@1000a000 { 39};
39 status = "okay";
40 };
41 40
42 ethernet@1002b000 { 41&fec {
43 status = "okay"; 42 status = "okay";
44 }; 43};
45 };
46 44
47 nand@d8000000 { 45&nfc {
48 status = "okay"; 46 status = "okay";
49 nand-bus-width = <16>; 47 nand-bus-width = <16>;
50 nand-ecc-mode = "hw"; 48 nand-ecc-mode = "hw";
51 nand-on-flash-bbt; 49 nand-on-flash-bbt;
52 50
53 partition@0 { 51 partition@0 {
54 label = "u-boot"; 52 label = "u-boot";
55 reg = <0x0 0x100000>; 53 reg = <0x0 0x100000>;
56 }; 54 };
57 55
58 partition@100000 { 56 partition@100000 {
59 label = "env"; 57 label = "env";
60 reg = <0x100000 0x80000>; 58 reg = <0x100000 0x80000>;
61 }; 59 };
62 60
63 partition@180000 { 61 partition@180000 {
64 label = "env2"; 62 label = "env2";
65 reg = <0x180000 0x80000>; 63 reg = <0x180000 0x80000>;
66 }; 64 };
67 65
68 partition@200000 { 66 partition@200000 {
69 label = "firmware"; 67 label = "firmware";
70 reg = <0x200000 0x80000>; 68 reg = <0x200000 0x80000>;
71 }; 69 };
72 70
73 partition@280000 { 71 partition@280000 {
74 label = "dtb"; 72 label = "dtb";
75 reg = <0x280000 0x80000>; 73 reg = <0x280000 0x80000>;
76 }; 74 };
77 75
78 partition@300000 { 76 partition@300000 {
79 label = "kernel"; 77 label = "kernel";
80 reg = <0x300000 0x500000>; 78 reg = <0x300000 0x500000>;
81 }; 79 };
82 80
83 partition@800000 { 81 partition@800000 {
84 label = "rootfs"; 82 label = "rootfs";
85 reg = <0x800000 0xf800000>; 83 reg = <0x800000 0xf800000>;
86 };
87 };
88 }; 84 };
89}; 85};
diff --git a/arch/arm/boot/dts/imx27-3ds.dts b/arch/arm/boot/dts/imx27-pdk.dts
index fa04c7b18bcb..41cd1105608e 100644
--- a/arch/arm/boot/dts/imx27-3ds.dts
+++ b/arch/arm/boot/dts/imx27-pdk.dts
@@ -13,25 +13,19 @@
13/include/ "imx27.dtsi" 13/include/ "imx27.dtsi"
14 14
15/ { 15/ {
16 model = "mx27_3ds"; 16 model = "Freescale i.MX27 Product Development Kit";
17 compatible = "freescale,imx27-3ds", "fsl,imx27"; 17 compatible = "fsl,imx27-pdk", "fsl,imx27";
18 18
19 memory { 19 memory {
20 reg = <0x0 0x0>; 20 reg = <0x0 0x0>;
21 }; 21 };
22};
22 23
23 soc { 24&uart1 {
24 aipi@10000000 { /* aipi1 */ 25 fsl,uart-has-rtscts;
25 uart1: serial@1000a000 { 26 status = "okay";
26 fsl,uart-has-rtscts; 27};
27 status = "okay";
28 };
29 };
30 28
31 aipi@10020000 { /* aipi2 */ 29&fec {
32 ethernet@1002b000 { 30 status = "okay";
33 status = "okay";
34 };
35 };
36 };
37}; 31};
diff --git a/arch/arm/boot/dts/imx28-cfa10037.dts b/arch/arm/boot/dts/imx28-cfa10037.dts
new file mode 100644
index 000000000000..c2ef3a3d655e
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-cfa10037.dts
@@ -0,0 +1,77 @@
1/*
2 * Copyright 2012 Free Electrons
3 *
4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License
6 * Version 2 or later at the following locations:
7 *
8 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html
10 */
11
12/*
13 * The CFA-10049 is an expansion board for the CFA-10036 module, thus we
14 * need to include the CFA-10036 DTS.
15 */
16/include/ "imx28-cfa10036.dts"
17
18/ {
19 model = "Crystalfontz CFA-10037 Board";
20 compatible = "crystalfontz,cfa10037", "crystalfontz,cfa10036", "fsl,imx28";
21
22 apb@80000000 {
23 apbh@80000000 {
24 pinctrl@80018000 {
25 pinctrl-names = "default", "default";
26 pinctrl-1 = <&hog_pins_cfa10037>;
27
28 hog_pins_cfa10037: hog-10037@0 {
29 reg = <0>;
30 fsl,pinmux-ids = <
31 0x0073 /* MX28_PAD_GPMI_D7__GPIO_0_7 */
32 0x2153 /* MX28_PAD_SSP2_D5__GPIO_2_21 */
33 >;
34 fsl,drive-strength = <0>;
35 fsl,voltage = <1>;
36 fsl,pull-up = <0>;
37 };
38 };
39 };
40
41 apbx@80040000 {
42 usbphy1: usbphy@8007e000 {
43 status = "okay";
44 };
45 };
46 };
47
48 ahb@80080000 {
49 usb1: usb@80090000 {
50 vbus-supply = <&reg_usb1_vbus>;
51 pinctrl-0 = <&usbphy1_pins_a>;
52 pinctrl-names = "default";
53 status = "okay";
54 };
55
56 mac0: ethernet@800f0000 {
57 phy-mode = "rmii";
58 pinctrl-names = "default";
59 pinctrl-0 = <&mac0_pins_a>;
60 phy-reset-gpios = <&gpio2 21 0>;
61 phy-reset-duration = <100>;
62 status = "okay";
63 };
64 };
65
66 regulators {
67 compatible = "simple-bus";
68
69 reg_usb1_vbus: usb1_vbus {
70 compatible = "regulator-fixed";
71 regulator-name = "usb1_vbus";
72 regulator-min-microvolt = <5000000>;
73 regulator-max-microvolt = <5000000>;
74 gpio = <&gpio0 7 1>;
75 };
76 };
77};
diff --git a/arch/arm/boot/dts/imx28-cfa10049.dts b/arch/arm/boot/dts/imx28-cfa10049.dts
index bdc80a4453dd..a0d3e9f1738e 100644
--- a/arch/arm/boot/dts/imx28-cfa10049.dts
+++ b/arch/arm/boot/dts/imx28-cfa10049.dts
@@ -23,69 +23,120 @@
23 apbh@80000000 { 23 apbh@80000000 {
24 pinctrl@80018000 { 24 pinctrl@80018000 {
25 pinctrl-names = "default", "default"; 25 pinctrl-names = "default", "default";
26 pinctrl-1 = <&hog_pins_cfa10049>; 26 pinctrl-1 = <&hog_pins_cfa10049
27 &hog_pins_cfa10049_pullup>;
27 28
28 hog_pins_cfa10049: hog-10049@0 { 29 hog_pins_cfa10049: hog-10049@0 {
29 reg = <0>; 30 reg = <0>;
30 fsl,pinmux-ids = < 31 fsl,pinmux-ids = <
31 0x0073 /* MX28_PAD_GPMI_D7__GPIO_0_7 */ 32 0x0073 /* MX28_PAD_GPMI_D7__GPIO_0_7 */
33 0x1153 /* MX28_PAD_LCD_D22__GPIO_1_21 */
32 0x1163 /* MX28_PAD_LCD_D22__GPIO_1_22 */ 34 0x1163 /* MX28_PAD_LCD_D22__GPIO_1_22 */
33 0x1173 /* MX28_PAD_LCD_D22__GPIO_1_23 */ 35 0x1173 /* MX28_PAD_LCD_D22__GPIO_1_23 */
34 0x2153 /* MX28_PAD_SSP2_D5__GPIO_2_21 */ 36 0x2153 /* MX28_PAD_SSP2_D5__GPIO_2_21 */
37 0x3173 /* MX28_PAD_LCD_RESET__GPIO_3_23 */
35 >; 38 >;
36 fsl,drive-strength = <0>; 39 fsl,drive-strength = <0>;
37 fsl,voltage = <1>; 40 fsl,voltage = <1>;
38 fsl,pull-up = <0>; 41 fsl,pull-up = <0>;
39 }; 42 };
40 43
41 spi3_pins_cfa10049: spi3-cfa10049@0 { 44 hog_pins_cfa10049_pullup: hog-10049-pullup@0 {
42 reg = <0>; 45 reg = <0>;
43 fsl,pinmux-ids = < 46 fsl,pinmux-ids = <
44 0x0181 /* MX28_PAD_GPMI_RDN__SSP3_SCK */ 47 0x2133 /* MX28_PAD_SSP2_D3__GPIO_2_19 */
45 0x01c1 /* MX28_PAD_GPMI_RESETN__SSP3_CMD */ 48 0x3183 /* MX28_PAD_I2C0_SCL__GPIO_3_24 */
46 0x0111 /* MX28_PAD_GPMI_CE1N__SSP3_D3 */ 49 0x3193 /* MX28_PAD_I2C0_SDA__GPIO_3_25 */
47 0x01a2 /* MX28_PAD_GPMI_ALE__SSP3_D4 */ 50 0x31a3 /* MX28_PAD_SAIF_SDATA0__GPIO_3_26 */
48 0x01b2 /* MX28_PAD_GPMI_CLE__SSP3_D5 */ 51 0x31e3 /* MX28_PAD_LCD_RESET__GPIO_3_30 */
49 >; 52 >;
50 fsl,drive-strength = <1>; 53 fsl,drive-strength = <0>;
51 fsl,voltage = <1>; 54 fsl,voltage = <1>;
52 fsl,pull-up = <1>; 55 fsl,pull-up = <1>;
53 }; 56 };
54 };
55 57
56 ssp3: ssp@80016000 { 58 spi2_pins_cfa10049: spi2-cfa10049@0 {
57 compatible = "fsl,imx28-spi"; 59 reg = <0>;
58 pinctrl-names = "default"; 60 fsl,pinmux-ids = <
59 pinctrl-0 = <&spi3_pins_cfa10049>; 61 0x2103 /* MX28_PAD_SSP2_SCK__GPIO_2_16 */
60 status = "okay"; 62 0x2113 /* MX28_PAD_SSP2_CMD__GPIO_2_17 */
63 0x2123 /* MX28_PAD_SSP2_D0__GPIO_2_18 */
64 >;
65 fsl,drive-strength = <1>;
66 fsl,voltage = <1>;
67 fsl,pull-up = <1>;
68 };
61 69
62 gpio5: gpio5@0 { 70 spi3_pins_cfa10049: spi3-cfa10049@0 {
63 compatible = "fairchild,74hc595";
64 gpio-controller;
65 #gpio-cells = <2>;
66 reg = <0>; 71 reg = <0>;
67 registers-number = <2>; 72 fsl,pinmux-ids = <
68 spi-max-frequency = <100000>; 73 0x0183 /* MX28_PAD_GPMI_RDN__GPIO_0_24 */
74 0x01c3 /* MX28_PAD_GPMI_RESETN__GPIO_0_28 */
75 0x0113 /* MX28_PAD_GPMI_CE1N__GPIO_0_17 */
76 0x01a3 /* MX28_PAD_GPMI_ALE__GPIO_0_26 */
77 0x01b3 /* MX28_PAD_GPMI_CLE__GPIO_0_27 */
78 >;
79 fsl,drive-strength = <1>;
80 fsl,voltage = <1>;
81 fsl,pull-up = <1>;
69 }; 82 };
70 83
71 gpio6: gpio6@1 { 84 lcdif_18bit_pins_cfa10049: lcdif-18bit@0 {
72 compatible = "fairchild,74hc595"; 85 reg = <0>;
73 gpio-controller; 86 fsl,pinmux-ids = <
74 #gpio-cells = <2>; 87 0x1000 /* MX28_PAD_LCD_D00__LCD_D0 */
75 reg = <1>; 88 0x1010 /* MX28_PAD_LCD_D01__LCD_D1 */
76 registers-number = <4>; 89 0x1020 /* MX28_PAD_LCD_D02__LCD_D2 */
77 spi-max-frequency = <100000>; 90 0x1030 /* MX28_PAD_LCD_D03__LCD_D3 */
91 0x1040 /* MX28_PAD_LCD_D04__LCD_D4 */
92 0x1050 /* MX28_PAD_LCD_D05__LCD_D5 */
93 0x1060 /* MX28_PAD_LCD_D06__LCD_D6 */
94 0x1070 /* MX28_PAD_LCD_D07__LCD_D7 */
95 0x1080 /* MX28_PAD_LCD_D08__LCD_D8 */
96 0x1090 /* MX28_PAD_LCD_D09__LCD_D9 */
97 0x10a0 /* MX28_PAD_LCD_D10__LCD_D10 */
98 0x10b0 /* MX28_PAD_LCD_D11__LCD_D11 */
99 0x10c0 /* MX28_PAD_LCD_D12__LCD_D12 */
100 0x10d0 /* MX28_PAD_LCD_D13__LCD_D13 */
101 0x10e0 /* MX28_PAD_LCD_D14__LCD_D14 */
102 0x10f0 /* MX28_PAD_LCD_D15__LCD_D15 */
103 0x1100 /* MX28_PAD_LCD_D16__LCD_D16 */
104 0x1110 /* MX28_PAD_LCD_D17__LCD_D17 */
105 >;
106 fsl,drive-strength = <0>;
107 fsl,voltage = <1>;
108 fsl,pull-up = <0>;
78 }; 109 };
79 110
80 dac0: dh2228@2 { 111 lcdif_pins_cfa10049: lcdif-evk@0 {
81 compatible = "rohm,dh2228fv"; 112 reg = <0>;
82 reg = <2>; 113 fsl,pinmux-ids = <
83 spi-max-frequency = <100000>; 114 0x1181 /* MX28_PAD_LCD_RD_E__LCD_VSYNC */
115 0x1191 /* MX28_PAD_LCD_WR_RWN__LCD_HSYNC */
116 0x11a1 /* MX28_PAD_LCD_RS__LCD_DOTCLK */
117 0x11b1 /* MX28_PAD_LCD_CS__LCD_ENABLE */
118 >;
119 fsl,drive-strength = <0>;
120 fsl,voltage = <1>;
121 fsl,pull-up = <0>;
84 }; 122 };
85 }; 123 };
124
125 lcdif@80030000 {
126 pinctrl-names = "default";
127 pinctrl-0 = <&lcdif_18bit_pins_cfa10049
128 &lcdif_pins_cfa10049>;
129 status = "okay";
130 };
86 }; 131 };
87 132
88 apbx@80040000 { 133 apbx@80040000 {
134 pwm: pwm@80064000 {
135 pinctrl-names = "default", "default";
136 pinctrl-1 = <&pwm3_pins_b>;
137 status = "okay";
138 };
139
89 i2c1: i2c@8005a000 { 140 i2c1: i2c@8005a000 {
90 pinctrl-names = "default"; 141 pinctrl-names = "default";
91 pinctrl-0 = <&i2c1_pins_a>; 142 pinctrl-0 = <&i2c1_pins_a>;
@@ -113,6 +164,19 @@
113 164
114 i2c@3 { 165 i2c@3 {
115 reg = <3>; 166 reg = <3>;
167 #address-cells = <1>;
168 #size-cells = <0>;
169
170 pca9555: pca9555@20 {
171 compatible = "nxp,pca9555";
172 interrupt-parent = <&gpio2>;
173 interrupts = <19 0x2>;
174 gpio-controller;
175 #gpio-cells = <2>;
176 interrupt-controller;
177 #interrupt-cells = <2>;
178 reg = <0x20>;
179 };
116 }; 180 };
117 }; 181 };
118 182
@@ -153,4 +217,92 @@
153 status = "okay"; 217 status = "okay";
154 }; 218 };
155 }; 219 };
220
221 spi2 {
222 compatible = "spi-gpio";
223 pinctrl-names = "default";
224 pinctrl-0 = <&spi2_pins_cfa10049>;
225 status = "okay";
226 gpio-sck = <&gpio2 16 0>;
227 gpio-mosi = <&gpio2 17 0>;
228 gpio-miso = <&gpio2 18 0>;
229 cs-gpios = <&gpio3 23 0>;
230 num-chipselects = <1>;
231 #address-cells = <1>;
232 #size-cells = <0>;
233
234 hx8357: hx8357@0 {
235 compatible = "himax,hx8357b", "himax,hx8357";
236 reg = <0>;
237 spi-max-frequency = <100000>;
238 spi-cpol;
239 spi-cpha;
240 gpios-reset = <&gpio3 30 0>;
241 im-gpios = <&gpio5 4 0 &gpio5 5 0 &gpio5 6 0>;
242 };
243 };
244
245 spi3 {
246 compatible = "spi-gpio";
247 pinctrl-names = "default";
248 pinctrl-0 = <&spi3_pins_cfa10049>;
249 status = "okay";
250 gpio-sck = <&gpio0 24 0>;
251 gpio-mosi = <&gpio0 28 0>;
252 cs-gpios = <&gpio0 17 0 &gpio0 26 0 &gpio0 27 0>;
253 num-chipselects = <3>;
254 #address-cells = <1>;
255 #size-cells = <0>;
256
257 gpio5: gpio5@0 {
258 compatible = "fairchild,74hc595";
259 gpio-controller;
260 #gpio-cells = <2>;
261 reg = <0>;
262 registers-number = <2>;
263 spi-max-frequency = <100000>;
264 };
265
266 gpio6: gpio6@1 {
267 compatible = "fairchild,74hc595";
268 gpio-controller;
269 #gpio-cells = <2>;
270 reg = <1>;
271 registers-number = <4>;
272 spi-max-frequency = <100000>;
273 };
274
275 dac0: dh2228@2 {
276 compatible = "rohm,dh2228fv";
277 reg = <2>;
278 spi-max-frequency = <100000>;
279 };
280 };
281
282 gpio_keys {
283 compatible = "gpio-keys";
284 #address-cells = <1>;
285 #size-cells = <0>;
286
287 rotary_button {
288 label = "rotary_button";
289 gpios = <&gpio3 26 1>;
290 debounce-interval = <10>;
291 linux,code = <28>;
292 };
293 };
294
295 rotary {
296 compatible = "rotary-encoder";
297 gpios = <&gpio3 24 1>, <&gpio3 25 1>;
298 linux,axis = <1>; /* REL_Y */
299 rotary-encoder,relative-axis;
300 };
301
302 backlight {
303 compatible = "pwm-backlight";
304 pwms = <&pwm 3 5000000>;
305 brightness-levels = <0 4 8 16 32 64 128 255>;
306 default-brightness-level = <6>;
307 };
156}; 308};
diff --git a/arch/arm/boot/dts/imx28-m28evk.dts b/arch/arm/boot/dts/imx28-m28evk.dts
index 3bab6b00c52d..6ce3d17c3a29 100644
--- a/arch/arm/boot/dts/imx28-m28evk.dts
+++ b/arch/arm/boot/dts/imx28-m28evk.dts
@@ -177,6 +177,7 @@
177 177
178 lradc@80050000 { 178 lradc@80050000 {
179 status = "okay"; 179 status = "okay";
180 fsl,lradc-touchscreen-wires = <4>;
180 }; 181 };
181 182
182 duart: serial@80074000 { 183 duart: serial@80074000 {
diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
index 13b7053d799e..7ba49662b9bc 100644
--- a/arch/arm/boot/dts/imx28.dtsi
+++ b/arch/arm/boot/dts/imx28.dtsi
@@ -502,6 +502,16 @@
502 fsl,pull-up = <0>; 502 fsl,pull-up = <0>;
503 }; 503 };
504 504
505 pwm3_pins_b: pwm3@1 {
506 reg = <1>;
507 fsl,pinmux-ids = <
508 0x3141 /* MX28_PAD_SAIF0_MCLK__PWM3 */
509 >;
510 fsl,drive-strength = <0>;
511 fsl,voltage = <1>;
512 fsl,pull-up = <0>;
513 };
514
505 pwm4_pins_a: pwm4@0 { 515 pwm4_pins_a: pwm4@0 {
506 reg = <0>; 516 reg = <0>;
507 fsl,pinmux-ids = < 517 fsl,pinmux-ids = <
diff --git a/arch/arm/boot/dts/imx31-bug.dts b/arch/arm/boot/dts/imx31-bug.dts
index 7f67402328d3..9ac6f6ba1d64 100644
--- a/arch/arm/boot/dts/imx31-bug.dts
+++ b/arch/arm/boot/dts/imx31-bug.dts
@@ -19,13 +19,9 @@
19 memory { 19 memory {
20 reg = <0x80000000 0x8000000>; /* 128M */ 20 reg = <0x80000000 0x8000000>; /* 128M */
21 }; 21 };
22};
22 23
23 soc { 24&uart5 {
24 aips@43f00000 { /* AIPS1 */ 25 fsl,uart-has-rtscts;
25 uart5: serial@43fb4000 { 26 status = "okay";
26 fsl,uart-has-rtscts;
27 status = "okay";
28 };
29 };
30 };
31}; 27};
diff --git a/arch/arm/boot/dts/imx31.dtsi b/arch/arm/boot/dts/imx31.dtsi
index eef7099f3e3c..454c2d175402 100644
--- a/arch/arm/boot/dts/imx31.dtsi
+++ b/arch/arm/boot/dts/imx31.dtsi
@@ -45,6 +45,8 @@
45 compatible = "fsl,imx31-uart", "fsl,imx21-uart"; 45 compatible = "fsl,imx31-uart", "fsl,imx21-uart";
46 reg = <0x43f90000 0x4000>; 46 reg = <0x43f90000 0x4000>;
47 interrupts = <45>; 47 interrupts = <45>;
48 clocks = <&clks 10>, <&clks 30>;
49 clock-names = "ipg", "per";
48 status = "disabled"; 50 status = "disabled";
49 }; 51 };
50 52
@@ -52,12 +54,16 @@
52 compatible = "fsl,imx31-uart", "fsl,imx21-uart"; 54 compatible = "fsl,imx31-uart", "fsl,imx21-uart";
53 reg = <0x43f94000 0x4000>; 55 reg = <0x43f94000 0x4000>;
54 interrupts = <32>; 56 interrupts = <32>;
57 clocks = <&clks 10>, <&clks 31>;
58 clock-names = "ipg", "per";
55 status = "disabled"; 59 status = "disabled";
56 }; 60 };
57 61
58 uart4: serial@43fb0000 { 62 uart4: serial@43fb0000 {
59 compatible = "fsl,imx31-uart", "fsl,imx21-uart"; 63 compatible = "fsl,imx31-uart", "fsl,imx21-uart";
60 reg = <0x43fb0000 0x4000>; 64 reg = <0x43fb0000 0x4000>;
65 clocks = <&clks 10>, <&clks 49>;
66 clock-names = "ipg", "per";
61 interrupts = <46>; 67 interrupts = <46>;
62 status = "disabled"; 68 status = "disabled";
63 }; 69 };
@@ -66,6 +72,8 @@
66 compatible = "fsl,imx31-uart", "fsl,imx21-uart"; 72 compatible = "fsl,imx31-uart", "fsl,imx21-uart";
67 reg = <0x43fb4000 0x4000>; 73 reg = <0x43fb4000 0x4000>;
68 interrupts = <47>; 74 interrupts = <47>;
75 clocks = <&clks 10>, <&clks 50>;
76 clock-names = "ipg", "per";
69 status = "disabled"; 77 status = "disabled";
70 }; 78 };
71 }; 79 };
@@ -81,8 +89,17 @@
81 compatible = "fsl,imx31-uart", "fsl,imx21-uart"; 89 compatible = "fsl,imx31-uart", "fsl,imx21-uart";
82 reg = <0x5000c000 0x4000>; 90 reg = <0x5000c000 0x4000>;
83 interrupts = <18>; 91 interrupts = <18>;
92 clocks = <&clks 10>, <&clks 48>;
93 clock-names = "ipg", "per";
84 status = "disabled"; 94 status = "disabled";
85 }; 95 };
96
97 clks: ccm@53f80000{
98 compatible = "fsl,imx31-ccm";
99 reg = <0x53f80000 0x4000>;
100 interrupts = <0 31 0x04 0 53 0x04>;
101 #clock-cells = <1>;
102 };
86 }; 103 };
87 }; 104 };
88}; 105};
diff --git a/arch/arm/boot/dts/imx51-apf51.dts b/arch/arm/boot/dts/imx51-apf51.dts
new file mode 100644
index 000000000000..92d3a66a69e2
--- /dev/null
+++ b/arch/arm/boot/dts/imx51-apf51.dts
@@ -0,0 +1,52 @@
1/*
2 * Copyright 2012 Armadeus Systems - <support@armadeus.com>
3 * Copyright 2012 Laurent Cans <laurent.cans@gmail.com>
4 *
5 * Based on mx51-babbage.dts
6 * Copyright 2011 Freescale Semiconductor, Inc.
7 * Copyright 2011 Linaro Ltd.
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/dts-v1/;
18/include/ "imx51.dtsi"
19
20/ {
21 model = "Armadeus Systems APF51 module";
22 compatible = "armadeus,imx51-apf51", "fsl,imx51";
23
24 memory {
25 reg = <0x90000000 0x20000000>;
26 };
27
28 clocks {
29 ckih1 {
30 clock-frequency = <0>;
31 };
32
33 osc {
34 clock-frequency = <33554432>;
35 };
36 };
37};
38
39&fec {
40 pinctrl-names = "default";
41 pinctrl-0 = <&pinctrl_fec_2>;
42 phy-mode = "mii";
43 phy-reset-gpios = <&gpio3 0 0>;
44 phy-reset-duration = <1>;
45 status = "okay";
46};
47
48&uart3 {
49 pinctrl-names = "default";
50 pinctrl-0 = <&pinctrl_uart3_2>;
51 status = "okay";
52};
diff --git a/arch/arm/boot/dts/imx51-babbage.dts b/arch/arm/boot/dts/imx51-babbage.dts
index 567e7ee72f91..aab6e43219af 100644
--- a/arch/arm/boot/dts/imx51-babbage.dts
+++ b/arch/arm/boot/dts/imx51-babbage.dts
@@ -21,239 +21,20 @@
21 reg = <0x90000000 0x20000000>; 21 reg = <0x90000000 0x20000000>;
22 }; 22 };
23 23
24 soc { 24 display@di0 {
25 display@di0 { 25 compatible = "fsl,imx-parallel-display";
26 compatible = "fsl,imx-parallel-display"; 26 crtcs = <&ipu 0>;
27 crtcs = <&ipu 0>; 27 interface-pix-fmt = "rgb24";
28 interface-pix-fmt = "rgb24"; 28 pinctrl-names = "default";
29 pinctrl-names = "default"; 29 pinctrl-0 = <&pinctrl_ipu_disp1_1>;
30 pinctrl-0 = <&pinctrl_ipu_disp1_1>; 30 };
31 };
32
33 display@di1 {
34 compatible = "fsl,imx-parallel-display";
35 crtcs = <&ipu 1>;
36 interface-pix-fmt = "rgb565";
37 pinctrl-names = "default";
38 pinctrl-0 = <&pinctrl_ipu_disp2_1>;
39 };
40
41 aips@70000000 { /* aips-1 */
42 spba@70000000 {
43 esdhc@70004000 { /* ESDHC1 */
44 pinctrl-names = "default";
45 pinctrl-0 = <&pinctrl_esdhc1_1>;
46 fsl,cd-controller;
47 fsl,wp-controller;
48 status = "okay";
49 };
50
51 esdhc@70008000 { /* ESDHC2 */
52 pinctrl-names = "default";
53 pinctrl-0 = <&pinctrl_esdhc2_1>;
54 cd-gpios = <&gpio1 6 0>;
55 wp-gpios = <&gpio1 5 0>;
56 status = "okay";
57 };
58
59 uart3: serial@7000c000 {
60 pinctrl-names = "default";
61 pinctrl-0 = <&pinctrl_uart3_1>;
62 fsl,uart-has-rtscts;
63 status = "okay";
64 };
65
66 ecspi@70010000 { /* ECSPI1 */
67 pinctrl-names = "default";
68 pinctrl-0 = <&pinctrl_ecspi1_1>;
69 fsl,spi-num-chipselects = <2>;
70 cs-gpios = <&gpio4 24 0>, <&gpio4 25 0>;
71 status = "okay";
72
73 pmic: mc13892@0 {
74 #address-cells = <1>;
75 #size-cells = <0>;
76 compatible = "fsl,mc13892";
77 spi-max-frequency = <6000000>;
78 reg = <0>;
79 interrupt-parent = <&gpio1>;
80 interrupts = <8 0x4>;
81
82 regulators {
83 sw1_reg: sw1 {
84 regulator-min-microvolt = <600000>;
85 regulator-max-microvolt = <1375000>;
86 regulator-boot-on;
87 regulator-always-on;
88 };
89
90 sw2_reg: sw2 {
91 regulator-min-microvolt = <900000>;
92 regulator-max-microvolt = <1850000>;
93 regulator-boot-on;
94 regulator-always-on;
95 };
96
97 sw3_reg: sw3 {
98 regulator-min-microvolt = <1100000>;
99 regulator-max-microvolt = <1850000>;
100 regulator-boot-on;
101 regulator-always-on;
102 };
103
104 sw4_reg: sw4 {
105 regulator-min-microvolt = <1100000>;
106 regulator-max-microvolt = <1850000>;
107 regulator-boot-on;
108 regulator-always-on;
109 };
110
111 vpll_reg: vpll {
112 regulator-min-microvolt = <1050000>;
113 regulator-max-microvolt = <1800000>;
114 regulator-boot-on;
115 regulator-always-on;
116 };
117
118 vdig_reg: vdig {
119 regulator-min-microvolt = <1650000>;
120 regulator-max-microvolt = <1650000>;
121 regulator-boot-on;
122 };
123
124 vsd_reg: vsd {
125 regulator-min-microvolt = <1800000>;
126 regulator-max-microvolt = <3150000>;
127 };
128
129 vusb2_reg: vusb2 {
130 regulator-min-microvolt = <2400000>;
131 regulator-max-microvolt = <2775000>;
132 regulator-boot-on;
133 regulator-always-on;
134 };
135
136 vvideo_reg: vvideo {
137 regulator-min-microvolt = <2775000>;
138 regulator-max-microvolt = <2775000>;
139 };
140
141 vaudio_reg: vaudio {
142 regulator-min-microvolt = <2300000>;
143 regulator-max-microvolt = <3000000>;
144 };
145
146 vcam_reg: vcam {
147 regulator-min-microvolt = <2500000>;
148 regulator-max-microvolt = <3000000>;
149 };
150
151 vgen1_reg: vgen1 {
152 regulator-min-microvolt = <1200000>;
153 regulator-max-microvolt = <1200000>;
154 };
155
156 vgen2_reg: vgen2 {
157 regulator-min-microvolt = <1200000>;
158 regulator-max-microvolt = <3150000>;
159 regulator-always-on;
160 };
161
162 vgen3_reg: vgen3 {
163 regulator-min-microvolt = <1800000>;
164 regulator-max-microvolt = <2900000>;
165 regulator-always-on;
166 };
167 };
168 };
169
170 flash: at45db321d@1 {
171 #address-cells = <1>;
172 #size-cells = <1>;
173 compatible = "atmel,at45db321d", "atmel,at45", "atmel,dataflash";
174 spi-max-frequency = <25000000>;
175 reg = <1>;
176
177 partition@0 {
178 label = "U-Boot";
179 reg = <0x0 0x40000>;
180 read-only;
181 };
182
183 partition@40000 {
184 label = "Kernel";
185 reg = <0x40000 0x3c0000>;
186 };
187 };
188 };
189
190 ssi2: ssi@70014000 {
191 fsl,mode = "i2s-slave";
192 status = "okay";
193 };
194 };
195
196 iomuxc@73fa8000 {
197 pinctrl-names = "default";
198 pinctrl-0 = <&pinctrl_hog>;
199
200 hog {
201 pinctrl_hog: hoggrp {
202 fsl,pins = <
203 694 0x20d5 /* MX51_PAD_GPIO1_0__SD1_CD */
204 697 0x20d5 /* MX51_PAD_GPIO1_1__SD1_WP */
205 737 0x100 /* MX51_PAD_GPIO1_5__GPIO1_5 */
206 740 0x100 /* MX51_PAD_GPIO1_6__GPIO1_6 */
207 121 0x5 /* MX51_PAD_EIM_A27__GPIO2_21 */
208 402 0x85 /* MX51_PAD_CSPI1_SS0__GPIO4_24 */
209 405 0x85 /* MX51_PAD_CSPI1_SS1__GPIO4_25 */
210 >;
211 };
212 };
213 };
214
215 uart1: serial@73fbc000 {
216 pinctrl-names = "default";
217 pinctrl-0 = <&pinctrl_uart1_1>;
218 fsl,uart-has-rtscts;
219 status = "okay";
220 };
221
222 uart2: serial@73fc0000 {
223 pinctrl-names = "default";
224 pinctrl-0 = <&pinctrl_uart2_1>;
225 status = "okay";
226 };
227 };
228
229 aips@80000000 { /* aips-2 */
230 i2c@83fc4000 { /* I2C2 */
231 pinctrl-names = "default";
232 pinctrl-0 = <&pinctrl_i2c2_1>;
233 status = "okay";
234
235 sgtl5000: codec@0a {
236 compatible = "fsl,sgtl5000";
237 reg = <0x0a>;
238 clock-frequency = <26000000>;
239 VDDA-supply = <&vdig_reg>;
240 VDDIO-supply = <&vvideo_reg>;
241 };
242 };
243
244 audmux@83fd0000 {
245 pinctrl-names = "default";
246 pinctrl-0 = <&pinctrl_audmux_1>;
247 status = "okay";
248 };
249 31
250 ethernet@83fec000 { 32 display@di1 {
251 pinctrl-names = "default"; 33 compatible = "fsl,imx-parallel-display";
252 pinctrl-0 = <&pinctrl_fec_1>; 34 crtcs = <&ipu 1>;
253 phy-mode = "mii"; 35 interface-pix-fmt = "rgb565";
254 status = "okay"; 36 pinctrl-names = "default";
255 }; 37 pinctrl-0 = <&pinctrl_ipu_disp2_1>;
256 };
257 }; 38 };
258 39
259 gpio-keys { 40 gpio-keys {
@@ -281,3 +62,236 @@
281 mux-ext-port = <3>; 62 mux-ext-port = <3>;
282 }; 63 };
283}; 64};
65
66&esdhc1 {
67 pinctrl-names = "default";
68 pinctrl-0 = <&pinctrl_esdhc1_1>;
69 fsl,cd-controller;
70 fsl,wp-controller;
71 status = "okay";
72};
73
74&esdhc2 {
75 pinctrl-names = "default";
76 pinctrl-0 = <&pinctrl_esdhc2_1>;
77 cd-gpios = <&gpio1 6 0>;
78 wp-gpios = <&gpio1 5 0>;
79 status = "okay";
80};
81
82&uart3 {
83 pinctrl-names = "default";
84 pinctrl-0 = <&pinctrl_uart3_1>;
85 fsl,uart-has-rtscts;
86 status = "okay";
87};
88
89&ecspi1 {
90 pinctrl-names = "default";
91 pinctrl-0 = <&pinctrl_ecspi1_1>;
92 fsl,spi-num-chipselects = <2>;
93 cs-gpios = <&gpio4 24 0>, <&gpio4 25 0>;
94 status = "okay";
95
96 pmic: mc13892@0 {
97 #address-cells = <1>;
98 #size-cells = <0>;
99 compatible = "fsl,mc13892";
100 spi-max-frequency = <6000000>;
101 reg = <0>;
102 interrupt-parent = <&gpio1>;
103 interrupts = <8 0x4>;
104
105 regulators {
106 sw1_reg: sw1 {
107 regulator-min-microvolt = <600000>;
108 regulator-max-microvolt = <1375000>;
109 regulator-boot-on;
110 regulator-always-on;
111 };
112
113 sw2_reg: sw2 {
114 regulator-min-microvolt = <900000>;
115 regulator-max-microvolt = <1850000>;
116 regulator-boot-on;
117 regulator-always-on;
118 };
119
120 sw3_reg: sw3 {
121 regulator-min-microvolt = <1100000>;
122 regulator-max-microvolt = <1850000>;
123 regulator-boot-on;
124 regulator-always-on;
125 };
126
127 sw4_reg: sw4 {
128 regulator-min-microvolt = <1100000>;
129 regulator-max-microvolt = <1850000>;
130 regulator-boot-on;
131 regulator-always-on;
132 };
133
134 vpll_reg: vpll {
135 regulator-min-microvolt = <1050000>;
136 regulator-max-microvolt = <1800000>;
137 regulator-boot-on;
138 regulator-always-on;
139 };
140
141 vdig_reg: vdig {
142 regulator-min-microvolt = <1650000>;
143 regulator-max-microvolt = <1650000>;
144 regulator-boot-on;
145 };
146
147 vsd_reg: vsd {
148 regulator-min-microvolt = <1800000>;
149 regulator-max-microvolt = <3150000>;
150 };
151
152 vusb2_reg: vusb2 {
153 regulator-min-microvolt = <2400000>;
154 regulator-max-microvolt = <2775000>;
155 regulator-boot-on;
156 regulator-always-on;
157 };
158
159 vvideo_reg: vvideo {
160 regulator-min-microvolt = <2775000>;
161 regulator-max-microvolt = <2775000>;
162 };
163
164 vaudio_reg: vaudio {
165 regulator-min-microvolt = <2300000>;
166 regulator-max-microvolt = <3000000>;
167 };
168
169 vcam_reg: vcam {
170 regulator-min-microvolt = <2500000>;
171 regulator-max-microvolt = <3000000>;
172 };
173
174 vgen1_reg: vgen1 {
175 regulator-min-microvolt = <1200000>;
176 regulator-max-microvolt = <1200000>;
177 };
178
179 vgen2_reg: vgen2 {
180 regulator-min-microvolt = <1200000>;
181 regulator-max-microvolt = <3150000>;
182 regulator-always-on;
183 };
184
185 vgen3_reg: vgen3 {
186 regulator-min-microvolt = <1800000>;
187 regulator-max-microvolt = <2900000>;
188 regulator-always-on;
189 };
190 };
191 };
192
193 flash: at45db321d@1 {
194 #address-cells = <1>;
195 #size-cells = <1>;
196 compatible = "atmel,at45db321d", "atmel,at45", "atmel,dataflash";
197 spi-max-frequency = <25000000>;
198 reg = <1>;
199
200 partition@0 {
201 label = "U-Boot";
202 reg = <0x0 0x40000>;
203 read-only;
204 };
205
206 partition@40000 {
207 label = "Kernel";
208 reg = <0x40000 0x3c0000>;
209 };
210 };
211};
212
213&ssi2 {
214 fsl,mode = "i2s-slave";
215 status = "okay";
216};
217
218&iomuxc {
219 pinctrl-names = "default";
220 pinctrl-0 = <&pinctrl_hog>;
221
222 hog {
223 pinctrl_hog: hoggrp {
224 fsl,pins = <
225 694 0x20d5 /* MX51_PAD_GPIO1_0__SD1_CD */
226 697 0x20d5 /* MX51_PAD_GPIO1_1__SD1_WP */
227 737 0x100 /* MX51_PAD_GPIO1_5__GPIO1_5 */
228 740 0x100 /* MX51_PAD_GPIO1_6__GPIO1_6 */
229 121 0x5 /* MX51_PAD_EIM_A27__GPIO2_21 */
230 402 0x85 /* MX51_PAD_CSPI1_SS0__GPIO4_24 */
231 405 0x85 /* MX51_PAD_CSPI1_SS1__GPIO4_25 */
232 >;
233 };
234 };
235};
236
237&uart1 {
238 pinctrl-names = "default";
239 pinctrl-0 = <&pinctrl_uart1_1>;
240 fsl,uart-has-rtscts;
241 status = "okay";
242};
243
244&uart2 {
245 pinctrl-names = "default";
246 pinctrl-0 = <&pinctrl_uart2_1>;
247 status = "okay";
248};
249
250&i2c2 {
251 pinctrl-names = "default";
252 pinctrl-0 = <&pinctrl_i2c2_1>;
253 status = "okay";
254
255 sgtl5000: codec@0a {
256 compatible = "fsl,sgtl5000";
257 reg = <0x0a>;
258 clock-frequency = <26000000>;
259 VDDA-supply = <&vdig_reg>;
260 VDDIO-supply = <&vvideo_reg>;
261 };
262};
263
264&audmux {
265 pinctrl-names = "default";
266 pinctrl-0 = <&pinctrl_audmux_1>;
267 status = "okay";
268};
269
270&fec {
271 pinctrl-names = "default";
272 pinctrl-0 = <&pinctrl_fec_1>;
273 phy-mode = "mii";
274 status = "okay";
275};
276
277&kpp {
278 pinctrl-names = "default";
279 pinctrl-0 = <&pinctrl_kpp_1>;
280 linux,keymap = <0x00000067 /* KEY_UP */
281 0x0001006c /* KEY_DOWN */
282 0x00020072 /* KEY_VOLUMEDOWN */
283 0x00030066 /* KEY_HOME */
284 0x0100006a /* KEY_RIGHT */
285 0x01010069 /* KEY_LEFT */
286 0x0102001c /* KEY_ENTER */
287 0x01030073 /* KEY_VOLUMEUP */
288 0x02000040 /* KEY_F6 */
289 0x02010042 /* KEY_F8 */
290 0x02020043 /* KEY_F9 */
291 0x02030044 /* KEY_F10 */
292 0x0300003b /* KEY_F1 */
293 0x0301003c /* KEY_F2 */
294 0x0302003d /* KEY_F3 */
295 0x03030074>; /* KEY_POWER */
296 status = "okay";
297};
diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
index 1f5d45eff45e..fcf035bf7c5a 100644
--- a/arch/arm/boot/dts/imx51.dtsi
+++ b/arch/arm/boot/dts/imx51.dtsi
@@ -221,6 +221,14 @@
221 #interrupt-cells = <2>; 221 #interrupt-cells = <2>;
222 }; 222 };
223 223
224 kpp: kpp@73f94000 {
225 compatible = "fsl,imx51-kpp", "fsl,imx21-kpp";
226 reg = <0x73f94000 0x4000>;
227 interrupts = <60>;
228 clocks = <&clks 0>;
229 status = "disabled";
230 };
231
224 wdog1: wdog@73f98000 { 232 wdog1: wdog@73f98000 {
225 compatible = "fsl,imx51-wdt", "fsl,imx21-wdt"; 233 compatible = "fsl,imx51-wdt", "fsl,imx21-wdt";
226 reg = <0x73f98000 0x4000>; 234 reg = <0x73f98000 0x4000>;
@@ -273,6 +281,29 @@
273 260 0x80000000 /* MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK */ 281 260 0x80000000 /* MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK */
274 >; 282 >;
275 }; 283 };
284
285 pinctrl_fec_2: fecgrp-2 {
286 fsl,pins = <
287 589 0x80000000 /* MX51_PAD_DI_GP3__FEC_TX_ER */
288 592 0x80000000 /* MX51_PAD_DI2_PIN4__FEC_CRS */
289 594 0x80000000 /* MX51_PAD_DI2_PIN2__FEC_MDC */
290 596 0x80000000 /* MX51_PAD_DI2_PIN3__FEC_MDIO */
291 598 0x80000000 /* MX51_PAD_DI2_DISP_CLK__FEC_RDATA1 */
292 602 0x80000000 /* MX51_PAD_DI_GP4__FEC_RDATA2 */
293 604 0x80000000 /* MX51_PAD_DISP2_DAT0__FEC_RDATA3 */
294 609 0x80000000 /* MX51_PAD_DISP2_DAT1__FEC_RX_ER */
295 618 0x80000000 /* MX51_PAD_DISP2_DAT6__FEC_TDATA1 */
296 623 0x80000000 /* MX51_PAD_DISP2_DAT7__FEC_TDATA2 */
297 628 0x80000000 /* MX51_PAD_DISP2_DAT8__FEC_TDATA3 */
298 634 0x80000000 /* MX51_PAD_DISP2_DAT9__FEC_TX_EN */
299 639 0x80000000 /* MX51_PAD_DISP2_DAT10__FEC_COL */
300 644 0x80000000 /* MX51_PAD_DISP2_DAT11__FEC_RX_CLK */
301 649 0x80000000 /* MX51_PAD_DISP2_DAT12__FEC_RX_DV */
302 653 0x80000000 /* MX51_PAD_DISP2_DAT13__FEC_TX_CLK */
303 657 0x80000000 /* MX51_PAD_DISP2_DAT14__FEC_RDATA0 */
304 662 0x80000000 /* MX51_PAD_DISP2_DAT15__FEC_TDATA0 */
305 >;
306 };
276 }; 307 };
277 308
278 ecspi1 { 309 ecspi1 {
@@ -409,6 +440,28 @@
409 49 0x1c5 /* MX51_PAD_EIM_D24__UART3_CTS */ 440 49 0x1c5 /* MX51_PAD_EIM_D24__UART3_CTS */
410 >; 441 >;
411 }; 442 };
443
444 pinctrl_uart3_2: uart3grp-2 {
445 fsl,pins = <
446 434 0x1c5 /* MX51_PAD_UART3_RXD__UART3_RXD */
447 430 0x1c5 /* MX51_PAD_UART3_TXD__UART3_TXD */
448 >;
449 };
450 };
451
452 kpp {
453 pinctrl_kpp_1: kppgrp-1 {
454 fsl,pins = <
455 438 0xe0 /* MX51_PAD_KEY_ROW0__KEY_ROW0 */
456 439 0xe0 /* MX51_PAD_KEY_ROW1__KEY_ROW1 */
457 440 0xe0 /* MX51_PAD_KEY_ROW2__KEY_ROW2 */
458 441 0xe0 /* MX51_PAD_KEY_ROW3__KEY_ROW3 */
459 442 0xe8 /* MX51_PAD_KEY_COL0__KEY_COL0 */
460 444 0xe8 /* MX51_PAD_KEY_COL1__KEY_COL1 */
461 446 0xe8 /* MX51_PAD_KEY_COL2__KEY_COL2 */
462 448 0xe8 /* MX51_PAD_KEY_COL3__KEY_COL3 */
463 >;
464 };
412 }; 465 };
413 }; 466 };
414 467
diff --git a/arch/arm/boot/dts/imx53-ard.dts b/arch/arm/boot/dts/imx53-ard.dts
index 4be76f223526..e049fd0319e8 100644
--- a/arch/arm/boot/dts/imx53-ard.dts
+++ b/arch/arm/boot/dts/imx53-ard.dts
@@ -21,72 +21,6 @@
21 reg = <0x70000000 0x40000000>; 21 reg = <0x70000000 0x40000000>;
22 }; 22 };
23 23
24 soc {
25 aips@50000000 { /* AIPS1 */
26 spba@50000000 {
27 esdhc@50004000 { /* ESDHC1 */
28 pinctrl-names = "default";
29 pinctrl-0 = <&pinctrl_esdhc1_2>;
30 cd-gpios = <&gpio1 1 0>;
31 wp-gpios = <&gpio1 9 0>;
32 status = "okay";
33 };
34 };
35
36 iomuxc@53fa8000 {
37 pinctrl-names = "default";
38 pinctrl-0 = <&pinctrl_hog>;
39
40 hog {
41 pinctrl_hog: hoggrp {
42 fsl,pins = <
43 1077 0x80000000 /* MX53_PAD_GPIO_1__GPIO1_1 */
44 1085 0x80000000 /* MX53_PAD_GPIO_9__GPIO1_9 */
45 486 0x80000000 /* MX53_PAD_EIM_EB3__GPIO2_31 */
46 739 0x80000000 /* MX53_PAD_GPIO_10__GPIO4_0 */
47 218 0x80000000 /* MX53_PAD_DISP0_DAT16__GPIO5_10 */
48 226 0x80000000 /* MX53_PAD_DISP0_DAT17__GPIO5_11 */
49 233 0x80000000 /* MX53_PAD_DISP0_DAT18__GPIO5_12 */
50 241 0x80000000 /* MX53_PAD_DISP0_DAT19__GPIO5_13 */
51 429 0x80000000 /* MX53_PAD_EIM_D16__EMI_WEIM_D_16 */
52 435 0x80000000 /* MX53_PAD_EIM_D17__EMI_WEIM_D_17 */
53 441 0x80000000 /* MX53_PAD_EIM_D18__EMI_WEIM_D_18 */
54 448 0x80000000 /* MX53_PAD_EIM_D19__EMI_WEIM_D_19 */
55 456 0x80000000 /* MX53_PAD_EIM_D20__EMI_WEIM_D_20 */
56 464 0x80000000 /* MX53_PAD_EIM_D21__EMI_WEIM_D_21 */
57 471 0x80000000 /* MX53_PAD_EIM_D22__EMI_WEIM_D_22 */
58 477 0x80000000 /* MX53_PAD_EIM_D23__EMI_WEIM_D_23 */
59 492 0x80000000 /* MX53_PAD_EIM_D24__EMI_WEIM_D_24 */
60 500 0x80000000 /* MX53_PAD_EIM_D25__EMI_WEIM_D_25 */
61 508 0x80000000 /* MX53_PAD_EIM_D26__EMI_WEIM_D_26 */
62 516 0x80000000 /* MX53_PAD_EIM_D27__EMI_WEIM_D_27 */
63 524 0x80000000 /* MX53_PAD_EIM_D28__EMI_WEIM_D_28 */
64 532 0x80000000 /* MX53_PAD_EIM_D29__EMI_WEIM_D_29 */
65 540 0x80000000 /* MX53_PAD_EIM_D30__EMI_WEIM_D_30 */
66 548 0x80000000 /* MX53_PAD_EIM_D31__EMI_WEIM_D_31 */
67 637 0x80000000 /* MX53_PAD_EIM_DA0__EMI_NAND_WEIM_DA_0 */
68 642 0x80000000 /* MX53_PAD_EIM_DA1__EMI_NAND_WEIM_DA_1 */
69 647 0x80000000 /* MX53_PAD_EIM_DA2__EMI_NAND_WEIM_DA_2 */
70 652 0x80000000 /* MX53_PAD_EIM_DA3__EMI_NAND_WEIM_DA_3 */
71 657 0x80000000 /* MX53_PAD_EIM_DA4__EMI_NAND_WEIM_DA_4 */
72 662 0x80000000 /* MX53_PAD_EIM_DA5__EMI_NAND_WEIM_DA_5 */
73 667 0x80000000 /* MX53_PAD_EIM_DA6__EMI_NAND_WEIM_DA_6 */
74 611 0x80000000 /* MX53_PAD_EIM_OE__EMI_WEIM_OE */
75 616 0x80000000 /* MX53_PAD_EIM_RW__EMI_WEIM_RW */
76 607 0x80000000 /* MX53_PAD_EIM_CS1__EMI_WEIM_CS_1 */
77 >;
78 };
79 };
80 };
81
82 uart1: serial@53fbc000 {
83 pinctrl-names = "default";
84 pinctrl-0 = <&pinctrl_uart1_2>;
85 status = "okay";
86 };
87 };
88 };
89
90 eim-cs1@f4000000 { 24 eim-cs1@f4000000 {
91 #address-cells = <1>; 25 #address-cells = <1>;
92 #size-cells = <1>; 26 #size-cells = <1>;
@@ -162,3 +96,63 @@
162 }; 96 };
163 }; 97 };
164}; 98};
99
100&esdhc1 {
101 pinctrl-names = "default";
102 pinctrl-0 = <&pinctrl_esdhc1_2>;
103 cd-gpios = <&gpio1 1 0>;
104 wp-gpios = <&gpio1 9 0>;
105 status = "okay";
106};
107
108&iomuxc {
109 pinctrl-names = "default";
110 pinctrl-0 = <&pinctrl_hog>;
111
112 hog {
113 pinctrl_hog: hoggrp {
114 fsl,pins = <
115 1077 0x80000000 /* MX53_PAD_GPIO_1__GPIO1_1 */
116 1085 0x80000000 /* MX53_PAD_GPIO_9__GPIO1_9 */
117 486 0x80000000 /* MX53_PAD_EIM_EB3__GPIO2_31 */
118 739 0x80000000 /* MX53_PAD_GPIO_10__GPIO4_0 */
119 218 0x80000000 /* MX53_PAD_DISP0_DAT16__GPIO5_10 */
120 226 0x80000000 /* MX53_PAD_DISP0_DAT17__GPIO5_11 */
121 233 0x80000000 /* MX53_PAD_DISP0_DAT18__GPIO5_12 */
122 241 0x80000000 /* MX53_PAD_DISP0_DAT19__GPIO5_13 */
123 429 0x80000000 /* MX53_PAD_EIM_D16__EMI_WEIM_D_16 */
124 435 0x80000000 /* MX53_PAD_EIM_D17__EMI_WEIM_D_17 */
125 441 0x80000000 /* MX53_PAD_EIM_D18__EMI_WEIM_D_18 */
126 448 0x80000000 /* MX53_PAD_EIM_D19__EMI_WEIM_D_19 */
127 456 0x80000000 /* MX53_PAD_EIM_D20__EMI_WEIM_D_20 */
128 464 0x80000000 /* MX53_PAD_EIM_D21__EMI_WEIM_D_21 */
129 471 0x80000000 /* MX53_PAD_EIM_D22__EMI_WEIM_D_22 */
130 477 0x80000000 /* MX53_PAD_EIM_D23__EMI_WEIM_D_23 */
131 492 0x80000000 /* MX53_PAD_EIM_D24__EMI_WEIM_D_24 */
132 500 0x80000000 /* MX53_PAD_EIM_D25__EMI_WEIM_D_25 */
133 508 0x80000000 /* MX53_PAD_EIM_D26__EMI_WEIM_D_26 */
134 516 0x80000000 /* MX53_PAD_EIM_D27__EMI_WEIM_D_27 */
135 524 0x80000000 /* MX53_PAD_EIM_D28__EMI_WEIM_D_28 */
136 532 0x80000000 /* MX53_PAD_EIM_D29__EMI_WEIM_D_29 */
137 540 0x80000000 /* MX53_PAD_EIM_D30__EMI_WEIM_D_30 */
138 548 0x80000000 /* MX53_PAD_EIM_D31__EMI_WEIM_D_31 */
139 637 0x80000000 /* MX53_PAD_EIM_DA0__EMI_NAND_WEIM_DA_0 */
140 642 0x80000000 /* MX53_PAD_EIM_DA1__EMI_NAND_WEIM_DA_1 */
141 647 0x80000000 /* MX53_PAD_EIM_DA2__EMI_NAND_WEIM_DA_2 */
142 652 0x80000000 /* MX53_PAD_EIM_DA3__EMI_NAND_WEIM_DA_3 */
143 657 0x80000000 /* MX53_PAD_EIM_DA4__EMI_NAND_WEIM_DA_4 */
144 662 0x80000000 /* MX53_PAD_EIM_DA5__EMI_NAND_WEIM_DA_5 */
145 667 0x80000000 /* MX53_PAD_EIM_DA6__EMI_NAND_WEIM_DA_6 */
146 611 0x80000000 /* MX53_PAD_EIM_OE__EMI_WEIM_OE */
147 616 0x80000000 /* MX53_PAD_EIM_RW__EMI_WEIM_RW */
148 607 0x80000000 /* MX53_PAD_EIM_CS1__EMI_WEIM_CS_1 */
149 >;
150 };
151 };
152};
153
154&uart1 {
155 pinctrl-names = "default";
156 pinctrl-0 = <&pinctrl_uart1_2>;
157 status = "okay";
158};
diff --git a/arch/arm/boot/dts/imx53-evk.dts b/arch/arm/boot/dts/imx53-evk.dts
index a124d1e25258..85a89b52f9b8 100644
--- a/arch/arm/boot/dts/imx53-evk.dts
+++ b/arch/arm/boot/dts/imx53-evk.dts
@@ -21,107 +21,6 @@
21 reg = <0x70000000 0x80000000>; 21 reg = <0x70000000 0x80000000>;
22 }; 22 };
23 23
24 soc {
25 aips@50000000 { /* AIPS1 */
26 spba@50000000 {
27 esdhc@50004000 { /* ESDHC1 */
28 pinctrl-names = "default";
29 pinctrl-0 = <&pinctrl_esdhc1_1>;
30 cd-gpios = <&gpio3 13 0>;
31 wp-gpios = <&gpio3 14 0>;
32 status = "okay";
33 };
34
35 ecspi@50010000 { /* ECSPI1 */
36 pinctrl-names = "default";
37 pinctrl-0 = <&pinctrl_ecspi1_1>;
38 fsl,spi-num-chipselects = <2>;
39 cs-gpios = <&gpio2 30 0>, <&gpio3 19 0>;
40 status = "okay";
41
42 flash: at45db321d@1 {
43 #address-cells = <1>;
44 #size-cells = <1>;
45 compatible = "atmel,at45db321d", "atmel,at45", "atmel,dataflash";
46 spi-max-frequency = <25000000>;
47 reg = <1>;
48
49 partition@0 {
50 label = "U-Boot";
51 reg = <0x0 0x40000>;
52 read-only;
53 };
54
55 partition@40000 {
56 label = "Kernel";
57 reg = <0x40000 0x3c0000>;
58 };
59 };
60 };
61
62 esdhc@50020000 { /* ESDHC3 */
63 pinctrl-names = "default";
64 pinctrl-0 = <&pinctrl_esdhc3_1>;
65 cd-gpios = <&gpio3 11 0>;
66 wp-gpios = <&gpio3 12 0>;
67 status = "okay";
68 };
69 };
70
71 iomuxc@53fa8000 {
72 pinctrl-names = "default";
73 pinctrl-0 = <&pinctrl_hog>;
74
75 hog {
76 pinctrl_hog: hoggrp {
77 fsl,pins = <
78 424 0x80000000 /* MX53_PAD_EIM_EB2__GPIO2_30 */
79 449 0x80000000 /* MX53_PAD_EIM_D19__GPIO3_19 */
80 693 0x80000000 /* MX53_PAD_EIM_DA11__GPIO3_11 */
81 697 0x80000000 /* MX53_PAD_EIM_DA12__GPIO3_12 */
82 701 0x80000000 /* MX53_PAD_EIM_DA13__GPIO3_13 */
83 705 0x80000000 /* MX53_PAD_EIM_DA14__GPIO3_14 */
84 868 0x80000000 /* MX53_PAD_PATA_DA_0__GPIO7_6 */
85 873 0x80000000 /* MX53_PAD_PATA_DA_1__GPIO7_7 */
86 >;
87 };
88 };
89 };
90
91 uart1: serial@53fbc000 {
92 pinctrl-names = "default";
93 pinctrl-0 = <&pinctrl_uart1_1>;
94 status = "okay";
95 };
96 };
97
98 aips@60000000 { /* AIPS2 */
99 i2c@63fc4000 { /* I2C2 */
100 pinctrl-names = "default";
101 pinctrl-0 = <&pinctrl_i2c2_1>;
102 status = "okay";
103
104 pmic: mc13892@08 {
105 compatible = "fsl,mc13892", "fsl,mc13xxx";
106 reg = <0x08>;
107 };
108
109 codec: sgtl5000@0a {
110 compatible = "fsl,sgtl5000";
111 reg = <0x0a>;
112 };
113 };
114
115 ethernet@63fec000 {
116 pinctrl-names = "default";
117 pinctrl-0 = <&pinctrl_fec_1>;
118 phy-mode = "rmii";
119 phy-reset-gpios = <&gpio7 6 0>;
120 status = "okay";
121 };
122 };
123 };
124
125 leds { 24 leds {
126 compatible = "gpio-leds"; 25 compatible = "gpio-leds";
127 26
@@ -132,3 +31,96 @@
132 }; 31 };
133 }; 32 };
134}; 33};
34
35&esdhc1 {
36 pinctrl-names = "default";
37 pinctrl-0 = <&pinctrl_esdhc1_1>;
38 cd-gpios = <&gpio3 13 0>;
39 wp-gpios = <&gpio3 14 0>;
40 status = "okay";
41};
42
43&ecspi1 {
44 pinctrl-names = "default";
45 pinctrl-0 = <&pinctrl_ecspi1_1>;
46 fsl,spi-num-chipselects = <2>;
47 cs-gpios = <&gpio2 30 0>, <&gpio3 19 0>;
48 status = "okay";
49
50 flash: at45db321d@1 {
51 #address-cells = <1>;
52 #size-cells = <1>;
53 compatible = "atmel,at45db321d", "atmel,at45", "atmel,dataflash";
54 spi-max-frequency = <25000000>;
55 reg = <1>;
56
57 partition@0 {
58 label = "U-Boot";
59 reg = <0x0 0x40000>;
60 read-only;
61 };
62
63 partition@40000 {
64 label = "Kernel";
65 reg = <0x40000 0x3c0000>;
66 };
67 };
68};
69
70&esdhc3 {
71 pinctrl-names = "default";
72 pinctrl-0 = <&pinctrl_esdhc3_1>;
73 cd-gpios = <&gpio3 11 0>;
74 wp-gpios = <&gpio3 12 0>;
75 status = "okay";
76};
77
78&iomuxc {
79 pinctrl-names = "default";
80 pinctrl-0 = <&pinctrl_hog>;
81
82 hog {
83 pinctrl_hog: hoggrp {
84 fsl,pins = <
85 424 0x80000000 /* MX53_PAD_EIM_EB2__GPIO2_30 */
86 449 0x80000000 /* MX53_PAD_EIM_D19__GPIO3_19 */
87 693 0x80000000 /* MX53_PAD_EIM_DA11__GPIO3_11 */
88 697 0x80000000 /* MX53_PAD_EIM_DA12__GPIO3_12 */
89 701 0x80000000 /* MX53_PAD_EIM_DA13__GPIO3_13 */
90 705 0x80000000 /* MX53_PAD_EIM_DA14__GPIO3_14 */
91 868 0x80000000 /* MX53_PAD_PATA_DA_0__GPIO7_6 */
92 873 0x80000000 /* MX53_PAD_PATA_DA_1__GPIO7_7 */
93 >;
94 };
95 };
96};
97
98&uart1 {
99 pinctrl-names = "default";
100 pinctrl-0 = <&pinctrl_uart1_1>;
101 status = "okay";
102};
103
104&i2c2 {
105 pinctrl-names = "default";
106 pinctrl-0 = <&pinctrl_i2c2_1>;
107 status = "okay";
108
109 pmic: mc13892@08 {
110 compatible = "fsl,mc13892", "fsl,mc13xxx";
111 reg = <0x08>;
112 };
113
114 codec: sgtl5000@0a {
115 compatible = "fsl,sgtl5000";
116 reg = <0x0a>;
117 };
118};
119
120&fec {
121 pinctrl-names = "default";
122 pinctrl-0 = <&pinctrl_fec_1>;
123 phy-mode = "rmii";
124 phy-reset-gpios = <&gpio7 6 0>;
125 status = "okay";
126};
diff --git a/arch/arm/boot/dts/imx53-mba53.dts b/arch/arm/boot/dts/imx53-mba53.dts
new file mode 100644
index 000000000000..e54fffd48369
--- /dev/null
+++ b/arch/arm/boot/dts/imx53-mba53.dts
@@ -0,0 +1,130 @@
1/*
2 * Copyright 2012 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
3 * Copyright 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de>, Pengutronix
4 *
5 * The code contained herein is licensed under the GNU General Public
6 * License. You may obtain a copy of the GNU General Public License
7 * Version 2 or later at the following locations:
8 *
9 * http://www.opensource.org/licenses/gpl-license.html
10 * http://www.gnu.org/copyleft/gpl.html
11 */
12
13/dts-v1/;
14/include/ "imx53-tqma53.dtsi"
15
16/ {
17 model = "TQ MBa53 starter kit";
18 compatible = "tq,mba53", "tq,tqma53", "fsl,imx53";
19};
20
21&iomuxc {
22 lvds1 {
23 pinctrl_lvds1_1: lvds1-grp1 {
24 fsl,pins = <730 0x10000 /* LVDS0_TX3 */
25 732 0x10000 /* LVDS0_CLK */
26 734 0x10000 /* LVDS0_TX2 */
27 736 0x10000 /* LVDS0_TX1 */
28 738 0x10000>; /* LVDS0_TX0 */
29 };
30
31 pinctrl_lvds1_2: lvds1-grp2 {
32 fsl,pins = <720 0x10000 /* LVDS1_TX3 */
33 722 0x10000 /* LVDS1_TX2 */
34 724 0x10000 /* LVDS1_CLK */
35 726 0x10000 /* LVDS1_TX1 */
36 728 0x10000>; /* LVDS1_TX0 */
37 };
38 };
39
40 disp1 {
41 pinctrl_disp1_1: disp1-grp1 {
42 fsl,pins = <689 0x10000 /* DISP1_DRDY */
43 482 0x10000 /* DISP1_HSYNC */
44 489 0x10000 /* DISP1_VSYNC */
45 684 0x10000 /* DISP1_DAT_0 */
46 515 0x10000 /* DISP1_DAT_22 */
47 523 0x10000 /* DISP1_DAT_23 */
48 543 0x10000 /* DISP1_DAT_21 */
49 553 0x10000 /* DISP1_DAT_20 */
50 558 0x10000 /* DISP1_DAT_19 */
51 564 0x10000 /* DISP1_DAT_18 */
52 570 0x10000 /* DISP1_DAT_17 */
53 575 0x10000 /* DISP1_DAT_16 */
54 580 0x10000 /* DISP1_DAT_15 */
55 585 0x10000 /* DISP1_DAT_14 */
56 590 0x10000 /* DISP1_DAT_13 */
57 595 0x10000 /* DISP1_DAT_12 */
58 628 0x10000 /* DISP1_DAT_11 */
59 634 0x10000 /* DISP1_DAT_10 */
60 639 0x10000 /* DISP1_DAT_9 */
61 644 0x10000 /* DISP1_DAT_8 */
62 649 0x10000 /* DISP1_DAT_7 */
63 654 0x10000 /* DISP1_DAT_6 */
64 659 0x10000 /* DISP1_DAT_5 */
65 664 0x10000 /* DISP1_DAT_4 */
66 669 0x10000 /* DISP1_DAT_3 */
67 674 0x10000 /* DISP1_DAT_2 */
68 679 0x10000 /* DISP1_DAT_1 */
69 684 0x10000>; /* DISP1_DAT_0 */
70 };
71 };
72};
73
74&cspi {
75 status = "okay";
76};
77
78&i2c2 {
79 codec: sgtl5000@a {
80 compatible = "fsl,sgtl5000";
81 reg = <0x0a>;
82 };
83
84 expander: pca9554@20 {
85 compatible = "pca9554";
86 reg = <0x20>;
87 interrupts = <109>;
88 };
89
90 sensor2: lm75@49 {
91 compatible = "lm75";
92 reg = <0x49>;
93 };
94};
95
96&fec {
97 status = "okay";
98};
99
100&esdhc2 {
101 status = "okay";
102};
103
104&uart3 {
105 status = "okay";
106};
107
108&ecspi1 {
109 status = "okay";
110};
111
112&uart1 {
113 status = "okay";
114};
115
116&uart2 {
117 status = "okay";
118};
119
120&can1 {
121 status = "okay";
122};
123
124&can2 {
125 status = "okay";
126};
127
128&i2c3 {
129 status = "okay";
130};
diff --git a/arch/arm/boot/dts/imx53-qsb.dts b/arch/arm/boot/dts/imx53-qsb.dts
index b0075537195b..05cc5620436b 100644
--- a/arch/arm/boot/dts/imx53-qsb.dts
+++ b/arch/arm/boot/dts/imx53-qsb.dts
@@ -21,200 +21,6 @@
21 reg = <0x70000000 0x40000000>; 21 reg = <0x70000000 0x40000000>;
22 }; 22 };
23 23
24 soc {
25 aips@50000000 { /* AIPS1 */
26 spba@50000000 {
27 esdhc@50004000 { /* ESDHC1 */
28 pinctrl-names = "default";
29 pinctrl-0 = <&pinctrl_esdhc1_1>;
30 cd-gpios = <&gpio3 13 0>;
31 status = "okay";
32 };
33
34 ssi2: ssi@50014000 {
35 fsl,mode = "i2s-slave";
36 status = "okay";
37 };
38
39 esdhc@50020000 { /* ESDHC3 */
40 pinctrl-names = "default";
41 pinctrl-0 = <&pinctrl_esdhc3_1>;
42 cd-gpios = <&gpio3 11 0>;
43 wp-gpios = <&gpio3 12 0>;
44 status = "okay";
45 };
46 };
47
48 iomuxc@53fa8000 {
49 pinctrl-names = "default";
50 pinctrl-0 = <&pinctrl_hog>;
51
52 hog {
53 pinctrl_hog: hoggrp {
54 fsl,pins = <
55 1071 0x80000000 /* MX53_PAD_GPIO_0__CCM_SSI_EXT1_CLK */
56 1141 0x80000000 /* MX53_PAD_GPIO_8__GPIO1_8 */
57 982 0x80000000 /* MX53_PAD_PATA_DATA14__GPIO2_14 */
58 989 0x80000000 /* MX53_PAD_PATA_DATA15__GPIO2_15 */
59 693 0x80000000 /* MX53_PAD_EIM_DA11__GPIO3_11 */
60 697 0x80000000 /* MX53_PAD_EIM_DA12__GPIO3_12 */
61 701 0x80000000 /* MX53_PAD_EIM_DA13__GPIO3_13 */
62 868 0x80000000 /* MX53_PAD_PATA_DA_0__GPIO7_6 */
63 1149 0x80000000 /* MX53_PAD_GPIO_16__GPIO7_11 */
64 >;
65 };
66
67 led_pin_gpio7_7: led_gpio7_7@0 {
68 fsl,pins = <
69 873 0x80000000 /* MX53_PAD_PATA_DA_1__GPIO7_7 */
70 >;
71 };
72 };
73
74 };
75
76 uart1: serial@53fbc000 {
77 pinctrl-names = "default";
78 pinctrl-0 = <&pinctrl_uart1_1>;
79 status = "okay";
80 };
81 };
82
83 aips@60000000 { /* AIPS2 */
84 i2c@63fc4000 { /* I2C2 */
85 pinctrl-names = "default";
86 pinctrl-0 = <&pinctrl_i2c2_1>;
87 status = "okay";
88
89 sgtl5000: codec@0a {
90 compatible = "fsl,sgtl5000";
91 reg = <0x0a>;
92 VDDA-supply = <&reg_3p2v>;
93 VDDIO-supply = <&reg_3p2v>;
94 };
95 };
96
97 i2c@63fc8000 { /* I2C1 */
98 pinctrl-names = "default";
99 pinctrl-0 = <&pinctrl_i2c1_1>;
100 status = "okay";
101
102 accelerometer: mma8450@1c {
103 compatible = "fsl,mma8450";
104 reg = <0x1c>;
105 };
106
107 pmic: dialog@48 {
108 compatible = "dlg,da9053-aa", "dlg,da9052";
109 reg = <0x48>;
110 interrupt-parent = <&gpio7>;
111 interrupts = <11 0x8>; /* low-level active IRQ at GPIO7_11 */
112
113 regulators {
114 buck1_reg: buck1 {
115 regulator-min-microvolt = <500000>;
116 regulator-max-microvolt = <2075000>;
117 regulator-always-on;
118 };
119
120 buck2_reg: buck2 {
121 regulator-min-microvolt = <500000>;
122 regulator-max-microvolt = <2075000>;
123 regulator-always-on;
124 };
125
126 buck3_reg: buck3 {
127 regulator-min-microvolt = <925000>;
128 regulator-max-microvolt = <2500000>;
129 regulator-always-on;
130 };
131
132 buck4_reg: buck4 {
133 regulator-min-microvolt = <925000>;
134 regulator-max-microvolt = <2500000>;
135 regulator-always-on;
136 };
137
138 ldo1_reg: ldo1 {
139 regulator-min-microvolt = <600000>;
140 regulator-max-microvolt = <1800000>;
141 regulator-boot-on;
142 regulator-always-on;
143 };
144
145 ldo2_reg: ldo2 {
146 regulator-min-microvolt = <600000>;
147 regulator-max-microvolt = <1800000>;
148 regulator-always-on;
149 };
150
151 ldo3_reg: ldo3 {
152 regulator-min-microvolt = <600000>;
153 regulator-max-microvolt = <1800000>;
154 regulator-always-on;
155 };
156
157 ldo4_reg: ldo4 {
158 regulator-min-microvolt = <1725000>;
159 regulator-max-microvolt = <3300000>;
160 regulator-always-on;
161 };
162
163 ldo5_reg: ldo5 {
164 regulator-min-microvolt = <1725000>;
165 regulator-max-microvolt = <3300000>;
166 regulator-always-on;
167 };
168
169 ldo6_reg: ldo6 {
170 regulator-min-microvolt = <1200000>;
171 regulator-max-microvolt = <3600000>;
172 regulator-always-on;
173 };
174
175 ldo7_reg: ldo7 {
176 regulator-min-microvolt = <1200000>;
177 regulator-max-microvolt = <3600000>;
178 regulator-always-on;
179 };
180
181 ldo8_reg: ldo8 {
182 regulator-min-microvolt = <1200000>;
183 regulator-max-microvolt = <3600000>;
184 regulator-always-on;
185 };
186
187 ldo9_reg: ldo9 {
188 regulator-min-microvolt = <1200000>;
189 regulator-max-microvolt = <3600000>;
190 regulator-always-on;
191 };
192
193 ldo10_reg: ldo10 {
194 regulator-min-microvolt = <1250000>;
195 regulator-max-microvolt = <3650000>;
196 regulator-always-on;
197 };
198 };
199 };
200 };
201
202 audmux@63fd0000 {
203 pinctrl-names = "default";
204 pinctrl-0 = <&pinctrl_audmux_1>;
205 status = "okay";
206 };
207
208 ethernet@63fec000 {
209 pinctrl-names = "default";
210 pinctrl-0 = <&pinctrl_fec_1>;
211 phy-mode = "rmii";
212 phy-reset-gpios = <&gpio7 6 0>;
213 status = "okay";
214 };
215 };
216 };
217
218 gpio-keys { 24 gpio-keys {
219 compatible = "gpio-keys"; 25 compatible = "gpio-keys";
220 26
@@ -276,3 +82,189 @@
276 mux-ext-port = <5>; 82 mux-ext-port = <5>;
277 }; 83 };
278}; 84};
85
86&esdhc1 {
87 pinctrl-names = "default";
88 pinctrl-0 = <&pinctrl_esdhc1_1>;
89 cd-gpios = <&gpio3 13 0>;
90 status = "okay";
91};
92
93&ssi2 {
94 fsl,mode = "i2s-slave";
95 status = "okay";
96};
97
98&esdhc3 {
99 pinctrl-names = "default";
100 pinctrl-0 = <&pinctrl_esdhc3_1>;
101 cd-gpios = <&gpio3 11 0>;
102 wp-gpios = <&gpio3 12 0>;
103 status = "okay";
104};
105
106&iomuxc {
107 pinctrl-names = "default";
108 pinctrl-0 = <&pinctrl_hog>;
109
110 hog {
111 pinctrl_hog: hoggrp {
112 fsl,pins = <
113 1071 0x80000000 /* MX53_PAD_GPIO_0__CCM_SSI_EXT1_CLK */
114 1141 0x80000000 /* MX53_PAD_GPIO_8__GPIO1_8 */
115 982 0x80000000 /* MX53_PAD_PATA_DATA14__GPIO2_14 */
116 989 0x80000000 /* MX53_PAD_PATA_DATA15__GPIO2_15 */
117 693 0x80000000 /* MX53_PAD_EIM_DA11__GPIO3_11 */
118 697 0x80000000 /* MX53_PAD_EIM_DA12__GPIO3_12 */
119 701 0x80000000 /* MX53_PAD_EIM_DA13__GPIO3_13 */
120 868 0x80000000 /* MX53_PAD_PATA_DA_0__GPIO7_6 */
121 1149 0x80000000 /* MX53_PAD_GPIO_16__GPIO7_11 */
122 >;
123 };
124
125 led_pin_gpio7_7: led_gpio7_7@0 {
126 fsl,pins = <
127 873 0x80000000 /* MX53_PAD_PATA_DA_1__GPIO7_7 */
128 >;
129 };
130 };
131
132};
133
134&uart1 {
135 pinctrl-names = "default";
136 pinctrl-0 = <&pinctrl_uart1_1>;
137 status = "okay";
138};
139
140&i2c2 {
141 pinctrl-names = "default";
142 pinctrl-0 = <&pinctrl_i2c2_1>;
143 status = "okay";
144
145 sgtl5000: codec@0a {
146 compatible = "fsl,sgtl5000";
147 reg = <0x0a>;
148 VDDA-supply = <&reg_3p2v>;
149 VDDIO-supply = <&reg_3p2v>;
150 };
151};
152
153&i2c1 {
154 pinctrl-names = "default";
155 pinctrl-0 = <&pinctrl_i2c1_1>;
156 status = "okay";
157
158 accelerometer: mma8450@1c {
159 compatible = "fsl,mma8450";
160 reg = <0x1c>;
161 };
162
163 pmic: dialog@48 {
164 compatible = "dlg,da9053-aa", "dlg,da9052";
165 reg = <0x48>;
166 interrupt-parent = <&gpio7>;
167 interrupts = <11 0x8>; /* low-level active IRQ at GPIO7_11 */
168
169 regulators {
170 buck1_reg: buck1 {
171 regulator-min-microvolt = <500000>;
172 regulator-max-microvolt = <2075000>;
173 regulator-always-on;
174 };
175
176 buck2_reg: buck2 {
177 regulator-min-microvolt = <500000>;
178 regulator-max-microvolt = <2075000>;
179 regulator-always-on;
180 };
181
182 buck3_reg: buck3 {
183 regulator-min-microvolt = <925000>;
184 regulator-max-microvolt = <2500000>;
185 regulator-always-on;
186 };
187
188 buck4_reg: buck4 {
189 regulator-min-microvolt = <925000>;
190 regulator-max-microvolt = <2500000>;
191 regulator-always-on;
192 };
193
194 ldo1_reg: ldo1 {
195 regulator-min-microvolt = <600000>;
196 regulator-max-microvolt = <1800000>;
197 regulator-boot-on;
198 regulator-always-on;
199 };
200
201 ldo2_reg: ldo2 {
202 regulator-min-microvolt = <600000>;
203 regulator-max-microvolt = <1800000>;
204 regulator-always-on;
205 };
206
207 ldo3_reg: ldo3 {
208 regulator-min-microvolt = <600000>;
209 regulator-max-microvolt = <1800000>;
210 regulator-always-on;
211 };
212
213 ldo4_reg: ldo4 {
214 regulator-min-microvolt = <1725000>;
215 regulator-max-microvolt = <3300000>;
216 regulator-always-on;
217 };
218
219 ldo5_reg: ldo5 {
220 regulator-min-microvolt = <1725000>;
221 regulator-max-microvolt = <3300000>;
222 regulator-always-on;
223 };
224
225 ldo6_reg: ldo6 {
226 regulator-min-microvolt = <1200000>;
227 regulator-max-microvolt = <3600000>;
228 regulator-always-on;
229 };
230
231 ldo7_reg: ldo7 {
232 regulator-min-microvolt = <1200000>;
233 regulator-max-microvolt = <3600000>;
234 regulator-always-on;
235 };
236
237 ldo8_reg: ldo8 {
238 regulator-min-microvolt = <1200000>;
239 regulator-max-microvolt = <3600000>;
240 regulator-always-on;
241 };
242
243 ldo9_reg: ldo9 {
244 regulator-min-microvolt = <1200000>;
245 regulator-max-microvolt = <3600000>;
246 regulator-always-on;
247 };
248
249 ldo10_reg: ldo10 {
250 regulator-min-microvolt = <1250000>;
251 regulator-max-microvolt = <3650000>;
252 regulator-always-on;
253 };
254 };
255 };
256};
257
258&audmux {
259 pinctrl-names = "default";
260 pinctrl-0 = <&pinctrl_audmux_1>;
261 status = "okay";
262};
263
264&fec {
265 pinctrl-names = "default";
266 pinctrl-0 = <&pinctrl_fec_1>;
267 phy-mode = "rmii";
268 phy-reset-gpios = <&gpio7 6 0>;
269 status = "okay";
270};
diff --git a/arch/arm/boot/dts/imx53-smd.dts b/arch/arm/boot/dts/imx53-smd.dts
index 06c68580c842..995554c324b8 100644
--- a/arch/arm/boot/dts/imx53-smd.dts
+++ b/arch/arm/boot/dts/imx53-smd.dts
@@ -21,157 +21,6 @@
21 reg = <0x70000000 0x40000000>; 21 reg = <0x70000000 0x40000000>;
22 }; 22 };
23 23
24 soc {
25 aips@50000000 { /* AIPS1 */
26 spba@50000000 {
27 esdhc@50004000 { /* ESDHC1 */
28 pinctrl-names = "default";
29 pinctrl-0 = <&pinctrl_esdhc1_1>;
30 cd-gpios = <&gpio3 13 0>;
31 wp-gpios = <&gpio4 11 0>;
32 status = "okay";
33 };
34
35 esdhc@50008000 { /* ESDHC2 */
36 pinctrl-names = "default";
37 pinctrl-0 = <&pinctrl_esdhc2_1>;
38 non-removable;
39 status = "okay";
40 };
41
42 uart3: serial@5000c000 {
43 pinctrl-names = "default";
44 pinctrl-0 = <&pinctrl_uart3_1>;
45 fsl,uart-has-rtscts;
46 status = "okay";
47 };
48
49 ecspi@50010000 { /* ECSPI1 */
50 pinctrl-names = "default";
51 pinctrl-0 = <&pinctrl_ecspi1_1>;
52 fsl,spi-num-chipselects = <2>;
53 cs-gpios = <&gpio2 30 0>, <&gpio3 19 0>;
54 status = "okay";
55
56 zigbee: mc1323@0 {
57 compatible = "fsl,mc1323";
58 spi-max-frequency = <8000000>;
59 reg = <0>;
60 };
61
62 flash: m25p32@1 {
63 #address-cells = <1>;
64 #size-cells = <1>;
65 compatible = "st,m25p32", "st,m25p";
66 spi-max-frequency = <20000000>;
67 reg = <1>;
68
69 partition@0 {
70 label = "U-Boot";
71 reg = <0x0 0x40000>;
72 read-only;
73 };
74
75 partition@40000 {
76 label = "Kernel";
77 reg = <0x40000 0x3c0000>;
78 };
79 };
80 };
81
82 esdhc@50020000 { /* ESDHC3 */
83 pinctrl-names = "default";
84 pinctrl-0 = <&pinctrl_esdhc3_1>;
85 non-removable;
86 status = "okay";
87 };
88 };
89
90 iomuxc@53fa8000 {
91 pinctrl-names = "default";
92 pinctrl-0 = <&pinctrl_hog>;
93
94 hog {
95 pinctrl_hog: hoggrp {
96 fsl,pins = <
97 982 0x80000000 /* MX53_PAD_PATA_DATA14__GPIO2_14 */
98 989 0x80000000 /* MX53_PAD_PATA_DATA15__GPIO2_15 */
99 424 0x80000000 /* MX53_PAD_EIM_EB2__GPIO2_30 */
100 701 0x80000000 /* MX53_PAD_EIM_DA13__GPIO3_13 */
101 449 0x80000000 /* MX53_PAD_EIM_D19__GPIO3_19 */
102 43 0x80000000 /* MX53_PAD_KEY_ROW2__GPIO4_11 */
103 868 0x80000000 /* MX53_PAD_PATA_DA_0__GPIO7_6 */
104 >;
105 };
106 };
107 };
108
109 uart1: serial@53fbc000 {
110 pinctrl-names = "default";
111 pinctrl-0 = <&pinctrl_uart1_1>;
112 status = "okay";
113 };
114
115 uart2: serial@53fc0000 {
116 pinctrl-names = "default";
117 pinctrl-0 = <&pinctrl_uart2_1>;
118 status = "okay";
119 };
120 };
121
122 aips@60000000 { /* AIPS2 */
123 i2c@63fc4000 { /* I2C2 */
124 pinctrl-names = "default";
125 pinctrl-0 = <&pinctrl_i2c2_1>;
126 status = "okay";
127
128 codec: sgtl5000@0a {
129 compatible = "fsl,sgtl5000";
130 reg = <0x0a>;
131 };
132
133 magnetometer: mag3110@0e {
134 compatible = "fsl,mag3110";
135 reg = <0x0e>;
136 };
137
138 touchkey: mpr121@5a {
139 compatible = "fsl,mpr121";
140 reg = <0x5a>;
141 };
142 };
143
144 i2c@63fc8000 { /* I2C1 */
145 pinctrl-names = "default";
146 pinctrl-0 = <&pinctrl_i2c1_1>;
147 status = "okay";
148
149 accelerometer: mma8450@1c {
150 compatible = "fsl,mma8450";
151 reg = <0x1c>;
152 };
153
154 camera: ov5642@3c {
155 compatible = "ovti,ov5642";
156 reg = <0x3c>;
157 };
158
159 pmic: dialog@48 {
160 compatible = "dialog,da9053", "dialog,da9052";
161 reg = <0x48>;
162 };
163 };
164
165 ethernet@63fec000 {
166 pinctrl-names = "default";
167 pinctrl-0 = <&pinctrl_fec_1>;
168 phy-mode = "rmii";
169 phy-reset-gpios = <&gpio7 6 0>;
170 status = "okay";
171 };
172 };
173 };
174
175 gpio-keys { 24 gpio-keys {
176 compatible = "gpio-keys"; 25 compatible = "gpio-keys";
177 26
@@ -188,3 +37,146 @@
188 }; 37 };
189 }; 38 };
190}; 39};
40
41&esdhc1 {
42 pinctrl-names = "default";
43 pinctrl-0 = <&pinctrl_esdhc1_1>;
44 cd-gpios = <&gpio3 13 0>;
45 wp-gpios = <&gpio4 11 0>;
46 status = "okay";
47};
48
49&esdhc2 {
50 pinctrl-names = "default";
51 pinctrl-0 = <&pinctrl_esdhc2_1>;
52 non-removable;
53 status = "okay";
54};
55
56&uart3 {
57 pinctrl-names = "default";
58 pinctrl-0 = <&pinctrl_uart3_1>;
59 fsl,uart-has-rtscts;
60 status = "okay";
61};
62
63&ecspi1 {
64 pinctrl-names = "default";
65 pinctrl-0 = <&pinctrl_ecspi1_1>;
66 fsl,spi-num-chipselects = <2>;
67 cs-gpios = <&gpio2 30 0>, <&gpio3 19 0>;
68 status = "okay";
69
70 zigbee: mc1323@0 {
71 compatible = "fsl,mc1323";
72 spi-max-frequency = <8000000>;
73 reg = <0>;
74 };
75
76 flash: m25p32@1 {
77 #address-cells = <1>;
78 #size-cells = <1>;
79 compatible = "st,m25p32", "st,m25p";
80 spi-max-frequency = <20000000>;
81 reg = <1>;
82
83 partition@0 {
84 label = "U-Boot";
85 reg = <0x0 0x40000>;
86 read-only;
87 };
88
89 partition@40000 {
90 label = "Kernel";
91 reg = <0x40000 0x3c0000>;
92 };
93 };
94};
95
96&esdhc3 {
97 pinctrl-names = "default";
98 pinctrl-0 = <&pinctrl_esdhc3_1>;
99 non-removable;
100 status = "okay";
101};
102
103&iomuxc {
104 pinctrl-names = "default";
105 pinctrl-0 = <&pinctrl_hog>;
106
107 hog {
108 pinctrl_hog: hoggrp {
109 fsl,pins = <
110 982 0x80000000 /* MX53_PAD_PATA_DATA14__GPIO2_14 */
111 989 0x80000000 /* MX53_PAD_PATA_DATA15__GPIO2_15 */
112 424 0x80000000 /* MX53_PAD_EIM_EB2__GPIO2_30 */
113 701 0x80000000 /* MX53_PAD_EIM_DA13__GPIO3_13 */
114 449 0x80000000 /* MX53_PAD_EIM_D19__GPIO3_19 */
115 43 0x80000000 /* MX53_PAD_KEY_ROW2__GPIO4_11 */
116 868 0x80000000 /* MX53_PAD_PATA_DA_0__GPIO7_6 */
117 >;
118 };
119 };
120};
121
122&uart1 {
123 pinctrl-names = "default";
124 pinctrl-0 = <&pinctrl_uart1_1>;
125 status = "okay";
126};
127
128&uart2 {
129 pinctrl-names = "default";
130 pinctrl-0 = <&pinctrl_uart2_1>;
131 status = "okay";
132};
133
134&i2c2 {
135 pinctrl-names = "default";
136 pinctrl-0 = <&pinctrl_i2c2_1>;
137 status = "okay";
138
139 codec: sgtl5000@0a {
140 compatible = "fsl,sgtl5000";
141 reg = <0x0a>;
142 };
143
144 magnetometer: mag3110@0e {
145 compatible = "fsl,mag3110";
146 reg = <0x0e>;
147 };
148
149 touchkey: mpr121@5a {
150 compatible = "fsl,mpr121";
151 reg = <0x5a>;
152 };
153};
154
155&i2c1 {
156 pinctrl-names = "default";
157 pinctrl-0 = <&pinctrl_i2c1_1>;
158 status = "okay";
159
160 accelerometer: mma8450@1c {
161 compatible = "fsl,mma8450";
162 reg = <0x1c>;
163 };
164
165 camera: ov5642@3c {
166 compatible = "ovti,ov5642";
167 reg = <0x3c>;
168 };
169
170 pmic: dialog@48 {
171 compatible = "dialog,da9053", "dialog,da9052";
172 reg = <0x48>;
173 };
174};
175
176&fec {
177 pinctrl-names = "default";
178 pinctrl-0 = <&pinctrl_fec_1>;
179 phy-mode = "rmii";
180 phy-reset-gpios = <&gpio7 6 0>;
181 status = "okay";
182};
diff --git a/arch/arm/boot/dts/imx53-tqma53.dtsi b/arch/arm/boot/dts/imx53-tqma53.dtsi
new file mode 100644
index 000000000000..8278ec5ec222
--- /dev/null
+++ b/arch/arm/boot/dts/imx53-tqma53.dtsi
@@ -0,0 +1,172 @@
1/*
2 * Copyright 2012 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
3 * Copyright 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de>, Pengutronix
4 *
5 * The code contained herein is licensed under the GNU General Public
6 * License. You may obtain a copy of the GNU General Public License
7 * Version 2 or later at the following locations:
8 *
9 * http://www.opensource.org/licenses/gpl-license.html
10 * http://www.gnu.org/copyleft/gpl.html
11 */
12
13/include/ "imx53.dtsi"
14
15/ {
16 model = "TQ TQMa53";
17 compatible = "tq,tqma53", "fsl,imx53";
18
19 memory {
20 reg = <0x70000000 0x40000000>; /* Up to 1GiB */
21 };
22
23 regulators {
24 compatible = "simple-bus";
25
26 reg_3p3v: 3p3v {
27 compatible = "regulator-fixed";
28 regulator-name = "3P3V";
29 regulator-min-microvolt = <3300000>;
30 regulator-max-microvolt = <3300000>;
31 regulator-always-on;
32 };
33 };
34};
35
36&esdhc2 {
37 pinctrl-names = "default";
38 pinctrl-0 = <&pinctrl_esdhc2_1>;
39 wp-gpios = <&gpio1 2 0>;
40 cd-gpios = <&gpio1 4 0>;
41 status = "disabled";
42};
43
44&uart3 {
45 pinctrl-names = "default";
46 pinctrl-0 = <&pinctrl_uart3_2>;
47 status = "disabled";
48};
49
50&ecspi1 {
51 pinctrl-names = "default";
52 pinctrl-0 = <&pinctrl_ecspi1_1>;
53 fsl,spi-num-chipselects = <4>;
54 cs-gpios = <&gpio2 30 0>, <&gpio3 19 0>,
55 <&gpio3 24 0>, <&gpio3 25 0>;
56 status = "disabled";
57};
58
59&esdhc3 { /* EMMC */
60 pinctrl-names = "default";
61 pinctrl-0 = <&pinctrl_esdhc3_1>;
62 vmmc-supply = <&reg_3p3v>;
63 non-removable;
64 bus-width = <8>;
65 status = "okay";
66};
67
68&iomuxc {
69 pinctrl-names = "default";
70 pinctrl-0 = <&pinctrl_hog>;
71
72 i2s {
73 pinctrl_i2s_1: i2s-grp1 {
74 fsl,pins = <
75 1 0x10000 /* I2S_MCLK */
76 10 0x10000 /* I2S_SCLK */
77 17 0x10000 /* I2S_DOUT */
78 23 0x10000 /* I2S_LRCLK*/
79 30 0x10000 /* I2S_DIN */
80 >;
81 };
82 };
83
84 hog {
85 pinctrl_hog: hoggrp {
86 fsl,pins = <
87 610 0x10000 /* MX53_PAD_EIM_CS1__IPU_DI1_PIN6 (VSYNC)*/
88 711 0x10000 /* MX53_PAD_EIM_DA15__IPU_DI1_PIN4 (HSYNC)*/
89 873 0x10000 /* MX53_PAD_PATA_DA_1__GPIO7_7 (LCD_BLT_EN)*/
90 878 0x10000 /* MX53_PAD_PATA_DA_2__GPIO7_8 (LCD_RESET)*/
91 922 0x10000 /* MX53_PAD_PATA_DATA5__GPIO2_5 (LCD_POWER)*/
92 928 0x10000 /* MX53_PAD_PATA_DATA6__GPIO2_6 (PMIC_INT)*/
93 982 0x10000 /* MX53_PAD_PATA_DATA14__GPIO2_14 (CSI_RST)*/
94 989 0x10000 /* MX53_PAD_PATA_DATA15__GPIO2_15 (CSI_PWDN)*/
95 1069 0x10000 /* MX53_PAD_GPIO_0__GPIO1_0 (SYSTEM_DOWN)*/
96 1093 0x10000 /* MX53_PAD_GPIO_3__GPIO1_3 */
97 >;
98 };
99 };
100};
101
102&uart1 {
103 pinctrl-names = "default";
104 pinctrl-0 = <&pinctrl_uart1_2>;
105 fsl,uart-has-rtscts;
106 status = "disabled";
107};
108
109&uart2 {
110 pinctrl-names = "default";
111 pinctrl-0 = <&pinctrl_uart2_1>;
112 status = "disabled";
113};
114
115&can1 {
116 pinctrl-names = "default";
117 pinctrl-0 = <&pinctrl_can1_2>;
118 status = "disabled";
119};
120
121&can2 {
122 pinctrl-names = "default";
123 pinctrl-0 = <&pinctrl_can2_1>;
124 status = "disabled";
125};
126
127&i2c3 {
128 pinctrl-names = "default";
129 pinctrl-0 = <&pinctrl_i2c3_1>;
130 status = "disabled";
131};
132
133&cspi {
134 pinctrl-names = "default";
135 pinctrl-0 = <&pinctrl_cspi_1>;
136 fsl,spi-num-chipselects = <3>;
137 cs-gpios = <&gpio1 18 0>, <&gpio1 19 0>,
138 <&gpio1 21 0>;
139 status = "disabled";
140};
141
142&i2c2 {
143 pinctrl-names = "default";
144 pinctrl-0 = <&pinctrl_i2c2_1>;
145 status = "okay";
146
147 pmic: mc34708@8 {
148 compatible = "fsl,mc34708";
149 reg = <0x8>;
150 fsl,mc13xxx-uses-rtc;
151 interrupt-parent = <&gpio2>;
152 interrupts = <6 8>; /* PDATA_DATA6, low active */
153 };
154
155 sensor1: lm75@48 {
156 compatible = "lm75";
157 reg = <0x48>;
158 };
159
160 eeprom: 24c64@50 {
161 compatible = "at,24c64";
162 pagesize = <32>;
163 reg = <0x50>;
164 };
165};
166
167&fec {
168 pinctrl-names = "default";
169 pinctrl-0 = <&pinctrl_fec_1>;
170 phy-mode = "rmii";
171 status = "disabled";
172};
diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi
index edc3f1eb6699..d05aa215c7f9 100644
--- a/arch/arm/boot/dts/imx53.dtsi
+++ b/arch/arm/boot/dts/imx53.dtsi
@@ -274,6 +274,44 @@
274 }; 274 };
275 }; 275 };
276 276
277 csi {
278 pinctrl_csi_1: csigrp-1 {
279 fsl,pins = <
280 286 0x1d5 /* MX53_PAD_CSI0_DATA_EN__IPU_CSI0_DATA_EN */
281 291 0x1d5 /* MX53_PAD_CSI0_VSYNC__IPU_CSI0_VSYNC */
282 280 0x1d5 /* MX53_PAD_CSI0_MCLK__IPU_CSI0_HSYNC */
283 276 0x1d5 /* MX53_PAD_CSI0_PIXCLK__IPU_CSI0_PIXCLK */
284 409 0x1d5 /* MX53_PAD_CSI0_DAT19__IPU_CSI0_D_19 */
285 402 0x1d5 /* MX53_PAD_CSI0_DAT18__IPU_CSI0_D_18 */
286 395 0x1d5 /* MX53_PAD_CSI0_DAT17__IPU_CSI0_D_17 */
287 388 0x1d5 /* MX53_PAD_CSI0_DAT16__IPU_CSI0_D_16 */
288 381 0x1d5 /* MX53_PAD_CSI0_DAT15__IPU_CSI0_D_15 */
289 374 0x1d5 /* MX53_PAD_CSI0_DAT14__IPU_CSI0_D_14 */
290 367 0x1d5 /* MX53_PAD_CSI0_DAT13__IPU_CSI0_D_13 */
291 360 0x1d5 /* MX53_PAD_CSI0_DAT12__IPU_CSI0_D_12 */
292 352 0x1d5 /* MX53_PAD_CSI0_DAT11__IPU_CSI0_D_11 */
293 344 0x1d5 /* MX53_PAD_CSI0_DAT10__IPU_CSI0_D_10 */
294 336 0x1d5 /* MX53_PAD_CSI0_DAT9__IPU_CSI0_D_9 */
295 328 0x1d5 /* MX53_PAD_CSI0_DAT8__IPU_CSI0_D_8 */
296 320 0x1d5 /* MX53_PAD_CSI0_DAT7__IPU_CSI0_D_7 */
297 312 0x1d5 /* MX53_PAD_CSI0_DAT6__IPU_CSI0_D_6 */
298 304 0x1d5 /* MX53_PAD_CSI0_DAT5__IPU_CSI0_D_5 */
299 296 0x1d5 /* MX53_PAD_CSI0_DAT4__IPU_CSI0_D_4 */
300 276 0x1d5 /* MX53_PAD_CSI0_PIXCLK__IPU_CSI0_PIXCLK */
301 >;
302 };
303 };
304
305 cspi {
306 pinctrl_cspi_1: cspigrp-1 {
307 fsl,pins = <
308 998 0x1d5 /* MX53_PAD_SD1_DATA0__CSPI_MISO */
309 1008 0x1d5 /* MX53_PAD_SD1_CMD__CSPI_MOSI */
310 1022 0x1d5 /* MX53_PAD_SD1_CLK__CSPI_SCLK */
311 >;
312 };
313 };
314
277 ecspi1 { 315 ecspi1 {
278 pinctrl_ecspi1_1: ecspi1grp-1 { 316 pinctrl_ecspi1_1: ecspi1grp-1 {
279 fsl,pins = < 317 fsl,pins = <
@@ -349,6 +387,13 @@
349 853 0x80000000 /* MX53_PAD_PATA_DIOR__CAN1_RXCAN */ 387 853 0x80000000 /* MX53_PAD_PATA_DIOR__CAN1_RXCAN */
350 >; 388 >;
351 }; 389 };
390
391 pinctrl_can1_2: can1grp-2 {
392 fsl,pins = <
393 37 0x80000000 /* MX53_PAD_KEY_COL2__CAN1_TXCAN */
394 44 0x80000000 /* MX53_PAD_KEY_ROW2__CAN1_RXCAN */
395 >;
396 };
352 }; 397 };
353 398
354 can2 { 399 can2 {
@@ -387,6 +432,14 @@
387 }; 432 };
388 }; 433 };
389 434
435 owire {
436 pinctrl_owire_1: owiregrp-1 {
437 fsl,pins = <
438 1166 0x80000000 /* MX53_PAD_GPIO_18__OWIRE_LINE */
439 >;
440 };
441 };
442
390 uart1 { 443 uart1 {
391 pinctrl_uart1_1: uart1grp-1 { 444 pinctrl_uart1_1: uart1grp-1 {
392 fsl,pins = < 445 fsl,pins = <
@@ -421,6 +474,14 @@
421 880 0x1c5 /* MX53_PAD_PATA_DA_2__UART3_RTS */ 474 880 0x1c5 /* MX53_PAD_PATA_DA_2__UART3_RTS */
422 >; 475 >;
423 }; 476 };
477
478 pinctrl_uart3_2: uart3grp-2 {
479 fsl,pins = <
480 884 0x1c5 /* MX53_PAD_PATA_CS_0__UART3_TXD_MUX */
481 888 0x1c5 /* MX53_PAD_PATA_CS_1__UART3_RXD_MUX */
482 >;
483 };
484
424 }; 485 };
425 486
426 uart4 { 487 uart4 {
@@ -570,6 +631,13 @@
570 status = "disabled"; 631 status = "disabled";
571 }; 632 };
572 633
634 owire: owire@63fa4000 {
635 compatible = "fsl,imx53-owire", "fsl,imx21-owire";
636 reg = <0x63fa4000 0x4000>;
637 clocks = <&clks 159>;
638 status = "disabled";
639 };
640
573 ecspi2: ecspi@63fac000 { 641 ecspi2: ecspi@63fac000 {
574 #address-cells = <1>; 642 #address-cells = <1>;
575 #size-cells = <0>; 643 #size-cells = <0>;
diff --git a/arch/arm/boot/dts/imx6dl.dtsi b/arch/arm/boot/dts/imx6dl.dtsi
new file mode 100644
index 000000000000..63fafe2a606c
--- /dev/null
+++ b/arch/arm/boot/dts/imx6dl.dtsi
@@ -0,0 +1,59 @@
1/*
2 * Copyright 2013 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 version 2 as
6 * published by the Free Software Foundation.
7 *
8 */
9
10/include/ "imx6qdl.dtsi"
11
12/ {
13 cpus {
14 #address-cells = <1>;
15 #size-cells = <0>;
16
17 cpu@0 {
18 compatible = "arm,cortex-a9";
19 reg = <0>;
20 next-level-cache = <&L2>;
21 };
22
23 cpu@1 {
24 compatible = "arm,cortex-a9";
25 reg = <1>;
26 next-level-cache = <&L2>;
27 };
28 };
29
30 soc {
31 aips1: aips-bus@02000000 {
32 pxp: pxp@020f0000 {
33 reg = <0x020f0000 0x4000>;
34 interrupts = <0 98 0x04>;
35 };
36
37 epdc: epdc@020f4000 {
38 reg = <0x020f4000 0x4000>;
39 interrupts = <0 97 0x04>;
40 };
41
42 lcdif: lcdif@020f8000 {
43 reg = <0x020f8000 0x4000>;
44 interrupts = <0 39 0x04>;
45 };
46 };
47
48 aips2: aips-bus@02100000 {
49 i2c4: i2c@021f8000 {
50 #address-cells = <1>;
51 #size-cells = <0>;
52 compatible = "fsl,imx1-i2c";
53 reg = <0x021f8000 0x4000>;
54 interrupts = <0 35 0x04>;
55 status = "disabled";
56 };
57 };
58 };
59};
diff --git a/arch/arm/boot/dts/imx6q-arm2.dts b/arch/arm/boot/dts/imx6q-arm2.dts
index 5bfa02a3f85c..53eb241fa5ad 100644
--- a/arch/arm/boot/dts/imx6q-arm2.dts
+++ b/arch/arm/boot/dts/imx6q-arm2.dts
@@ -21,71 +21,6 @@
21 reg = <0x10000000 0x80000000>; 21 reg = <0x10000000 0x80000000>;
22 }; 22 };
23 23
24 soc {
25 gpmi-nand@00112000 {
26 pinctrl-names = "default";
27 pinctrl-0 = <&pinctrl_gpmi_nand_1>;
28 status = "disabled"; /* gpmi nand conflicts with SD */
29 };
30
31 aips-bus@02000000 { /* AIPS1 */
32 iomuxc@020e0000 {
33 pinctrl-names = "default";
34 pinctrl-0 = <&pinctrl_hog>;
35
36 hog {
37 pinctrl_hog: hoggrp {
38 fsl,pins = <
39 176 0x80000000 /* MX6Q_PAD_EIM_D25__GPIO_3_25 */
40 >;
41 };
42 };
43
44 arm2 {
45 pinctrl_usdhc3_arm2: usdhc3grp-arm2 {
46 fsl,pins = <
47 1363 0x80000000 /* MX6Q_PAD_NANDF_CS0__GPIO_6_11 */
48 1369 0x80000000 /* MX6Q_PAD_NANDF_CS1__GPIO_6_14 */
49 >;
50 };
51 };
52 };
53 };
54
55 aips-bus@02100000 { /* AIPS2 */
56 ethernet@02188000 {
57 pinctrl-names = "default";
58 pinctrl-0 = <&pinctrl_enet_2>;
59 phy-mode = "rgmii";
60 status = "okay";
61 };
62
63 usdhc@02198000 { /* uSDHC3 */
64 cd-gpios = <&gpio6 11 0>;
65 wp-gpios = <&gpio6 14 0>;
66 vmmc-supply = <&reg_3p3v>;
67 pinctrl-names = "default";
68 pinctrl-0 = <&pinctrl_usdhc3_1
69 &pinctrl_usdhc3_arm2>;
70 status = "okay";
71 };
72
73 usdhc@0219c000 { /* uSDHC4 */
74 non-removable;
75 vmmc-supply = <&reg_3p3v>;
76 pinctrl-names = "default";
77 pinctrl-0 = <&pinctrl_usdhc4_1>;
78 status = "okay";
79 };
80
81 uart4: serial@021f0000 {
82 pinctrl-names = "default";
83 pinctrl-0 = <&pinctrl_uart4_1>;
84 status = "okay";
85 };
86 };
87 };
88
89 regulators { 24 regulators {
90 compatible = "simple-bus"; 25 compatible = "simple-bus";
91 26
@@ -108,3 +43,62 @@
108 }; 43 };
109 }; 44 };
110}; 45};
46
47&gpmi {
48 pinctrl-names = "default";
49 pinctrl-0 = <&pinctrl_gpmi_nand_1>;
50 status = "disabled"; /* gpmi nand conflicts with SD */
51};
52
53&iomuxc {
54 pinctrl-names = "default";
55 pinctrl-0 = <&pinctrl_hog>;
56
57 hog {
58 pinctrl_hog: hoggrp {
59 fsl,pins = <
60 176 0x80000000 /* MX6Q_PAD_EIM_D25__GPIO_3_25 */
61 >;
62 };
63 };
64
65 arm2 {
66 pinctrl_usdhc3_arm2: usdhc3grp-arm2 {
67 fsl,pins = <
68 1363 0x80000000 /* MX6Q_PAD_NANDF_CS0__GPIO_6_11 */
69 1369 0x80000000 /* MX6Q_PAD_NANDF_CS1__GPIO_6_14 */
70 >;
71 };
72 };
73};
74
75&fec {
76 pinctrl-names = "default";
77 pinctrl-0 = <&pinctrl_enet_2>;
78 phy-mode = "rgmii";
79 status = "okay";
80};
81
82&usdhc3 {
83 cd-gpios = <&gpio6 11 0>;
84 wp-gpios = <&gpio6 14 0>;
85 vmmc-supply = <&reg_3p3v>;
86 pinctrl-names = "default";
87 pinctrl-0 = <&pinctrl_usdhc3_1
88 &pinctrl_usdhc3_arm2>;
89 status = "okay";
90};
91
92&usdhc4 {
93 non-removable;
94 vmmc-supply = <&reg_3p3v>;
95 pinctrl-names = "default";
96 pinctrl-0 = <&pinctrl_usdhc4_1>;
97 status = "okay";
98};
99
100&uart4 {
101 pinctrl-names = "default";
102 pinctrl-0 = <&pinctrl_uart4_1>;
103 status = "okay";
104};
diff --git a/arch/arm/boot/dts/imx6q-sabreauto.dts b/arch/arm/boot/dts/imx6q-sabreauto.dts
index 826e4ad1477e..656d489122fe 100644
--- a/arch/arm/boot/dts/imx6q-sabreauto.dts
+++ b/arch/arm/boot/dts/imx6q-sabreauto.dts
@@ -20,45 +20,39 @@
20 memory { 20 memory {
21 reg = <0x10000000 0x80000000>; 21 reg = <0x10000000 0x80000000>;
22 }; 22 };
23};
23 24
24 soc { 25&iomuxc {
25 aips-bus@02000000 { /* AIPS1 */ 26 pinctrl-names = "default";
26 iomuxc@020e0000 { 27 pinctrl-0 = <&pinctrl_hog>;
27 pinctrl-names = "default";
28 pinctrl-0 = <&pinctrl_hog>;
29 28
30 hog { 29 hog {
31 pinctrl_hog: hoggrp { 30 pinctrl_hog: hoggrp {
32 fsl,pins = < 31 fsl,pins = <
33 1376 0x80000000 /* MX6Q_PAD_NANDF_CS2__GPIO_6_15 */ 32 1376 0x80000000 /* MX6Q_PAD_NANDF_CS2__GPIO_6_15 */
34 13 0x80000000 /* MX6Q_PAD_SD2_DAT2__GPIO_1_13 */ 33 13 0x80000000 /* MX6Q_PAD_SD2_DAT2__GPIO_1_13 */
35 >; 34 >;
36 };
37 };
38 };
39 }; 35 };
36 };
37};
40 38
41 aips-bus@02100000 { /* AIPS2 */ 39&uart4 {
42 uart4: serial@021f0000 { 40 pinctrl-names = "default";
43 pinctrl-names = "default"; 41 pinctrl-0 = <&pinctrl_uart4_1>;
44 pinctrl-0 = <&pinctrl_uart4_1>; 42 status = "okay";
45 status = "okay"; 43};
46 };
47 44
48 ethernet@02188000 { 45&fec {
49 pinctrl-names = "default"; 46 pinctrl-names = "default";
50 pinctrl-0 = <&pinctrl_enet_2>; 47 pinctrl-0 = <&pinctrl_enet_2>;
51 phy-mode = "rgmii"; 48 phy-mode = "rgmii";
52 status = "okay"; 49 status = "okay";
53 }; 50};
54 51
55 usdhc@02198000 { /* uSDHC3 */ 52&usdhc3 {
56 pinctrl-names = "default"; 53 pinctrl-names = "default";
57 pinctrl-0 = <&pinctrl_usdhc3_1>; 54 pinctrl-0 = <&pinctrl_usdhc3_1>;
58 cd-gpios = <&gpio6 15 0>; 55 cd-gpios = <&gpio6 15 0>;
59 wp-gpios = <&gpio1 13 0>; 56 wp-gpios = <&gpio1 13 0>;
60 status = "okay"; 57 status = "okay";
61 };
62 };
63 };
64}; 58};
diff --git a/arch/arm/boot/dts/imx6q-sabrelite.dts b/arch/arm/boot/dts/imx6q-sabrelite.dts
index d152328285a1..2ce355cd05e5 100644
--- a/arch/arm/boot/dts/imx6q-sabrelite.dts
+++ b/arch/arm/boot/dts/imx6q-sabrelite.dts
@@ -21,118 +21,6 @@
21 reg = <0x10000000 0x40000000>; 21 reg = <0x10000000 0x40000000>;
22 }; 22 };
23 23
24 soc {
25 aips-bus@02000000 { /* AIPS1 */
26 spba-bus@02000000 {
27 ecspi@02008000 { /* eCSPI1 */
28 fsl,spi-num-chipselects = <1>;
29 cs-gpios = <&gpio3 19 0>;
30 pinctrl-names = "default";
31 pinctrl-0 = <&pinctrl_ecspi1_1>;
32 status = "okay";
33
34 flash: m25p80@0 {
35 compatible = "sst,sst25vf016b";
36 spi-max-frequency = <20000000>;
37 reg = <0>;
38 };
39 };
40
41 ssi1: ssi@02028000 {
42 fsl,mode = "i2s-slave";
43 status = "okay";
44 };
45 };
46
47 iomuxc@020e0000 {
48 pinctrl-names = "default";
49 pinctrl-0 = <&pinctrl_hog>;
50
51 hog {
52 pinctrl_hog: hoggrp {
53 fsl,pins = <
54 1450 0x80000000 /* MX6Q_PAD_NANDF_D6__GPIO_2_6 */
55 1458 0x80000000 /* MX6Q_PAD_NANDF_D7__GPIO_2_7 */
56 121 0x80000000 /* MX6Q_PAD_EIM_D19__GPIO_3_19 */
57 144 0x80000000 /* MX6Q_PAD_EIM_D22__GPIO_3_22 */
58 152 0x80000000 /* MX6Q_PAD_EIM_D23__GPIO_3_23 */
59 1262 0x80000000 /* MX6Q_PAD_SD3_DAT5__GPIO_7_0 */
60 1270 0x1f0b0 /* MX6Q_PAD_SD3_DAT4__GPIO_7_1 */
61 953 0x80000000 /* MX6Q_PAD_GPIO_0__CCM_CLKO */
62 >;
63 };
64 };
65 };
66 };
67
68 aips-bus@02100000 { /* AIPS2 */
69 usb@02184000 { /* USB OTG */
70 vbus-supply = <&reg_usb_otg_vbus>;
71 pinctrl-names = "default";
72 pinctrl-0 = <&pinctrl_usbotg_1>;
73 disable-over-current;
74 status = "okay";
75 };
76
77 usb@02184200 { /* USB1 */
78 status = "okay";
79 };
80
81 ethernet@02188000 {
82 pinctrl-names = "default";
83 pinctrl-0 = <&pinctrl_enet_1>;
84 phy-mode = "rgmii";
85 phy-reset-gpios = <&gpio3 23 0>;
86 status = "okay";
87 };
88
89 usdhc@02198000 { /* uSDHC3 */
90 pinctrl-names = "default";
91 pinctrl-0 = <&pinctrl_usdhc3_2>;
92 cd-gpios = <&gpio7 0 0>;
93 wp-gpios = <&gpio7 1 0>;
94 vmmc-supply = <&reg_3p3v>;
95 status = "okay";
96 };
97
98 usdhc@0219c000 { /* uSDHC4 */
99 pinctrl-names = "default";
100 pinctrl-0 = <&pinctrl_usdhc4_2>;
101 cd-gpios = <&gpio2 6 0>;
102 wp-gpios = <&gpio2 7 0>;
103 vmmc-supply = <&reg_3p3v>;
104 status = "okay";
105 };
106
107 audmux@021d8000 {
108 status = "okay";
109 pinctrl-names = "default";
110 pinctrl-0 = <&pinctrl_audmux_1>;
111 };
112
113 uart2: serial@021e8000 {
114 status = "okay";
115 pinctrl-names = "default";
116 pinctrl-0 = <&pinctrl_uart2_1>;
117 };
118
119 i2c@021a0000 { /* I2C1 */
120 status = "okay";
121 clock-frequency = <100000>;
122 pinctrl-names = "default";
123 pinctrl-0 = <&pinctrl_i2c1_1>;
124
125 codec: sgtl5000@0a {
126 compatible = "fsl,sgtl5000";
127 reg = <0x0a>;
128 clocks = <&clks 169>;
129 VDDA-supply = <&reg_2p5v>;
130 VDDIO-supply = <&reg_3p3v>;
131 };
132 };
133 };
134 };
135
136 regulators { 24 regulators {
137 compatible = "simple-bus"; 25 compatible = "simple-bus";
138 26
@@ -176,3 +64,107 @@
176 mux-ext-port = <4>; 64 mux-ext-port = <4>;
177 }; 65 };
178}; 66};
67
68&ecspi1 {
69 fsl,spi-num-chipselects = <1>;
70 cs-gpios = <&gpio3 19 0>;
71 pinctrl-names = "default";
72 pinctrl-0 = <&pinctrl_ecspi1_1>;
73 status = "okay";
74
75 flash: m25p80@0 {
76 compatible = "sst,sst25vf016b";
77 spi-max-frequency = <20000000>;
78 reg = <0>;
79 };
80};
81
82&ssi1 {
83 fsl,mode = "i2s-slave";
84 status = "okay";
85};
86
87&iomuxc {
88 pinctrl-names = "default";
89 pinctrl-0 = <&pinctrl_hog>;
90
91 hog {
92 pinctrl_hog: hoggrp {
93 fsl,pins = <
94 1450 0x80000000 /* MX6Q_PAD_NANDF_D6__GPIO_2_6 */
95 1458 0x80000000 /* MX6Q_PAD_NANDF_D7__GPIO_2_7 */
96 121 0x80000000 /* MX6Q_PAD_EIM_D19__GPIO_3_19 */
97 144 0x80000000 /* MX6Q_PAD_EIM_D22__GPIO_3_22 */
98 152 0x80000000 /* MX6Q_PAD_EIM_D23__GPIO_3_23 */
99 1262 0x80000000 /* MX6Q_PAD_SD3_DAT5__GPIO_7_0 */
100 1270 0x1f0b0 /* MX6Q_PAD_SD3_DAT4__GPIO_7_1 */
101 953 0x80000000 /* MX6Q_PAD_GPIO_0__CCM_CLKO */
102 >;
103 };
104 };
105};
106
107&usbotg {
108 vbus-supply = <&reg_usb_otg_vbus>;
109 pinctrl-names = "default";
110 pinctrl-0 = <&pinctrl_usbotg_1>;
111 disable-over-current;
112 status = "okay";
113};
114
115&usbh1 {
116 status = "okay";
117};
118
119&fec {
120 pinctrl-names = "default";
121 pinctrl-0 = <&pinctrl_enet_1>;
122 phy-mode = "rgmii";
123 phy-reset-gpios = <&gpio3 23 0>;
124 status = "okay";
125};
126
127&usdhc3 {
128 pinctrl-names = "default";
129 pinctrl-0 = <&pinctrl_usdhc3_2>;
130 cd-gpios = <&gpio7 0 0>;
131 wp-gpios = <&gpio7 1 0>;
132 vmmc-supply = <&reg_3p3v>;
133 status = "okay";
134};
135
136&usdhc4 {
137 pinctrl-names = "default";
138 pinctrl-0 = <&pinctrl_usdhc4_2>;
139 cd-gpios = <&gpio2 6 0>;
140 wp-gpios = <&gpio2 7 0>;
141 vmmc-supply = <&reg_3p3v>;
142 status = "okay";
143};
144
145&audmux {
146 status = "okay";
147 pinctrl-names = "default";
148 pinctrl-0 = <&pinctrl_audmux_1>;
149};
150
151&uart2 {
152 status = "okay";
153 pinctrl-names = "default";
154 pinctrl-0 = <&pinctrl_uart2_1>;
155};
156
157&i2c1 {
158 status = "okay";
159 clock-frequency = <100000>;
160 pinctrl-names = "default";
161 pinctrl-0 = <&pinctrl_i2c1_1>;
162
163 codec: sgtl5000@0a {
164 compatible = "fsl,sgtl5000";
165 reg = <0x0a>;
166 clocks = <&clks 169>;
167 VDDA-supply = <&reg_2p5v>;
168 VDDIO-supply = <&reg_3p3v>;
169 };
170};
diff --git a/arch/arm/boot/dts/imx6q-sabresd.dts b/arch/arm/boot/dts/imx6q-sabresd.dts
index a42402562b7b..2dea304a7980 100644
--- a/arch/arm/boot/dts/imx6q-sabresd.dts
+++ b/arch/arm/boot/dts/imx6q-sabresd.dts
@@ -21,61 +21,6 @@
21 reg = <0x10000000 0x40000000>; 21 reg = <0x10000000 0x40000000>;
22 }; 22 };
23 23
24 soc {
25 aips-bus@02000000 { /* AIPS1 */
26 spba-bus@02000000 {
27 uart1: serial@02020000 {
28 pinctrl-names = "default";
29 pinctrl-0 = <&pinctrl_uart1_1>;
30 status = "okay";
31 };
32 };
33
34 iomuxc@020e0000 {
35 pinctrl-names = "default";
36 pinctrl-0 = <&pinctrl_hog>;
37
38 hog {
39 pinctrl_hog: hoggrp {
40 fsl,pins = <
41 1004 0x80000000 /* MX6Q_PAD_GPIO_4__GPIO_1_4 */
42 1012 0x80000000 /* MX6Q_PAD_GPIO_5__GPIO_1_5 */
43 1402 0x80000000 /* MX6Q_PAD_NANDF_D0__GPIO_2_0 */
44 1410 0x80000000 /* MX6Q_PAD_NANDF_D1__GPIO_2_1 */
45 1418 0x80000000 /* MX6Q_PAD_NANDF_D2__GPIO_2_2 */
46 1426 0x80000000 /* MX6Q_PAD_NANDF_D3__GPIO_2_3 */
47 >;
48 };
49 };
50 };
51 };
52
53 aips-bus@02100000 { /* AIPS2 */
54 ethernet@02188000 {
55 pinctrl-names = "default";
56 pinctrl-0 = <&pinctrl_enet_1>;
57 phy-mode = "rgmii";
58 status = "okay";
59 };
60
61 usdhc@02194000 { /* uSDHC2 */
62 pinctrl-names = "default";
63 pinctrl-0 = <&pinctrl_usdhc2_1>;
64 cd-gpios = <&gpio2 2 0>;
65 wp-gpios = <&gpio2 3 0>;
66 status = "okay";
67 };
68
69 usdhc@02198000 { /* uSDHC3 */
70 pinctrl-names = "default";
71 pinctrl-0 = <&pinctrl_usdhc3_1>;
72 cd-gpios = <&gpio2 0 0>;
73 wp-gpios = <&gpio2 1 0>;
74 status = "okay";
75 };
76 };
77 };
78
79 gpio-keys { 24 gpio-keys {
80 compatible = "gpio-keys"; 25 compatible = "gpio-keys";
81 26
@@ -92,3 +37,50 @@
92 }; 37 };
93 }; 38 };
94}; 39};
40
41&uart1 {
42 pinctrl-names = "default";
43 pinctrl-0 = <&pinctrl_uart1_1>;
44 status = "okay";
45};
46
47&iomuxc {
48 pinctrl-names = "default";
49 pinctrl-0 = <&pinctrl_hog>;
50
51 hog {
52 pinctrl_hog: hoggrp {
53 fsl,pins = <
54 1004 0x80000000 /* MX6Q_PAD_GPIO_4__GPIO_1_4 */
55 1012 0x80000000 /* MX6Q_PAD_GPIO_5__GPIO_1_5 */
56 1402 0x80000000 /* MX6Q_PAD_NANDF_D0__GPIO_2_0 */
57 1410 0x80000000 /* MX6Q_PAD_NANDF_D1__GPIO_2_1 */
58 1418 0x80000000 /* MX6Q_PAD_NANDF_D2__GPIO_2_2 */
59 1426 0x80000000 /* MX6Q_PAD_NANDF_D3__GPIO_2_3 */
60 >;
61 };
62 };
63};
64
65&fec {
66 pinctrl-names = "default";
67 pinctrl-0 = <&pinctrl_enet_1>;
68 phy-mode = "rgmii";
69 status = "okay";
70};
71
72&usdhc2 {
73 pinctrl-names = "default";
74 pinctrl-0 = <&pinctrl_usdhc2_1>;
75 cd-gpios = <&gpio2 2 0>;
76 wp-gpios = <&gpio2 3 0>;
77 status = "okay";
78};
79
80&usdhc3 {
81 pinctrl-names = "default";
82 pinctrl-0 = <&pinctrl_usdhc3_1>;
83 cd-gpios = <&gpio2 0 0>;
84 wp-gpios = <&gpio2 1 0>;
85 status = "okay";
86};
diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi
index d6265ca97119..cba021eb035e 100644
--- a/arch/arm/boot/dts/imx6q.dtsi
+++ b/arch/arm/boot/dts/imx6q.dtsi
@@ -1,33 +1,16 @@
1
1/* 2/*
2 * Copyright 2011 Freescale Semiconductor, Inc. 3 * Copyright 2013 Freescale Semiconductor, Inc.
3 * Copyright 2011 Linaro Ltd.
4 * 4 *
5 * The code contained herein is licensed under the GNU General Public 5 * This program is free software; you can redistribute it and/or modify
6 * License. You may obtain a copy of the GNU General Public License 6 * it under the terms of the GNU General Public License version 2 as
7 * Version 2 or later at the following locations: 7 * published by the Free Software Foundation.
8 * 8 *
9 * http://www.opensource.org/licenses/gpl-license.html
10 * http://www.gnu.org/copyleft/gpl.html
11 */ 9 */
12 10
13/include/ "skeleton.dtsi" 11/include/ "imx6qdl.dtsi"
14 12
15/ { 13/ {
16 aliases {
17 serial0 = &uart1;
18 serial1 = &uart2;
19 serial2 = &uart3;
20 serial3 = &uart4;
21 serial4 = &uart5;
22 gpio0 = &gpio1;
23 gpio1 = &gpio2;
24 gpio2 = &gpio3;
25 gpio3 = &gpio4;
26 gpio4 = &gpio5;
27 gpio5 = &gpio6;
28 gpio6 = &gpio7;
29 };
30
31 cpus { 14 cpus {
32 #address-cells = <1>; 15 #address-cells = <1>;
33 #size-cells = <0>; 16 #size-cells = <0>;
@@ -38,12 +21,19 @@
38 next-level-cache = <&L2>; 21 next-level-cache = <&L2>;
39 operating-points = < 22 operating-points = <
40 /* kHz uV */ 23 /* kHz uV */
41 792000 1100000 24 1200000 1275000
25 996000 1250000
26 792000 1150000
42 396000 950000 27 396000 950000
43 198000 850000
44 >; 28 >;
45 clock-latency = <61036>; /* two CLK32 periods */ 29 clock-latency = <61036>; /* two CLK32 periods */
46 cpu0-supply = <&reg_cpu>; 30 clocks = <&clks 104>, <&clks 6>, <&clks 16>,
31 <&clks 17>, <&clks 170>;
32 clock-names = "arm", "pll2_pfd2_396m", "step",
33 "pll1_sw", "pll1_sys";
34 arm-supply = <&reg_arm>;
35 pu-supply = <&reg_pu>;
36 soc-supply = <&reg_soc>;
47 }; 37 };
48 38
49 cpu@1 { 39 cpu@1 {
@@ -65,142 +55,9 @@
65 }; 55 };
66 }; 56 };
67 57
68 intc: interrupt-controller@00a01000 {
69 compatible = "arm,cortex-a9-gic";
70 #interrupt-cells = <3>;
71 #address-cells = <1>;
72 #size-cells = <1>;
73 interrupt-controller;
74 reg = <0x00a01000 0x1000>,
75 <0x00a00100 0x100>;
76 };
77
78 clocks {
79 #address-cells = <1>;
80 #size-cells = <0>;
81
82 ckil {
83 compatible = "fsl,imx-ckil", "fixed-clock";
84 clock-frequency = <32768>;
85 };
86
87 ckih1 {
88 compatible = "fsl,imx-ckih1", "fixed-clock";
89 clock-frequency = <0>;
90 };
91
92 osc {
93 compatible = "fsl,imx-osc", "fixed-clock";
94 clock-frequency = <24000000>;
95 };
96 };
97
98 soc { 58 soc {
99 #address-cells = <1>;
100 #size-cells = <1>;
101 compatible = "simple-bus";
102 interrupt-parent = <&intc>;
103 ranges;
104
105 dma-apbh@00110000 {
106 compatible = "fsl,imx6q-dma-apbh", "fsl,imx28-dma-apbh";
107 reg = <0x00110000 0x2000>;
108 clocks = <&clks 106>;
109 };
110
111 nfc: gpmi-nand@00112000 {
112 compatible = "fsl,imx6q-gpmi-nand";
113 #address-cells = <1>;
114 #size-cells = <1>;
115 reg = <0x00112000 0x2000>, <0x00114000 0x2000>;
116 reg-names = "gpmi-nand", "bch";
117 interrupts = <0 13 0x04>, <0 15 0x04>;
118 interrupt-names = "gpmi-dma", "bch";
119 clocks = <&clks 152>, <&clks 153>, <&clks 151>,
120 <&clks 150>, <&clks 149>;
121 clock-names = "gpmi_io", "gpmi_apb", "gpmi_bch",
122 "gpmi_bch_apb", "per1_bch";
123 fsl,gpmi-dma-channel = <0>;
124 status = "disabled";
125 };
126
127 timer@00a00600 {
128 compatible = "arm,cortex-a9-twd-timer";
129 reg = <0x00a00600 0x20>;
130 interrupts = <1 13 0xf01>;
131 };
132
133 L2: l2-cache@00a02000 {
134 compatible = "arm,pl310-cache";
135 reg = <0x00a02000 0x1000>;
136 interrupts = <0 92 0x04>;
137 cache-unified;
138 cache-level = <2>;
139 };
140
141 aips-bus@02000000 { /* AIPS1 */ 59 aips-bus@02000000 { /* AIPS1 */
142 compatible = "fsl,aips-bus", "simple-bus";
143 #address-cells = <1>;
144 #size-cells = <1>;
145 reg = <0x02000000 0x100000>;
146 ranges;
147
148 spba-bus@02000000 { 60 spba-bus@02000000 {
149 compatible = "fsl,spba-bus", "simple-bus";
150 #address-cells = <1>;
151 #size-cells = <1>;
152 reg = <0x02000000 0x40000>;
153 ranges;
154
155 spdif: spdif@02004000 {
156 reg = <0x02004000 0x4000>;
157 interrupts = <0 52 0x04>;
158 };
159
160 ecspi1: ecspi@02008000 {
161 #address-cells = <1>;
162 #size-cells = <0>;
163 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
164 reg = <0x02008000 0x4000>;
165 interrupts = <0 31 0x04>;
166 clocks = <&clks 112>, <&clks 112>;
167 clock-names = "ipg", "per";
168 status = "disabled";
169 };
170
171 ecspi2: ecspi@0200c000 {
172 #address-cells = <1>;
173 #size-cells = <0>;
174 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
175 reg = <0x0200c000 0x4000>;
176 interrupts = <0 32 0x04>;
177 clocks = <&clks 113>, <&clks 113>;
178 clock-names = "ipg", "per";
179 status = "disabled";
180 };
181
182 ecspi3: ecspi@02010000 {
183 #address-cells = <1>;
184 #size-cells = <0>;
185 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
186 reg = <0x02010000 0x4000>;
187 interrupts = <0 33 0x04>;
188 clocks = <&clks 114>, <&clks 114>;
189 clock-names = "ipg", "per";
190 status = "disabled";
191 };
192
193 ecspi4: ecspi@02014000 {
194 #address-cells = <1>;
195 #size-cells = <0>;
196 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
197 reg = <0x02014000 0x4000>;
198 interrupts = <0 34 0x04>;
199 clocks = <&clks 115>, <&clks 115>;
200 clock-names = "ipg", "per";
201 status = "disabled";
202 };
203
204 ecspi5: ecspi@02018000 { 61 ecspi5: ecspi@02018000 {
205 #address-cells = <1>; 62 #address-cells = <1>;
206 #size-cells = <0>; 63 #size-cells = <0>;
@@ -211,361 +68,6 @@
211 clock-names = "ipg", "per"; 68 clock-names = "ipg", "per";
212 status = "disabled"; 69 status = "disabled";
213 }; 70 };
214
215 uart1: serial@02020000 {
216 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
217 reg = <0x02020000 0x4000>;
218 interrupts = <0 26 0x04>;
219 clocks = <&clks 160>, <&clks 161>;
220 clock-names = "ipg", "per";
221 status = "disabled";
222 };
223
224 esai: esai@02024000 {
225 reg = <0x02024000 0x4000>;
226 interrupts = <0 51 0x04>;
227 };
228
229 ssi1: ssi@02028000 {
230 compatible = "fsl,imx6q-ssi","fsl,imx21-ssi";
231 reg = <0x02028000 0x4000>;
232 interrupts = <0 46 0x04>;
233 clocks = <&clks 178>;
234 fsl,fifo-depth = <15>;
235 fsl,ssi-dma-events = <38 37>;
236 status = "disabled";
237 };
238
239 ssi2: ssi@0202c000 {
240 compatible = "fsl,imx6q-ssi","fsl,imx21-ssi";
241 reg = <0x0202c000 0x4000>;
242 interrupts = <0 47 0x04>;
243 clocks = <&clks 179>;
244 fsl,fifo-depth = <15>;
245 fsl,ssi-dma-events = <42 41>;
246 status = "disabled";
247 };
248
249 ssi3: ssi@02030000 {
250 compatible = "fsl,imx6q-ssi","fsl,imx21-ssi";
251 reg = <0x02030000 0x4000>;
252 interrupts = <0 48 0x04>;
253 clocks = <&clks 180>;
254 fsl,fifo-depth = <15>;
255 fsl,ssi-dma-events = <46 45>;
256 status = "disabled";
257 };
258
259 asrc: asrc@02034000 {
260 reg = <0x02034000 0x4000>;
261 interrupts = <0 50 0x04>;
262 };
263
264 spba@0203c000 {
265 reg = <0x0203c000 0x4000>;
266 };
267 };
268
269 vpu: vpu@02040000 {
270 reg = <0x02040000 0x3c000>;
271 interrupts = <0 3 0x04 0 12 0x04>;
272 };
273
274 aipstz@0207c000 { /* AIPSTZ1 */
275 reg = <0x0207c000 0x4000>;
276 };
277
278 pwm1: pwm@02080000 {
279 #pwm-cells = <2>;
280 compatible = "fsl,imx6q-pwm", "fsl,imx27-pwm";
281 reg = <0x02080000 0x4000>;
282 interrupts = <0 83 0x04>;
283 clocks = <&clks 62>, <&clks 145>;
284 clock-names = "ipg", "per";
285 };
286
287 pwm2: pwm@02084000 {
288 #pwm-cells = <2>;
289 compatible = "fsl,imx6q-pwm", "fsl,imx27-pwm";
290 reg = <0x02084000 0x4000>;
291 interrupts = <0 84 0x04>;
292 clocks = <&clks 62>, <&clks 146>;
293 clock-names = "ipg", "per";
294 };
295
296 pwm3: pwm@02088000 {
297 #pwm-cells = <2>;
298 compatible = "fsl,imx6q-pwm", "fsl,imx27-pwm";
299 reg = <0x02088000 0x4000>;
300 interrupts = <0 85 0x04>;
301 clocks = <&clks 62>, <&clks 147>;
302 clock-names = "ipg", "per";
303 };
304
305 pwm4: pwm@0208c000 {
306 #pwm-cells = <2>;
307 compatible = "fsl,imx6q-pwm", "fsl,imx27-pwm";
308 reg = <0x0208c000 0x4000>;
309 interrupts = <0 86 0x04>;
310 clocks = <&clks 62>, <&clks 148>;
311 clock-names = "ipg", "per";
312 };
313
314 can1: flexcan@02090000 {
315 reg = <0x02090000 0x4000>;
316 interrupts = <0 110 0x04>;
317 };
318
319 can2: flexcan@02094000 {
320 reg = <0x02094000 0x4000>;
321 interrupts = <0 111 0x04>;
322 };
323
324 gpt: gpt@02098000 {
325 compatible = "fsl,imx6q-gpt";
326 reg = <0x02098000 0x4000>;
327 interrupts = <0 55 0x04>;
328 };
329
330 gpio1: gpio@0209c000 {
331 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
332 reg = <0x0209c000 0x4000>;
333 interrupts = <0 66 0x04 0 67 0x04>;
334 gpio-controller;
335 #gpio-cells = <2>;
336 interrupt-controller;
337 #interrupt-cells = <2>;
338 };
339
340 gpio2: gpio@020a0000 {
341 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
342 reg = <0x020a0000 0x4000>;
343 interrupts = <0 68 0x04 0 69 0x04>;
344 gpio-controller;
345 #gpio-cells = <2>;
346 interrupt-controller;
347 #interrupt-cells = <2>;
348 };
349
350 gpio3: gpio@020a4000 {
351 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
352 reg = <0x020a4000 0x4000>;
353 interrupts = <0 70 0x04 0 71 0x04>;
354 gpio-controller;
355 #gpio-cells = <2>;
356 interrupt-controller;
357 #interrupt-cells = <2>;
358 };
359
360 gpio4: gpio@020a8000 {
361 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
362 reg = <0x020a8000 0x4000>;
363 interrupts = <0 72 0x04 0 73 0x04>;
364 gpio-controller;
365 #gpio-cells = <2>;
366 interrupt-controller;
367 #interrupt-cells = <2>;
368 };
369
370 gpio5: gpio@020ac000 {
371 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
372 reg = <0x020ac000 0x4000>;
373 interrupts = <0 74 0x04 0 75 0x04>;
374 gpio-controller;
375 #gpio-cells = <2>;
376 interrupt-controller;
377 #interrupt-cells = <2>;
378 };
379
380 gpio6: gpio@020b0000 {
381 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
382 reg = <0x020b0000 0x4000>;
383 interrupts = <0 76 0x04 0 77 0x04>;
384 gpio-controller;
385 #gpio-cells = <2>;
386 interrupt-controller;
387 #interrupt-cells = <2>;
388 };
389
390 gpio7: gpio@020b4000 {
391 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
392 reg = <0x020b4000 0x4000>;
393 interrupts = <0 78 0x04 0 79 0x04>;
394 gpio-controller;
395 #gpio-cells = <2>;
396 interrupt-controller;
397 #interrupt-cells = <2>;
398 };
399
400 kpp: kpp@020b8000 {
401 reg = <0x020b8000 0x4000>;
402 interrupts = <0 82 0x04>;
403 };
404
405 wdog1: wdog@020bc000 {
406 compatible = "fsl,imx6q-wdt", "fsl,imx21-wdt";
407 reg = <0x020bc000 0x4000>;
408 interrupts = <0 80 0x04>;
409 clocks = <&clks 0>;
410 };
411
412 wdog2: wdog@020c0000 {
413 compatible = "fsl,imx6q-wdt", "fsl,imx21-wdt";
414 reg = <0x020c0000 0x4000>;
415 interrupts = <0 81 0x04>;
416 clocks = <&clks 0>;
417 status = "disabled";
418 };
419
420 clks: ccm@020c4000 {
421 compatible = "fsl,imx6q-ccm";
422 reg = <0x020c4000 0x4000>;
423 interrupts = <0 87 0x04 0 88 0x04>;
424 #clock-cells = <1>;
425 };
426
427 anatop: anatop@020c8000 {
428 compatible = "fsl,imx6q-anatop", "syscon", "simple-bus";
429 reg = <0x020c8000 0x1000>;
430 interrupts = <0 49 0x04 0 54 0x04 0 127 0x04>;
431
432 regulator-1p1@110 {
433 compatible = "fsl,anatop-regulator";
434 regulator-name = "vdd1p1";
435 regulator-min-microvolt = <800000>;
436 regulator-max-microvolt = <1375000>;
437 regulator-always-on;
438 anatop-reg-offset = <0x110>;
439 anatop-vol-bit-shift = <8>;
440 anatop-vol-bit-width = <5>;
441 anatop-min-bit-val = <4>;
442 anatop-min-voltage = <800000>;
443 anatop-max-voltage = <1375000>;
444 };
445
446 regulator-3p0@120 {
447 compatible = "fsl,anatop-regulator";
448 regulator-name = "vdd3p0";
449 regulator-min-microvolt = <2800000>;
450 regulator-max-microvolt = <3150000>;
451 regulator-always-on;
452 anatop-reg-offset = <0x120>;
453 anatop-vol-bit-shift = <8>;
454 anatop-vol-bit-width = <5>;
455 anatop-min-bit-val = <0>;
456 anatop-min-voltage = <2625000>;
457 anatop-max-voltage = <3400000>;
458 };
459
460 regulator-2p5@130 {
461 compatible = "fsl,anatop-regulator";
462 regulator-name = "vdd2p5";
463 regulator-min-microvolt = <2000000>;
464 regulator-max-microvolt = <2750000>;
465 regulator-always-on;
466 anatop-reg-offset = <0x130>;
467 anatop-vol-bit-shift = <8>;
468 anatop-vol-bit-width = <5>;
469 anatop-min-bit-val = <0>;
470 anatop-min-voltage = <2000000>;
471 anatop-max-voltage = <2750000>;
472 };
473
474 reg_cpu: regulator-vddcore@140 {
475 compatible = "fsl,anatop-regulator";
476 regulator-name = "cpu";
477 regulator-min-microvolt = <725000>;
478 regulator-max-microvolt = <1450000>;
479 regulator-always-on;
480 anatop-reg-offset = <0x140>;
481 anatop-vol-bit-shift = <0>;
482 anatop-vol-bit-width = <5>;
483 anatop-min-bit-val = <1>;
484 anatop-min-voltage = <725000>;
485 anatop-max-voltage = <1450000>;
486 };
487
488 regulator-vddpu@140 {
489 compatible = "fsl,anatop-regulator";
490 regulator-name = "vddpu";
491 regulator-min-microvolt = <725000>;
492 regulator-max-microvolt = <1450000>;
493 regulator-always-on;
494 anatop-reg-offset = <0x140>;
495 anatop-vol-bit-shift = <9>;
496 anatop-vol-bit-width = <5>;
497 anatop-min-bit-val = <1>;
498 anatop-min-voltage = <725000>;
499 anatop-max-voltage = <1450000>;
500 };
501
502 regulator-vddsoc@140 {
503 compatible = "fsl,anatop-regulator";
504 regulator-name = "vddsoc";
505 regulator-min-microvolt = <725000>;
506 regulator-max-microvolt = <1450000>;
507 regulator-always-on;
508 anatop-reg-offset = <0x140>;
509 anatop-vol-bit-shift = <18>;
510 anatop-vol-bit-width = <5>;
511 anatop-min-bit-val = <1>;
512 anatop-min-voltage = <725000>;
513 anatop-max-voltage = <1450000>;
514 };
515 };
516
517 usbphy1: usbphy@020c9000 {
518 compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy";
519 reg = <0x020c9000 0x1000>;
520 interrupts = <0 44 0x04>;
521 clocks = <&clks 182>;
522 };
523
524 usbphy2: usbphy@020ca000 {
525 compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy";
526 reg = <0x020ca000 0x1000>;
527 interrupts = <0 45 0x04>;
528 clocks = <&clks 183>;
529 };
530
531 snvs@020cc000 {
532 compatible = "fsl,sec-v4.0-mon", "simple-bus";
533 #address-cells = <1>;
534 #size-cells = <1>;
535 ranges = <0 0x020cc000 0x4000>;
536
537 snvs-rtc-lp@34 {
538 compatible = "fsl,sec-v4.0-mon-rtc-lp";
539 reg = <0x34 0x58>;
540 interrupts = <0 19 0x04 0 20 0x04>;
541 };
542 };
543
544 epit1: epit@020d0000 { /* EPIT1 */
545 reg = <0x020d0000 0x4000>;
546 interrupts = <0 56 0x04>;
547 };
548
549 epit2: epit@020d4000 { /* EPIT2 */
550 reg = <0x020d4000 0x4000>;
551 interrupts = <0 57 0x04>;
552 };
553
554 src: src@020d8000 {
555 compatible = "fsl,imx6q-src";
556 reg = <0x020d8000 0x4000>;
557 interrupts = <0 91 0x04 0 96 0x04>;
558 };
559
560 gpc: gpc@020dc000 {
561 compatible = "fsl,imx6q-gpc";
562 reg = <0x020dc000 0x4000>;
563 interrupts = <0 89 0x04 0 90 0x04>;
564 };
565
566 gpr: iomuxc-gpr@020e0000 {
567 compatible = "fsl,imx6q-iomuxc-gpr", "syscon";
568 reg = <0x020e0000 0x38>;
569 }; 71 };
570 72
571 iomuxc: iomuxc@020e0000 { 73 iomuxc: iomuxc@020e0000 {
@@ -780,272 +282,6 @@
780 }; 282 };
781 }; 283 };
782 }; 284 };
783
784 dcic1: dcic@020e4000 {
785 reg = <0x020e4000 0x4000>;
786 interrupts = <0 124 0x04>;
787 };
788
789 dcic2: dcic@020e8000 {
790 reg = <0x020e8000 0x4000>;
791 interrupts = <0 125 0x04>;
792 };
793
794 sdma: sdma@020ec000 {
795 compatible = "fsl,imx6q-sdma", "fsl,imx35-sdma";
796 reg = <0x020ec000 0x4000>;
797 interrupts = <0 2 0x04>;
798 clocks = <&clks 155>, <&clks 155>;
799 clock-names = "ipg", "ahb";
800 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx6q-to1.bin";
801 };
802 };
803
804 aips-bus@02100000 { /* AIPS2 */
805 compatible = "fsl,aips-bus", "simple-bus";
806 #address-cells = <1>;
807 #size-cells = <1>;
808 reg = <0x02100000 0x100000>;
809 ranges;
810
811 caam@02100000 {
812 reg = <0x02100000 0x40000>;
813 interrupts = <0 105 0x04 0 106 0x04>;
814 };
815
816 aipstz@0217c000 { /* AIPSTZ2 */
817 reg = <0x0217c000 0x4000>;
818 };
819
820 usbotg: usb@02184000 {
821 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
822 reg = <0x02184000 0x200>;
823 interrupts = <0 43 0x04>;
824 clocks = <&clks 162>;
825 fsl,usbphy = <&usbphy1>;
826 fsl,usbmisc = <&usbmisc 0>;
827 status = "disabled";
828 };
829
830 usbh1: usb@02184200 {
831 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
832 reg = <0x02184200 0x200>;
833 interrupts = <0 40 0x04>;
834 clocks = <&clks 162>;
835 fsl,usbphy = <&usbphy2>;
836 fsl,usbmisc = <&usbmisc 1>;
837 status = "disabled";
838 };
839
840 usbh2: usb@02184400 {
841 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
842 reg = <0x02184400 0x200>;
843 interrupts = <0 41 0x04>;
844 clocks = <&clks 162>;
845 fsl,usbmisc = <&usbmisc 2>;
846 status = "disabled";
847 };
848
849 usbh3: usb@02184600 {
850 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
851 reg = <0x02184600 0x200>;
852 interrupts = <0 42 0x04>;
853 clocks = <&clks 162>;
854 fsl,usbmisc = <&usbmisc 3>;
855 status = "disabled";
856 };
857
858 usbmisc: usbmisc: usbmisc@02184800 {
859 #index-cells = <1>;
860 compatible = "fsl,imx6q-usbmisc";
861 reg = <0x02184800 0x200>;
862 clocks = <&clks 162>;
863 };
864
865 fec: ethernet@02188000 {
866 compatible = "fsl,imx6q-fec";
867 reg = <0x02188000 0x4000>;
868 interrupts = <0 118 0x04 0 119 0x04>;
869 clocks = <&clks 117>, <&clks 117>, <&clks 177>;
870 clock-names = "ipg", "ahb", "ptp";
871 status = "disabled";
872 };
873
874 mlb@0218c000 {
875 reg = <0x0218c000 0x4000>;
876 interrupts = <0 53 0x04 0 117 0x04 0 126 0x04>;
877 };
878
879 usdhc1: usdhc@02190000 {
880 compatible = "fsl,imx6q-usdhc";
881 reg = <0x02190000 0x4000>;
882 interrupts = <0 22 0x04>;
883 clocks = <&clks 163>, <&clks 163>, <&clks 163>;
884 clock-names = "ipg", "ahb", "per";
885 bus-width = <4>;
886 status = "disabled";
887 };
888
889 usdhc2: usdhc@02194000 {
890 compatible = "fsl,imx6q-usdhc";
891 reg = <0x02194000 0x4000>;
892 interrupts = <0 23 0x04>;
893 clocks = <&clks 164>, <&clks 164>, <&clks 164>;
894 clock-names = "ipg", "ahb", "per";
895 bus-width = <4>;
896 status = "disabled";
897 };
898
899 usdhc3: usdhc@02198000 {
900 compatible = "fsl,imx6q-usdhc";
901 reg = <0x02198000 0x4000>;
902 interrupts = <0 24 0x04>;
903 clocks = <&clks 165>, <&clks 165>, <&clks 165>;
904 clock-names = "ipg", "ahb", "per";
905 bus-width = <4>;
906 status = "disabled";
907 };
908
909 usdhc4: usdhc@0219c000 {
910 compatible = "fsl,imx6q-usdhc";
911 reg = <0x0219c000 0x4000>;
912 interrupts = <0 25 0x04>;
913 clocks = <&clks 166>, <&clks 166>, <&clks 166>;
914 clock-names = "ipg", "ahb", "per";
915 bus-width = <4>;
916 status = "disabled";
917 };
918
919 i2c1: i2c@021a0000 {
920 #address-cells = <1>;
921 #size-cells = <0>;
922 compatible = "fsl,imx6q-i2c", "fsl,imx21-i2c";
923 reg = <0x021a0000 0x4000>;
924 interrupts = <0 36 0x04>;
925 clocks = <&clks 125>;
926 status = "disabled";
927 };
928
929 i2c2: i2c@021a4000 {
930 #address-cells = <1>;
931 #size-cells = <0>;
932 compatible = "fsl,imx6q-i2c", "fsl,imx21-i2c";
933 reg = <0x021a4000 0x4000>;
934 interrupts = <0 37 0x04>;
935 clocks = <&clks 126>;
936 status = "disabled";
937 };
938
939 i2c3: i2c@021a8000 {
940 #address-cells = <1>;
941 #size-cells = <0>;
942 compatible = "fsl,imx6q-i2c", "fsl,imx21-i2c";
943 reg = <0x021a8000 0x4000>;
944 interrupts = <0 38 0x04>;
945 clocks = <&clks 127>;
946 status = "disabled";
947 };
948
949 romcp@021ac000 {
950 reg = <0x021ac000 0x4000>;
951 };
952
953 mmdc0: mmdc@021b0000 { /* MMDC0 */
954 compatible = "fsl,imx6q-mmdc";
955 reg = <0x021b0000 0x4000>;
956 };
957
958 mmdc1: mmdc@021b4000 { /* MMDC1 */
959 reg = <0x021b4000 0x4000>;
960 };
961
962 weim@021b8000 {
963 reg = <0x021b8000 0x4000>;
964 interrupts = <0 14 0x04>;
965 };
966
967 ocotp@021bc000 {
968 reg = <0x021bc000 0x4000>;
969 };
970
971 ocotp@021c0000 {
972 reg = <0x021c0000 0x4000>;
973 interrupts = <0 21 0x04>;
974 };
975
976 tzasc@021d0000 { /* TZASC1 */
977 reg = <0x021d0000 0x4000>;
978 interrupts = <0 108 0x04>;
979 };
980
981 tzasc@021d4000 { /* TZASC2 */
982 reg = <0x021d4000 0x4000>;
983 interrupts = <0 109 0x04>;
984 };
985
986 audmux: audmux@021d8000 {
987 compatible = "fsl,imx6q-audmux", "fsl,imx31-audmux";
988 reg = <0x021d8000 0x4000>;
989 status = "disabled";
990 };
991
992 mipi@021dc000 { /* MIPI-CSI */
993 reg = <0x021dc000 0x4000>;
994 };
995
996 mipi@021e0000 { /* MIPI-DSI */
997 reg = <0x021e0000 0x4000>;
998 };
999
1000 vdoa@021e4000 {
1001 reg = <0x021e4000 0x4000>;
1002 interrupts = <0 18 0x04>;
1003 };
1004
1005 uart2: serial@021e8000 {
1006 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
1007 reg = <0x021e8000 0x4000>;
1008 interrupts = <0 27 0x04>;
1009 clocks = <&clks 160>, <&clks 161>;
1010 clock-names = "ipg", "per";
1011 status = "disabled";
1012 };
1013
1014 uart3: serial@021ec000 {
1015 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
1016 reg = <0x021ec000 0x4000>;
1017 interrupts = <0 28 0x04>;
1018 clocks = <&clks 160>, <&clks 161>;
1019 clock-names = "ipg", "per";
1020 status = "disabled";
1021 };
1022
1023 uart4: serial@021f0000 {
1024 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
1025 reg = <0x021f0000 0x4000>;
1026 interrupts = <0 29 0x04>;
1027 clocks = <&clks 160>, <&clks 161>;
1028 clock-names = "ipg", "per";
1029 status = "disabled";
1030 };
1031
1032 uart5: serial@021f4000 {
1033 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
1034 reg = <0x021f4000 0x4000>;
1035 interrupts = <0 30 0x04>;
1036 clocks = <&clks 160>, <&clks 161>;
1037 clock-names = "ipg", "per";
1038 status = "disabled";
1039 };
1040 };
1041
1042 ipu1: ipu@02400000 {
1043 #crtc-cells = <1>;
1044 compatible = "fsl,imx6q-ipu";
1045 reg = <0x02400000 0x400000>;
1046 interrupts = <0 6 0x4 0 5 0x4>;
1047 clocks = <&clks 130>, <&clks 131>, <&clks 132>;
1048 clock-names = "bus", "di0", "di1";
1049 }; 285 };
1050 286
1051 ipu2: ipu@02800000 { 287 ipu2: ipu@02800000 {
diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
new file mode 100644
index 000000000000..06ec460b4581
--- /dev/null
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -0,0 +1,800 @@
1/*
2 * Copyright 2011 Freescale Semiconductor, Inc.
3 * Copyright 2011 Linaro Ltd.
4 *
5 * The code contained herein is licensed under the GNU General Public
6 * License. You may obtain a copy of the GNU General Public License
7 * Version 2 or later at the following locations:
8 *
9 * http://www.opensource.org/licenses/gpl-license.html
10 * http://www.gnu.org/copyleft/gpl.html
11 */
12
13/include/ "skeleton.dtsi"
14
15/ {
16 aliases {
17 serial0 = &uart1;
18 serial1 = &uart2;
19 serial2 = &uart3;
20 serial3 = &uart4;
21 serial4 = &uart5;
22 gpio0 = &gpio1;
23 gpio1 = &gpio2;
24 gpio2 = &gpio3;
25 gpio3 = &gpio4;
26 gpio4 = &gpio5;
27 gpio5 = &gpio6;
28 gpio6 = &gpio7;
29 };
30
31 intc: interrupt-controller@00a01000 {
32 compatible = "arm,cortex-a9-gic";
33 #interrupt-cells = <3>;
34 #address-cells = <1>;
35 #size-cells = <1>;
36 interrupt-controller;
37 reg = <0x00a01000 0x1000>,
38 <0x00a00100 0x100>;
39 };
40
41 clocks {
42 #address-cells = <1>;
43 #size-cells = <0>;
44
45 ckil {
46 compatible = "fsl,imx-ckil", "fixed-clock";
47 clock-frequency = <32768>;
48 };
49
50 ckih1 {
51 compatible = "fsl,imx-ckih1", "fixed-clock";
52 clock-frequency = <0>;
53 };
54
55 osc {
56 compatible = "fsl,imx-osc", "fixed-clock";
57 clock-frequency = <24000000>;
58 };
59 };
60
61 soc {
62 #address-cells = <1>;
63 #size-cells = <1>;
64 compatible = "simple-bus";
65 interrupt-parent = <&intc>;
66 ranges;
67
68 dma-apbh@00110000 {
69 compatible = "fsl,imx6q-dma-apbh", "fsl,imx28-dma-apbh";
70 reg = <0x00110000 0x2000>;
71 clocks = <&clks 106>;
72 };
73
74 gpmi: gpmi-nand@00112000 {
75 compatible = "fsl,imx6q-gpmi-nand";
76 #address-cells = <1>;
77 #size-cells = <1>;
78 reg = <0x00112000 0x2000>, <0x00114000 0x2000>;
79 reg-names = "gpmi-nand", "bch";
80 interrupts = <0 13 0x04>, <0 15 0x04>;
81 interrupt-names = "gpmi-dma", "bch";
82 clocks = <&clks 152>, <&clks 153>, <&clks 151>,
83 <&clks 150>, <&clks 149>;
84 clock-names = "gpmi_io", "gpmi_apb", "gpmi_bch",
85 "gpmi_bch_apb", "per1_bch";
86 fsl,gpmi-dma-channel = <0>;
87 status = "disabled";
88 };
89
90 timer@00a00600 {
91 compatible = "arm,cortex-a9-twd-timer";
92 reg = <0x00a00600 0x20>;
93 interrupts = <1 13 0xf01>;
94 };
95
96 L2: l2-cache@00a02000 {
97 compatible = "arm,pl310-cache";
98 reg = <0x00a02000 0x1000>;
99 interrupts = <0 92 0x04>;
100 cache-unified;
101 cache-level = <2>;
102 };
103
104 aips-bus@02000000 { /* AIPS1 */
105 compatible = "fsl,aips-bus", "simple-bus";
106 #address-cells = <1>;
107 #size-cells = <1>;
108 reg = <0x02000000 0x100000>;
109 ranges;
110
111 spba-bus@02000000 {
112 compatible = "fsl,spba-bus", "simple-bus";
113 #address-cells = <1>;
114 #size-cells = <1>;
115 reg = <0x02000000 0x40000>;
116 ranges;
117
118 spdif: spdif@02004000 {
119 reg = <0x02004000 0x4000>;
120 interrupts = <0 52 0x04>;
121 };
122
123 ecspi1: ecspi@02008000 {
124 #address-cells = <1>;
125 #size-cells = <0>;
126 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
127 reg = <0x02008000 0x4000>;
128 interrupts = <0 31 0x04>;
129 clocks = <&clks 112>, <&clks 112>;
130 clock-names = "ipg", "per";
131 status = "disabled";
132 };
133
134 ecspi2: ecspi@0200c000 {
135 #address-cells = <1>;
136 #size-cells = <0>;
137 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
138 reg = <0x0200c000 0x4000>;
139 interrupts = <0 32 0x04>;
140 clocks = <&clks 113>, <&clks 113>;
141 clock-names = "ipg", "per";
142 status = "disabled";
143 };
144
145 ecspi3: ecspi@02010000 {
146 #address-cells = <1>;
147 #size-cells = <0>;
148 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
149 reg = <0x02010000 0x4000>;
150 interrupts = <0 33 0x04>;
151 clocks = <&clks 114>, <&clks 114>;
152 clock-names = "ipg", "per";
153 status = "disabled";
154 };
155
156 ecspi4: ecspi@02014000 {
157 #address-cells = <1>;
158 #size-cells = <0>;
159 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
160 reg = <0x02014000 0x4000>;
161 interrupts = <0 34 0x04>;
162 clocks = <&clks 115>, <&clks 115>;
163 clock-names = "ipg", "per";
164 status = "disabled";
165 };
166
167 uart1: serial@02020000 {
168 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
169 reg = <0x02020000 0x4000>;
170 interrupts = <0 26 0x04>;
171 clocks = <&clks 160>, <&clks 161>;
172 clock-names = "ipg", "per";
173 status = "disabled";
174 };
175
176 esai: esai@02024000 {
177 reg = <0x02024000 0x4000>;
178 interrupts = <0 51 0x04>;
179 };
180
181 ssi1: ssi@02028000 {
182 compatible = "fsl,imx6q-ssi","fsl,imx21-ssi";
183 reg = <0x02028000 0x4000>;
184 interrupts = <0 46 0x04>;
185 clocks = <&clks 178>;
186 fsl,fifo-depth = <15>;
187 fsl,ssi-dma-events = <38 37>;
188 status = "disabled";
189 };
190
191 ssi2: ssi@0202c000 {
192 compatible = "fsl,imx6q-ssi","fsl,imx21-ssi";
193 reg = <0x0202c000 0x4000>;
194 interrupts = <0 47 0x04>;
195 clocks = <&clks 179>;
196 fsl,fifo-depth = <15>;
197 fsl,ssi-dma-events = <42 41>;
198 status = "disabled";
199 };
200
201 ssi3: ssi@02030000 {
202 compatible = "fsl,imx6q-ssi","fsl,imx21-ssi";
203 reg = <0x02030000 0x4000>;
204 interrupts = <0 48 0x04>;
205 clocks = <&clks 180>;
206 fsl,fifo-depth = <15>;
207 fsl,ssi-dma-events = <46 45>;
208 status = "disabled";
209 };
210
211 asrc: asrc@02034000 {
212 reg = <0x02034000 0x4000>;
213 interrupts = <0 50 0x04>;
214 };
215
216 spba@0203c000 {
217 reg = <0x0203c000 0x4000>;
218 };
219 };
220
221 vpu: vpu@02040000 {
222 reg = <0x02040000 0x3c000>;
223 interrupts = <0 3 0x04 0 12 0x04>;
224 };
225
226 aipstz@0207c000 { /* AIPSTZ1 */
227 reg = <0x0207c000 0x4000>;
228 };
229
230 pwm1: pwm@02080000 {
231 #pwm-cells = <2>;
232 compatible = "fsl,imx6q-pwm", "fsl,imx27-pwm";
233 reg = <0x02080000 0x4000>;
234 interrupts = <0 83 0x04>;
235 clocks = <&clks 62>, <&clks 145>;
236 clock-names = "ipg", "per";
237 };
238
239 pwm2: pwm@02084000 {
240 #pwm-cells = <2>;
241 compatible = "fsl,imx6q-pwm", "fsl,imx27-pwm";
242 reg = <0x02084000 0x4000>;
243 interrupts = <0 84 0x04>;
244 clocks = <&clks 62>, <&clks 146>;
245 clock-names = "ipg", "per";
246 };
247
248 pwm3: pwm@02088000 {
249 #pwm-cells = <2>;
250 compatible = "fsl,imx6q-pwm", "fsl,imx27-pwm";
251 reg = <0x02088000 0x4000>;
252 interrupts = <0 85 0x04>;
253 clocks = <&clks 62>, <&clks 147>;
254 clock-names = "ipg", "per";
255 };
256
257 pwm4: pwm@0208c000 {
258 #pwm-cells = <2>;
259 compatible = "fsl,imx6q-pwm", "fsl,imx27-pwm";
260 reg = <0x0208c000 0x4000>;
261 interrupts = <0 86 0x04>;
262 clocks = <&clks 62>, <&clks 148>;
263 clock-names = "ipg", "per";
264 };
265
266 can1: flexcan@02090000 {
267 reg = <0x02090000 0x4000>;
268 interrupts = <0 110 0x04>;
269 };
270
271 can2: flexcan@02094000 {
272 reg = <0x02094000 0x4000>;
273 interrupts = <0 111 0x04>;
274 };
275
276 gpt: gpt@02098000 {
277 compatible = "fsl,imx6q-gpt";
278 reg = <0x02098000 0x4000>;
279 interrupts = <0 55 0x04>;
280 };
281
282 gpio1: gpio@0209c000 {
283 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
284 reg = <0x0209c000 0x4000>;
285 interrupts = <0 66 0x04 0 67 0x04>;
286 gpio-controller;
287 #gpio-cells = <2>;
288 interrupt-controller;
289 #interrupt-cells = <2>;
290 };
291
292 gpio2: gpio@020a0000 {
293 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
294 reg = <0x020a0000 0x4000>;
295 interrupts = <0 68 0x04 0 69 0x04>;
296 gpio-controller;
297 #gpio-cells = <2>;
298 interrupt-controller;
299 #interrupt-cells = <2>;
300 };
301
302 gpio3: gpio@020a4000 {
303 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
304 reg = <0x020a4000 0x4000>;
305 interrupts = <0 70 0x04 0 71 0x04>;
306 gpio-controller;
307 #gpio-cells = <2>;
308 interrupt-controller;
309 #interrupt-cells = <2>;
310 };
311
312 gpio4: gpio@020a8000 {
313 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
314 reg = <0x020a8000 0x4000>;
315 interrupts = <0 72 0x04 0 73 0x04>;
316 gpio-controller;
317 #gpio-cells = <2>;
318 interrupt-controller;
319 #interrupt-cells = <2>;
320 };
321
322 gpio5: gpio@020ac000 {
323 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
324 reg = <0x020ac000 0x4000>;
325 interrupts = <0 74 0x04 0 75 0x04>;
326 gpio-controller;
327 #gpio-cells = <2>;
328 interrupt-controller;
329 #interrupt-cells = <2>;
330 };
331
332 gpio6: gpio@020b0000 {
333 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
334 reg = <0x020b0000 0x4000>;
335 interrupts = <0 76 0x04 0 77 0x04>;
336 gpio-controller;
337 #gpio-cells = <2>;
338 interrupt-controller;
339 #interrupt-cells = <2>;
340 };
341
342 gpio7: gpio@020b4000 {
343 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
344 reg = <0x020b4000 0x4000>;
345 interrupts = <0 78 0x04 0 79 0x04>;
346 gpio-controller;
347 #gpio-cells = <2>;
348 interrupt-controller;
349 #interrupt-cells = <2>;
350 };
351
352 kpp: kpp@020b8000 {
353 reg = <0x020b8000 0x4000>;
354 interrupts = <0 82 0x04>;
355 };
356
357 wdog1: wdog@020bc000 {
358 compatible = "fsl,imx6q-wdt", "fsl,imx21-wdt";
359 reg = <0x020bc000 0x4000>;
360 interrupts = <0 80 0x04>;
361 clocks = <&clks 0>;
362 };
363
364 wdog2: wdog@020c0000 {
365 compatible = "fsl,imx6q-wdt", "fsl,imx21-wdt";
366 reg = <0x020c0000 0x4000>;
367 interrupts = <0 81 0x04>;
368 clocks = <&clks 0>;
369 status = "disabled";
370 };
371
372 clks: ccm@020c4000 {
373 compatible = "fsl,imx6q-ccm";
374 reg = <0x020c4000 0x4000>;
375 interrupts = <0 87 0x04 0 88 0x04>;
376 #clock-cells = <1>;
377 };
378
379 anatop: anatop@020c8000 {
380 compatible = "fsl,imx6q-anatop", "syscon", "simple-bus";
381 reg = <0x020c8000 0x1000>;
382 interrupts = <0 49 0x04 0 54 0x04 0 127 0x04>;
383
384 regulator-1p1@110 {
385 compatible = "fsl,anatop-regulator";
386 regulator-name = "vdd1p1";
387 regulator-min-microvolt = <800000>;
388 regulator-max-microvolt = <1375000>;
389 regulator-always-on;
390 anatop-reg-offset = <0x110>;
391 anatop-vol-bit-shift = <8>;
392 anatop-vol-bit-width = <5>;
393 anatop-min-bit-val = <4>;
394 anatop-min-voltage = <800000>;
395 anatop-max-voltage = <1375000>;
396 };
397
398 regulator-3p0@120 {
399 compatible = "fsl,anatop-regulator";
400 regulator-name = "vdd3p0";
401 regulator-min-microvolt = <2800000>;
402 regulator-max-microvolt = <3150000>;
403 regulator-always-on;
404 anatop-reg-offset = <0x120>;
405 anatop-vol-bit-shift = <8>;
406 anatop-vol-bit-width = <5>;
407 anatop-min-bit-val = <0>;
408 anatop-min-voltage = <2625000>;
409 anatop-max-voltage = <3400000>;
410 };
411
412 regulator-2p5@130 {
413 compatible = "fsl,anatop-regulator";
414 regulator-name = "vdd2p5";
415 regulator-min-microvolt = <2000000>;
416 regulator-max-microvolt = <2750000>;
417 regulator-always-on;
418 anatop-reg-offset = <0x130>;
419 anatop-vol-bit-shift = <8>;
420 anatop-vol-bit-width = <5>;
421 anatop-min-bit-val = <0>;
422 anatop-min-voltage = <2000000>;
423 anatop-max-voltage = <2750000>;
424 };
425
426 reg_arm: regulator-vddcore@140 {
427 compatible = "fsl,anatop-regulator";
428 regulator-name = "cpu";
429 regulator-min-microvolt = <725000>;
430 regulator-max-microvolt = <1450000>;
431 regulator-always-on;
432 anatop-reg-offset = <0x140>;
433 anatop-vol-bit-shift = <0>;
434 anatop-vol-bit-width = <5>;
435 anatop-delay-reg-offset = <0x170>;
436 anatop-delay-bit-shift = <24>;
437 anatop-delay-bit-width = <2>;
438 anatop-min-bit-val = <1>;
439 anatop-min-voltage = <725000>;
440 anatop-max-voltage = <1450000>;
441 };
442
443 reg_pu: regulator-vddpu@140 {
444 compatible = "fsl,anatop-regulator";
445 regulator-name = "vddpu";
446 regulator-min-microvolt = <725000>;
447 regulator-max-microvolt = <1450000>;
448 regulator-always-on;
449 anatop-reg-offset = <0x140>;
450 anatop-vol-bit-shift = <9>;
451 anatop-vol-bit-width = <5>;
452 anatop-delay-reg-offset = <0x170>;
453 anatop-delay-bit-shift = <26>;
454 anatop-delay-bit-width = <2>;
455 anatop-min-bit-val = <1>;
456 anatop-min-voltage = <725000>;
457 anatop-max-voltage = <1450000>;
458 };
459
460 reg_soc: regulator-vddsoc@140 {
461 compatible = "fsl,anatop-regulator";
462 regulator-name = "vddsoc";
463 regulator-min-microvolt = <725000>;
464 regulator-max-microvolt = <1450000>;
465 regulator-always-on;
466 anatop-reg-offset = <0x140>;
467 anatop-vol-bit-shift = <18>;
468 anatop-vol-bit-width = <5>;
469 anatop-delay-reg-offset = <0x170>;
470 anatop-delay-bit-shift = <28>;
471 anatop-delay-bit-width = <2>;
472 anatop-min-bit-val = <1>;
473 anatop-min-voltage = <725000>;
474 anatop-max-voltage = <1450000>;
475 };
476 };
477
478 usbphy1: usbphy@020c9000 {
479 compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy";
480 reg = <0x020c9000 0x1000>;
481 interrupts = <0 44 0x04>;
482 clocks = <&clks 182>;
483 };
484
485 usbphy2: usbphy@020ca000 {
486 compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy";
487 reg = <0x020ca000 0x1000>;
488 interrupts = <0 45 0x04>;
489 clocks = <&clks 183>;
490 };
491
492 snvs@020cc000 {
493 compatible = "fsl,sec-v4.0-mon", "simple-bus";
494 #address-cells = <1>;
495 #size-cells = <1>;
496 ranges = <0 0x020cc000 0x4000>;
497
498 snvs-rtc-lp@34 {
499 compatible = "fsl,sec-v4.0-mon-rtc-lp";
500 reg = <0x34 0x58>;
501 interrupts = <0 19 0x04 0 20 0x04>;
502 };
503 };
504
505 epit1: epit@020d0000 { /* EPIT1 */
506 reg = <0x020d0000 0x4000>;
507 interrupts = <0 56 0x04>;
508 };
509
510 epit2: epit@020d4000 { /* EPIT2 */
511 reg = <0x020d4000 0x4000>;
512 interrupts = <0 57 0x04>;
513 };
514
515 src: src@020d8000 {
516 compatible = "fsl,imx6q-src";
517 reg = <0x020d8000 0x4000>;
518 interrupts = <0 91 0x04 0 96 0x04>;
519 };
520
521 gpc: gpc@020dc000 {
522 compatible = "fsl,imx6q-gpc";
523 reg = <0x020dc000 0x4000>;
524 interrupts = <0 89 0x04 0 90 0x04>;
525 };
526
527 gpr: iomuxc-gpr@020e0000 {
528 compatible = "fsl,imx6q-iomuxc-gpr", "syscon";
529 reg = <0x020e0000 0x38>;
530 };
531
532 dcic1: dcic@020e4000 {
533 reg = <0x020e4000 0x4000>;
534 interrupts = <0 124 0x04>;
535 };
536
537 dcic2: dcic@020e8000 {
538 reg = <0x020e8000 0x4000>;
539 interrupts = <0 125 0x04>;
540 };
541
542 sdma: sdma@020ec000 {
543 compatible = "fsl,imx6q-sdma", "fsl,imx35-sdma";
544 reg = <0x020ec000 0x4000>;
545 interrupts = <0 2 0x04>;
546 clocks = <&clks 155>, <&clks 155>;
547 clock-names = "ipg", "ahb";
548 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx6q.bin";
549 };
550 };
551
552 aips-bus@02100000 { /* AIPS2 */
553 compatible = "fsl,aips-bus", "simple-bus";
554 #address-cells = <1>;
555 #size-cells = <1>;
556 reg = <0x02100000 0x100000>;
557 ranges;
558
559 caam@02100000 {
560 reg = <0x02100000 0x40000>;
561 interrupts = <0 105 0x04 0 106 0x04>;
562 };
563
564 aipstz@0217c000 { /* AIPSTZ2 */
565 reg = <0x0217c000 0x4000>;
566 };
567
568 usbotg: usb@02184000 {
569 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
570 reg = <0x02184000 0x200>;
571 interrupts = <0 43 0x04>;
572 clocks = <&clks 162>;
573 fsl,usbphy = <&usbphy1>;
574 fsl,usbmisc = <&usbmisc 0>;
575 status = "disabled";
576 };
577
578 usbh1: usb@02184200 {
579 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
580 reg = <0x02184200 0x200>;
581 interrupts = <0 40 0x04>;
582 clocks = <&clks 162>;
583 fsl,usbphy = <&usbphy2>;
584 fsl,usbmisc = <&usbmisc 1>;
585 status = "disabled";
586 };
587
588 usbh2: usb@02184400 {
589 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
590 reg = <0x02184400 0x200>;
591 interrupts = <0 41 0x04>;
592 clocks = <&clks 162>;
593 fsl,usbmisc = <&usbmisc 2>;
594 status = "disabled";
595 };
596
597 usbh3: usb@02184600 {
598 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
599 reg = <0x02184600 0x200>;
600 interrupts = <0 42 0x04>;
601 clocks = <&clks 162>;
602 fsl,usbmisc = <&usbmisc 3>;
603 status = "disabled";
604 };
605
606 usbmisc: usbmisc: usbmisc@02184800 {
607 #index-cells = <1>;
608 compatible = "fsl,imx6q-usbmisc";
609 reg = <0x02184800 0x200>;
610 clocks = <&clks 162>;
611 };
612
613 fec: ethernet@02188000 {
614 compatible = "fsl,imx6q-fec";
615 reg = <0x02188000 0x4000>;
616 interrupts = <0 118 0x04 0 119 0x04>;
617 clocks = <&clks 117>, <&clks 117>, <&clks 190>;
618 clock-names = "ipg", "ahb", "ptp";
619 status = "disabled";
620 };
621
622 mlb@0218c000 {
623 reg = <0x0218c000 0x4000>;
624 interrupts = <0 53 0x04 0 117 0x04 0 126 0x04>;
625 };
626
627 usdhc1: usdhc@02190000 {
628 compatible = "fsl,imx6q-usdhc";
629 reg = <0x02190000 0x4000>;
630 interrupts = <0 22 0x04>;
631 clocks = <&clks 163>, <&clks 163>, <&clks 163>;
632 clock-names = "ipg", "ahb", "per";
633 bus-width = <4>;
634 status = "disabled";
635 };
636
637 usdhc2: usdhc@02194000 {
638 compatible = "fsl,imx6q-usdhc";
639 reg = <0x02194000 0x4000>;
640 interrupts = <0 23 0x04>;
641 clocks = <&clks 164>, <&clks 164>, <&clks 164>;
642 clock-names = "ipg", "ahb", "per";
643 bus-width = <4>;
644 status = "disabled";
645 };
646
647 usdhc3: usdhc@02198000 {
648 compatible = "fsl,imx6q-usdhc";
649 reg = <0x02198000 0x4000>;
650 interrupts = <0 24 0x04>;
651 clocks = <&clks 165>, <&clks 165>, <&clks 165>;
652 clock-names = "ipg", "ahb", "per";
653 bus-width = <4>;
654 status = "disabled";
655 };
656
657 usdhc4: usdhc@0219c000 {
658 compatible = "fsl,imx6q-usdhc";
659 reg = <0x0219c000 0x4000>;
660 interrupts = <0 25 0x04>;
661 clocks = <&clks 166>, <&clks 166>, <&clks 166>;
662 clock-names = "ipg", "ahb", "per";
663 bus-width = <4>;
664 status = "disabled";
665 };
666
667 i2c1: i2c@021a0000 {
668 #address-cells = <1>;
669 #size-cells = <0>;
670 compatible = "fsl,imx6q-i2c", "fsl,imx21-i2c";
671 reg = <0x021a0000 0x4000>;
672 interrupts = <0 36 0x04>;
673 clocks = <&clks 125>;
674 status = "disabled";
675 };
676
677 i2c2: i2c@021a4000 {
678 #address-cells = <1>;
679 #size-cells = <0>;
680 compatible = "fsl,imx6q-i2c", "fsl,imx21-i2c";
681 reg = <0x021a4000 0x4000>;
682 interrupts = <0 37 0x04>;
683 clocks = <&clks 126>;
684 status = "disabled";
685 };
686
687 i2c3: i2c@021a8000 {
688 #address-cells = <1>;
689 #size-cells = <0>;
690 compatible = "fsl,imx6q-i2c", "fsl,imx21-i2c";
691 reg = <0x021a8000 0x4000>;
692 interrupts = <0 38 0x04>;
693 clocks = <&clks 127>;
694 status = "disabled";
695 };
696
697 romcp@021ac000 {
698 reg = <0x021ac000 0x4000>;
699 };
700
701 mmdc0: mmdc@021b0000 { /* MMDC0 */
702 compatible = "fsl,imx6q-mmdc";
703 reg = <0x021b0000 0x4000>;
704 };
705
706 mmdc1: mmdc@021b4000 { /* MMDC1 */
707 reg = <0x021b4000 0x4000>;
708 };
709
710 weim@021b8000 {
711 reg = <0x021b8000 0x4000>;
712 interrupts = <0 14 0x04>;
713 };
714
715 ocotp@021bc000 {
716 compatible = "fsl,imx6q-ocotp";
717 reg = <0x021bc000 0x4000>;
718 };
719
720 ocotp@021c0000 {
721 reg = <0x021c0000 0x4000>;
722 interrupts = <0 21 0x04>;
723 };
724
725 tzasc@021d0000 { /* TZASC1 */
726 reg = <0x021d0000 0x4000>;
727 interrupts = <0 108 0x04>;
728 };
729
730 tzasc@021d4000 { /* TZASC2 */
731 reg = <0x021d4000 0x4000>;
732 interrupts = <0 109 0x04>;
733 };
734
735 audmux: audmux@021d8000 {
736 compatible = "fsl,imx6q-audmux", "fsl,imx31-audmux";
737 reg = <0x021d8000 0x4000>;
738 status = "disabled";
739 };
740
741 mipi@021dc000 { /* MIPI-CSI */
742 reg = <0x021dc000 0x4000>;
743 };
744
745 mipi@021e0000 { /* MIPI-DSI */
746 reg = <0x021e0000 0x4000>;
747 };
748
749 vdoa@021e4000 {
750 reg = <0x021e4000 0x4000>;
751 interrupts = <0 18 0x04>;
752 };
753
754 uart2: serial@021e8000 {
755 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
756 reg = <0x021e8000 0x4000>;
757 interrupts = <0 27 0x04>;
758 clocks = <&clks 160>, <&clks 161>;
759 clock-names = "ipg", "per";
760 status = "disabled";
761 };
762
763 uart3: serial@021ec000 {
764 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
765 reg = <0x021ec000 0x4000>;
766 interrupts = <0 28 0x04>;
767 clocks = <&clks 160>, <&clks 161>;
768 clock-names = "ipg", "per";
769 status = "disabled";
770 };
771
772 uart4: serial@021f0000 {
773 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
774 reg = <0x021f0000 0x4000>;
775 interrupts = <0 29 0x04>;
776 clocks = <&clks 160>, <&clks 161>;
777 clock-names = "ipg", "per";
778 status = "disabled";
779 };
780
781 uart5: serial@021f4000 {
782 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
783 reg = <0x021f4000 0x4000>;
784 interrupts = <0 30 0x04>;
785 clocks = <&clks 160>, <&clks 161>;
786 clock-names = "ipg", "per";
787 status = "disabled";
788 };
789 };
790
791 ipu1: ipu@02400000 {
792 #crtc-cells = <1>;
793 compatible = "fsl,imx6q-ipu";
794 reg = <0x02400000 0x400000>;
795 interrupts = <0 6 0x4 0 5 0x4>;
796 clocks = <&clks 130>, <&clks 131>, <&clks 132>;
797 clock-names = "bus", "di0", "di1";
798 };
799 };
800};
diff --git a/arch/arm/boot/dts/kirkwood-6282.dtsi b/arch/arm/boot/dts/kirkwood-6282.dtsi
index 4ccea2130a6c..192cf76fbf93 100644
--- a/arch/arm/boot/dts/kirkwood-6282.dtsi
+++ b/arch/arm/boot/dts/kirkwood-6282.dtsi
@@ -5,6 +5,12 @@
5 compatible = "marvell,88f6282-pinctrl"; 5 compatible = "marvell,88f6282-pinctrl";
6 reg = <0x10000 0x20>; 6 reg = <0x10000 0x20>;
7 7
8 pmx_nand: pmx-nand {
9 marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3",
10 "mpp4", "mpp5", "mpp18", "mpp19";
11 marvell,function = "nand";
12 };
13
8 pmx_sata0: pmx-sata0 { 14 pmx_sata0: pmx-sata0 {
9 marvell,pins = "mpp5", "mpp21", "mpp23"; 15 marvell,pins = "mpp5", "mpp21", "mpp23";
10 marvell,function = "sata0"; 16 marvell,function = "sata0";
@@ -21,6 +27,12 @@
21 marvell,pins = "mpp8", "mpp9"; 27 marvell,pins = "mpp8", "mpp9";
22 marvell,function = "twsi0"; 28 marvell,function = "twsi0";
23 }; 29 };
30
31 pmx_twsi1: pmx-twsi1 {
32 marvell,pins = "mpp36", "mpp37";
33 marvell,function = "twsi1";
34 };
35
24 pmx_uart0: pmx-uart0 { 36 pmx_uart0: pmx-uart0 {
25 marvell,pins = "mpp10", "mpp11"; 37 marvell,pins = "mpp10", "mpp11";
26 marvell,function = "uart0"; 38 marvell,function = "uart0";
@@ -30,6 +42,11 @@
30 marvell,pins = "mpp13", "mpp14"; 42 marvell,pins = "mpp13", "mpp14";
31 marvell,function = "uart1"; 43 marvell,function = "uart1";
32 }; 44 };
45 pmx_sdio: pmx-sdio {
46 marvell,pins = "mpp12", "mpp13", "mpp14",
47 "mpp15", "mpp16", "mpp17";
48 marvell,function = "sdio";
49 };
33 }; 50 };
34 51
35 i2c@11100 { 52 i2c@11100 {
diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index f2d386c95b07..ef2d8c705709 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -74,6 +74,13 @@
74 status = "okay"; 74 status = "okay";
75 nr-ports = <1>; 75 nr-ports = <1>;
76 }; 76 };
77
78 mvsdio@90000 {
79 pinctrl-0 = <&pmx_sdio>;
80 pinctrl-names = "default";
81 status = "okay";
82 /* No CD or WP GPIOs */
83 };
77 }; 84 };
78 85
79 gpio-leds { 86 gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts b/arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts
new file mode 100644
index 000000000000..9555a86297c2
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts
@@ -0,0 +1,94 @@
1/dts-v1/;
2
3/include/ "kirkwood.dtsi"
4/include/ "kirkwood-6281.dtsi"
5
6/ {
7 model = "Globalscale Technologies Guruplug Server Plus";
8 compatible = "globalscale,guruplug-server-plus", "globalscale,guruplug", "marvell,kirkwood-88f6281", "marvell,kirkwood";
9
10 memory {
11 device_type = "memory";
12 reg = <0x00000000 0x20000000>;
13 };
14
15 chosen {
16 bootargs = "console=ttyS0,115200n8 earlyprintk";
17 };
18
19 ocp@f1000000 {
20 pinctrl: pinctrl@10000 {
21
22 pinctrl-0 = < &pmx_led_health_r &pmx_led_health_g
23 &pmx_led_wmode_r &pmx_led_wmode_g >;
24 pinctrl-names = "default";
25
26 pmx_led_health_r: pmx-led-health-r {
27 marvell,pins = "mpp46";
28 marvell,function = "gpio";
29 };
30 pmx_led_health_g: pmx-led-health-g {
31 marvell,pins = "mpp47";
32 marvell,function = "gpio";
33 };
34 pmx_led_wmode_r: pmx-led-wmode-r {
35 marvell,pins = "mpp48";
36 marvell,function = "gpio";
37 };
38 pmx_led_wmode_g: pmx-led-wmode-g {
39 marvell,pins = "mpp49";
40 marvell,function = "gpio";
41 };
42 };
43 serial@12000 {
44 clock-frequency = <200000000>;
45 status = "ok";
46 };
47
48 nand@3000000 {
49 status = "okay";
50
51 partition@0 {
52 label = "u-boot";
53 reg = <0x00000000 0x00100000>;
54 read-only;
55 };
56
57 partition@100000 {
58 label = "uImage";
59 reg = <0x00100000 0x00400000>;
60 };
61
62 partition@500000 {
63 label = "data";
64 reg = <0x00500000 0x1fb00000>;
65 };
66 };
67
68 sata@80000 {
69 status = "okay";
70 nr-ports = <1>;
71 };
72 };
73
74 gpio-leds {
75 compatible = "gpio-leds";
76
77 health-r {
78 label = "guruplug:red:health";
79 gpios = <&gpio1 14 1>;
80 };
81 health-g {
82 label = "guruplug:green:health";
83 gpios = <&gpio1 15 1>;
84 };
85 wmode-r {
86 label = "guruplug:red:wmode";
87 gpios = <&gpio1 16 1>;
88 };
89 wmode-g {
90 label = "guruplug:green:wmode";
91 gpios = <&gpio1 17 1>;
92 };
93 };
94};
diff --git a/arch/arm/boot/dts/kirkwood-mplcec4.dts b/arch/arm/boot/dts/kirkwood-mplcec4.dts
index 262c65403760..662dfd81b1ce 100644
--- a/arch/arm/boot/dts/kirkwood-mplcec4.dts
+++ b/arch/arm/boot/dts/kirkwood-mplcec4.dts
@@ -20,12 +20,11 @@
20 pinctrl: pinctrl@10000 { 20 pinctrl: pinctrl@10000 {
21 21
22 pinctrl-0 = < &pmx_nand &pmx_uart0 22 pinctrl-0 = < &pmx_nand &pmx_uart0
23 &pmx_led_health &pmx_sdio 23 &pmx_led_health
24 &pmx_sata0 &pmx_sata1 24 &pmx_sata0 &pmx_sata1
25 &pmx_led_user1o 25 &pmx_led_user1o
26 &pmx_led_user1g &pmx_led_user0o 26 &pmx_led_user1g &pmx_led_user0o
27 &pmx_led_user0g &pmx_led_misc 27 &pmx_led_user0g &pmx_led_misc
28 &pmx_sdio_cd
29 >; 28 >;
30 pinctrl-names = "default"; 29 pinctrl-names = "default";
31 30
@@ -133,6 +132,14 @@
133 status = "okay"; 132 status = "okay";
134 133
135 }; 134 };
135
136 mvsdio@90000 {
137 pinctrl-0 = <&pmx_sdio &pmx_sdio_cd>;
138 pinctrl-names = "default";
139 status = "okay";
140 cd-gpios = <&gpio1 15 0>;
141 /* No WP GPIO */
142 };
136 }; 143 };
137 144
138 gpio-leds { 145 gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood-ns2-common.dtsi b/arch/arm/boot/dts/kirkwood-ns2-common.dtsi
index 77d21abfcdf7..e8e7ecef1650 100644
--- a/arch/arm/boot/dts/kirkwood-ns2-common.dtsi
+++ b/arch/arm/boot/dts/kirkwood-ns2-common.dtsi
@@ -76,4 +76,10 @@
76 gpios = <&gpio0 12 0>; 76 gpios = <&gpio0 12 0>;
77 }; 77 };
78 }; 78 };
79
80 gpio_poweroff {
81 compatible = "gpio-poweroff";
82 gpios = <&gpio0 31 0>;
83 };
84
79}; 85};
diff --git a/arch/arm/boot/dts/kirkwood-nsa310.dts b/arch/arm/boot/dts/kirkwood-nsa310.dts
index 5509f9659546..3a178cf708d7 100644
--- a/arch/arm/boot/dts/kirkwood-nsa310.dts
+++ b/arch/arm/boot/dts/kirkwood-nsa310.dts
@@ -16,6 +16,105 @@
16 }; 16 };
17 17
18 ocp@f1000000 { 18 ocp@f1000000 {
19 pinctrl: pinctrl@10000 {
20 pinctrl-0 = < &pmx_led_esata_green
21 &pmx_led_esata_red
22 &pmx_led_usb_green
23 &pmx_led_usb_red
24 &pmx_usb_power_off
25 &pmx_led_sys_green
26 &pmx_led_sys_red
27 &pmx_btn_reset
28 &pmx_btn_copy
29 &pmx_led_copy_green
30 &pmx_led_copy_red
31 &pmx_led_hdd_green
32 &pmx_led_hdd_red
33 &pmx_unknown
34 &pmx_btn_power
35 &pmx_pwr_off >;
36 pinctrl-names = "default";
37
38 pmx_led_esata_green: pmx-led-esata-green {
39 marvell,pins = "mpp12";
40 marvell,function = "gpio";
41 };
42
43 pmx_led_esata_red: pmx-led-esata-red {
44 marvell,pins = "mpp13";
45 marvell,function = "gpio";
46 };
47
48 pmx_led_usb_green: pmx-led-usb-green {
49 marvell,pins = "mpp15";
50 marvell,function = "gpio";
51 };
52
53 pmx_led_usb_red: pmx-led-usb-red {
54 marvell,pins = "mpp16";
55 marvell,function = "gpio";
56 };
57
58 pmx_usb_power_off: pmx-usb-power-off {
59 marvell,pins = "mpp21";
60 marvell,function = "gpio";
61 };
62
63 pmx_led_sys_green: pmx-led-sys-green {
64 marvell,pins = "mpp28";
65 marvell,function = "gpio";
66 };
67
68 pmx_led_sys_red: pmx-led-sys-red {
69 marvell,pins = "mpp29";
70 marvell,function = "gpio";
71 };
72
73 pmx_btn_reset: pmx-btn-reset {
74 marvell,pins = "mpp36";
75 marvell,function = "gpio";
76 };
77
78 pmx_btn_copy: pmx-btn-copy {
79 marvell,pins = "mpp37";
80 marvell,function = "gpio";
81 };
82
83 pmx_led_copy_green: pmx-led-copy-green {
84 marvell,pins = "mpp39";
85 marvell,function = "gpio";
86 };
87
88 pmx_led_copy_red: pmx-led-copy-red {
89 marvell,pins = "mpp40";
90 marvell,function = "gpio";
91 };
92
93 pmx_led_hdd_green: pmx-led-hdd-green {
94 marvell,pins = "mpp41";
95 marvell,function = "gpio";
96 };
97
98 pmx_led_hdd_red: pmx-led-hdd-red {
99 marvell,pins = "mpp42";
100 marvell,function = "gpio";
101 };
102
103 pmx_unknown: pmx-unknown {
104 marvell,pins = "mpp44";
105 marvell,function = "gpio";
106 };
107
108 pmx_btn_power: pmx-btn-power {
109 marvell,pins = "mpp46";
110 marvell,function = "gpio";
111 };
112
113 pmx_pwr_off: pmx-pwr-off {
114 marvell,pins = "mpp48";
115 marvell,function = "gpio";
116 };
117 };
19 118
20 serial@12000 { 119 serial@12000 {
21 clock-frequency = <200000000>; 120 clock-frequency = <200000000>;
@@ -29,6 +128,11 @@
29 128
30 i2c@11000 { 129 i2c@11000 {
31 status = "okay"; 130 status = "okay";
131
132 adt7476: adt7476a@2e {
133 compatible = "adt7476";
134 reg = <0x2e>;
135 };
32 }; 136 };
33 137
34 nand@3000000 { 138 nand@3000000 {
@@ -141,4 +245,26 @@
141 gpios = <&gpio1 8 0>; 245 gpios = <&gpio1 8 0>;
142 }; 246 };
143 }; 247 };
248
249 gpio_poweroff {
250 compatible = "gpio-poweroff";
251 gpios = <&gpio1 16 0>;
252 };
253
254 regulators {
255 compatible = "simple-bus";
256 #address-cells = <1>;
257 #size-cells = <0>;
258
259 usb0_power_off: regulator@1 {
260 compatible = "regulator-fixed";
261 reg = <1>;
262 regulator-name = "USB Power Off";
263 regulator-min-microvolt = <5000000>;
264 regulator-max-microvolt = <5000000>;
265 regulator-always-on;
266 regulator-boot-on;
267 gpio = <&gpio0 21 0>;
268 };
269 };
144}; 270};
diff --git a/arch/arm/boot/dts/kirkwood-openblocks_a6.dts b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
index 49d3d74d4d38..ede7fe0d7a87 100644
--- a/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
+++ b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
@@ -75,6 +75,122 @@
75 reg = <0x30>; 75 reg = <0x30>;
76 }; 76 };
77 }; 77 };
78
79 pinctrl: pinctrl@10000 {
80 pinctrl-0 = < &pmx_nand &pmx_uart0
81 &pmx_uart1 &pmx_twsi1
82 &pmx_dip_sw0 &pmx_dip_sw1
83 &pmx_dip_sw2 &pmx_dip_sw3
84 &pmx_gpio_0 &pmx_gpio_1
85 &pmx_gpio_2 &pmx_gpio_3
86 &pmx_gpio_4 &pmx_gpio_5
87 &pmx_gpio_6 &pmx_gpio_7
88 &pmx_led_red &pmx_led_green
89 &pmx_led_yellow >;
90 pinctrl-names = "default";
91
92 pmx_uart0: pmx-uart0 {
93 marvell,pins = "mpp10", "mpp11", "mpp15",
94 "mpp16";
95 marvell,function = "uart0";
96 };
97
98 pmx_uart1: pmx-uart1 {
99 marvell,pins = "mpp13", "mpp14", "mpp8",
100 "mpp9";
101 marvell,function = "uart1";
102 };
103
104 pmx_sysrst: pmx-sysrst {
105 marvell,pins = "mpp6";
106 marvell,function = "sysrst";
107 };
108
109 pmx_dip_sw0: pmx-dip-sw0 {
110 marvell,pins = "mpp20";
111 marvell,function = "gpio";
112 };
113
114 pmx_dip_sw1: pmx-dip-sw1 {
115 marvell,pins = "mpp21";
116 marvell,function = "gpio";
117 };
118
119 pmx_dip_sw2: pmx-dip-sw2 {
120 marvell,pins = "mpp22";
121 marvell,function = "gpio";
122 };
123
124 pmx_dip_sw3: pmx-dip-sw3 {
125 marvell,pins = "mpp23";
126 marvell,function = "gpio";
127 };
128
129 pmx_gpio_0: pmx-gpio-0 {
130 marvell,pins = "mpp24";
131 marvell,function = "gpio";
132 };
133
134 pmx_gpio_1: pmx-gpio-1 {
135 marvell,pins = "mpp25";
136 marvell,function = "gpio";
137 };
138
139 pmx_gpio_2: pmx-gpio-2 {
140 marvell,pins = "mpp26";
141 marvell,function = "gpio";
142 };
143
144 pmx_gpio_3: pmx-gpio-3 {
145 marvell,pins = "mpp27";
146 marvell,function = "gpio";
147 };
148
149 pmx_gpio_4: pmx-gpio-4 {
150 marvell,pins = "mpp28";
151 marvell,function = "gpio";
152 };
153
154 pmx_gpio_5: pmx-gpio-5 {
155 marvell,pins = "mpp29";
156 marvell,function = "gpio";
157 };
158
159 pmx_gpio_6: pmx-gpio-6 {
160 marvell,pins = "mpp30";
161 marvell,function = "gpio";
162 };
163
164 pmx_gpio_7: pmx-gpio-7 {
165 marvell,pins = "mpp31";
166 marvell,function = "gpio";
167 };
168
169 pmx_gpio_init: pmx-init {
170 marvell,pins = "mpp38";
171 marvell,function = "gpio";
172 };
173
174 pmx_usb_oc: pmx-usb-oc {
175 marvell,pins = "mpp39";
176 marvell,function = "gpio";
177 };
178
179 pmx_led_red: pmx-led-red {
180 marvell,pins = "mpp41";
181 marvell,function = "gpio";
182 };
183
184 pmx_led_green: pmx-led-green {
185 marvell,pins = "mpp42";
186 marvell,function = "gpio";
187 };
188
189 pmx_led_yellow: pmx-led-yellow {
190 marvell,pins = "mpp43";
191 marvell,function = "gpio";
192 };
193 };
78 }; 194 };
79 195
80 gpio-leds { 196 gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
index cd15452a52a6..842ff95d60df 100644
--- a/arch/arm/boot/dts/kirkwood-topkick.dts
+++ b/arch/arm/boot/dts/kirkwood-topkick.dts
@@ -1,6 +1,7 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood.dtsi" 3/include/ "kirkwood.dtsi"
4/include/ "kirkwood-6282.dtsi"
4 5
5/ { 6/ {
6 model = "Univeral Scientific Industrial Co. Topkick-1281P2"; 7 model = "Univeral Scientific Industrial Co. Topkick-1281P2";
@@ -16,6 +17,96 @@
16 }; 17 };
17 18
18 ocp@f1000000 { 19 ocp@f1000000 {
20 pinctrl: pinctrl@10000 {
21 /*
22 * GPIO LED layout
23 *
24 * /-SYS_LED(2)
25 * |
26 * | /-DISK_LED
27 * | |
28 * | | /-WLAN_LED(2)
29 * | | |
30 * [SW] [*] [*] [*]
31 */
32
33 /*
34 * Switch positions
35 *
36 * /-SW_LEFT(2)
37 * |
38 * | /-SW_IDLE
39 * | |
40 * | | /-SW_RIGHT
41 * | | |
42 * PS [L] [I] [R] LEDS
43 */
44 pinctrl-0 = < &pmx_led_disk_yellow
45 &pmx_sata0_pwr_enable
46 &pmx_led_sys_red
47 &pmx_led_sys_blue
48 &pmx_led_wifi_green
49 &pmx_sw_left
50 &pmx_sw_right
51 &pmx_sw_idle
52 &pmx_sw_left2
53 &pmx_led_wifi_yellow
54 &pmx_uart0
55 &pmx_nand
56 &pmx_twsi0 >;
57 pinctrl-names = "default";
58
59 pmx_led_disk_yellow: pmx-led-disk-yellow {
60 marvell,pins = "mpp21";
61 marvell,function = "gpio";
62 };
63
64 pmx_sata0_pwr_enable: pmx-sata0-pwr-enable {
65 marvell,pins = "mpp36";
66 marvell,function = "gpio";
67 };
68
69 pmx_led_sys_red: pmx-led-sys-red {
70 marvell,pins = "mpp37";
71 marvell,function = "gpio";
72 };
73
74 pmx_led_sys_blue: pmx-led-sys-blue {
75 marvell,pins = "mpp38";
76 marvell,function = "gpio";
77 };
78
79 pmx_led_wifi_green: pmx-led-wifi-green {
80 marvell,pins = "mpp39";
81 marvell,function = "gpio";
82 };
83
84 pmx_sw_left: pmx-sw-left {
85 marvell,pins = "mpp43";
86 marvell,function = "gpio";
87 };
88
89 pmx_sw_right: pmx-sw-right {
90 marvell,pins = "mpp44";
91 marvell,function = "gpio";
92 };
93
94 pmx_sw_idle: pmx-sw-idle {
95 marvell,pins = "mpp45";
96 marvell,function = "gpio";
97 };
98
99 pmx_sw_left2: pmx-sw-left2 {
100 marvell,pins = "mpp46";
101 marvell,function = "gpio";
102 };
103
104 pmx_led_wifi_yellow: pmx-led-wifi-yellow {
105 marvell,pins = "mpp48";
106 marvell,function = "gpio";
107 };
108 };
109
19 serial@12000 { 110 serial@12000 {
20 clock-frequency = <200000000>; 111 clock-frequency = <200000000>;
21 status = "ok"; 112 status = "ok";
@@ -54,6 +145,17 @@
54 status = "okay"; 145 status = "okay";
55 nr-ports = <1>; 146 nr-ports = <1>;
56 }; 147 };
148
149 i2c@11000 {
150 status = "ok";
151 };
152
153 mvsdio@90000 {
154 pinctrl-0 = <&pmx_sdio>;
155 pinctrl-names = "default";
156 status = "okay";
157 /* No CD or WP GPIOs */
158 };
57 }; 159 };
58 160
59 gpio-leds { 161 gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index d6ab442b7011..2c738d9dc82a 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -193,5 +193,13 @@
193 clocks = <&gate_clk 17>; 193 clocks = <&gate_clk 17>;
194 status = "okay"; 194 status = "okay";
195 }; 195 };
196
197 mvsdio@90000 {
198 compatible = "marvell,orion-sdio";
199 reg = <0x90000 0x200>;
200 interrupts = <28>;
201 clocks = <&gate_clk 4>;
202 status = "disabled";
203 };
196 }; 204 };
197}; 205};
diff --git a/arch/arm/boot/dts/marco-evb.dts b/arch/arm/boot/dts/marco-evb.dts
new file mode 100644
index 000000000000..5130aeacfca5
--- /dev/null
+++ b/arch/arm/boot/dts/marco-evb.dts
@@ -0,0 +1,54 @@
1/*
2 * DTS file for CSR SiRFmarco Evaluation Board
3 *
4 * Copyright (c) 2012 Cambridge Silicon Radio Limited, a CSR plc group company.
5 *
6 * Licensed under GPLv2 or later.
7 */
8
9/dts-v1/;
10
11/include/ "marco.dtsi"
12
13/ {
14 model = "CSR SiRFmarco Evaluation Board";
15 compatible = "sirf,marco-cb", "sirf,marco";
16
17 memory {
18 reg = <0x40000000 0x60000000>;
19 };
20
21 axi {
22 peri-iobg {
23 uart1: uart@cc060000 {
24 status = "okay";
25 };
26 uart2: uart@cc070000 {
27 status = "okay";
28 };
29 i2c0: i2c@cc0e0000 {
30 status = "okay";
31 fpga-cpld@4d {
32 compatible = "sirf,fpga-cpld";
33 reg = <0x4d>;
34 };
35 };
36 spi1: spi@cc170000 {
37 status = "okay";
38 pinctrl-names = "default";
39 pinctrl-0 = <&spi1_pins_a>;
40 spi@0 {
41 compatible = "spidev";
42 reg = <0>;
43 spi-max-frequency = <1000000>;
44 };
45 };
46 pci-iobg {
47 sd0: sdhci@cd000000 {
48 bus-width = <8>;
49 status = "okay";
50 };
51 };
52 };
53 };
54};
diff --git a/arch/arm/boot/dts/marco.dtsi b/arch/arm/boot/dts/marco.dtsi
new file mode 100644
index 000000000000..1579c3491ccd
--- /dev/null
+++ b/arch/arm/boot/dts/marco.dtsi
@@ -0,0 +1,756 @@
1/*
2 * DTS file for CSR SiRFmarco SoC
3 *
4 * Copyright (c) 2012 Cambridge Silicon Radio Limited, a CSR plc group company.
5 *
6 * Licensed under GPLv2 or later.
7 */
8
9/include/ "skeleton.dtsi"
10/ {
11 compatible = "sirf,marco";
12 #address-cells = <1>;
13 #size-cells = <1>;
14 interrupt-parent = <&gic>;
15
16 cpus {
17 #address-cells = <1>;
18 #size-cells = <0>;
19
20 cpu@0 {
21 device_type = "cpu";
22 compatible = "arm,cortex-a9";
23 reg = <0>;
24 };
25 cpu@1 {
26 device_type = "cpu";
27 compatible = "arm,cortex-a9";
28 reg = <1>;
29 };
30 };
31
32 axi {
33 compatible = "simple-bus";
34 #address-cells = <1>;
35 #size-cells = <1>;
36 ranges = <0x40000000 0x40000000 0xa0000000>;
37
38 l2-cache-controller@c0030000 {
39 compatible = "sirf,marco-pl310-cache", "arm,pl310-cache";
40 reg = <0xc0030000 0x1000>;
41 interrupts = <0 59 0>;
42 arm,tag-latency = <1 1 1>;
43 arm,data-latency = <1 1 1>;
44 arm,filter-ranges = <0x40000000 0x80000000>;
45 };
46
47 gic: interrupt-controller@c0011000 {
48 compatible = "arm,cortex-a9-gic";
49 interrupt-controller;
50 #interrupt-cells = <3>;
51 reg = <0xc0011000 0x1000>,
52 <0xc0010100 0x0100>;
53 };
54
55 rstc-iobg {
56 compatible = "simple-bus";
57 #address-cells = <1>;
58 #size-cells = <1>;
59 ranges = <0xc2000000 0xc2000000 0x1000000>;
60
61 reset-controller@c2000000 {
62 compatible = "sirf,marco-rstc";
63 reg = <0xc2000000 0x10000>;
64 };
65 };
66
67 sys-iobg {
68 compatible = "simple-bus";
69 #address-cells = <1>;
70 #size-cells = <1>;
71 ranges = <0xc3000000 0xc3000000 0x1000000>;
72
73 clock-controller@c3000000 {
74 compatible = "sirf,marco-clkc";
75 reg = <0xc3000000 0x1000>;
76 interrupts = <0 3 0>;
77 };
78
79 rsc-controller@c3010000 {
80 compatible = "sirf,marco-rsc";
81 reg = <0xc3010000 0x1000>;
82 };
83 };
84
85 mem-iobg {
86 compatible = "simple-bus";
87 #address-cells = <1>;
88 #size-cells = <1>;
89 ranges = <0xc4000000 0xc4000000 0x1000000>;
90
91 memory-controller@c4000000 {
92 compatible = "sirf,marco-memc";
93 reg = <0xc4000000 0x10000>;
94 interrupts = <0 27 0>;
95 };
96 };
97
98 disp-iobg0 {
99 compatible = "simple-bus";
100 #address-cells = <1>;
101 #size-cells = <1>;
102 ranges = <0xc5000000 0xc5000000 0x1000000>;
103
104 display0@c5000000 {
105 compatible = "sirf,marco-lcd";
106 reg = <0xc5000000 0x10000>;
107 interrupts = <0 30 0>;
108 };
109
110 vpp0@c5010000 {
111 compatible = "sirf,marco-vpp";
112 reg = <0xc5010000 0x10000>;
113 interrupts = <0 31 0>;
114 };
115 };
116
117 disp-iobg1 {
118 compatible = "simple-bus";
119 #address-cells = <1>;
120 #size-cells = <1>;
121 ranges = <0xc6000000 0xc6000000 0x1000000>;
122
123 display1@c6000000 {
124 compatible = "sirf,marco-lcd";
125 reg = <0xc6000000 0x10000>;
126 interrupts = <0 62 0>;
127 };
128
129 vpp1@c6010000 {
130 compatible = "sirf,marco-vpp";
131 reg = <0xc6010000 0x10000>;
132 interrupts = <0 63 0>;
133 };
134 };
135
136 graphics-iobg {
137 compatible = "simple-bus";
138 #address-cells = <1>;
139 #size-cells = <1>;
140 ranges = <0xc8000000 0xc8000000 0x1000000>;
141
142 graphics@c8000000 {
143 compatible = "powervr,sgx540";
144 reg = <0xc8000000 0x1000000>;
145 interrupts = <0 6 0>;
146 };
147 };
148
149 multimedia-iobg {
150 compatible = "simple-bus";
151 #address-cells = <1>;
152 #size-cells = <1>;
153 ranges = <0xc9000000 0xc9000000 0x1000000>;
154
155 multimedia@a0000000 {
156 compatible = "sirf,marco-video-codec";
157 reg = <0xc9000000 0x1000000>;
158 interrupts = <0 5 0>;
159 };
160 };
161
162 dsp-iobg {
163 compatible = "simple-bus";
164 #address-cells = <1>;
165 #size-cells = <1>;
166 ranges = <0xca000000 0xca000000 0x2000000>;
167
168 dspif@ca000000 {
169 compatible = "sirf,marco-dspif";
170 reg = <0xca000000 0x10000>;
171 interrupts = <0 9 0>;
172 };
173
174 gps@ca010000 {
175 compatible = "sirf,marco-gps";
176 reg = <0xca010000 0x10000>;
177 interrupts = <0 7 0>;
178 };
179
180 dsp@cb000000 {
181 compatible = "sirf,marco-dsp";
182 reg = <0xcb000000 0x1000000>;
183 interrupts = <0 8 0>;
184 };
185 };
186
187 peri-iobg {
188 compatible = "simple-bus";
189 #address-cells = <1>;
190 #size-cells = <1>;
191 ranges = <0xcc000000 0xcc000000 0x2000000>;
192
193 timer@cc020000 {
194 compatible = "sirf,marco-tick";
195 reg = <0xcc020000 0x1000>;
196 interrupts = <0 0 0>,
197 <0 1 0>,
198 <0 2 0>,
199 <0 49 0>,
200 <0 50 0>,
201 <0 51 0>;
202 };
203
204 nand@cc030000 {
205 compatible = "sirf,marco-nand";
206 reg = <0xcc030000 0x10000>;
207 interrupts = <0 41 0>;
208 };
209
210 audio@cc040000 {
211 compatible = "sirf,marco-audio";
212 reg = <0xcc040000 0x10000>;
213 interrupts = <0 35 0>;
214 };
215
216 uart0: uart@cc050000 {
217 cell-index = <0>;
218 compatible = "sirf,marco-uart";
219 reg = <0xcc050000 0x1000>;
220 interrupts = <0 17 0>;
221 fifosize = <128>;
222 status = "disabled";
223 };
224
225 uart1: uart@cc060000 {
226 cell-index = <1>;
227 compatible = "sirf,marco-uart";
228 reg = <0xcc060000 0x1000>;
229 interrupts = <0 18 0>;
230 fifosize = <32>;
231 status = "disabled";
232 };
233
234 uart2: uart@cc070000 {
235 cell-index = <2>;
236 compatible = "sirf,marco-uart";
237 reg = <0xcc070000 0x1000>;
238 interrupts = <0 19 0>;
239 fifosize = <128>;
240 status = "disabled";
241 };
242
243 uart3: uart@cc190000 {
244 cell-index = <3>;
245 compatible = "sirf,marco-uart";
246 reg = <0xcc190000 0x1000>;
247 interrupts = <0 66 0>;
248 fifosize = <128>;
249 status = "disabled";
250 };
251
252 uart4: uart@cc1a0000 {
253 cell-index = <4>;
254 compatible = "sirf,marco-uart";
255 reg = <0xcc1a0000 0x1000>;
256 interrupts = <0 69 0>;
257 fifosize = <128>;
258 status = "disabled";
259 };
260
261 usp0: usp@cc080000 {
262 cell-index = <0>;
263 compatible = "sirf,marco-usp";
264 reg = <0xcc080000 0x10000>;
265 interrupts = <0 20 0>;
266 status = "disabled";
267 };
268
269 usp1: usp@cc090000 {
270 cell-index = <1>;
271 compatible = "sirf,marco-usp";
272 reg = <0xcc090000 0x10000>;
273 interrupts = <0 21 0>;
274 status = "disabled";
275 };
276
277 usp2: usp@cc0a0000 {
278 cell-index = <2>;
279 compatible = "sirf,marco-usp";
280 reg = <0xcc0a0000 0x10000>;
281 interrupts = <0 22 0>;
282 status = "disabled";
283 };
284
285 dmac0: dma-controller@cc0b0000 {
286 cell-index = <0>;
287 compatible = "sirf,marco-dmac";
288 reg = <0xcc0b0000 0x10000>;
289 interrupts = <0 12 0>;
290 };
291
292 dmac1: dma-controller@cc160000 {
293 cell-index = <1>;
294 compatible = "sirf,marco-dmac";
295 reg = <0xcc160000 0x10000>;
296 interrupts = <0 13 0>;
297 };
298
299 vip@cc0c0000 {
300 compatible = "sirf,marco-vip";
301 reg = <0xcc0c0000 0x10000>;
302 };
303
304 spi0: spi@cc0d0000 {
305 cell-index = <0>;
306 compatible = "sirf,marco-spi";
307 reg = <0xcc0d0000 0x10000>;
308 interrupts = <0 15 0>;
309 sirf,spi-num-chipselects = <1>;
310 cs-gpios = <&gpio 0 0>;
311 sirf,spi-dma-rx-channel = <25>;
312 sirf,spi-dma-tx-channel = <20>;
313 #address-cells = <1>;
314 #size-cells = <0>;
315 status = "disabled";
316 };
317
318 spi1: spi@cc170000 {
319 cell-index = <1>;
320 compatible = "sirf,marco-spi";
321 reg = <0xcc170000 0x10000>;
322 interrupts = <0 16 0>;
323 sirf,spi-num-chipselects = <1>;
324 cs-gpios = <&gpio 0 0>;
325 sirf,spi-dma-rx-channel = <12>;
326 sirf,spi-dma-tx-channel = <13>;
327 #address-cells = <1>;
328 #size-cells = <0>;
329 status = "disabled";
330 };
331
332 i2c0: i2c@cc0e0000 {
333 cell-index = <0>;
334 compatible = "sirf,marco-i2c";
335 reg = <0xcc0e0000 0x10000>;
336 interrupts = <0 24 0>;
337 #address-cells = <1>;
338 #size-cells = <0>;
339 status = "disabled";
340 };
341
342 i2c1: i2c@cc0f0000 {
343 cell-index = <1>;
344 compatible = "sirf,marco-i2c";
345 reg = <0xcc0f0000 0x10000>;
346 interrupts = <0 25 0>;
347 #address-cells = <1>;
348 #size-cells = <0>;
349 status = "disabled";
350 };
351
352 tsc@cc110000 {
353 compatible = "sirf,marco-tsc";
354 reg = <0xcc110000 0x10000>;
355 interrupts = <0 33 0>;
356 };
357
358 gpio: pinctrl@cc120000 {
359 #gpio-cells = <2>;
360 #interrupt-cells = <2>;
361 compatible = "sirf,marco-pinctrl";
362 reg = <0xcc120000 0x10000>;
363 interrupts = <0 43 0>,
364 <0 44 0>,
365 <0 45 0>,
366 <0 46 0>,
367 <0 47 0>;
368 gpio-controller;
369 interrupt-controller;
370
371 lcd_16pins_a: lcd0_0 {
372 lcd {
373 sirf,pins = "lcd_16bitsgrp";
374 sirf,function = "lcd_16bits";
375 };
376 };
377 lcd_18pins_a: lcd0_1 {
378 lcd {
379 sirf,pins = "lcd_18bitsgrp";
380 sirf,function = "lcd_18bits";
381 };
382 };
383 lcd_24pins_a: lcd0_2 {
384 lcd {
385 sirf,pins = "lcd_24bitsgrp";
386 sirf,function = "lcd_24bits";
387 };
388 };
389 lcdrom_pins_a: lcdrom0_0 {
390 lcd {
391 sirf,pins = "lcdromgrp";
392 sirf,function = "lcdrom";
393 };
394 };
395 uart0_pins_a: uart0_0 {
396 uart {
397 sirf,pins = "uart0grp";
398 sirf,function = "uart0";
399 };
400 };
401 uart1_pins_a: uart1_0 {
402 uart {
403 sirf,pins = "uart1grp";
404 sirf,function = "uart1";
405 };
406 };
407 uart2_pins_a: uart2_0 {
408 uart {
409 sirf,pins = "uart2grp";
410 sirf,function = "uart2";
411 };
412 };
413 uart2_noflow_pins_a: uart2_1 {
414 uart {
415 sirf,pins = "uart2_nostreamctrlgrp";
416 sirf,function = "uart2_nostreamctrl";
417 };
418 };
419 spi0_pins_a: spi0_0 {
420 spi {
421 sirf,pins = "spi0grp";
422 sirf,function = "spi0";
423 };
424 };
425 spi1_pins_a: spi1_0 {
426 spi {
427 sirf,pins = "spi1grp";
428 sirf,function = "spi1";
429 };
430 };
431 i2c0_pins_a: i2c0_0 {
432 i2c {
433 sirf,pins = "i2c0grp";
434 sirf,function = "i2c0";
435 };
436 };
437 i2c1_pins_a: i2c1_0 {
438 i2c {
439 sirf,pins = "i2c1grp";
440 sirf,function = "i2c1";
441 };
442 };
443 pwm0_pins_a: pwm0_0 {
444 pwm {
445 sirf,pins = "pwm0grp";
446 sirf,function = "pwm0";
447 };
448 };
449 pwm1_pins_a: pwm1_0 {
450 pwm {
451 sirf,pins = "pwm1grp";
452 sirf,function = "pwm1";
453 };
454 };
455 pwm2_pins_a: pwm2_0 {
456 pwm {
457 sirf,pins = "pwm2grp";
458 sirf,function = "pwm2";
459 };
460 };
461 pwm3_pins_a: pwm3_0 {
462 pwm {
463 sirf,pins = "pwm3grp";
464 sirf,function = "pwm3";
465 };
466 };
467 gps_pins_a: gps_0 {
468 gps {
469 sirf,pins = "gpsgrp";
470 sirf,function = "gps";
471 };
472 };
473 vip_pins_a: vip_0 {
474 vip {
475 sirf,pins = "vipgrp";
476 sirf,function = "vip";
477 };
478 };
479 sdmmc0_pins_a: sdmmc0_0 {
480 sdmmc0 {
481 sirf,pins = "sdmmc0grp";
482 sirf,function = "sdmmc0";
483 };
484 };
485 sdmmc1_pins_a: sdmmc1_0 {
486 sdmmc1 {
487 sirf,pins = "sdmmc1grp";
488 sirf,function = "sdmmc1";
489 };
490 };
491 sdmmc2_pins_a: sdmmc2_0 {
492 sdmmc2 {
493 sirf,pins = "sdmmc2grp";
494 sirf,function = "sdmmc2";
495 };
496 };
497 sdmmc3_pins_a: sdmmc3_0 {
498 sdmmc3 {
499 sirf,pins = "sdmmc3grp";
500 sirf,function = "sdmmc3";
501 };
502 };
503 sdmmc4_pins_a: sdmmc4_0 {
504 sdmmc4 {
505 sirf,pins = "sdmmc4grp";
506 sirf,function = "sdmmc4";
507 };
508 };
509 sdmmc5_pins_a: sdmmc5_0 {
510 sdmmc5 {
511 sirf,pins = "sdmmc5grp";
512 sirf,function = "sdmmc5";
513 };
514 };
515 i2s_pins_a: i2s_0 {
516 i2s {
517 sirf,pins = "i2sgrp";
518 sirf,function = "i2s";
519 };
520 };
521 ac97_pins_a: ac97_0 {
522 ac97 {
523 sirf,pins = "ac97grp";
524 sirf,function = "ac97";
525 };
526 };
527 nand_pins_a: nand_0 {
528 nand {
529 sirf,pins = "nandgrp";
530 sirf,function = "nand";
531 };
532 };
533 usp0_pins_a: usp0_0 {
534 usp0 {
535 sirf,pins = "usp0grp";
536 sirf,function = "usp0";
537 };
538 };
539 usp1_pins_a: usp1_0 {
540 usp1 {
541 sirf,pins = "usp1grp";
542 sirf,function = "usp1";
543 };
544 };
545 usp2_pins_a: usp2_0 {
546 usp2 {
547 sirf,pins = "usp2grp";
548 sirf,function = "usp2";
549 };
550 };
551 usb0_utmi_drvbus_pins_a: usb0_utmi_drvbus_0 {
552 usb0_utmi_drvbus {
553 sirf,pins = "usb0_utmi_drvbusgrp";
554 sirf,function = "usb0_utmi_drvbus";
555 };
556 };
557 usb1_utmi_drvbus_pins_a: usb1_utmi_drvbus_0 {
558 usb1_utmi_drvbus {
559 sirf,pins = "usb1_utmi_drvbusgrp";
560 sirf,function = "usb1_utmi_drvbus";
561 };
562 };
563 warm_rst_pins_a: warm_rst_0 {
564 warm_rst {
565 sirf,pins = "warm_rstgrp";
566 sirf,function = "warm_rst";
567 };
568 };
569 pulse_count_pins_a: pulse_count_0 {
570 pulse_count {
571 sirf,pins = "pulse_countgrp";
572 sirf,function = "pulse_count";
573 };
574 };
575 cko0_rst_pins_a: cko0_rst_0 {
576 cko0_rst {
577 sirf,pins = "cko0_rstgrp";
578 sirf,function = "cko0_rst";
579 };
580 };
581 cko1_rst_pins_a: cko1_rst_0 {
582 cko1_rst {
583 sirf,pins = "cko1_rstgrp";
584 sirf,function = "cko1_rst";
585 };
586 };
587 };
588
589 pwm@cc130000 {
590 compatible = "sirf,marco-pwm";
591 reg = <0xcc130000 0x10000>;
592 };
593
594 efusesys@cc140000 {
595 compatible = "sirf,marco-efuse";
596 reg = <0xcc140000 0x10000>;
597 };
598
599 pulsec@cc150000 {
600 compatible = "sirf,marco-pulsec";
601 reg = <0xcc150000 0x10000>;
602 interrupts = <0 48 0>;
603 };
604
605 pci-iobg {
606 compatible = "sirf,marco-pciiobg", "simple-bus";
607 #address-cells = <1>;
608 #size-cells = <1>;
609 ranges = <0xcd000000 0xcd000000 0x1000000>;
610
611 sd0: sdhci@cd000000 {
612 cell-index = <0>;
613 compatible = "sirf,marco-sdhc";
614 reg = <0xcd000000 0x100000>;
615 interrupts = <0 38 0>;
616 status = "disabled";
617 };
618
619 sd1: sdhci@cd100000 {
620 cell-index = <1>;
621 compatible = "sirf,marco-sdhc";
622 reg = <0xcd100000 0x100000>;
623 interrupts = <0 38 0>;
624 status = "disabled";
625 };
626
627 sd2: sdhci@cd200000 {
628 cell-index = <2>;
629 compatible = "sirf,marco-sdhc";
630 reg = <0xcd200000 0x100000>;
631 interrupts = <0 23 0>;
632 status = "disabled";
633 };
634
635 sd3: sdhci@cd300000 {
636 cell-index = <3>;
637 compatible = "sirf,marco-sdhc";
638 reg = <0xcd300000 0x100000>;
639 interrupts = <0 23 0>;
640 status = "disabled";
641 };
642
643 sd4: sdhci@cd400000 {
644 cell-index = <4>;
645 compatible = "sirf,marco-sdhc";
646 reg = <0xcd400000 0x100000>;
647 interrupts = <0 39 0>;
648 status = "disabled";
649 };
650
651 sd5: sdhci@cd500000 {
652 cell-index = <5>;
653 compatible = "sirf,marco-sdhc";
654 reg = <0xcd500000 0x100000>;
655 interrupts = <0 39 0>;
656 status = "disabled";
657 };
658
659 pci-copy@cd900000 {
660 compatible = "sirf,marco-pcicp";
661 reg = <0xcd900000 0x100000>;
662 interrupts = <0 40 0>;
663 };
664
665 rom-interface@cda00000 {
666 compatible = "sirf,marco-romif";
667 reg = <0xcda00000 0x100000>;
668 };
669 };
670 };
671
672 rtc-iobg {
673 compatible = "sirf,marco-rtciobg", "sirf-marco-rtciobg-bus";
674 #address-cells = <1>;
675 #size-cells = <1>;
676 reg = <0xc1000000 0x10000>;
677
678 gpsrtc@1000 {
679 compatible = "sirf,marco-gpsrtc";
680 reg = <0x1000 0x1000>;
681 interrupts = <0 55 0>,
682 <0 56 0>,
683 <0 57 0>;
684 };
685
686 sysrtc@2000 {
687 compatible = "sirf,marco-sysrtc";
688 reg = <0x2000 0x1000>;
689 interrupts = <0 52 0>,
690 <0 53 0>,
691 <0 54 0>;
692 };
693
694 pwrc@3000 {
695 compatible = "sirf,marco-pwrc";
696 reg = <0x3000 0x1000>;
697 interrupts = <0 32 0>;
698 };
699 };
700
701 uus-iobg {
702 compatible = "simple-bus";
703 #address-cells = <1>;
704 #size-cells = <1>;
705 ranges = <0xce000000 0xce000000 0x1000000>;
706
707 usb0: usb@ce000000 {
708 compatible = "chipidea,ci13611a-marco";
709 reg = <0xce000000 0x10000>;
710 interrupts = <0 10 0>;
711 };
712
713 usb1: usb@ce010000 {
714 compatible = "chipidea,ci13611a-marco";
715 reg = <0xce010000 0x10000>;
716 interrupts = <0 11 0>;
717 };
718
719 security@ce020000 {
720 compatible = "sirf,marco-security";
721 reg = <0xce020000 0x10000>;
722 interrupts = <0 42 0>;
723 };
724 };
725
726 can-iobg {
727 compatible = "simple-bus";
728 #address-cells = <1>;
729 #size-cells = <1>;
730 ranges = <0xd0000000 0xd0000000 0x1000000>;
731
732 can0: can@d0000000 {
733 compatible = "sirf,marco-can";
734 reg = <0xd0000000 0x10000>;
735 };
736
737 can1: can@d0010000 {
738 compatible = "sirf,marco-can";
739 reg = <0xd0010000 0x10000>;
740 };
741 };
742
743 lvds-iobg {
744 compatible = "simple-bus";
745 #address-cells = <1>;
746 #size-cells = <1>;
747 ranges = <0xd1000000 0xd1000000 0x1000000>;
748
749 lvds@d1000000 {
750 compatible = "sirf,marco-lvds";
751 reg = <0xd1000000 0x10000>;
752 interrupts = <0 64 0>;
753 };
754 };
755 };
756};
diff --git a/arch/arm/boot/dts/mmp2-brownstone.dts b/arch/arm/boot/dts/mmp2-brownstone.dts
index c9b4f27d191e..7f70a39459f6 100644
--- a/arch/arm/boot/dts/mmp2-brownstone.dts
+++ b/arch/arm/boot/dts/mmp2-brownstone.dts
@@ -29,6 +29,164 @@
29 }; 29 };
30 twsi1: i2c@d4011000 { 30 twsi1: i2c@d4011000 {
31 status = "okay"; 31 status = "okay";
32 pmic: max8925@3c {
33 compatible = "maxium,max8925";
34 reg = <0x3c>;
35 interrupts = <1>;
36 interrupt-parent = <&intcmux4>;
37 interrupt-controller;
38 #interrupt-cells = <1>;
39 maxim,tsc-irq = <0>;
40
41 regulators {
42 SDV1 {
43 regulator-min-microvolt = <637500>;
44 regulator-max-microvolt = <1425000>;
45 regulator-boot-on;
46 regulator-always-on;
47 };
48 SDV2 {
49 regulator-min-microvolt = <650000>;
50 regulator-max-microvolt = <2225000>;
51 regulator-boot-on;
52 regulator-always-on;
53 };
54 SDV3 {
55 regulator-min-microvolt = <750000>;
56 regulator-max-microvolt = <3900000>;
57 regulator-boot-on;
58 regulator-always-on;
59 };
60 LDO1 {
61 regulator-min-microvolt = <750000>;
62 regulator-max-microvolt = <3900000>;
63 regulator-boot-on;
64 regulator-always-on;
65 };
66 LDO2 {
67 regulator-min-microvolt = <650000>;
68 regulator-max-microvolt = <2250000>;
69 regulator-boot-on;
70 regulator-always-on;
71 };
72 LDO3 {
73 regulator-min-microvolt = <650000>;
74 regulator-max-microvolt = <2250000>;
75 regulator-boot-on;
76 regulator-always-on;
77 };
78 LDO4 {
79 regulator-min-microvolt = <750000>;
80 regulator-max-microvolt = <3900000>;
81 regulator-boot-on;
82 regulator-always-on;
83 };
84 LDO5 {
85 regulator-min-microvolt = <750000>;
86 regulator-max-microvolt = <3900000>;
87 regulator-boot-on;
88 regulator-always-on;
89 };
90 LDO6 {
91 regulator-min-microvolt = <750000>;
92 regulator-max-microvolt = <3900000>;
93 regulator-boot-on;
94 regulator-always-on;
95 };
96 LDO7 {
97 regulator-min-microvolt = <750000>;
98 regulator-max-microvolt = <3900000>;
99 regulator-boot-on;
100 regulator-always-on;
101 };
102 LDO8 {
103 regulator-min-microvolt = <750000>;
104 regulator-max-microvolt = <3900000>;
105 regulator-boot-on;
106 regulator-always-on;
107 };
108 LDO9 {
109 regulator-min-microvolt = <750000>;
110 regulator-max-microvolt = <3900000>;
111 regulator-boot-on;
112 regulator-always-on;
113 };
114 LDO10 {
115 regulator-min-microvolt = <750000>;
116 regulator-max-microvolt = <3900000>;
117 };
118 LDO11 {
119 regulator-min-microvolt = <750000>;
120 regulator-max-microvolt = <3900000>;
121 regulator-boot-on;
122 regulator-always-on;
123 };
124 LDO12 {
125 regulator-min-microvolt = <750000>;
126 regulator-max-microvolt = <3900000>;
127 regulator-boot-on;
128 regulator-always-on;
129 };
130 LDO13 {
131 regulator-min-microvolt = <750000>;
132 regulator-max-microvolt = <3900000>;
133 regulator-boot-on;
134 regulator-always-on;
135 };
136 LDO14 {
137 regulator-min-microvolt = <750000>;
138 regulator-max-microvolt = <3900000>;
139 regulator-boot-on;
140 regulator-always-on;
141 };
142 LDO15 {
143 regulator-min-microvolt = <750000>;
144 regulator-max-microvolt = <3900000>;
145 regulator-boot-on;
146 regulator-always-on;
147 };
148 LDO16 {
149 regulator-min-microvolt = <750000>;
150 regulator-max-microvolt = <3900000>;
151 regulator-boot-on;
152 regulator-always-on;
153 };
154 LDO17 {
155 regulator-min-microvolt = <650000>;
156 regulator-max-microvolt = <2250000>;
157 regulator-boot-on;
158 regulator-always-on;
159 };
160 LDO18 {
161 regulator-min-microvolt = <650000>;
162 regulator-max-microvolt = <2250000>;
163 regulator-boot-on;
164 regulator-always-on;
165 };
166 LDO19 {
167 regulator-min-microvolt = <750000>;
168 regulator-max-microvolt = <3900000>;
169 regulator-boot-on;
170 regulator-always-on;
171 };
172 LDO20 {
173 regulator-min-microvolt = <750000>;
174 regulator-max-microvolt = <3900000>;
175 regulator-boot-on;
176 regulator-always-on;
177 };
178 };
179 backlight {
180 maxim,max8925-dual-string = <0>;
181 };
182 charger {
183 batt-detect = <0>;
184 topoff-threshold = <1>;
185 fast-charge = <7>;
186 no-temp-support = <0>;
187 no-insert-detect = <0>;
188 };
189 };
32 }; 190 };
33 rtc: rtc@d4010000 { 191 rtc: rtc@d4010000 {
34 status = "okay"; 192 status = "okay";
diff --git a/arch/arm/boot/dts/mmp2.dtsi b/arch/arm/boot/dts/mmp2.dtsi
index 0514fb41627e..1429ac05b36d 100644
--- a/arch/arm/boot/dts/mmp2.dtsi
+++ b/arch/arm/boot/dts/mmp2.dtsi
@@ -46,7 +46,7 @@
46 mrvl,intc-nr-irqs = <64>; 46 mrvl,intc-nr-irqs = <64>;
47 }; 47 };
48 48
49 intcmux4@d4282150 { 49 intcmux4: interrupt-controller@d4282150 {
50 compatible = "mrvl,mmp2-mux-intc"; 50 compatible = "mrvl,mmp2-mux-intc";
51 interrupts = <4>; 51 interrupts = <4>;
52 interrupt-controller; 52 interrupt-controller;
@@ -201,6 +201,8 @@
201 compatible = "mrvl,mmp-twsi"; 201 compatible = "mrvl,mmp-twsi";
202 reg = <0xd4011000 0x1000>; 202 reg = <0xd4011000 0x1000>;
203 interrupts = <7>; 203 interrupts = <7>;
204 #address-cells = <1>;
205 #size-cells = <0>;
204 mrvl,i2c-fast-mode; 206 mrvl,i2c-fast-mode;
205 status = "disabled"; 207 status = "disabled";
206 }; 208 };
diff --git a/arch/arm/boot/dts/prima2.dtsi b/arch/arm/boot/dts/prima2.dtsi
index 055fca542120..3329719a9412 100644
--- a/arch/arm/boot/dts/prima2.dtsi
+++ b/arch/arm/boot/dts/prima2.dtsi
@@ -58,10 +58,11 @@
58 #size-cells = <1>; 58 #size-cells = <1>;
59 ranges = <0x88000000 0x88000000 0x40000>; 59 ranges = <0x88000000 0x88000000 0x40000>;
60 60
61 clock-controller@88000000 { 61 clks: clock-controller@88000000 {
62 compatible = "sirf,prima2-clkc"; 62 compatible = "sirf,prima2-clkc";
63 reg = <0x88000000 0x1000>; 63 reg = <0x88000000 0x1000>;
64 interrupts = <3>; 64 interrupts = <3>;
65 #clock-cells = <1>;
65 }; 66 };
66 67
67 reset-controller@88010000 { 68 reset-controller@88010000 {
@@ -85,6 +86,7 @@
85 compatible = "sirf,prima2-memc"; 86 compatible = "sirf,prima2-memc";
86 reg = <0x90000000 0x10000>; 87 reg = <0x90000000 0x10000>;
87 interrupts = <27>; 88 interrupts = <27>;
89 clocks = <&clks 5>;
88 }; 90 };
89 }; 91 };
90 92
@@ -104,6 +106,7 @@
104 compatible = "sirf,prima2-vpp"; 106 compatible = "sirf,prima2-vpp";
105 reg = <0x90020000 0x10000>; 107 reg = <0x90020000 0x10000>;
106 interrupts = <31>; 108 interrupts = <31>;
109 clocks = <&clks 35>;
107 }; 110 };
108 }; 111 };
109 112
@@ -117,6 +120,7 @@
117 compatible = "powervr,sgx531"; 120 compatible = "powervr,sgx531";
118 reg = <0x98000000 0x8000000>; 121 reg = <0x98000000 0x8000000>;
119 interrupts = <6>; 122 interrupts = <6>;
123 clocks = <&clks 32>;
120 }; 124 };
121 }; 125 };
122 126
@@ -130,6 +134,7 @@
130 compatible = "sirf,prima2-video-codec"; 134 compatible = "sirf,prima2-video-codec";
131 reg = <0xa0000000 0x8000000>; 135 reg = <0xa0000000 0x8000000>;
132 interrupts = <5>; 136 interrupts = <5>;
137 clocks = <&clks 33>;
133 }; 138 };
134 }; 139 };
135 140
@@ -149,12 +154,14 @@
149 compatible = "sirf,prima2-gps"; 154 compatible = "sirf,prima2-gps";
150 reg = <0xa8010000 0x10000>; 155 reg = <0xa8010000 0x10000>;
151 interrupts = <7>; 156 interrupts = <7>;
157 clocks = <&clks 9>;
152 }; 158 };
153 159
154 dsp@a9000000 { 160 dsp@a9000000 {
155 compatible = "sirf,prima2-dsp"; 161 compatible = "sirf,prima2-dsp";
156 reg = <0xa9000000 0x1000000>; 162 reg = <0xa9000000 0x1000000>;
157 interrupts = <8>; 163 interrupts = <8>;
164 clocks = <&clks 8>;
158 }; 165 };
159 }; 166 };
160 167
@@ -174,12 +181,14 @@
174 compatible = "sirf,prima2-nand"; 181 compatible = "sirf,prima2-nand";
175 reg = <0xb0030000 0x10000>; 182 reg = <0xb0030000 0x10000>;
176 interrupts = <41>; 183 interrupts = <41>;
184 clocks = <&clks 26>;
177 }; 185 };
178 186
179 audio@b0040000 { 187 audio@b0040000 {
180 compatible = "sirf,prima2-audio"; 188 compatible = "sirf,prima2-audio";
181 reg = <0xb0040000 0x10000>; 189 reg = <0xb0040000 0x10000>;
182 interrupts = <35>; 190 interrupts = <35>;
191 clocks = <&clks 27>;
183 }; 192 };
184 193
185 uart0: uart@b0050000 { 194 uart0: uart@b0050000 {
@@ -187,6 +196,7 @@
187 compatible = "sirf,prima2-uart"; 196 compatible = "sirf,prima2-uart";
188 reg = <0xb0050000 0x10000>; 197 reg = <0xb0050000 0x10000>;
189 interrupts = <17>; 198 interrupts = <17>;
199 clocks = <&clks 13>;
190 }; 200 };
191 201
192 uart1: uart@b0060000 { 202 uart1: uart@b0060000 {
@@ -194,6 +204,7 @@
194 compatible = "sirf,prima2-uart"; 204 compatible = "sirf,prima2-uart";
195 reg = <0xb0060000 0x10000>; 205 reg = <0xb0060000 0x10000>;
196 interrupts = <18>; 206 interrupts = <18>;
207 clocks = <&clks 14>;
197 }; 208 };
198 209
199 uart2: uart@b0070000 { 210 uart2: uart@b0070000 {
@@ -201,6 +212,7 @@
201 compatible = "sirf,prima2-uart"; 212 compatible = "sirf,prima2-uart";
202 reg = <0xb0070000 0x10000>; 213 reg = <0xb0070000 0x10000>;
203 interrupts = <19>; 214 interrupts = <19>;
215 clocks = <&clks 15>;
204 }; 216 };
205 217
206 usp0: usp@b0080000 { 218 usp0: usp@b0080000 {
@@ -208,6 +220,7 @@
208 compatible = "sirf,prima2-usp"; 220 compatible = "sirf,prima2-usp";
209 reg = <0xb0080000 0x10000>; 221 reg = <0xb0080000 0x10000>;
210 interrupts = <20>; 222 interrupts = <20>;
223 clocks = <&clks 28>;
211 }; 224 };
212 225
213 usp1: usp@b0090000 { 226 usp1: usp@b0090000 {
@@ -215,6 +228,7 @@
215 compatible = "sirf,prima2-usp"; 228 compatible = "sirf,prima2-usp";
216 reg = <0xb0090000 0x10000>; 229 reg = <0xb0090000 0x10000>;
217 interrupts = <21>; 230 interrupts = <21>;
231 clocks = <&clks 29>;
218 }; 232 };
219 233
220 usp2: usp@b00a0000 { 234 usp2: usp@b00a0000 {
@@ -222,6 +236,7 @@
222 compatible = "sirf,prima2-usp"; 236 compatible = "sirf,prima2-usp";
223 reg = <0xb00a0000 0x10000>; 237 reg = <0xb00a0000 0x10000>;
224 interrupts = <22>; 238 interrupts = <22>;
239 clocks = <&clks 30>;
225 }; 240 };
226 241
227 dmac0: dma-controller@b00b0000 { 242 dmac0: dma-controller@b00b0000 {
@@ -229,6 +244,7 @@
229 compatible = "sirf,prima2-dmac"; 244 compatible = "sirf,prima2-dmac";
230 reg = <0xb00b0000 0x10000>; 245 reg = <0xb00b0000 0x10000>;
231 interrupts = <12>; 246 interrupts = <12>;
247 clocks = <&clks 24>;
232 }; 248 };
233 249
234 dmac1: dma-controller@b0160000 { 250 dmac1: dma-controller@b0160000 {
@@ -236,11 +252,13 @@
236 compatible = "sirf,prima2-dmac"; 252 compatible = "sirf,prima2-dmac";
237 reg = <0xb0160000 0x10000>; 253 reg = <0xb0160000 0x10000>;
238 interrupts = <13>; 254 interrupts = <13>;
255 clocks = <&clks 25>;
239 }; 256 };
240 257
241 vip@b00C0000 { 258 vip@b00C0000 {
242 compatible = "sirf,prima2-vip"; 259 compatible = "sirf,prima2-vip";
243 reg = <0xb00C0000 0x10000>; 260 reg = <0xb00C0000 0x10000>;
261 clocks = <&clks 31>;
244 }; 262 };
245 263
246 spi0: spi@b00d0000 { 264 spi0: spi@b00d0000 {
@@ -248,6 +266,7 @@
248 compatible = "sirf,prima2-spi"; 266 compatible = "sirf,prima2-spi";
249 reg = <0xb00d0000 0x10000>; 267 reg = <0xb00d0000 0x10000>;
250 interrupts = <15>; 268 interrupts = <15>;
269 clocks = <&clks 19>;
251 }; 270 };
252 271
253 spi1: spi@b0170000 { 272 spi1: spi@b0170000 {
@@ -255,6 +274,7 @@
255 compatible = "sirf,prima2-spi"; 274 compatible = "sirf,prima2-spi";
256 reg = <0xb0170000 0x10000>; 275 reg = <0xb0170000 0x10000>;
257 interrupts = <16>; 276 interrupts = <16>;
277 clocks = <&clks 20>;
258 }; 278 };
259 279
260 i2c0: i2c@b00e0000 { 280 i2c0: i2c@b00e0000 {
@@ -262,6 +282,7 @@
262 compatible = "sirf,prima2-i2c"; 282 compatible = "sirf,prima2-i2c";
263 reg = <0xb00e0000 0x10000>; 283 reg = <0xb00e0000 0x10000>;
264 interrupts = <24>; 284 interrupts = <24>;
285 clocks = <&clks 17>;
265 }; 286 };
266 287
267 i2c1: i2c@b00f0000 { 288 i2c1: i2c@b00f0000 {
@@ -269,12 +290,14 @@
269 compatible = "sirf,prima2-i2c"; 290 compatible = "sirf,prima2-i2c";
270 reg = <0xb00f0000 0x10000>; 291 reg = <0xb00f0000 0x10000>;
271 interrupts = <25>; 292 interrupts = <25>;
293 clocks = <&clks 18>;
272 }; 294 };
273 295
274 tsc@b0110000 { 296 tsc@b0110000 {
275 compatible = "sirf,prima2-tsc"; 297 compatible = "sirf,prima2-tsc";
276 reg = <0xb0110000 0x10000>; 298 reg = <0xb0110000 0x10000>;
277 interrupts = <33>; 299 interrupts = <33>;
300 clocks = <&clks 16>;
278 }; 301 };
279 302
280 gpio: pinctrl@b0120000 { 303 gpio: pinctrl@b0120000 {
@@ -507,17 +530,20 @@
507 pwm@b0130000 { 530 pwm@b0130000 {
508 compatible = "sirf,prima2-pwm"; 531 compatible = "sirf,prima2-pwm";
509 reg = <0xb0130000 0x10000>; 532 reg = <0xb0130000 0x10000>;
533 clocks = <&clks 21>;
510 }; 534 };
511 535
512 efusesys@b0140000 { 536 efusesys@b0140000 {
513 compatible = "sirf,prima2-efuse"; 537 compatible = "sirf,prima2-efuse";
514 reg = <0xb0140000 0x10000>; 538 reg = <0xb0140000 0x10000>;
539 clocks = <&clks 22>;
515 }; 540 };
516 541
517 pulsec@b0150000 { 542 pulsec@b0150000 {
518 compatible = "sirf,prima2-pulsec"; 543 compatible = "sirf,prima2-pulsec";
519 reg = <0xb0150000 0x10000>; 544 reg = <0xb0150000 0x10000>;
520 interrupts = <48>; 545 interrupts = <48>;
546 clocks = <&clks 23>;
521 }; 547 };
522 548
523 pci-iobg { 549 pci-iobg {
@@ -616,12 +642,14 @@
616 compatible = "chipidea,ci13611a-prima2"; 642 compatible = "chipidea,ci13611a-prima2";
617 reg = <0xb8000000 0x10000>; 643 reg = <0xb8000000 0x10000>;
618 interrupts = <10>; 644 interrupts = <10>;
645 clocks = <&clks 40>;
619 }; 646 };
620 647
621 usb1: usb@b00f0000 { 648 usb1: usb@b00f0000 {
622 compatible = "chipidea,ci13611a-prima2"; 649 compatible = "chipidea,ci13611a-prima2";
623 reg = <0xb8010000 0x10000>; 650 reg = <0xb8010000 0x10000>;
624 interrupts = <11>; 651 interrupts = <11>;
652 clocks = <&clks 41>;
625 }; 653 };
626 654
627 sata@b00f0000 { 655 sata@b00f0000 {
@@ -634,6 +662,7 @@
634 compatible = "sirf,prima2-security"; 662 compatible = "sirf,prima2-security";
635 reg = <0xb8030000 0x10000>; 663 reg = <0xb8030000 0x10000>;
636 interrupts = <42>; 664 interrupts = <42>;
665 clocks = <&clks 7>;
637 }; 666 };
638 }; 667 };
639 }; 668 };
diff --git a/arch/arm/boot/dts/r8a7740-armadillo800eva.dts b/arch/arm/boot/dts/r8a7740-armadillo800eva.dts
index a7505a95a3b7..93da655b2598 100644
--- a/arch/arm/boot/dts/r8a7740-armadillo800eva.dts
+++ b/arch/arm/boot/dts/r8a7740-armadillo800eva.dts
@@ -9,12 +9,16 @@
9 */ 9 */
10 10
11/dts-v1/; 11/dts-v1/;
12/include/ "skeleton.dtsi" 12/include/ "r8a7740.dtsi"
13 13
14/ { 14/ {
15 model = "armadillo 800 eva"; 15 model = "armadillo 800 eva";
16 compatible = "renesas,armadillo800eva"; 16 compatible = "renesas,armadillo800eva";
17 17
18 chosen {
19 bootargs = "console=tty0 console=ttySC1,115200 earlyprintk=sh-sci.1,115200 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096 rw";
20 };
21
18 memory { 22 memory {
19 device_type = "memory"; 23 device_type = "memory";
20 reg = <0x40000000 0x20000000>; 24 reg = <0x40000000 0x20000000>;
diff --git a/arch/arm/boot/dts/sh7372-mackerel.dts b/arch/arm/boot/dts/sh7372-mackerel.dts
index 286f0caef013..8acf51e0cdae 100644
--- a/arch/arm/boot/dts/sh7372-mackerel.dts
+++ b/arch/arm/boot/dts/sh7372-mackerel.dts
@@ -9,12 +9,16 @@
9 */ 9 */
10 10
11/dts-v1/; 11/dts-v1/;
12/include/ "skeleton.dtsi" 12/include/ "sh7372.dtsi"
13 13
14/ { 14/ {
15 model = "Mackerel (AP4 EVM 2nd)"; 15 model = "Mackerel (AP4 EVM 2nd)";
16 compatible = "renesas,mackerel"; 16 compatible = "renesas,mackerel";
17 17
18 chosen {
19 bootargs = "console=tty0, console=ttySC0,115200 earlyprintk=sh-sci.0,115200 root=/dev/nfs nfsroot=,tcp,v3 ip=dhcp mem=240m rw";
20 };
21
18 memory { 22 memory {
19 device_type = "memory"; 23 device_type = "memory";
20 reg = <0x40000000 0x10000000>; 24 reg = <0x40000000 0x10000000>;
diff --git a/arch/arm/boot/dts/sh73a0-kzm9g.dts b/arch/arm/boot/dts/sh73a0-kzm9g.dts
index bcb911951978..7c4071e7790c 100644
--- a/arch/arm/boot/dts/sh73a0-kzm9g.dts
+++ b/arch/arm/boot/dts/sh73a0-kzm9g.dts
@@ -9,12 +9,16 @@
9 */ 9 */
10 10
11/dts-v1/; 11/dts-v1/;
12/include/ "skeleton.dtsi" 12/include/ "sh73a0.dtsi"
13 13
14/ { 14/ {
15 model = "KZM-A9-GT"; 15 model = "KZM-A9-GT";
16 compatible = "renesas,kzm9g", "renesas,sh73a0"; 16 compatible = "renesas,kzm9g", "renesas,sh73a0";
17 17
18 chosen {
19 bootargs = "console=tty0 console=ttySC4,115200 root=/dev/nfs ip=dhcp ignore_loglevel earlyprintk=sh-sci.4,115200";
20 };
21
18 memory { 22 memory {
19 device_type = "memory"; 23 device_type = "memory";
20 reg = <0x41000000 0x1e800000>; 24 reg = <0x41000000 0x1e800000>;
diff --git a/arch/arm/boot/dts/sh73a0-reference.dtsi b/arch/arm/boot/dts/sh73a0-reference.dtsi
new file mode 100644
index 000000000000..d4bb0125b2b2
--- /dev/null
+++ b/arch/arm/boot/dts/sh73a0-reference.dtsi
@@ -0,0 +1,24 @@
1/*
2 * Device Tree Source for the SH73A0 SoC
3 *
4 * Copyright (C) 2012 Renesas Solutions Corp.
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10
11/include/ "sh73a0.dtsi"
12
13/ {
14 compatible = "renesas,sh73a0";
15
16 mmcif: mmcif@0x10010000 {
17 compatible = "renesas,sh-mmcif";
18 reg = <0xe6bd0000 0x100>;
19 interrupt-parent = <&gic>;
20 interrupts = <0 140 0x4
21 0 141 0x4>;
22 reg-io-width = <4>;
23 };
24};
diff --git a/arch/arm/boot/dts/sh73a0.dtsi b/arch/arm/boot/dts/sh73a0.dtsi
new file mode 100644
index 000000000000..8a59465d0231
--- /dev/null
+++ b/arch/arm/boot/dts/sh73a0.dtsi
@@ -0,0 +1,100 @@
1/*
2 * Device Tree Source for the SH73A0 SoC
3 *
4 * Copyright (C) 2012 Renesas Solutions Corp.
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10
11/include/ "skeleton.dtsi"
12
13/ {
14 compatible = "renesas,sh73a0";
15
16 cpus {
17 #address-cells = <1>;
18 #size-cells = <0>;
19
20 cpu@0 {
21 device_type = "cpu";
22 compatible = "arm,cortex-a9";
23 reg = <0>;
24 };
25 cpu@1 {
26 device_type = "cpu";
27 compatible = "arm,cortex-a9";
28 reg = <1>;
29 };
30 };
31
32 gic: interrupt-controller@f0001000 {
33 compatible = "arm,cortex-a9-gic";
34 #interrupt-cells = <3>;
35 #address-cells = <1>;
36 interrupt-controller;
37 reg = <0xf0001000 0x1000>,
38 <0xf0000100 0x100>;
39 };
40
41 i2c0: i2c@0xe6820000 {
42 #address-cells = <1>;
43 #size-cells = <0>;
44 compatible = "renesas,rmobile-iic";
45 reg = <0xe6820000 0x425>;
46 interrupt-parent = <&gic>;
47 interrupts = <0 167 0x4
48 0 168 0x4
49 0 169 0x4
50 0 170 0x4>;
51 };
52
53 i2c1: i2c@0xe6822000 {
54 #address-cells = <1>;
55 #size-cells = <0>;
56 compatible = "renesas,rmobile-iic";
57 reg = <0xe6822000 0x425>;
58 interrupt-parent = <&gic>;
59 interrupts = <0 51 0x4
60 0 52 0x4
61 0 53 0x4
62 0 54 0x4>;
63 };
64
65 i2c2: i2c@0xe6824000 {
66 #address-cells = <1>;
67 #size-cells = <0>;
68 compatible = "renesas,rmobile-iic";
69 reg = <0xe6824000 0x425>;
70 interrupt-parent = <&gic>;
71 interrupts = <0 171 0x4
72 0 172 0x4
73 0 173 0x4
74 0 174 0x4>;
75 };
76
77 i2c3: i2c@0xe6826000 {
78 #address-cells = <1>;
79 #size-cells = <0>;
80 compatible = "renesas,rmobile-iic";
81 reg = <0xe6826000 0x425>;
82 interrupt-parent = <&gic>;
83 interrupts = <0 183 0x4
84 0 184 0x4
85 0 185 0x4
86 0 186 0x4>;
87 };
88
89 i2c4: i2c@0xe6828000 {
90 #address-cells = <1>;
91 #size-cells = <0>;
92 compatible = "renesas,rmobile-iic";
93 reg = <0xe6828000 0x425>;
94 interrupt-parent = <&gic>;
95 interrupts = <0 187 0x4
96 0 188 0x4
97 0 189 0x4
98 0 190 0x4>;
99 };
100};
diff --git a/arch/arm/boot/dts/socfpga.dtsi b/arch/arm/boot/dts/socfpga.dtsi
index 19aec421bb26..936d2306e7e1 100644
--- a/arch/arm/boot/dts/socfpga.dtsi
+++ b/arch/arm/boot/dts/socfpga.dtsi
@@ -25,6 +25,10 @@
25 ethernet0 = &gmac0; 25 ethernet0 = &gmac0;
26 serial0 = &uart0; 26 serial0 = &uart0;
27 serial1 = &uart1; 27 serial1 = &uart1;
28 timer0 = &timer0;
29 timer1 = &timer1;
30 timer2 = &timer2;
31 timer3 = &timer3;
28 }; 32 };
29 33
30 cpus { 34 cpus {
@@ -98,47 +102,41 @@
98 interrupts = <1 13 0xf04>; 102 interrupts = <1 13 0xf04>;
99 }; 103 };
100 104
101 timer0: timer@ffc08000 { 105 timer0: timer0@ffc08000 {
102 compatible = "snps,dw-apb-timer-sp"; 106 compatible = "snps,dw-apb-timer-sp";
103 interrupts = <0 167 4>; 107 interrupts = <0 167 4>;
104 clock-frequency = <200000000>;
105 reg = <0xffc08000 0x1000>; 108 reg = <0xffc08000 0x1000>;
106 }; 109 };
107 110
108 timer1: timer@ffc09000 { 111 timer1: timer1@ffc09000 {
109 compatible = "snps,dw-apb-timer-sp"; 112 compatible = "snps,dw-apb-timer-sp";
110 interrupts = <0 168 4>; 113 interrupts = <0 168 4>;
111 clock-frequency = <200000000>;
112 reg = <0xffc09000 0x1000>; 114 reg = <0xffc09000 0x1000>;
113 }; 115 };
114 116
115 timer2: timer@ffd00000 { 117 timer2: timer2@ffd00000 {
116 compatible = "snps,dw-apb-timer-osc"; 118 compatible = "snps,dw-apb-timer-osc";
117 interrupts = <0 169 4>; 119 interrupts = <0 169 4>;
118 clock-frequency = <200000000>;
119 reg = <0xffd00000 0x1000>; 120 reg = <0xffd00000 0x1000>;
120 }; 121 };
121 122
122 timer3: timer@ffd01000 { 123 timer3: timer3@ffd01000 {
123 compatible = "snps,dw-apb-timer-osc"; 124 compatible = "snps,dw-apb-timer-osc";
124 interrupts = <0 170 4>; 125 interrupts = <0 170 4>;
125 clock-frequency = <200000000>;
126 reg = <0xffd01000 0x1000>; 126 reg = <0xffd01000 0x1000>;
127 }; 127 };
128 128
129 uart0: uart@ffc02000 { 129 uart0: serial0@ffc02000 {
130 compatible = "snps,dw-apb-uart"; 130 compatible = "snps,dw-apb-uart";
131 reg = <0xffc02000 0x1000>; 131 reg = <0xffc02000 0x1000>;
132 clock-frequency = <7372800>;
133 interrupts = <0 162 4>; 132 interrupts = <0 162 4>;
134 reg-shift = <2>; 133 reg-shift = <2>;
135 reg-io-width = <4>; 134 reg-io-width = <4>;
136 }; 135 };
137 136
138 uart1: uart@ffc03000 { 137 uart1: serial1@ffc03000 {
139 compatible = "snps,dw-apb-uart"; 138 compatible = "snps,dw-apb-uart";
140 reg = <0xffc03000 0x1000>; 139 reg = <0xffc03000 0x1000>;
141 clock-frequency = <7372800>;
142 interrupts = <0 163 4>; 140 interrupts = <0 163 4>;
143 reg-shift = <2>; 141 reg-shift = <2>;
144 reg-io-width = <4>; 142 reg-io-width = <4>;
diff --git a/arch/arm/boot/dts/socfpga_cyclone5.dts b/arch/arm/boot/dts/socfpga_cyclone5.dts
index ab7e4a94299f..3ae8a83a0875 100644
--- a/arch/arm/boot/dts/socfpga_cyclone5.dts
+++ b/arch/arm/boot/dts/socfpga_cyclone5.dts
@@ -20,7 +20,7 @@
20 20
21/ { 21/ {
22 model = "Altera SOCFPGA Cyclone V"; 22 model = "Altera SOCFPGA Cyclone V";
23 compatible = "altr,socfpga-cyclone5"; 23 compatible = "altr,socfpga-cyclone5", "altr,socfpga";
24 24
25 chosen { 25 chosen {
26 bootargs = "console=ttyS0,57600"; 26 bootargs = "console=ttyS0,57600";
@@ -29,6 +29,36 @@
29 memory { 29 memory {
30 name = "memory"; 30 name = "memory";
31 device_type = "memory"; 31 device_type = "memory";
32 reg = <0x0 0x10000000>; /* 256MB */ 32 reg = <0x0 0x40000000>; /* 1GB */
33 };
34
35 soc {
36 timer0@ffc08000 {
37 clock-frequency = <100000000>;
38 };
39
40 timer1@ffc09000 {
41 clock-frequency = <100000000>;
42 };
43
44 timer2@ffd00000 {
45 clock-frequency = <25000000>;
46 };
47
48 timer3@ffd01000 {
49 clock-frequency = <25000000>;
50 };
51
52 serial0@ffc02000 {
53 clock-frequency = <100000000>;
54 };
55
56 serial1@ffc03000 {
57 clock-frequency = <100000000>;
58 };
59
60 sysmgr@ffd08000 {
61 cpu1-start-addr = <0xffd080c4>;
62 };
33 }; 63 };
34}; 64};
diff --git a/arch/arm/boot/dts/socfpga_vt.dts b/arch/arm/boot/dts/socfpga_vt.dts
new file mode 100644
index 000000000000..1036eba40bbf
--- /dev/null
+++ b/arch/arm/boot/dts/socfpga_vt.dts
@@ -0,0 +1,64 @@
1/*
2 * Copyright (C) 2013 Altera Corporation <www.altera.com>
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 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/dts-v1/;
19/include/ "socfpga.dtsi"
20
21/ {
22 model = "Altera SOCFPGA VT";
23 compatible = "altr,socfpga-vt", "altr,socfpga";
24
25 chosen {
26 bootargs = "console=ttyS0,57600";
27 };
28
29 memory {
30 name = "memory";
31 device_type = "memory";
32 reg = <0x0 0x40000000>; /* 1 GB */
33 };
34
35 soc {
36 timer0@ffc08000 {
37 clock-frequency = <7000000>;
38 };
39
40 timer1@ffc09000 {
41 clock-frequency = <7000000>;
42 };
43
44 timer2@ffd00000 {
45 clock-frequency = <7000000>;
46 };
47
48 timer3@ffd01000 {
49 clock-frequency = <7000000>;
50 };
51
52 serial0@ffc02000 {
53 clock-frequency = <7372800>;
54 };
55
56 serial1@ffc03000 {
57 clock-frequency = <7372800>;
58 };
59
60 sysmgr@ffd08000 {
61 cpu1-start-addr = <0xffd08010>;
62 };
63 };
64};
diff --git a/arch/arm/boot/dts/ste-nomadik-s8815.dts b/arch/arm/boot/dts/ste-nomadik-s8815.dts
new file mode 100644
index 000000000000..b28fbf3408e3
--- /dev/null
+++ b/arch/arm/boot/dts/ste-nomadik-s8815.dts
@@ -0,0 +1,30 @@
1/*
2 * Device Tree for the ST-Ericsson Nomadik S8815 board
3 * Produced by Calao Systems
4 */
5
6/dts-v1/;
7/include/ "ste-nomadik-stn8815.dtsi"
8
9/ {
10 model = "Calao Systems USB-S8815";
11 compatible = "calaosystems,usb-s8815";
12
13 chosen {
14 bootargs = "root=/dev/ram0 console=ttyAMA1,115200n8 earlyprintk";
15 };
16
17 /* Custom board node with GPIO pins to active etc */
18 usb-s8815 {
19 /* The S8815 is using this very GPIO pin for the SMSC91x IRQs */
20 ethernet-gpio {
21 gpios = <&gpio3 19 0x1>;
22 interrupts = <19 0x1>;
23 interrupt-parent = <&gpio3>;
24 };
25 /* This will bias the MMC/SD card detect line */
26 mmcsd-gpio {
27 gpios = <&gpio3 16 0x1>;
28 };
29 };
30};
diff --git a/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi b/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
new file mode 100644
index 000000000000..4a4aab395141
--- /dev/null
+++ b/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
@@ -0,0 +1,256 @@
1/*
2 * Device Tree for the ST-Ericsson Nomadik 8815 STn8815 SoC
3 */
4/include/ "skeleton.dtsi"
5
6/ {
7 #address-cells = <1>;
8 #size-cells = <1>;
9
10 memory {
11 reg = <0x00000000 0x04000000>,
12 <0x08000000 0x04000000>;
13 };
14
15 L2: l2-cache {
16 compatible = "arm,l210-cache";
17 reg = <0x10210000 0x1000>;
18 interrupt-parent = <&vica>;
19 interrupts = <30>;
20 cache-unified;
21 cache-level = <2>;
22 };
23
24 mtu0 {
25 /* Nomadik system timer */
26 reg = <0x101e2000 0x1000>;
27 interrupt-parent = <&vica>;
28 interrupts = <4>;
29 };
30
31 mtu1 {
32 /* Secondary timer */
33 reg = <0x101e3000 0x1000>;
34 interrupt-parent = <&vica>;
35 interrupts = <5>;
36 };
37
38 gpio0: gpio@101e4000 {
39 compatible = "st,nomadik-gpio";
40 reg = <0x101e4000 0x80>;
41 interrupt-parent = <&vica>;
42 interrupts = <6>;
43 interrupt-controller;
44 #interrupt-cells = <2>;
45 gpio-controller;
46 #gpio-cells = <2>;
47 gpio-bank = <0>;
48 };
49
50 gpio1: gpio@101e5000 {
51 compatible = "st,nomadik-gpio";
52 reg = <0x101e5000 0x80>;
53 interrupt-parent = <&vica>;
54 interrupts = <7>;
55 interrupt-controller;
56 #interrupt-cells = <2>;
57 gpio-controller;
58 #gpio-cells = <2>;
59 gpio-bank = <1>;
60 };
61
62 gpio2: gpio@101e6000 {
63 compatible = "st,nomadik-gpio";
64 reg = <0x101e6000 0x80>;
65 interrupt-parent = <&vica>;
66 interrupts = <8>;
67 interrupt-controller;
68 #interrupt-cells = <2>;
69 gpio-controller;
70 #gpio-cells = <2>;
71 gpio-bank = <2>;
72 };
73
74 gpio3: gpio@101e7000 {
75 compatible = "st,nomadik-gpio";
76 reg = <0x101e7000 0x80>;
77 interrupt-parent = <&vica>;
78 interrupts = <9>;
79 interrupt-controller;
80 #interrupt-cells = <2>;
81 gpio-controller;
82 #gpio-cells = <2>;
83 gpio-bank = <3>;
84 };
85
86 pinctrl {
87 compatible = "stericsson,nmk-pinctrl-stn8815";
88 };
89
90 /* A NAND flash of 128 MiB */
91 fsmc: flash@40000000 {
92 compatible = "stericsson,fsmc-nand";
93 #address-cells = <1>;
94 #size-cells = <1>;
95 reg = <0x10100000 0x1000>, /* FSMC Register*/
96 <0x40000000 0x2000>, /* NAND Base DATA */
97 <0x41000000 0x2000>, /* NAND Base ADDR */
98 <0x40800000 0x2000>; /* NAND Base CMD */
99 reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";
100 status = "okay";
101
102 partition@0 {
103 label = "X-Loader(NAND)";
104 reg = <0x0 0x40000>;
105 };
106 partition@40000 {
107 label = "MemInit(NAND)";
108 reg = <0x40000 0x40000>;
109 };
110 partition@80000 {
111 label = "BootLoader(NAND)";
112 reg = <0x80000 0x200000>;
113 };
114 partition@280000 {
115 label = "Kernel zImage(NAND)";
116 reg = <0x280000 0x300000>;
117 };
118 partition@580000 {
119 label = "Root Filesystem(NAND)";
120 reg = <0x580000 0x1600000>;
121 };
122 partition@1b80000 {
123 label = "User Filesystem(NAND)";
124 reg = <0x1b80000 0x6480000>;
125 };
126 };
127
128 external-bus@34000000 {
129 compatible = "simple-bus";
130 reg = <0x34000000 0x1000000>;
131 #address-cells = <1>;
132 #size-cells = <1>;
133 ranges = <0 0x34000000 0x1000000>;
134 ethernet@300 {
135 compatible = "smsc,lan91c111";
136 reg = <0x300 0x0fd00>;
137 };
138 };
139
140 /* I2C0 connected to the STw4811 power management chip */
141 i2c0 {
142 compatible = "i2c-gpio";
143 gpios = <&gpio1 31 0>, /* sda */
144 <&gpio1 30 0>; /* scl */
145 #address-cells = <1>;
146 #size-cells = <0>;
147
148 stw4811@2d {
149 compatible = "st,stw4811";
150 reg = <0x2d>;
151 };
152 };
153
154 /* I2C1 connected to various sensors */
155 i2c1 {
156 compatible = "i2c-gpio";
157 gpios = <&gpio1 22 0>, /* sda */
158 <&gpio1 21 0>; /* scl */
159 #address-cells = <1>;
160 #size-cells = <0>;
161
162 camera@2d {
163 compatible = "st,camera";
164 reg = <0x10>;
165 };
166 stw5095@1a {
167 compatible = "st,stw5095";
168 reg = <0x1a>;
169 };
170 lis3lv02dl@1d {
171 compatible = "st,lis3lv02dl";
172 reg = <0x1d>;
173 };
174 };
175
176 /* I2C2 connected to the USB portions of the STw4811 only */
177 i2c2 {
178 compatible = "i2c-gpio";
179 gpios = <&gpio2 10 0>, /* sda */
180 <&gpio2 9 0>; /* scl */
181 #address-cells = <1>;
182 #size-cells = <0>;
183 stw4811@2d {
184 compatible = "st,stw4811-usb";
185 reg = <0x2d>;
186 };
187 };
188
189 amba {
190 compatible = "arm,amba-bus";
191 #address-cells = <1>;
192 #size-cells = <1>;
193 ranges;
194
195 vica: intc@0x10140000 {
196 compatible = "arm,versatile-vic";
197 interrupt-controller;
198 #interrupt-cells = <1>;
199 reg = <0x10140000 0x20>;
200 };
201
202 vicb: intc@0x10140020 {
203 compatible = "arm,versatile-vic";
204 interrupt-controller;
205 #interrupt-cells = <1>;
206 reg = <0x10140020 0x20>;
207 };
208
209 uart0: uart@101fd000 {
210 compatible = "arm,pl011", "arm,primecell";
211 reg = <0x101fd000 0x1000>;
212 interrupt-parent = <&vica>;
213 interrupts = <12>;
214 };
215
216 uart1: uart@101fb000 {
217 compatible = "arm,pl011", "arm,primecell";
218 reg = <0x101fb000 0x1000>;
219 interrupt-parent = <&vica>;
220 interrupts = <17>;
221 };
222
223 uart2: uart@101f2000 {
224 compatible = "arm,pl011", "arm,primecell";
225 reg = <0x101f2000 0x1000>;
226 interrupt-parent = <&vica>;
227 interrupts = <28>;
228 status = "disabled";
229 };
230
231 rng: rng@101b0000 {
232 compatible = "arm,primecell";
233 reg = <0x101b0000 0x1000>;
234 };
235
236 rtc: rtc@101e8000 {
237 compatible = "arm,pl031", "arm,primecell";
238 reg = <0x101e8000 0x1000>;
239 interrupt-parent = <&vica>;
240 interrupts = <10>;
241 };
242
243 mmcsd: sdi@101f6000 {
244 compatible = "arm,pl18x", "arm,primecell";
245 reg = <0x101f6000 0x1000>;
246 interrupt-parent = <&vica>;
247 interrupts = <22>;
248 max-frequency = <48000000>;
249 bus-width = <4>;
250 mmc-cap-mmc-highspeed;
251 mmc-cap-sd-highspeed;
252 cd-gpios = <&gpio3 15 0x1>;
253 cd-inverted;
254 };
255 };
256};
diff --git a/arch/arm/boot/dts/sun4i-a10-hackberry.dts b/arch/arm/boot/dts/sun4i-a10-hackberry.dts
new file mode 100644
index 000000000000..f84549ad791e
--- /dev/null
+++ b/arch/arm/boot/dts/sun4i-a10-hackberry.dts
@@ -0,0 +1,30 @@
1/*
2 * Copyright 2012 Maxime Ripard
3 *
4 * Maxime Ripard <maxime.ripard@free-electrons.com>
5 *
6 * The code contained herein is licensed under the GNU General Public
7 * License. You may obtain a copy of the GNU General Public License
8 * Version 2 or later at the following locations:
9 *
10 * http://www.opensource.org/licenses/gpl-license.html
11 * http://www.gnu.org/copyleft/gpl.html
12 */
13
14/dts-v1/;
15/include/ "sun4i-a10.dtsi"
16
17/ {
18 model = "Miniand Hackberry";
19 compatible = "miniand,hackberry", "allwinner,sun4i-a10";
20
21 chosen {
22 bootargs = "earlyprintk console=ttyS0,115200";
23 };
24
25 soc {
26 uart0: uart@01c28000 {
27 status = "okay";
28 };
29 };
30};
diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi
index e61fdd47bd01..f99f60dadf5d 100644
--- a/arch/arm/boot/dts/sun4i-a10.dtsi
+++ b/arch/arm/boot/dts/sun4i-a10.dtsi
@@ -16,4 +16,34 @@
16 memory { 16 memory {
17 reg = <0x40000000 0x80000000>; 17 reg = <0x40000000 0x80000000>;
18 }; 18 };
19
20 soc {
21 pinctrl@01c20800 {
22 compatible = "allwinner,sun4i-a10-pinctrl";
23 reg = <0x01c20800 0x400>;
24 #address-cells = <1>;
25 #size-cells = <0>;
26
27 uart0_pins_a: uart0@0 {
28 allwinner,pins = "PB22", "PB23";
29 allwinner,function = "uart0";
30 allwinner,drive = <0>;
31 allwinner,pull = <0>;
32 };
33
34 uart0_pins_b: uart0@1 {
35 allwinner,pins = "PF2", "PF4";
36 allwinner,function = "uart0";
37 allwinner,drive = <0>;
38 allwinner,pull = <0>;
39 };
40
41 uart1_pins_a: uart1@0 {
42 allwinner,pins = "PA10", "PA11";
43 allwinner,function = "uart1";
44 allwinner,drive = <0>;
45 allwinner,pull = <0>;
46 };
47 };
48 };
19}; 49};
diff --git a/arch/arm/boot/dts/sun5i-a13-olinuxino.dts b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts
index 498a091a4ea2..4a1e45d4aace 100644
--- a/arch/arm/boot/dts/sun5i-a13-olinuxino.dts
+++ b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts
@@ -24,6 +24,8 @@
24 24
25 soc { 25 soc {
26 uart1: uart@01c28400 { 26 uart1: uart@01c28400 {
27 pinctrl-names = "default";
28 pinctrl-0 = <&uart1_pins_b>;
27 status = "okay"; 29 status = "okay";
28 }; 30 };
29 }; 31 };
diff --git a/arch/arm/boot/dts/sun5i-a13.dtsi b/arch/arm/boot/dts/sun5i-a13.dtsi
index 59a2d265a98e..e1121890fb29 100644
--- a/arch/arm/boot/dts/sun5i-a13.dtsi
+++ b/arch/arm/boot/dts/sun5i-a13.dtsi
@@ -17,4 +17,27 @@
17 memory { 17 memory {
18 reg = <0x40000000 0x20000000>; 18 reg = <0x40000000 0x20000000>;
19 }; 19 };
20
21 soc {
22 pinctrl@01c20800 {
23 compatible = "allwinner,sun5i-a13-pinctrl";
24 reg = <0x01c20800 0x400>;
25 #address-cells = <1>;
26 #size-cells = <0>;
27
28 uart1_pins_a: uart1@0 {
29 allwinner,pins = "PE10", "PE11";
30 allwinner,function = "uart1";
31 allwinner,drive = <0>;
32 allwinner,pull = <0>;
33 };
34
35 uart1_pins_b: uart1@1 {
36 allwinner,pins = "PG3", "PG4";
37 allwinner,function = "uart1";
38 allwinner,drive = <0>;
39 allwinner,pull = <0>;
40 };
41 };
42 };
20}; 43};
diff --git a/arch/arm/boot/dts/tegra114-dalmore.dts b/arch/arm/boot/dts/tegra114-dalmore.dts
new file mode 100644
index 000000000000..a30aca62658a
--- /dev/null
+++ b/arch/arm/boot/dts/tegra114-dalmore.dts
@@ -0,0 +1,21 @@
1/dts-v1/;
2
3/include/ "tegra114.dtsi"
4
5/ {
6 model = "NVIDIA Tegra114 Dalmore evaluation board";
7 compatible = "nvidia,dalmore", "nvidia,tegra114";
8
9 memory {
10 reg = <0x80000000 0x40000000>;
11 };
12
13 serial@70006300 {
14 status = "okay";
15 clock-frequency = <408000000>;
16 };
17
18 pmc {
19 nvidia,invert-interrupt;
20 };
21};
diff --git a/arch/arm/boot/dts/tegra114-pluto.dts b/arch/arm/boot/dts/tegra114-pluto.dts
new file mode 100644
index 000000000000..9bea8f57aa47
--- /dev/null
+++ b/arch/arm/boot/dts/tegra114-pluto.dts
@@ -0,0 +1,21 @@
1/dts-v1/;
2
3/include/ "tegra114.dtsi"
4
5/ {
6 model = "NVIDIA Tegra114 Pluto evaluation board";
7 compatible = "nvidia,pluto", "nvidia,tegra114";
8
9 memory {
10 reg = <0x80000000 0x40000000>;
11 };
12
13 serial@70006300 {
14 status = "okay";
15 clock-frequency = <408000000>;
16 };
17
18 pmc {
19 nvidia,invert-interrupt;
20 };
21};
diff --git a/arch/arm/boot/dts/tegra114.dtsi b/arch/arm/boot/dts/tegra114.dtsi
new file mode 100644
index 000000000000..1dfaf2874c57
--- /dev/null
+++ b/arch/arm/boot/dts/tegra114.dtsi
@@ -0,0 +1,153 @@
1/include/ "skeleton.dtsi"
2
3/ {
4 compatible = "nvidia,tegra114";
5 interrupt-parent = <&gic>;
6
7 gic: interrupt-controller {
8 compatible = "arm,cortex-a15-gic";
9 #interrupt-cells = <3>;
10 interrupt-controller;
11 reg = <0x50041000 0x1000>,
12 <0x50042000 0x1000>,
13 <0x50044000 0x2000>,
14 <0x50046000 0x2000>;
15 interrupts = <1 9 0xf04>;
16 };
17
18 timer@60005000 {
19 compatible = "nvidia,tegra114-timer", "nvidia,tegra20-timer";
20 reg = <0x60005000 0x400>;
21 interrupts = <0 0 0x04
22 0 1 0x04
23 0 41 0x04
24 0 42 0x04
25 0 121 0x04
26 0 122 0x04>;
27 };
28
29 tegra_car: clock {
30 compatible = "nvidia,tegra114-car, nvidia,tegra30-car";
31 reg = <0x60006000 0x1000>;
32 #clock-cells = <1>;
33 };
34
35 ahb: ahb {
36 compatible = "nvidia,tegra114-ahb", "nvidia,tegra30-ahb";
37 reg = <0x6000c004 0x14c>;
38 };
39
40 gpio: gpio {
41 compatible = "nvidia,tegra114-gpio", "nvidia,tegra30-gpio";
42 reg = <0x6000d000 0x1000>;
43 interrupts = <0 32 0x04
44 0 33 0x04
45 0 34 0x04
46 0 35 0x04
47 0 55 0x04
48 0 87 0x04
49 0 89 0x04
50 0 125 0x04>;
51 #gpio-cells = <2>;
52 gpio-controller;
53 #interrupt-cells = <2>;
54 interrupt-controller;
55 };
56
57 pinmux: pinmux {
58 compatible = "nvidia,tegra114-pinmux";
59 reg = <0x70000868 0x148 /* Pad control registers */
60 0x70003000 0x40c>; /* Mux registers */
61 };
62
63 serial@70006000 {
64 compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart";
65 reg = <0x70006000 0x40>;
66 reg-shift = <2>;
67 interrupts = <0 36 0x04>;
68 status = "disabled";
69 };
70
71 serial@70006040 {
72 compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart";
73 reg = <0x70006040 0x40>;
74 reg-shift = <2>;
75 interrupts = <0 37 0x04>;
76 status = "disabled";
77 };
78
79 serial@70006200 {
80 compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart";
81 reg = <0x70006200 0x100>;
82 reg-shift = <2>;
83 interrupts = <0 46 0x04>;
84 status = "disabled";
85 };
86
87 serial@70006300 {
88 compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart";
89 reg = <0x70006300 0x100>;
90 reg-shift = <2>;
91 interrupts = <0 90 0x04>;
92 status = "disabled";
93 };
94
95 rtc {
96 compatible = "nvidia,tegra114-rtc", "nvidia,tegra20-rtc";
97 reg = <0x7000e000 0x100>;
98 interrupts = <0 2 0x04>;
99 };
100
101 pmc {
102 compatible = "nvidia,tegra114-pmc", "nvidia,tegra30-pmc";
103 reg = <0x7000e400 0x400>;
104 };
105
106 iommu {
107 compatible = "nvidia,tegra114-smmu", "nvidia,tegra30-smmu";
108 reg = <0x7000f010 0x02c
109 0x7000f1f0 0x010
110 0x7000f228 0x074>;
111 nvidia,#asids = <4>;
112 dma-window = <0 0x40000000>;
113 nvidia,swgroups = <0x18659fe>;
114 nvidia,ahb = <&ahb>;
115 };
116
117 cpus {
118 #address-cells = <1>;
119 #size-cells = <0>;
120
121 cpu@0 {
122 device_type = "cpu";
123 compatible = "arm,cortex-a15";
124 reg = <0>;
125 };
126
127 cpu@1 {
128 device_type = "cpu";
129 compatible = "arm,cortex-a15";
130 reg = <1>;
131 };
132
133 cpu@2 {
134 device_type = "cpu";
135 compatible = "arm,cortex-a15";
136 reg = <2>;
137 };
138
139 cpu@3 {
140 device_type = "cpu";
141 compatible = "arm,cortex-a15";
142 reg = <3>;
143 };
144 };
145
146 timer {
147 compatible = "arm,armv7-timer";
148 interrupts = <1 13 0xf08>,
149 <1 14 0xf08>,
150 <1 11 0xf08>,
151 <1 10 0xf08>;
152 };
153};
diff --git a/arch/arm/boot/dts/tegra20-colibri-512.dtsi b/arch/arm/boot/dts/tegra20-colibri-512.dtsi
new file mode 100644
index 000000000000..444162090042
--- /dev/null
+++ b/arch/arm/boot/dts/tegra20-colibri-512.dtsi
@@ -0,0 +1,491 @@
1/include/ "tegra20.dtsi"
2
3/ {
4 model = "Toradex Colibri T20 512MB";
5 compatible = "toradex,colibri_t20-512", "nvidia,tegra20";
6
7 memory {
8 reg = <0x00000000 0x20000000>;
9 };
10
11 host1x {
12 hdmi {
13 vdd-supply = <&hdmi_vdd_reg>;
14 pll-supply = <&hdmi_pll_reg>;
15
16 nvidia,ddc-i2c-bus = <&i2c_ddc>;
17 nvidia,hpd-gpio = <&gpio 111 0>; /* PN7 */
18 };
19 };
20
21 pinmux {
22 pinctrl-names = "default";
23 pinctrl-0 = <&state_default>;
24
25 state_default: pinmux {
26 audio_refclk {
27 nvidia,pins = "cdev1";
28 nvidia,function = "plla_out";
29 nvidia,pull = <0>;
30 nvidia,tristate = <0>;
31 };
32 crt {
33 nvidia,pins = "crtp";
34 nvidia,function = "crt";
35 nvidia,pull = <0>;
36 nvidia,tristate = <1>;
37 };
38 dap3 {
39 nvidia,pins = "dap3";
40 nvidia,function = "dap3";
41 nvidia,pull = <0>;
42 nvidia,tristate = <0>;
43 };
44 displaya {
45 nvidia,pins = "ld0", "ld1", "ld2", "ld3",
46 "ld4", "ld5", "ld6", "ld7", "ld8",
47 "ld9", "ld10", "ld11", "ld12", "ld13",
48 "ld14", "ld15", "ld16", "ld17",
49 "lhs", "lpw0", "lpw2", "lsc0",
50 "lsc1", "lsck", "lsda", "lspi", "lvs";
51 nvidia,function = "displaya";
52 nvidia,tristate = <1>;
53 };
54 gpio_dte {
55 nvidia,pins = "dte";
56 nvidia,function = "rsvd1";
57 nvidia,pull = <0>;
58 nvidia,tristate = <0>;
59 };
60 gpio_gmi {
61 nvidia,pins = "ata", "atc", "atd", "ate",
62 "dap1", "dap2", "dap4", "gpu", "irrx",
63 "irtx", "spia", "spib", "spic";
64 nvidia,function = "gmi";
65 nvidia,pull = <0>;
66 nvidia,tristate = <0>;
67 };
68 gpio_pta {
69 nvidia,pins = "pta";
70 nvidia,function = "rsvd4";
71 nvidia,pull = <0>;
72 nvidia,tristate = <0>;
73 };
74 gpio_uac {
75 nvidia,pins = "uac";
76 nvidia,function = "rsvd2";
77 nvidia,pull = <0>;
78 nvidia,tristate = <0>;
79 };
80 hdint {
81 nvidia,pins = "hdint";
82 nvidia,function = "hdmi";
83 nvidia,tristate = <1>;
84 };
85 i2c1 {
86 nvidia,pins = "rm";
87 nvidia,function = "i2c1";
88 nvidia,pull = <0>;
89 nvidia,tristate = <1>;
90 };
91 i2c3 {
92 nvidia,pins = "dtf";
93 nvidia,function = "i2c3";
94 nvidia,pull = <0>;
95 nvidia,tristate = <1>;
96 };
97 i2cddc {
98 nvidia,pins = "ddc";
99 nvidia,function = "i2c2";
100 nvidia,pull = <2>;
101 nvidia,tristate = <1>;
102 };
103 i2cp {
104 nvidia,pins = "i2cp";
105 nvidia,function = "i2cp";
106 nvidia,pull = <0>;
107 nvidia,tristate = <0>;
108 };
109 irda {
110 nvidia,pins = "uad";
111 nvidia,function = "irda";
112 nvidia,pull = <0>;
113 nvidia,tristate = <1>;
114 };
115 nand {
116 nvidia,pins = "kbca", "kbcc", "kbcd",
117 "kbce", "kbcf";
118 nvidia,function = "nand";
119 nvidia,pull = <0>;
120 nvidia,tristate = <0>;
121 };
122 owc {
123 nvidia,pins = "owc";
124 nvidia,function = "owr";
125 nvidia,pull = <0>;
126 nvidia,tristate = <1>;
127 };
128 pmc {
129 nvidia,pins = "pmc";
130 nvidia,function = "pwr_on";
131 nvidia,tristate = <0>;
132 };
133 pwm {
134 nvidia,pins = "sdb", "sdc", "sdd";
135 nvidia,function = "pwm";
136 nvidia,tristate = <1>;
137 };
138 sdio4 {
139 nvidia,pins = "atb", "gma", "gme";
140 nvidia,function = "sdio4";
141 nvidia,pull = <0>;
142 nvidia,tristate = <1>;
143 };
144 spi1 {
145 nvidia,pins = "spid", "spie", "spif";
146 nvidia,function = "spi1";
147 nvidia,pull = <0>;
148 nvidia,tristate = <1>;
149 };
150 spi4 {
151 nvidia,pins = "slxa", "slxc", "slxd", "slxk";
152 nvidia,function = "spi4";
153 nvidia,pull = <0>;
154 nvidia,tristate = <1>;
155 };
156 uarta {
157 nvidia,pins = "sdio1";
158 nvidia,function = "uarta";
159 nvidia,pull = <0>;
160 nvidia,tristate = <1>;
161 };
162 uartd {
163 nvidia,pins = "gmc";
164 nvidia,function = "uartd";
165 nvidia,pull = <0>;
166 nvidia,tristate = <1>;
167 };
168 ulpi {
169 nvidia,pins = "uaa", "uab", "uda";
170 nvidia,function = "ulpi";
171 nvidia,pull = <0>;
172 nvidia,tristate = <0>;
173 };
174 ulpi_refclk {
175 nvidia,pins = "cdev2";
176 nvidia,function = "pllp_out4";
177 nvidia,pull = <0>;
178 nvidia,tristate = <0>;
179 };
180 usb_gpio {
181 nvidia,pins = "spig", "spih";
182 nvidia,function = "spi2_alt";
183 nvidia,pull = <0>;
184 nvidia,tristate = <0>;
185 };
186 vi {
187 nvidia,pins = "dta", "dtb", "dtc", "dtd";
188 nvidia,function = "vi";
189 nvidia,pull = <0>;
190 nvidia,tristate = <1>;
191 };
192 vi_sc {
193 nvidia,pins = "csus";
194 nvidia,function = "vi_sensor_clk";
195 nvidia,pull = <0>;
196 nvidia,tristate = <1>;
197 };
198 };
199 };
200
201 i2c@7000c000 {
202 clock-frequency = <400000>;
203 };
204
205 i2c_ddc: i2c@7000c400 {
206 clock-frequency = <100000>;
207 };
208
209 i2c@7000c500 {
210 clock-frequency = <400000>;
211 };
212
213 i2c@7000d000 {
214 status = "okay";
215 clock-frequency = <400000>;
216
217 pmic: tps6586x@34 {
218 compatible = "ti,tps6586x";
219 reg = <0x34>;
220 interrupts = <0 86 0x4>;
221
222 ti,system-power-controller;
223
224 #gpio-cells = <2>;
225 gpio-controller;
226
227 sys-supply = <&vdd_5v0_reg>;
228 vin-sm0-supply = <&sys_reg>;
229 vin-sm1-supply = <&sys_reg>;
230 vin-sm2-supply = <&sys_reg>;
231 vinldo01-supply = <&sm2_reg>;
232 vinldo23-supply = <&sm2_reg>;
233 vinldo4-supply = <&sm2_reg>;
234 vinldo678-supply = <&sm2_reg>;
235 vinldo9-supply = <&sm2_reg>;
236
237 regulators {
238 #address-cells = <1>;
239 #size-cells = <0>;
240
241 sys_reg: regulator@0 {
242 reg = <0>;
243 regulator-compatible = "sys";
244 regulator-name = "vdd_sys";
245 regulator-always-on;
246 };
247
248 regulator@1 {
249 reg = <1>;
250 regulator-compatible = "sm0";
251 regulator-name = "vdd_sm0,vdd_core";
252 regulator-min-microvolt = <1275000>;
253 regulator-max-microvolt = <1275000>;
254 regulator-always-on;
255 };
256
257 regulator@2 {
258 reg = <2>;
259 regulator-compatible = "sm1";
260 regulator-name = "vdd_sm1,vdd_cpu";
261 regulator-min-microvolt = <1100000>;
262 regulator-max-microvolt = <1100000>;
263 regulator-always-on;
264 };
265
266 sm2_reg: regulator@3 {
267 reg = <3>;
268 regulator-compatible = "sm2";
269 regulator-name = "vdd_sm2,vin_ldo*";
270 regulator-min-microvolt = <3700000>;
271 regulator-max-microvolt = <3700000>;
272 regulator-always-on;
273 };
274
275 /* LDO0 is not connected to anything */
276
277 regulator@5 {
278 reg = <5>;
279 regulator-compatible = "ldo1";
280 regulator-name = "vdd_ldo1,avdd_pll*";
281 regulator-min-microvolt = <1100000>;
282 regulator-max-microvolt = <1100000>;
283 regulator-always-on;
284 };
285
286 regulator@6 {
287 reg = <6>;
288 regulator-compatible = "ldo2";
289 regulator-name = "vdd_ldo2,vdd_rtc";
290 regulator-min-microvolt = <1200000>;
291 regulator-max-microvolt = <1200000>;
292 };
293
294 /* LDO3 is not connected to anything */
295
296 regulator@8 {
297 reg = <8>;
298 regulator-compatible = "ldo4";
299 regulator-name = "vdd_ldo4,avdd_osc,vddio_sys";
300 regulator-min-microvolt = <1800000>;
301 regulator-max-microvolt = <1800000>;
302 regulator-always-on;
303 };
304
305 ldo5_reg: regulator@9 {
306 reg = <9>;
307 regulator-compatible = "ldo5";
308 regulator-name = "vdd_ldo5,vdd_fuse";
309 regulator-min-microvolt = <3300000>;
310 regulator-max-microvolt = <3300000>;
311 regulator-always-on;
312 };
313
314 regulator@10 {
315 reg = <10>;
316 regulator-compatible = "ldo6";
317 regulator-name = "vdd_ldo6,avdd_vdac,vddio_vi,vddio_cam";
318 regulator-min-microvolt = <1800000>;
319 regulator-max-microvolt = <1800000>;
320 };
321
322 hdmi_vdd_reg: regulator@11 {
323 reg = <11>;
324 regulator-compatible = "ldo7";
325 regulator-name = "vdd_ldo7,avdd_hdmi";
326 regulator-min-microvolt = <3300000>;
327 regulator-max-microvolt = <3300000>;
328 };
329
330 hdmi_pll_reg: regulator@12 {
331 reg = <12>;
332 regulator-compatible = "ldo8";
333 regulator-name = "vdd_ldo8,avdd_hdmi_pll";
334 regulator-min-microvolt = <1800000>;
335 regulator-max-microvolt = <1800000>;
336 };
337
338 regulator@13 {
339 reg = <13>;
340 regulator-compatible = "ldo9";
341 regulator-name = "vdd_ldo9,avdd_2v85,vdd_ddr_rx";
342 regulator-min-microvolt = <2850000>;
343 regulator-max-microvolt = <2850000>;
344 regulator-always-on;
345 };
346
347 regulator@14 {
348 reg = <14>;
349 regulator-compatible = "ldo_rtc";
350 regulator-name = "vdd_rtc_out,vdd_cell";
351 regulator-min-microvolt = <3300000>;
352 regulator-max-microvolt = <3300000>;
353 regulator-always-on;
354 };
355 };
356 };
357
358 temperature-sensor@4c {
359 compatible = "national,lm95245";
360 reg = <0x4c>;
361 };
362 };
363
364 memory-controller@7000f400 {
365 emc-table@83250 {
366 reg = <83250>;
367 compatible = "nvidia,tegra20-emc-table";
368 clock-frequency = <83250>;
369 nvidia,emc-registers = <0x00000005 0x00000011
370 0x00000004 0x00000002 0x00000004 0x00000004
371 0x00000001 0x0000000a 0x00000002 0x00000002
372 0x00000001 0x00000001 0x00000003 0x00000004
373 0x00000003 0x00000009 0x0000000c 0x0000025f
374 0x00000000 0x00000003 0x00000003 0x00000002
375 0x00000002 0x00000001 0x00000008 0x000000c8
376 0x00000003 0x00000005 0x00000003 0x0000000c
377 0x00000002 0x00000000 0x00000000 0x00000002
378 0x00000000 0x00000000 0x00000083 0x00520006
379 0x00000010 0x00000008 0x00000000 0x00000000
380 0x00000000 0x00000000 0x00000000 0x00000000>;
381 };
382 emc-table@133200 {
383 reg = <133200>;
384 compatible = "nvidia,tegra20-emc-table";
385 clock-frequency = <133200>;
386 nvidia,emc-registers = <0x00000008 0x00000019
387 0x00000006 0x00000002 0x00000004 0x00000004
388 0x00000001 0x0000000a 0x00000002 0x00000002
389 0x00000002 0x00000001 0x00000003 0x00000004
390 0x00000003 0x00000009 0x0000000c 0x0000039f
391 0x00000000 0x00000003 0x00000003 0x00000002
392 0x00000002 0x00000001 0x00000008 0x000000c8
393 0x00000003 0x00000007 0x00000003 0x0000000c
394 0x00000002 0x00000000 0x00000000 0x00000002
395 0x00000000 0x00000000 0x00000083 0x00510006
396 0x00000010 0x00000008 0x00000000 0x00000000
397 0x00000000 0x00000000 0x00000000 0x00000000>;
398 };
399 emc-table@166500 {
400 reg = <166500>;
401 compatible = "nvidia,tegra20-emc-table";
402 clock-frequency = <166500>;
403 nvidia,emc-registers = <0x0000000a 0x00000021
404 0x00000008 0x00000003 0x00000004 0x00000004
405 0x00000002 0x0000000a 0x00000003 0x00000003
406 0x00000002 0x00000001 0x00000003 0x00000004
407 0x00000003 0x00000009 0x0000000c 0x000004df
408 0x00000000 0x00000003 0x00000003 0x00000003
409 0x00000003 0x00000001 0x00000009 0x000000c8
410 0x00000003 0x00000009 0x00000004 0x0000000c
411 0x00000002 0x00000000 0x00000000 0x00000002
412 0x00000000 0x00000000 0x00000083 0x004f0006
413 0x00000010 0x00000008 0x00000000 0x00000000
414 0x00000000 0x00000000 0x00000000 0x00000000>;
415 };
416 emc-table@333000 {
417 reg = <333000>;
418 compatible = "nvidia,tegra20-emc-table";
419 clock-frequency = <333000>;
420 nvidia,emc-registers = <0x00000014 0x00000041
421 0x0000000f 0x00000005 0x00000004 0x00000005
422 0x00000003 0x0000000a 0x00000005 0x00000005
423 0x00000004 0x00000001 0x00000003 0x00000004
424 0x00000003 0x00000009 0x0000000c 0x000009ff
425 0x00000000 0x00000003 0x00000003 0x00000005
426 0x00000005 0x00000001 0x0000000e 0x000000c8
427 0x00000003 0x00000011 0x00000006 0x0000000c
428 0x00000002 0x00000000 0x00000000 0x00000002
429 0x00000000 0x00000000 0x00000083 0x00380006
430 0x00000010 0x00000008 0x00000000 0x00000000
431 0x00000000 0x00000000 0x00000000 0x00000000>;
432 };
433 };
434
435 ac97: ac97 {
436 status = "okay";
437 nvidia,codec-reset-gpio = <&gpio 168 0>; /* gpio PV0 */
438 nvidia,codec-sync-gpio = <&gpio 120 0>; /* gpio PP0 */
439 };
440
441 usb@c5004000 {
442 status = "okay";
443 nvidia,phy-reset-gpio = <&gpio 169 0>; /* gpio PV1 */
444 };
445
446 sdhci@c8000600 {
447 cd-gpios = <&gpio 23 0>; /* gpio PC7 */
448 };
449
450 sound {
451 compatible = "nvidia,tegra-audio-wm9712-colibri_t20",
452 "nvidia,tegra-audio-wm9712";
453 nvidia,model = "Colibri T20 AC97 Audio";
454
455 nvidia,audio-routing =
456 "Headphone", "HPOUTL",
457 "Headphone", "HPOUTR",
458 "LineIn", "LINEINL",
459 "LineIn", "LINEINR",
460 "Mic", "MIC1";
461
462 nvidia,ac97-controller = <&ac97>;
463 };
464
465 regulators {
466 compatible = "simple-bus";
467 #address-cells = <1>;
468 #size-cells = <0>;
469
470 vdd_5v0_reg: regulator@100 {
471 compatible = "regulator-fixed";
472 reg = <100>;
473 regulator-name = "vdd_5v0";
474 regulator-min-microvolt = <5000000>;
475 regulator-max-microvolt = <5000000>;
476 regulator-always-on;
477 };
478
479 regulator@101 {
480 compatible = "regulator-fixed";
481 reg = <101>;
482 regulator-name = "internal_usb";
483 regulator-min-microvolt = <5000000>;
484 regulator-max-microvolt = <5000000>;
485 enable-active-high;
486 regulator-boot-on;
487 regulator-always-on;
488 gpio = <&gpio 217 0>;
489 };
490 };
491};
diff --git a/arch/arm/boot/dts/tegra20-harmony.dts b/arch/arm/boot/dts/tegra20-harmony.dts
index 43eb72af8948..61d027f03617 100644
--- a/arch/arm/boot/dts/tegra20-harmony.dts
+++ b/arch/arm/boot/dts/tegra20-harmony.dts
@@ -3,7 +3,7 @@
3/include/ "tegra20.dtsi" 3/include/ "tegra20.dtsi"
4 4
5/ { 5/ {
6 model = "NVIDIA Tegra2 Harmony evaluation board"; 6 model = "NVIDIA Tegra20 Harmony evaluation board";
7 compatible = "nvidia,harmony", "nvidia,tegra20"; 7 compatible = "nvidia,harmony", "nvidia,tegra20";
8 8
9 memory { 9 memory {
@@ -252,7 +252,6 @@
252 252
253 serial@70006300 { 253 serial@70006300 {
254 status = "okay"; 254 status = "okay";
255 clock-frequency = <216000000>;
256 }; 255 };
257 256
258 i2c@7000c000 { 257 i2c@7000c000 {
@@ -432,6 +431,10 @@
432 status = "okay"; 431 status = "okay";
433 }; 432 };
434 433
434 usb-phy@c5004400 {
435 nvidia,phy-reset-gpio = <&gpio 169 0>; /* gpio PV1 */
436 };
437
435 sdhci@c8000200 { 438 sdhci@c8000200 {
436 status = "okay"; 439 status = "okay";
437 cd-gpios = <&gpio 69 0>; /* gpio PI5 */ 440 cd-gpios = <&gpio 69 0>; /* gpio PI5 */
@@ -448,6 +451,123 @@
448 bus-width = <8>; 451 bus-width = <8>;
449 }; 452 };
450 453
454 kbc {
455 status = "okay";
456 nvidia,debounce-delay-ms = <2>;
457 nvidia,repeat-delay-ms = <160>;
458 nvidia,kbc-row-pins = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15>;
459 nvidia,kbc-col-pins = <16 17 18 19 20 21 22 23>;
460 linux,keymap = <0x00020011 /* KEY_W */
461 0x0003001F /* KEY_S */
462 0x0004001E /* KEY_A */
463 0x0005002C /* KEY_Z */
464 0x000701D0 /* KEY_FN */
465 0x0107008B /* KEY_MENU */
466 0x02060038 /* KEY_LEFTALT */
467 0x02070064 /* KEY_RIGHTALT */
468 0x03000006 /* KEY_5 */
469 0x03010005 /* KEY_4 */
470 0x03020013 /* KEY_R */
471 0x03030012 /* KEY_E */
472 0x03040021 /* KEY_F */
473 0x03050020 /* KEY_D */
474 0x0306002D /* KEY_X */
475 0x04000008 /* KEY_7 */
476 0x04010007 /* KEY_6 */
477 0x04020014 /* KEY_T */
478 0x04030023 /* KEY_H */
479 0x04040022 /* KEY_G */
480 0x0405002F /* KEY_V */
481 0x0406002E /* KEY_C */
482 0x04070039 /* KEY_SPACE */
483 0x0500000A /* KEY_9 */
484 0x05010009 /* KEY_8 */
485 0x05020016 /* KEY_U */
486 0x05030015 /* KEY_Y */
487 0x05040024 /* KEY_J */
488 0x05050031 /* KEY_N */
489 0x05060030 /* KEY_B */
490 0x0507002B /* KEY_BACKSLASH */
491 0x0600000C /* KEY_MINUS */
492 0x0601000B /* KEY_0 */
493 0x06020018 /* KEY_O */
494 0x06030017 /* KEY_I */
495 0x06040026 /* KEY_L */
496 0x06050025 /* KEY_K */
497 0x06060033 /* KEY_COMMA */
498 0x06070032 /* KEY_M */
499 0x0701000D /* KEY_EQUAL */
500 0x0702001B /* KEY_RIGHTBRACE */
501 0x0703001C /* KEY_ENTER */
502 0x0707008B /* KEY_MENU */
503 0x0804002A /* KEY_LEFTSHIFT */
504 0x08050036 /* KEY_RIGHTSHIFT */
505 0x0905001D /* KEY_LEFTCTRL */
506 0x09070061 /* KEY_RIGHTCTRL */
507 0x0B00001A /* KEY_LEFTBRACE */
508 0x0B010019 /* KEY_P */
509 0x0B020028 /* KEY_APOSTROPHE */
510 0x0B030027 /* KEY_SEMICOLON */
511 0x0B040035 /* KEY_SLASH */
512 0x0B050034 /* KEY_DOT */
513 0x0C000044 /* KEY_F10 */
514 0x0C010043 /* KEY_F9 */
515 0x0C02000E /* KEY_BACKSPACE */
516 0x0C030004 /* KEY_3 */
517 0x0C040003 /* KEY_2 */
518 0x0C050067 /* KEY_UP */
519 0x0C0600D2 /* KEY_PRINT */
520 0x0C070077 /* KEY_PAUSE */
521 0x0D00006E /* KEY_INSERT */
522 0x0D01006F /* KEY_DELETE */
523 0x0D030068 /* KEY_PAGEUP */
524 0x0D04006D /* KEY_PAGEDOWN */
525 0x0D05006A /* KEY_RIGHT */
526 0x0D06006C /* KEY_DOWN */
527 0x0D070069 /* KEY_LEFT */
528 0x0E000057 /* KEY_F11 */
529 0x0E010058 /* KEY_F12 */
530 0x0E020042 /* KEY_F8 */
531 0x0E030010 /* KEY_Q */
532 0x0E04003E /* KEY_F4 */
533 0x0E05003D /* KEY_F3 */
534 0x0E060002 /* KEY_1 */
535 0x0E070041 /* KEY_F7 */
536 0x0F000001 /* KEY_ESC */
537 0x0F010029 /* KEY_GRAVE */
538 0x0F02003F /* KEY_F5 */
539 0x0F03000F /* KEY_TAB */
540 0x0F04003B /* KEY_F1 */
541 0x0F05003C /* KEY_F2 */
542 0x0F06003A /* KEY_CAPSLOCK */
543 0x0F070040 /* KEY_F6 */
544 0x14000047 /* KEY_KP7 */
545 0x15000049 /* KEY_KP9 */
546 0x15010048 /* KEY_KP8 */
547 0x1502004B /* KEY_KP4 */
548 0x1504004F /* KEY_KP1 */
549 0x1601004E /* KEY_KPSLASH */
550 0x1602004D /* KEY_KP6 */
551 0x1603004C /* KEY_KP5 */
552 0x16040051 /* KEY_KP3 */
553 0x16050050 /* KEY_KP2 */
554 0x16070052 /* KEY_KP0 */
555 0x1B010037 /* KEY_KPASTERISK */
556 0x1B03004A /* KEY_KPMINUS */
557 0x1B04004E /* KEY_KPPLUS */
558 0x1B050053 /* KEY_KPDOT */
559 0x1C050073 /* KEY_VOLUMEUP */
560 0x1D030066 /* KEY_HOME */
561 0x1D04006B /* KEY_END */
562 0x1D0500E1 /* KEY_BRIGHTNESSUP */
563 0x1D060072 /* KEY_VOLUMEDOWN */
564 0x1D0700E0 /* KEY_BRIGHTNESSDOWN */
565 0x1E000045 /* KEY_NUMLOCK */
566 0x1E010046 /* KEY_SCROLLLOCK */
567 0x1E020071 /* KEY_MUTE */
568 0x1F0400D6>; /* KEY_QUESTION */
569 };
570
451 regulators { 571 regulators {
452 compatible = "simple-bus"; 572 compatible = "simple-bus";
453 #address-cells = <1>; 573 #address-cells = <1>;
diff --git a/arch/arm/boot/dts/tegra20-iris-512.dts b/arch/arm/boot/dts/tegra20-iris-512.dts
new file mode 100644
index 000000000000..52f1103907d7
--- /dev/null
+++ b/arch/arm/boot/dts/tegra20-iris-512.dts
@@ -0,0 +1,89 @@
1/dts-v1/;
2
3/include/ "tegra20-colibri-512.dtsi"
4
5/ {
6 model = "Toradex Colibri T20 512MB on Iris";
7 compatible = "toradex,iris", "toradex,colibri_t20-512", "nvidia,tegra20";
8
9 host1x {
10 hdmi {
11 status = "okay";
12 };
13 };
14
15 pinmux {
16 state_default: pinmux {
17 hdint {
18 nvidia,tristate = <0>;
19 };
20
21 i2cddc {
22 nvidia,tristate = <0>;
23 };
24
25 sdio4 {
26 nvidia,tristate = <0>;
27 };
28
29 uarta {
30 nvidia,tristate = <0>;
31 };
32
33 uartd {
34 nvidia,tristate = <0>;
35 };
36 };
37 };
38
39 usb@c5000000 {
40 status = "okay";
41 dr_mode = "otg";
42 };
43
44 usb@c5008000 {
45 status = "okay";
46 };
47
48 serial@70006000 {
49 status = "okay";
50 };
51
52 serial@70006300 {
53 status = "okay";
54 };
55
56 i2c_ddc: i2c@7000c400 {
57 status = "okay";
58 };
59
60 sdhci@c8000600 {
61 status = "okay";
62 bus-width = <4>;
63 vmmc-supply = <&vcc_sd_reg>;
64 vqmmc-supply = <&vcc_sd_reg>;
65 };
66
67 regulators {
68 regulator@0 {
69 compatible = "regulator-fixed";
70 reg = <0>;
71 regulator-name = "usb_host_vbus";
72 regulator-min-microvolt = <5000000>;
73 regulator-max-microvolt = <5000000>;
74 regulator-boot-on;
75 regulator-always-on;
76 gpio = <&gpio 178 0>;
77 };
78
79 vcc_sd_reg: regulator@1 {
80 compatible = "regulator-fixed";
81 reg = <1>;
82 regulator-name = "vcc_sd";
83 regulator-min-microvolt = <3300000>;
84 regulator-max-microvolt = <3300000>;
85 regulator-boot-on;
86 regulator-always-on;
87 };
88 };
89};
diff --git a/arch/arm/boot/dts/tegra20-paz00.dts b/arch/arm/boot/dts/tegra20-paz00.dts
index 6a93d1404c76..54d6fce00a59 100644
--- a/arch/arm/boot/dts/tegra20-paz00.dts
+++ b/arch/arm/boot/dts/tegra20-paz00.dts
@@ -10,6 +10,18 @@
10 reg = <0x00000000 0x20000000>; 10 reg = <0x00000000 0x20000000>;
11 }; 11 };
12 12
13 host1x {
14 hdmi {
15 status = "okay";
16
17 vdd-supply = <&hdmi_vdd_reg>;
18 pll-supply = <&hdmi_pll_reg>;
19
20 nvidia,ddc-i2c-bus = <&hdmi_ddc>;
21 nvidia,hpd-gpio = <&gpio 111 0>; /* PN7 */
22 };
23 };
24
13 pinmux { 25 pinmux {
14 pinctrl-names = "default"; 26 pinctrl-names = "default";
15 pinctrl-0 = <&state_default>; 27 pinctrl-0 = <&state_default>;
@@ -232,12 +244,10 @@
232 244
233 serial@70006000 { 245 serial@70006000 {
234 status = "okay"; 246 status = "okay";
235 clock-frequency = <216000000>;
236 }; 247 };
237 248
238 serial@70006200 { 249 serial@70006200 {
239 status = "okay"; 250 status = "okay";
240 clock-frequency = <216000000>;
241 }; 251 };
242 252
243 i2c@7000c000 { 253 i2c@7000c000 {
@@ -252,9 +262,9 @@
252 }; 262 };
253 }; 263 };
254 264
255 i2c@7000c400 { 265 hdmi_ddc: i2c@7000c400 {
256 status = "okay"; 266 status = "okay";
257 clock-frequency = <400000>; 267 clock-frequency = <100000>;
258 }; 268 };
259 269
260 nvec { 270 nvec {
@@ -266,6 +276,8 @@
266 clock-frequency = <80000>; 276 clock-frequency = <80000>;
267 request-gpios = <&gpio 170 0>; /* gpio PV2 */ 277 request-gpios = <&gpio 170 0>; /* gpio PV2 */
268 slave-addr = <138>; 278 slave-addr = <138>;
279 clocks = <&tegra_car 67>, <&tegra_car 124>;
280 clock-names = "div-clk", "fast-clk";
269 }; 281 };
270 282
271 i2c@7000d000 { 283 i2c@7000d000 {
@@ -367,13 +379,13 @@
367 regulator-max-microvolt = <1800000>; 379 regulator-max-microvolt = <1800000>;
368 }; 380 };
369 381
370 ldo7 { 382 hdmi_vdd_reg: ldo7 {
371 regulator-name = "+3.3vs_ldo7,avdd_hdmi"; 383 regulator-name = "+3.3vs_ldo7,avdd_hdmi";
372 regulator-min-microvolt = <3300000>; 384 regulator-min-microvolt = <3300000>;
373 regulator-max-microvolt = <3300000>; 385 regulator-max-microvolt = <3300000>;
374 }; 386 };
375 387
376 ldo8 { 388 hdmi_pll_reg: ldo8 {
377 regulator-name = "+1.8vs_ldo8,avdd_hdmi_pll"; 389 regulator-name = "+1.8vs_ldo8,avdd_hdmi_pll";
378 regulator-min-microvolt = <1800000>; 390 regulator-min-microvolt = <1800000>;
379 regulator-max-microvolt = <1800000>; 391 regulator-max-microvolt = <1800000>;
@@ -418,6 +430,10 @@
418 status = "okay"; 430 status = "okay";
419 }; 431 };
420 432
433 usb-phy@c5004400 {
434 nvidia,phy-reset-gpio = <&gpio 168 0>; /* gpio PV0 */
435 };
436
421 sdhci@c8000000 { 437 sdhci@c8000000 {
422 status = "okay"; 438 status = "okay";
423 cd-gpios = <&gpio 173 0>; /* gpio PV5 */ 439 cd-gpios = <&gpio 173 0>; /* gpio PV5 */
diff --git a/arch/arm/boot/dts/tegra20-seaboard.dts b/arch/arm/boot/dts/tegra20-seaboard.dts
index 420459825b46..37b3a57ec0f1 100644
--- a/arch/arm/boot/dts/tegra20-seaboard.dts
+++ b/arch/arm/boot/dts/tegra20-seaboard.dts
@@ -10,6 +10,18 @@
10 reg = <0x00000000 0x40000000>; 10 reg = <0x00000000 0x40000000>;
11 }; 11 };
12 12
13 host1x {
14 hdmi {
15 status = "okay";
16
17 vdd-supply = <&hdmi_vdd_reg>;
18 pll-supply = <&hdmi_pll_reg>;
19
20 nvidia,ddc-i2c-bus = <&hdmi_ddc>;
21 nvidia,hpd-gpio = <&gpio 111 0>; /* PN7 */
22 };
23 };
24
13 pinmux { 25 pinmux {
14 pinctrl-names = "default"; 26 pinctrl-names = "default";
15 pinctrl-0 = <&state_default>; 27 pinctrl-0 = <&state_default>;
@@ -291,7 +303,6 @@
291 303
292 serial@70006300 { 304 serial@70006300 {
293 status = "okay"; 305 status = "okay";
294 clock-frequency = <216000000>;
295 }; 306 };
296 307
297 i2c@7000c000 { 308 i2c@7000c000 {
@@ -345,7 +356,7 @@
345 pinctrl-1 = <&state_i2cmux_pta>; 356 pinctrl-1 = <&state_i2cmux_pta>;
346 pinctrl-2 = <&state_i2cmux_idle>; 357 pinctrl-2 = <&state_i2cmux_idle>;
347 358
348 i2c@0 { 359 hdmi_ddc: i2c@0 {
349 reg = <0>; 360 reg = <0>;
350 #address-cells = <1>; 361 #address-cells = <1>;
351 #size-cells = <0>; 362 #size-cells = <0>;
@@ -463,13 +474,13 @@
463 regulator-max-microvolt = <1800000>; 474 regulator-max-microvolt = <1800000>;
464 }; 475 };
465 476
466 ldo7 { 477 hdmi_vdd_reg: ldo7 {
467 regulator-name = "vdd_ldo7,avdd_hdmi,vdd_fuse"; 478 regulator-name = "vdd_ldo7,avdd_hdmi,vdd_fuse";
468 regulator-min-microvolt = <3300000>; 479 regulator-min-microvolt = <3300000>;
469 regulator-max-microvolt = <3300000>; 480 regulator-max-microvolt = <3300000>;
470 }; 481 };
471 482
472 ldo8 { 483 hdmi_pll_reg: ldo8 {
473 regulator-name = "vdd_ldo8,avdd_hdmi_pll"; 484 regulator-name = "vdd_ldo8,avdd_hdmi_pll";
474 regulator-min-microvolt = <1800000>; 485 regulator-min-microvolt = <1800000>;
475 regulator-max-microvolt = <1800000>; 486 regulator-max-microvolt = <1800000>;
@@ -561,6 +572,10 @@
561 status = "okay"; 572 status = "okay";
562 }; 573 };
563 574
575 usb-phy@c5004400 {
576 nvidia,phy-reset-gpio = <&gpio 169 0>; /* gpio PV1 */
577 };
578
564 sdhci@c8000000 { 579 sdhci@c8000000 {
565 status = "okay"; 580 status = "okay";
566 power-gpios = <&gpio 86 0>; /* gpio PK6 */ 581 power-gpios = <&gpio 86 0>; /* gpio PK6 */
@@ -600,6 +615,145 @@
600 }; 615 };
601 }; 616 };
602 617
618 kbc {
619 status = "okay";
620 nvidia,debounce-delay-ms = <32>;
621 nvidia,repeat-delay-ms = <160>;
622 nvidia,ghost-filter;
623 nvidia,kbc-row-pins = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15>;
624 nvidia,kbc-col-pins = <16 17 18 19 20 21 22 23>;
625 linux,keymap = <0x00020011 /* KEY_W */
626 0x0003001F /* KEY_S */
627 0x0004001E /* KEY_A */
628 0x0005002C /* KEY_Z */
629 0x000701d0 /* KEY_FN */
630
631 0x0107007D /* KEY_LEFTMETA */
632 0x02060064 /* KEY_RIGHTALT */
633 0x02070038 /* KEY_LEFTALT */
634
635 0x03000006 /* KEY_5 */
636 0x03010005 /* KEY_4 */
637 0x03020013 /* KEY_R */
638 0x03030012 /* KEY_E */
639 0x03040021 /* KEY_F */
640 0x03050020 /* KEY_D */
641 0x0306002D /* KEY_X */
642
643 0x04000008 /* KEY_7 */
644 0x04010007 /* KEY_6 */
645 0x04020014 /* KEY_T */
646 0x04030023 /* KEY_H */
647 0x04040022 /* KEY_G */
648 0x0405002F /* KEY_V */
649 0x0406002E /* KEY_C */
650 0x04070039 /* KEY_SPACE */
651
652 0x0500000A /* KEY_9 */
653 0x05010009 /* KEY_8 */
654 0x05020016 /* KEY_U */
655 0x05030015 /* KEY_Y */
656 0x05040024 /* KEY_J */
657 0x05050031 /* KEY_N */
658 0x05060030 /* KEY_B */
659 0x0507002B /* KEY_BACKSLASH */
660
661 0x0600000C /* KEY_MINUS */
662 0x0601000B /* KEY_0 */
663 0x06020018 /* KEY_O */
664 0x06030017 /* KEY_I */
665 0x06040026 /* KEY_L */
666 0x06050025 /* KEY_K */
667 0x06060033 /* KEY_COMMA */
668 0x06070032 /* KEY_M */
669
670 0x0701000D /* KEY_EQUAL */
671 0x0702001B /* KEY_RIGHTBRACE */
672 0x0703001C /* KEY_ENTER */
673 0x0707008B /* KEY_MENU */
674
675 0x08040036 /* KEY_RIGHTSHIFT */
676 0x0805002A /* KEY_LEFTSHIFT */
677
678 0x09050061 /* KEY_RIGHTCTRL */
679 0x0907001D /* KEY_LEFTCTRL */
680
681 0x0B00001A /* KEY_LEFTBRACE */
682 0x0B010019 /* KEY_P */
683 0x0B020028 /* KEY_APOSTROPHE */
684 0x0B030027 /* KEY_SEMICOLON */
685 0x0B040035 /* KEY_SLASH */
686 0x0B050034 /* KEY_DOT */
687
688 0x0C000044 /* KEY_F10 */
689 0x0C010043 /* KEY_F9 */
690 0x0C02000E /* KEY_BACKSPACE */
691 0x0C030004 /* KEY_3 */
692 0x0C040003 /* KEY_2 */
693 0x0C050067 /* KEY_UP */
694 0x0C0600D2 /* KEY_PRINT */
695 0x0C070077 /* KEY_PAUSE */
696
697 0x0D00006E /* KEY_INSERT */
698 0x0D01006F /* KEY_DELETE */
699 0x0D030068 /* KEY_PAGEUP */
700 0x0D04006D /* KEY_PAGEDOWN */
701 0x0D05006A /* KEY_RIGHT */
702 0x0D06006C /* KEY_DOWN */
703 0x0D070069 /* KEY_LEFT */
704
705 0x0E000057 /* KEY_F11 */
706 0x0E010058 /* KEY_F12 */
707 0x0E020042 /* KEY_F8 */
708 0x0E030010 /* KEY_Q */
709 0x0E04003E /* KEY_F4 */
710 0x0E05003D /* KEY_F3 */
711 0x0E060002 /* KEY_1 */
712 0x0E070041 /* KEY_F7 */
713
714 0x0F000001 /* KEY_ESC */
715 0x0F010029 /* KEY_GRAVE */
716 0x0F02003F /* KEY_F5 */
717 0x0F03000F /* KEY_TAB */
718 0x0F04003B /* KEY_F1 */
719 0x0F05003C /* KEY_F2 */
720 0x0F06003A /* KEY_CAPSLOCK */
721 0x0F070040 /* KEY_F6 */
722
723 /* Software Handled Function Keys */
724 0x14000047 /* KEY_KP7 */
725
726 0x15000049 /* KEY_KP9 */
727 0x15010048 /* KEY_KP8 */
728 0x1502004B /* KEY_KP4 */
729 0x1504004F /* KEY_KP1 */
730
731 0x1601004E /* KEY_KPSLASH */
732 0x1602004D /* KEY_KP6 */
733 0x1603004C /* KEY_KP5 */
734 0x16040051 /* KEY_KP3 */
735 0x16050050 /* KEY_KP2 */
736 0x16070052 /* KEY_KP0 */
737
738 0x1B010037 /* KEY_KPASTERISK */
739 0x1B03004A /* KEY_KPMINUS */
740 0x1B04004E /* KEY_KPPLUS */
741 0x1B050053 /* KEY_KPDOT */
742
743 0x1C050073 /* KEY_VOLUMEUP */
744
745 0x1D030066 /* KEY_HOME */
746 0x1D04006B /* KEY_END */
747 0x1D0500E0 /* KEY_BRIGHTNESSDOWN */
748 0x1D060072 /* KEY_VOLUMEDOWN */
749 0x1D0700E1 /* KEY_BRIGHTNESSUP */
750
751 0x1E000045 /* KEY_NUMLOCK */
752 0x1E010046 /* KEY_SCROLLLOCK */
753 0x1E020071 /* KEY_MUTE */
754
755 0x1F04008A>; /* KEY_HELP */
756 };
603 regulators { 757 regulators {
604 compatible = "simple-bus"; 758 compatible = "simple-bus";
605 #address-cells = <1>; 759 #address-cells = <1>;
diff --git a/arch/arm/boot/dts/tegra20-tamonten.dtsi b/arch/arm/boot/dts/tegra20-tamonten.dtsi
index a239ccdfaa52..4766abae7a72 100644
--- a/arch/arm/boot/dts/tegra20-tamonten.dtsi
+++ b/arch/arm/boot/dts/tegra20-tamonten.dtsi
@@ -276,7 +276,6 @@
276 }; 276 };
277 277
278 serial@70006300 { 278 serial@70006300 {
279 clock-frequency = <216000000>;
280 status = "okay"; 279 status = "okay";
281 }; 280 };
282 281
diff --git a/arch/arm/boot/dts/tegra20-trimslice.dts b/arch/arm/boot/dts/tegra20-trimslice.dts
index b70b4cb754c8..5d79e4fc49a6 100644
--- a/arch/arm/boot/dts/tegra20-trimslice.dts
+++ b/arch/arm/boot/dts/tegra20-trimslice.dts
@@ -249,6 +249,11 @@
249 "ld23_22"; 249 "ld23_22";
250 nvidia,pull = <1>; 250 nvidia,pull = <1>;
251 }; 251 };
252 conf_spif {
253 nvidia,pins = "spif";
254 nvidia,pull = <1>;
255 nvidia,tristate = <0>;
256 };
252 }; 257 };
253 }; 258 };
254 259
@@ -258,7 +263,6 @@
258 263
259 serial@70006000 { 264 serial@70006000 {
260 status = "okay"; 265 status = "okay";
261 clock-frequency = <216000000>;
262 }; 266 };
263 267
264 dvi_ddc: i2c@7000c000 { 268 dvi_ddc: i2c@7000c000 {
@@ -310,6 +314,10 @@
310 status = "okay"; 314 status = "okay";
311 }; 315 };
312 316
317 usb-phy@c5004400 {
318 nvidia,phy-reset-gpio = <&gpio 168 0>; /* gpio PV0 */
319 };
320
313 sdhci@c8000000 { 321 sdhci@c8000000 {
314 status = "okay"; 322 status = "okay";
315 bus-width = <4>; 323 bus-width = <4>;
@@ -322,6 +330,11 @@
322 bus-width = <4>; 330 bus-width = <4>;
323 }; 331 };
324 332
333 poweroff {
334 compatible = "gpio-poweroff";
335 gpios = <&gpio 191 1>; /* gpio PX7, active low */
336 };
337
325 regulators { 338 regulators {
326 compatible = "simple-bus"; 339 compatible = "simple-bus";
327 #address-cells = <1>; 340 #address-cells = <1>;
diff --git a/arch/arm/boot/dts/tegra20-ventana.dts b/arch/arm/boot/dts/tegra20-ventana.dts
index adc47547eaae..425c89000c20 100644
--- a/arch/arm/boot/dts/tegra20-ventana.dts
+++ b/arch/arm/boot/dts/tegra20-ventana.dts
@@ -3,13 +3,25 @@
3/include/ "tegra20.dtsi" 3/include/ "tegra20.dtsi"
4 4
5/ { 5/ {
6 model = "NVIDIA Tegra2 Ventana evaluation board"; 6 model = "NVIDIA Tegra20 Ventana evaluation board";
7 compatible = "nvidia,ventana", "nvidia,tegra20"; 7 compatible = "nvidia,ventana", "nvidia,tegra20";
8 8
9 memory { 9 memory {
10 reg = <0x00000000 0x40000000>; 10 reg = <0x00000000 0x40000000>;
11 }; 11 };
12 12
13 host1x {
14 hdmi {
15 status = "okay";
16
17 vdd-supply = <&hdmi_vdd_reg>;
18 pll-supply = <&hdmi_pll_reg>;
19
20 nvidia,ddc-i2c-bus = <&hdmi_ddc>;
21 nvidia,hpd-gpio = <&gpio 111 0>; /* PN7 */
22 };
23 };
24
13 pinmux { 25 pinmux {
14 pinctrl-names = "default"; 26 pinctrl-names = "default";
15 pinctrl-0 = <&state_default>; 27 pinctrl-0 = <&state_default>;
@@ -288,7 +300,6 @@
288 300
289 serial@70006300 { 301 serial@70006300 {
290 status = "okay"; 302 status = "okay";
291 clock-frequency = <216000000>;
292 }; 303 };
293 304
294 i2c@7000c000 { 305 i2c@7000c000 {
@@ -320,7 +331,7 @@
320 331
321 i2c@7000c400 { 332 i2c@7000c400 {
322 status = "okay"; 333 status = "okay";
323 clock-frequency = <400000>; 334 clock-frequency = <100000>;
324 }; 335 };
325 336
326 i2cmux { 337 i2cmux {
@@ -335,7 +346,7 @@
335 pinctrl-1 = <&state_i2cmux_pta>; 346 pinctrl-1 = <&state_i2cmux_pta>;
336 pinctrl-2 = <&state_i2cmux_idle>; 347 pinctrl-2 = <&state_i2cmux_idle>;
337 348
338 i2c@0 { 349 hdmi_ddc: i2c@0 {
339 reg = <0>; 350 reg = <0>;
340 #address-cells = <1>; 351 #address-cells = <1>;
341 #size-cells = <0>; 352 #size-cells = <0>;
@@ -446,13 +457,13 @@
446 regulator-max-microvolt = <1800000>; 457 regulator-max-microvolt = <1800000>;
447 }; 458 };
448 459
449 ldo7 { 460 hdmi_vdd_reg: ldo7 {
450 regulator-name = "vdd_ldo7,avdd_hdmi,vdd_fuse"; 461 regulator-name = "vdd_ldo7,avdd_hdmi,vdd_fuse";
451 regulator-min-microvolt = <3300000>; 462 regulator-min-microvolt = <3300000>;
452 regulator-max-microvolt = <3300000>; 463 regulator-max-microvolt = <3300000>;
453 }; 464 };
454 465
455 ldo8 { 466 hdmi_pll_reg: ldo8 {
456 regulator-name = "vdd_ldo8,avdd_hdmi_pll"; 467 regulator-name = "vdd_ldo8,avdd_hdmi_pll";
457 regulator-min-microvolt = <1800000>; 468 regulator-min-microvolt = <1800000>;
458 regulator-max-microvolt = <1800000>; 469 regulator-max-microvolt = <1800000>;
@@ -497,6 +508,10 @@
497 status = "okay"; 508 status = "okay";
498 }; 509 };
499 510
511 usb-phy@c5004400 {
512 nvidia,phy-reset-gpio = <&gpio 169 0>; /* gpio PV1 */
513 };
514
500 sdhci@c8000000 { 515 sdhci@c8000000 {
501 status = "okay"; 516 status = "okay";
502 power-gpios = <&gpio 86 0>; /* gpio PK6 */ 517 power-gpios = <&gpio 86 0>; /* gpio PK6 */
diff --git a/arch/arm/boot/dts/tegra20-whistler.dts b/arch/arm/boot/dts/tegra20-whistler.dts
index 20d576ecd555..ea57c0f6dcce 100644
--- a/arch/arm/boot/dts/tegra20-whistler.dts
+++ b/arch/arm/boot/dts/tegra20-whistler.dts
@@ -3,7 +3,7 @@
3/include/ "tegra20.dtsi" 3/include/ "tegra20.dtsi"
4 4
5/ { 5/ {
6 model = "NVIDIA Tegra2 Whistler evaluation board"; 6 model = "NVIDIA Tegra20 Whistler evaluation board";
7 compatible = "nvidia,whistler", "nvidia,tegra20"; 7 compatible = "nvidia,whistler", "nvidia,tegra20";
8 8
9 memory { 9 memory {
@@ -255,7 +255,6 @@
255 255
256 serial@70006000 { 256 serial@70006000 {
257 status = "okay"; 257 status = "okay";
258 clock-frequency = <216000000>;
259 }; 258 };
260 259
261 hdmi_ddc: i2c@7000c400 { 260 hdmi_ddc: i2c@7000c400 {
@@ -520,6 +519,18 @@
520 bus-width = <8>; 519 bus-width = <8>;
521 }; 520 };
522 521
522 kbc {
523 status = "okay";
524 nvidia,debounce-delay-ms = <20>;
525 nvidia,repeat-delay-ms = <160>;
526 nvidia,kbc-row-pins = <0 1 2>;
527 nvidia,kbc-col-pins = <16 17>;
528 linux,keymap = <0x00000074 /* KEY_POWER */
529 0x01000066 /* KEY_HOME */
530 0x0101009E /* KEY_BACK */
531 0x0201008B>; /* KEY_MENU */
532 };
533
523 regulators { 534 regulators {
524 compatible = "simple-bus"; 535 compatible = "simple-bus";
525 #address-cells = <1>; 536 #address-cells = <1>;
diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi
index b8effa1cbda7..9a428931d042 100644
--- a/arch/arm/boot/dts/tegra20.dtsi
+++ b/arch/arm/boot/dts/tegra20.dtsi
@@ -4,11 +4,20 @@
4 compatible = "nvidia,tegra20"; 4 compatible = "nvidia,tegra20";
5 interrupt-parent = <&intc>; 5 interrupt-parent = <&intc>;
6 6
7 aliases {
8 serial0 = &uarta;
9 serial1 = &uartb;
10 serial2 = &uartc;
11 serial3 = &uartd;
12 serial4 = &uarte;
13 };
14
7 host1x { 15 host1x {
8 compatible = "nvidia,tegra20-host1x", "simple-bus"; 16 compatible = "nvidia,tegra20-host1x", "simple-bus";
9 reg = <0x50000000 0x00024000>; 17 reg = <0x50000000 0x00024000>;
10 interrupts = <0 65 0x04 /* mpcore syncpt */ 18 interrupts = <0 65 0x04 /* mpcore syncpt */
11 0 67 0x04>; /* mpcore general */ 19 0 67 0x04>; /* mpcore general */
20 clocks = <&tegra_car 28>;
12 21
13 #address-cells = <1>; 22 #address-cells = <1>;
14 #size-cells = <1>; 23 #size-cells = <1>;
@@ -19,41 +28,49 @@
19 compatible = "nvidia,tegra20-mpe"; 28 compatible = "nvidia,tegra20-mpe";
20 reg = <0x54040000 0x00040000>; 29 reg = <0x54040000 0x00040000>;
21 interrupts = <0 68 0x04>; 30 interrupts = <0 68 0x04>;
31 clocks = <&tegra_car 60>;
22 }; 32 };
23 33
24 vi { 34 vi {
25 compatible = "nvidia,tegra20-vi"; 35 compatible = "nvidia,tegra20-vi";
26 reg = <0x54080000 0x00040000>; 36 reg = <0x54080000 0x00040000>;
27 interrupts = <0 69 0x04>; 37 interrupts = <0 69 0x04>;
38 clocks = <&tegra_car 100>;
28 }; 39 };
29 40
30 epp { 41 epp {
31 compatible = "nvidia,tegra20-epp"; 42 compatible = "nvidia,tegra20-epp";
32 reg = <0x540c0000 0x00040000>; 43 reg = <0x540c0000 0x00040000>;
33 interrupts = <0 70 0x04>; 44 interrupts = <0 70 0x04>;
45 clocks = <&tegra_car 19>;
34 }; 46 };
35 47
36 isp { 48 isp {
37 compatible = "nvidia,tegra20-isp"; 49 compatible = "nvidia,tegra20-isp";
38 reg = <0x54100000 0x00040000>; 50 reg = <0x54100000 0x00040000>;
39 interrupts = <0 71 0x04>; 51 interrupts = <0 71 0x04>;
52 clocks = <&tegra_car 23>;
40 }; 53 };
41 54
42 gr2d { 55 gr2d {
43 compatible = "nvidia,tegra20-gr2d"; 56 compatible = "nvidia,tegra20-gr2d";
44 reg = <0x54140000 0x00040000>; 57 reg = <0x54140000 0x00040000>;
45 interrupts = <0 72 0x04>; 58 interrupts = <0 72 0x04>;
59 clocks = <&tegra_car 21>;
46 }; 60 };
47 61
48 gr3d { 62 gr3d {
49 compatible = "nvidia,tegra20-gr3d"; 63 compatible = "nvidia,tegra20-gr3d";
50 reg = <0x54180000 0x00040000>; 64 reg = <0x54180000 0x00040000>;
65 clocks = <&tegra_car 24>;
51 }; 66 };
52 67
53 dc@54200000 { 68 dc@54200000 {
54 compatible = "nvidia,tegra20-dc"; 69 compatible = "nvidia,tegra20-dc";
55 reg = <0x54200000 0x00040000>; 70 reg = <0x54200000 0x00040000>;
56 interrupts = <0 73 0x04>; 71 interrupts = <0 73 0x04>;
72 clocks = <&tegra_car 27>, <&tegra_car 121>;
73 clock-names = "disp1", "parent";
57 74
58 rgb { 75 rgb {
59 status = "disabled"; 76 status = "disabled";
@@ -64,6 +81,8 @@
64 compatible = "nvidia,tegra20-dc"; 81 compatible = "nvidia,tegra20-dc";
65 reg = <0x54240000 0x00040000>; 82 reg = <0x54240000 0x00040000>;
66 interrupts = <0 74 0x04>; 83 interrupts = <0 74 0x04>;
84 clocks = <&tegra_car 26>, <&tegra_car 121>;
85 clock-names = "disp2", "parent";
67 86
68 rgb { 87 rgb {
69 status = "disabled"; 88 status = "disabled";
@@ -74,6 +93,8 @@
74 compatible = "nvidia,tegra20-hdmi"; 93 compatible = "nvidia,tegra20-hdmi";
75 reg = <0x54280000 0x00040000>; 94 reg = <0x54280000 0x00040000>;
76 interrupts = <0 75 0x04>; 95 interrupts = <0 75 0x04>;
96 clocks = <&tegra_car 51>, <&tegra_car 117>;
97 clock-names = "hdmi", "parent";
77 status = "disabled"; 98 status = "disabled";
78 }; 99 };
79 100
@@ -81,12 +102,14 @@
81 compatible = "nvidia,tegra20-tvo"; 102 compatible = "nvidia,tegra20-tvo";
82 reg = <0x542c0000 0x00040000>; 103 reg = <0x542c0000 0x00040000>;
83 interrupts = <0 76 0x04>; 104 interrupts = <0 76 0x04>;
105 clocks = <&tegra_car 102>;
84 status = "disabled"; 106 status = "disabled";
85 }; 107 };
86 108
87 dsi { 109 dsi {
88 compatible = "nvidia,tegra20-dsi"; 110 compatible = "nvidia,tegra20-dsi";
89 reg = <0x54300000 0x00040000>; 111 reg = <0x54300000 0x00040000>;
112 clocks = <&tegra_car 48>;
90 status = "disabled"; 113 status = "disabled";
91 }; 114 };
92 }; 115 };
@@ -97,15 +120,6 @@
97 interrupts = <1 13 0x304>; 120 interrupts = <1 13 0x304>;
98 }; 121 };
99 122
100 cache-controller@50043000 {
101 compatible = "arm,pl310-cache";
102 reg = <0x50043000 0x1000>;
103 arm,data-latency = <5 5 2>;
104 arm,tag-latency = <4 4 2>;
105 cache-unified;
106 cache-level = <2>;
107 };
108
109 intc: interrupt-controller { 123 intc: interrupt-controller {
110 compatible = "arm,cortex-a9-gic"; 124 compatible = "arm,cortex-a9-gic";
111 reg = <0x50041000 0x1000 125 reg = <0x50041000 0x1000
@@ -114,6 +128,15 @@
114 #interrupt-cells = <3>; 128 #interrupt-cells = <3>;
115 }; 129 };
116 130
131 cache-controller {
132 compatible = "arm,pl310-cache";
133 reg = <0x50043000 0x1000>;
134 arm,data-latency = <5 5 2>;
135 arm,tag-latency = <4 4 2>;
136 cache-unified;
137 cache-level = <2>;
138 };
139
117 timer@60005000 { 140 timer@60005000 {
118 compatible = "nvidia,tegra20-timer"; 141 compatible = "nvidia,tegra20-timer";
119 reg = <0x60005000 0x60>; 142 reg = <0x60005000 0x60>;
@@ -123,6 +146,12 @@
123 0 42 0x04>; 146 0 42 0x04>;
124 }; 147 };
125 148
149 tegra_car: clock {
150 compatible = "nvidia,tegra20-car";
151 reg = <0x60006000 0x1000>;
152 #clock-cells = <1>;
153 };
154
126 apbdma: dma { 155 apbdma: dma {
127 compatible = "nvidia,tegra20-apbdma"; 156 compatible = "nvidia,tegra20-apbdma";
128 reg = <0x6000a000 0x1200>; 157 reg = <0x6000a000 0x1200>;
@@ -142,6 +171,7 @@
142 0 117 0x04 171 0 117 0x04
143 0 118 0x04 172 0 118 0x04
144 0 119 0x04>; 173 0 119 0x04>;
174 clocks = <&tegra_car 34>;
145 }; 175 };
146 176
147 ahb { 177 ahb {
@@ -177,12 +207,22 @@
177 compatible = "nvidia,tegra20-das"; 207 compatible = "nvidia,tegra20-das";
178 reg = <0x70000c00 0x80>; 208 reg = <0x70000c00 0x80>;
179 }; 209 };
210
211 tegra_ac97: ac97 {
212 compatible = "nvidia,tegra20-ac97";
213 reg = <0x70002000 0x200>;
214 interrupts = <0 81 0x04>;
215 nvidia,dma-request-selector = <&apbdma 12>;
216 clocks = <&tegra_car 3>;
217 status = "disabled";
218 };
180 219
181 tegra_i2s1: i2s@70002800 { 220 tegra_i2s1: i2s@70002800 {
182 compatible = "nvidia,tegra20-i2s"; 221 compatible = "nvidia,tegra20-i2s";
183 reg = <0x70002800 0x200>; 222 reg = <0x70002800 0x200>;
184 interrupts = <0 13 0x04>; 223 interrupts = <0 13 0x04>;
185 nvidia,dma-request-selector = <&apbdma 2>; 224 nvidia,dma-request-selector = <&apbdma 2>;
225 clocks = <&tegra_car 11>;
186 status = "disabled"; 226 status = "disabled";
187 }; 227 };
188 228
@@ -191,46 +231,64 @@
191 reg = <0x70002a00 0x200>; 231 reg = <0x70002a00 0x200>;
192 interrupts = <0 3 0x04>; 232 interrupts = <0 3 0x04>;
193 nvidia,dma-request-selector = <&apbdma 1>; 233 nvidia,dma-request-selector = <&apbdma 1>;
234 clocks = <&tegra_car 18>;
194 status = "disabled"; 235 status = "disabled";
195 }; 236 };
196 237
197 serial@70006000 { 238 /*
239 * There are two serial driver i.e. 8250 based simple serial
240 * driver and APB DMA based serial driver for higher baudrate
241 * and performace. To enable the 8250 based driver, the compatible
242 * is "nvidia,tegra20-uart" and to enable the APB DMA based serial
243 * driver, the comptible is "nvidia,tegra20-hsuart".
244 */
245 uarta: serial@70006000 {
198 compatible = "nvidia,tegra20-uart"; 246 compatible = "nvidia,tegra20-uart";
199 reg = <0x70006000 0x40>; 247 reg = <0x70006000 0x40>;
200 reg-shift = <2>; 248 reg-shift = <2>;
201 interrupts = <0 36 0x04>; 249 interrupts = <0 36 0x04>;
250 nvidia,dma-request-selector = <&apbdma 8>;
251 clocks = <&tegra_car 6>;
202 status = "disabled"; 252 status = "disabled";
203 }; 253 };
204 254
205 serial@70006040 { 255 uartb: serial@70006040 {
206 compatible = "nvidia,tegra20-uart"; 256 compatible = "nvidia,tegra20-uart";
207 reg = <0x70006040 0x40>; 257 reg = <0x70006040 0x40>;
208 reg-shift = <2>; 258 reg-shift = <2>;
209 interrupts = <0 37 0x04>; 259 interrupts = <0 37 0x04>;
260 nvidia,dma-request-selector = <&apbdma 9>;
261 clocks = <&tegra_car 96>;
210 status = "disabled"; 262 status = "disabled";
211 }; 263 };
212 264
213 serial@70006200 { 265 uartc: serial@70006200 {
214 compatible = "nvidia,tegra20-uart"; 266 compatible = "nvidia,tegra20-uart";
215 reg = <0x70006200 0x100>; 267 reg = <0x70006200 0x100>;
216 reg-shift = <2>; 268 reg-shift = <2>;
217 interrupts = <0 46 0x04>; 269 interrupts = <0 46 0x04>;
270 nvidia,dma-request-selector = <&apbdma 10>;
271 clocks = <&tegra_car 55>;
218 status = "disabled"; 272 status = "disabled";
219 }; 273 };
220 274
221 serial@70006300 { 275 uartd: serial@70006300 {
222 compatible = "nvidia,tegra20-uart"; 276 compatible = "nvidia,tegra20-uart";
223 reg = <0x70006300 0x100>; 277 reg = <0x70006300 0x100>;
224 reg-shift = <2>; 278 reg-shift = <2>;
225 interrupts = <0 90 0x04>; 279 interrupts = <0 90 0x04>;
280 nvidia,dma-request-selector = <&apbdma 19>;
281 clocks = <&tegra_car 65>;
226 status = "disabled"; 282 status = "disabled";
227 }; 283 };
228 284
229 serial@70006400 { 285 uarte: serial@70006400 {
230 compatible = "nvidia,tegra20-uart"; 286 compatible = "nvidia,tegra20-uart";
231 reg = <0x70006400 0x100>; 287 reg = <0x70006400 0x100>;
232 reg-shift = <2>; 288 reg-shift = <2>;
233 interrupts = <0 91 0x04>; 289 interrupts = <0 91 0x04>;
290 nvidia,dma-request-selector = <&apbdma 20>;
291 clocks = <&tegra_car 66>;
234 status = "disabled"; 292 status = "disabled";
235 }; 293 };
236 294
@@ -238,6 +296,7 @@
238 compatible = "nvidia,tegra20-pwm"; 296 compatible = "nvidia,tegra20-pwm";
239 reg = <0x7000a000 0x100>; 297 reg = <0x7000a000 0x100>;
240 #pwm-cells = <2>; 298 #pwm-cells = <2>;
299 clocks = <&tegra_car 17>;
241 }; 300 };
242 301
243 rtc { 302 rtc {
@@ -252,6 +311,8 @@
252 interrupts = <0 38 0x04>; 311 interrupts = <0 38 0x04>;
253 #address-cells = <1>; 312 #address-cells = <1>;
254 #size-cells = <0>; 313 #size-cells = <0>;
314 clocks = <&tegra_car 12>, <&tegra_car 124>;
315 clock-names = "div-clk", "fast-clk";
255 status = "disabled"; 316 status = "disabled";
256 }; 317 };
257 318
@@ -262,6 +323,7 @@
262 nvidia,dma-request-selector = <&apbdma 11>; 323 nvidia,dma-request-selector = <&apbdma 11>;
263 #address-cells = <1>; 324 #address-cells = <1>;
264 #size-cells = <0>; 325 #size-cells = <0>;
326 clocks = <&tegra_car 43>;
265 status = "disabled"; 327 status = "disabled";
266 }; 328 };
267 329
@@ -271,6 +333,8 @@
271 interrupts = <0 84 0x04>; 333 interrupts = <0 84 0x04>;
272 #address-cells = <1>; 334 #address-cells = <1>;
273 #size-cells = <0>; 335 #size-cells = <0>;
336 clocks = <&tegra_car 54>, <&tegra_car 124>;
337 clock-names = "div-clk", "fast-clk";
274 status = "disabled"; 338 status = "disabled";
275 }; 339 };
276 340
@@ -280,6 +344,8 @@
280 interrupts = <0 92 0x04>; 344 interrupts = <0 92 0x04>;
281 #address-cells = <1>; 345 #address-cells = <1>;
282 #size-cells = <0>; 346 #size-cells = <0>;
347 clocks = <&tegra_car 67>, <&tegra_car 124>;
348 clock-names = "div-clk", "fast-clk";
283 status = "disabled"; 349 status = "disabled";
284 }; 350 };
285 351
@@ -289,6 +355,8 @@
289 interrupts = <0 53 0x04>; 355 interrupts = <0 53 0x04>;
290 #address-cells = <1>; 356 #address-cells = <1>;
291 #size-cells = <0>; 357 #size-cells = <0>;
358 clocks = <&tegra_car 47>, <&tegra_car 124>;
359 clock-names = "div-clk", "fast-clk";
292 status = "disabled"; 360 status = "disabled";
293 }; 361 };
294 362
@@ -299,6 +367,7 @@
299 nvidia,dma-request-selector = <&apbdma 15>; 367 nvidia,dma-request-selector = <&apbdma 15>;
300 #address-cells = <1>; 368 #address-cells = <1>;
301 #size-cells = <0>; 369 #size-cells = <0>;
370 clocks = <&tegra_car 41>;
302 status = "disabled"; 371 status = "disabled";
303 }; 372 };
304 373
@@ -309,6 +378,7 @@
309 nvidia,dma-request-selector = <&apbdma 16>; 378 nvidia,dma-request-selector = <&apbdma 16>;
310 #address-cells = <1>; 379 #address-cells = <1>;
311 #size-cells = <0>; 380 #size-cells = <0>;
381 clocks = <&tegra_car 44>;
312 status = "disabled"; 382 status = "disabled";
313 }; 383 };
314 384
@@ -319,6 +389,7 @@
319 nvidia,dma-request-selector = <&apbdma 17>; 389 nvidia,dma-request-selector = <&apbdma 17>;
320 #address-cells = <1>; 390 #address-cells = <1>;
321 #size-cells = <0>; 391 #size-cells = <0>;
392 clocks = <&tegra_car 46>;
322 status = "disabled"; 393 status = "disabled";
323 }; 394 };
324 395
@@ -329,6 +400,15 @@
329 nvidia,dma-request-selector = <&apbdma 18>; 400 nvidia,dma-request-selector = <&apbdma 18>;
330 #address-cells = <1>; 401 #address-cells = <1>;
331 #size-cells = <0>; 402 #size-cells = <0>;
403 clocks = <&tegra_car 68>;
404 status = "disabled";
405 };
406
407 kbc {
408 compatible = "nvidia,tegra20-kbc";
409 reg = <0x7000e200 0x100>;
410 interrupts = <0 85 0x04>;
411 clocks = <&tegra_car 36>;
332 status = "disabled"; 412 status = "disabled";
333 }; 413 };
334 414
@@ -344,7 +424,7 @@
344 interrupts = <0 77 0x04>; 424 interrupts = <0 77 0x04>;
345 }; 425 };
346 426
347 gart { 427 iommu {
348 compatible = "nvidia,tegra20-gart"; 428 compatible = "nvidia,tegra20-gart";
349 reg = <0x7000f024 0x00000018 /* controller registers */ 429 reg = <0x7000f024 0x00000018 /* controller registers */
350 0x58000000 0x02000000>; /* GART aperture */ 430 0x58000000 0x02000000>; /* GART aperture */
@@ -357,12 +437,40 @@
357 #size-cells = <0>; 437 #size-cells = <0>;
358 }; 438 };
359 439
440 phy1: usb-phy@c5000400 {
441 compatible = "nvidia,tegra20-usb-phy";
442 reg = <0xc5000400 0x3c00>;
443 phy_type = "utmi";
444 nvidia,has-legacy-mode;
445 clocks = <&tegra_car 22>, <&tegra_car 127>;
446 clock-names = "phy", "pll_u";
447 };
448
449 phy2: usb-phy@c5004400 {
450 compatible = "nvidia,tegra20-usb-phy";
451 reg = <0xc5004400 0x3c00>;
452 phy_type = "ulpi";
453 clocks = <&tegra_car 94>, <&tegra_car 127>;
454 clock-names = "phy", "pll_u";
455 };
456
457 phy3: usb-phy@c5008400 {
458 compatible = "nvidia,tegra20-usb-phy";
459 reg = <0xc5008400 0x3C00>;
460 phy_type = "utmi";
461 clocks = <&tegra_car 22>, <&tegra_car 127>;
462 clock-names = "phy", "pll_u";
463 };
464
360 usb@c5000000 { 465 usb@c5000000 {
361 compatible = "nvidia,tegra20-ehci", "usb-ehci"; 466 compatible = "nvidia,tegra20-ehci", "usb-ehci";
362 reg = <0xc5000000 0x4000>; 467 reg = <0xc5000000 0x4000>;
363 interrupts = <0 20 0x04>; 468 interrupts = <0 20 0x04>;
364 phy_type = "utmi"; 469 phy_type = "utmi";
365 nvidia,has-legacy-mode; 470 nvidia,has-legacy-mode;
471 clocks = <&tegra_car 22>;
472 nvidia,needs-double-reset;
473 nvidia,phy = <&phy1>;
366 status = "disabled"; 474 status = "disabled";
367 }; 475 };
368 476
@@ -371,6 +479,8 @@
371 reg = <0xc5004000 0x4000>; 479 reg = <0xc5004000 0x4000>;
372 interrupts = <0 21 0x04>; 480 interrupts = <0 21 0x04>;
373 phy_type = "ulpi"; 481 phy_type = "ulpi";
482 clocks = <&tegra_car 58>;
483 nvidia,phy = <&phy2>;
374 status = "disabled"; 484 status = "disabled";
375 }; 485 };
376 486
@@ -379,6 +489,8 @@
379 reg = <0xc5008000 0x4000>; 489 reg = <0xc5008000 0x4000>;
380 interrupts = <0 97 0x04>; 490 interrupts = <0 97 0x04>;
381 phy_type = "utmi"; 491 phy_type = "utmi";
492 clocks = <&tegra_car 59>;
493 nvidia,phy = <&phy3>;
382 status = "disabled"; 494 status = "disabled";
383 }; 495 };
384 496
@@ -386,6 +498,7 @@
386 compatible = "nvidia,tegra20-sdhci"; 498 compatible = "nvidia,tegra20-sdhci";
387 reg = <0xc8000000 0x200>; 499 reg = <0xc8000000 0x200>;
388 interrupts = <0 14 0x04>; 500 interrupts = <0 14 0x04>;
501 clocks = <&tegra_car 14>;
389 status = "disabled"; 502 status = "disabled";
390 }; 503 };
391 504
@@ -393,6 +506,7 @@
393 compatible = "nvidia,tegra20-sdhci"; 506 compatible = "nvidia,tegra20-sdhci";
394 reg = <0xc8000200 0x200>; 507 reg = <0xc8000200 0x200>;
395 interrupts = <0 15 0x04>; 508 interrupts = <0 15 0x04>;
509 clocks = <&tegra_car 9>;
396 status = "disabled"; 510 status = "disabled";
397 }; 511 };
398 512
@@ -400,6 +514,7 @@
400 compatible = "nvidia,tegra20-sdhci"; 514 compatible = "nvidia,tegra20-sdhci";
401 reg = <0xc8000400 0x200>; 515 reg = <0xc8000400 0x200>;
402 interrupts = <0 19 0x04>; 516 interrupts = <0 19 0x04>;
517 clocks = <&tegra_car 69>;
403 status = "disabled"; 518 status = "disabled";
404 }; 519 };
405 520
@@ -407,9 +522,27 @@
407 compatible = "nvidia,tegra20-sdhci"; 522 compatible = "nvidia,tegra20-sdhci";
408 reg = <0xc8000600 0x200>; 523 reg = <0xc8000600 0x200>;
409 interrupts = <0 31 0x04>; 524 interrupts = <0 31 0x04>;
525 clocks = <&tegra_car 15>;
410 status = "disabled"; 526 status = "disabled";
411 }; 527 };
412 528
529 cpus {
530 #address-cells = <1>;
531 #size-cells = <0>;
532
533 cpu@0 {
534 device_type = "cpu";
535 compatible = "arm,cortex-a9";
536 reg = <0>;
537 };
538
539 cpu@1 {
540 device_type = "cpu";
541 compatible = "arm,cortex-a9";
542 reg = <1>;
543 };
544 };
545
413 pmu { 546 pmu {
414 compatible = "arm,cortex-a9-pmu"; 547 compatible = "arm,cortex-a9-pmu";
415 interrupts = <0 56 0x04 548 interrupts = <0 56 0x04
diff --git a/arch/arm/boot/dts/tegra30-beaver.dts b/arch/arm/boot/dts/tegra30-beaver.dts
new file mode 100644
index 000000000000..8ff2ff20e4a3
--- /dev/null
+++ b/arch/arm/boot/dts/tegra30-beaver.dts
@@ -0,0 +1,373 @@
1/dts-v1/;
2
3/include/ "tegra30.dtsi"
4
5/ {
6 model = "NVIDIA Tegra30 Beaver evaluation board";
7 compatible = "nvidia,beaver", "nvidia,tegra30";
8
9 memory {
10 reg = <0x80000000 0x80000000>;
11 };
12
13 pinmux {
14 pinctrl-names = "default";
15 pinctrl-0 = <&state_default>;
16
17 state_default: pinmux {
18 sdmmc1_clk_pz0 {
19 nvidia,pins = "sdmmc1_clk_pz0";
20 nvidia,function = "sdmmc1";
21 nvidia,pull = <0>;
22 nvidia,tristate = <0>;
23 };
24 sdmmc1_cmd_pz1 {
25 nvidia,pins = "sdmmc1_cmd_pz1",
26 "sdmmc1_dat0_py7",
27 "sdmmc1_dat1_py6",
28 "sdmmc1_dat2_py5",
29 "sdmmc1_dat3_py4";
30 nvidia,function = "sdmmc1";
31 nvidia,pull = <2>;
32 nvidia,tristate = <0>;
33 };
34 sdmmc3_clk_pa6 {
35 nvidia,pins = "sdmmc3_clk_pa6";
36 nvidia,function = "sdmmc3";
37 nvidia,pull = <0>;
38 nvidia,tristate = <0>;
39 };
40 sdmmc3_cmd_pa7 {
41 nvidia,pins = "sdmmc3_cmd_pa7",
42 "sdmmc3_dat0_pb7",
43 "sdmmc3_dat1_pb6",
44 "sdmmc3_dat2_pb5",
45 "sdmmc3_dat3_pb4";
46 nvidia,function = "sdmmc3";
47 nvidia,pull = <2>;
48 nvidia,tristate = <0>;
49 };
50 sdmmc4_clk_pcc4 {
51 nvidia,pins = "sdmmc4_clk_pcc4",
52 "sdmmc4_rst_n_pcc3";
53 nvidia,function = "sdmmc4";
54 nvidia,pull = <0>;
55 nvidia,tristate = <0>;
56 };
57 sdmmc4_dat0_paa0 {
58 nvidia,pins = "sdmmc4_dat0_paa0",
59 "sdmmc4_dat1_paa1",
60 "sdmmc4_dat2_paa2",
61 "sdmmc4_dat3_paa3",
62 "sdmmc4_dat4_paa4",
63 "sdmmc4_dat5_paa5",
64 "sdmmc4_dat6_paa6",
65 "sdmmc4_dat7_paa7";
66 nvidia,function = "sdmmc4";
67 nvidia,pull = <2>;
68 nvidia,tristate = <0>;
69 };
70 dap2_fs_pa2 {
71 nvidia,pins = "dap2_fs_pa2",
72 "dap2_sclk_pa3",
73 "dap2_din_pa4",
74 "dap2_dout_pa5";
75 nvidia,function = "i2s1";
76 nvidia,pull = <0>;
77 nvidia,tristate = <0>;
78 };
79 sdio3 {
80 nvidia,pins = "drive_sdio3";
81 nvidia,high-speed-mode = <0>;
82 nvidia,schmitt = <0>;
83 nvidia,pull-down-strength = <46>;
84 nvidia,pull-up-strength = <42>;
85 nvidia,slew-rate-rising = <1>;
86 nvidia,slew-rate-falling = <1>;
87 };
88 };
89 };
90
91 serial@70006000 {
92 status = "okay";
93 };
94
95 i2c@7000c000 {
96 status = "okay";
97 clock-frequency = <100000>;
98 };
99
100 i2c@7000c400 {
101 status = "okay";
102 clock-frequency = <100000>;
103 };
104
105 i2c@7000c500 {
106 status = "okay";
107 clock-frequency = <100000>;
108 };
109
110 i2c@7000c700 {
111 status = "okay";
112 clock-frequency = <100000>;
113 };
114
115 i2c@7000d000 {
116 status = "okay";
117 clock-frequency = <100000>;
118
119 tps62361 {
120 compatible = "ti,tps62361";
121 reg = <0x60>;
122
123 regulator-name = "tps62361-vout";
124 regulator-min-microvolt = <500000>;
125 regulator-max-microvolt = <1500000>;
126 regulator-boot-on;
127 regulator-always-on;
128 ti,vsel0-state-high;
129 ti,vsel1-state-high;
130 };
131
132 pmic: tps65911@2d {
133 compatible = "ti,tps65911";
134 reg = <0x2d>;
135
136 interrupts = <0 86 0x4>;
137 #interrupt-cells = <2>;
138 interrupt-controller;
139
140 ti,system-power-controller;
141
142 #gpio-cells = <2>;
143 gpio-controller;
144
145 vcc1-supply = <&vdd_5v_in_reg>;
146 vcc2-supply = <&vdd_5v_in_reg>;
147 vcc3-supply = <&vio_reg>;
148 vcc4-supply = <&vdd_5v_in_reg>;
149 vcc5-supply = <&vdd_5v_in_reg>;
150 vcc6-supply = <&vdd2_reg>;
151 vcc7-supply = <&vdd_5v_in_reg>;
152 vccio-supply = <&vdd_5v_in_reg>;
153
154 regulators {
155 #address-cells = <1>;
156 #size-cells = <0>;
157
158 vdd1_reg: vdd1 {
159 regulator-name = "vddio_ddr_1v2";
160 regulator-min-microvolt = <1200000>;
161 regulator-max-microvolt = <1200000>;
162 regulator-always-on;
163 };
164
165 vdd2_reg: vdd2 {
166 regulator-name = "vdd_1v5_gen";
167 regulator-min-microvolt = <1500000>;
168 regulator-max-microvolt = <1500000>;
169 regulator-always-on;
170 };
171
172 vddctrl_reg: vddctrl {
173 regulator-name = "vdd_cpu,vdd_sys";
174 regulator-min-microvolt = <1000000>;
175 regulator-max-microvolt = <1000000>;
176 regulator-always-on;
177 };
178
179 vio_reg: vio {
180 regulator-name = "vdd_1v8_gen";
181 regulator-min-microvolt = <1800000>;
182 regulator-max-microvolt = <1800000>;
183 regulator-always-on;
184 };
185
186 ldo1_reg: ldo1 {
187 regulator-name = "vdd_pexa,vdd_pexb";
188 regulator-min-microvolt = <1050000>;
189 regulator-max-microvolt = <1050000>;
190 };
191
192 ldo2_reg: ldo2 {
193 regulator-name = "vdd_sata,avdd_plle";
194 regulator-min-microvolt = <1050000>;
195 regulator-max-microvolt = <1050000>;
196 };
197
198 /* LDO3 is not connected to anything */
199
200 ldo4_reg: ldo4 {
201 regulator-name = "vdd_rtc";
202 regulator-min-microvolt = <1200000>;
203 regulator-max-microvolt = <1200000>;
204 regulator-always-on;
205 };
206
207 ldo5_reg: ldo5 {
208 regulator-name = "vddio_sdmmc,avdd_vdac";
209 regulator-min-microvolt = <3300000>;
210 regulator-max-microvolt = <3300000>;
211 regulator-always-on;
212 };
213
214 ldo6_reg: ldo6 {
215 regulator-name = "avdd_dsi_csi,pwrdet_mipi";
216 regulator-min-microvolt = <1200000>;
217 regulator-max-microvolt = <1200000>;
218 };
219
220 ldo7_reg: ldo7 {
221 regulator-name = "vdd_pllm,x,u,a_p_c_s";
222 regulator-min-microvolt = <1200000>;
223 regulator-max-microvolt = <1200000>;
224 regulator-always-on;
225 };
226
227 ldo8_reg: ldo8 {
228 regulator-name = "vdd_ddr_hs";
229 regulator-min-microvolt = <1000000>;
230 regulator-max-microvolt = <1000000>;
231 regulator-always-on;
232 };
233 };
234 };
235 };
236
237 spi@7000da00 {
238 status = "okay";
239 spi-max-frequency = <25000000>;
240 spi-flash@1 {
241 compatible = "winbond,w25q32";
242 reg = <1>;
243 spi-max-frequency = <20000000>;
244 };
245 };
246
247 ahub {
248 i2s@70080400 {
249 status = "okay";
250 };
251 };
252
253 pmc {
254 status = "okay";
255 nvidia,invert-interrupt;
256 };
257
258 sdhci@78000000 {
259 status = "okay";
260 cd-gpios = <&gpio 69 0>; /* gpio PI5 */
261 wp-gpios = <&gpio 155 0>; /* gpio PT3 */
262 power-gpios = <&gpio 31 0>; /* gpio PD7 */
263 bus-width = <4>;
264 };
265
266 sdhci@78000600 {
267 status = "okay";
268 bus-width = <8>;
269 };
270
271 regulators {
272 compatible = "simple-bus";
273 #address-cells = <1>;
274 #size-cells = <0>;
275
276 vdd_5v_in_reg: regulator@0 {
277 compatible = "regulator-fixed";
278 reg = <0>;
279 regulator-name = "vdd_5v_in";
280 regulator-min-microvolt = <5000000>;
281 regulator-max-microvolt = <5000000>;
282 regulator-always-on;
283 };
284
285 chargepump_5v_reg: regulator@1 {
286 compatible = "regulator-fixed";
287 reg = <1>;
288 regulator-name = "chargepump_5v";
289 regulator-min-microvolt = <5000000>;
290 regulator-max-microvolt = <5000000>;
291 regulator-boot-on;
292 regulator-always-on;
293 enable-active-high;
294 gpio = <&pmic 0 0>; /* PMIC TPS65911 GPIO0 */
295 };
296
297 ddr_reg: regulator@2 {
298 compatible = "regulator-fixed";
299 reg = <2>;
300 regulator-name = "vdd_ddr";
301 regulator-min-microvolt = <1500000>;
302 regulator-max-microvolt = <1500000>;
303 regulator-always-on;
304 regulator-boot-on;
305 enable-active-high;
306 gpio = <&pmic 7 0>; /* PMIC TPS65911 GPIO7 */
307 vin-supply = <&vdd_5v_in_reg>;
308 };
309
310 vdd_5v_sata_reg: regulator@3 {
311 compatible = "regulator-fixed";
312 reg = <3>;
313 regulator-name = "vdd_5v_sata";
314 regulator-min-microvolt = <5000000>;
315 regulator-max-microvolt = <5000000>;
316 regulator-always-on;
317 regulator-boot-on;
318 enable-active-high;
319 gpio = <&gpio 30 0>; /* gpio PD6 */
320 vin-supply = <&vdd_5v_in_reg>;
321 };
322
323 usb1_vbus_reg: regulator@4 {
324 compatible = "regulator-fixed";
325 reg = <4>;
326 regulator-name = "usb1_vbus";
327 regulator-min-microvolt = <5000000>;
328 regulator-max-microvolt = <5000000>;
329 enable-active-high;
330 gpio = <&gpio 68 0>; /* GPIO PI4 */
331 gpio-open-drain;
332 vin-supply = <&vdd_5v_in_reg>;
333 };
334
335 usb3_vbus_reg: regulator@5 {
336 compatible = "regulator-fixed";
337 reg = <5>;
338 regulator-name = "usb3_vbus";
339 regulator-min-microvolt = <5000000>;
340 regulator-max-microvolt = <5000000>;
341 enable-active-high;
342 gpio = <&gpio 63 0>; /* GPIO PH7 */
343 gpio-open-drain;
344 vin-supply = <&vdd_5v_in_reg>;
345 };
346
347 sys_3v3_reg: regulator@6 {
348 compatible = "regulator-fixed";
349 reg = <6>;
350 regulator-name = "sys_3v3,vdd_3v3_alw";
351 regulator-min-microvolt = <3300000>;
352 regulator-max-microvolt = <3300000>;
353 regulator-always-on;
354 regulator-boot-on;
355 enable-active-high;
356 gpio = <&pmic 6 0>; /* PMIC TPS65911 GPIO6 */
357 vin-supply = <&vdd_5v_in_reg>;
358 };
359
360 sys_3v3_pexs_reg: regulator@7 {
361 compatible = "regulator-fixed";
362 reg = <7>;
363 regulator-name = "sys_3v3_pexs";
364 regulator-min-microvolt = <3300000>;
365 regulator-max-microvolt = <3300000>;
366 regulator-always-on;
367 regulator-boot-on;
368 enable-active-high;
369 gpio = <&gpio 95 0>; /* gpio PL7 */
370 vin-supply = <&sys_3v3_reg>;
371 };
372 };
373};
diff --git a/arch/arm/boot/dts/tegra30-cardhu.dtsi b/arch/arm/boot/dts/tegra30-cardhu.dtsi
index bdb2a660f376..17499272a4ef 100644
--- a/arch/arm/boot/dts/tegra30-cardhu.dtsi
+++ b/arch/arm/boot/dts/tegra30-cardhu.dtsi
@@ -106,12 +106,25 @@
106 nvidia,slew-rate-rising = <1>; 106 nvidia,slew-rate-rising = <1>;
107 nvidia,slew-rate-falling = <1>; 107 nvidia,slew-rate-falling = <1>;
108 }; 108 };
109 uart3_txd_pw6 {
110 nvidia,pins = "uart3_txd_pw6",
111 "uart3_cts_n_pa1",
112 "uart3_rts_n_pc0",
113 "uart3_rxd_pw7";
114 nvidia,function = "uartc";
115 nvidia,pull = <0>;
116 nvidia,tristate = <0>;
117 };
109 }; 118 };
110 }; 119 };
111 120
112 serial@70006000 { 121 serial@70006000 {
113 status = "okay"; 122 status = "okay";
114 clock-frequency = <408000000>; 123 };
124
125 serial@70006200 {
126 compatible = "nvidia,tegra30-hsuart";
127 status = "okay";
115 }; 128 };
116 129
117 i2c@7000c000 { 130 i2c@7000c000 {
diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
index 529fdb82dfdb..767803e1fd55 100644
--- a/arch/arm/boot/dts/tegra30.dtsi
+++ b/arch/arm/boot/dts/tegra30.dtsi
@@ -4,11 +4,20 @@
4 compatible = "nvidia,tegra30"; 4 compatible = "nvidia,tegra30";
5 interrupt-parent = <&intc>; 5 interrupt-parent = <&intc>;
6 6
7 aliases {
8 serial0 = &uarta;
9 serial1 = &uartb;
10 serial2 = &uartc;
11 serial3 = &uartd;
12 serial4 = &uarte;
13 };
14
7 host1x { 15 host1x {
8 compatible = "nvidia,tegra30-host1x", "simple-bus"; 16 compatible = "nvidia,tegra30-host1x", "simple-bus";
9 reg = <0x50000000 0x00024000>; 17 reg = <0x50000000 0x00024000>;
10 interrupts = <0 65 0x04 /* mpcore syncpt */ 18 interrupts = <0 65 0x04 /* mpcore syncpt */
11 0 67 0x04>; /* mpcore general */ 19 0 67 0x04>; /* mpcore general */
20 clocks = <&tegra_car 28>;
12 21
13 #address-cells = <1>; 22 #address-cells = <1>;
14 #size-cells = <1>; 23 #size-cells = <1>;
@@ -19,41 +28,50 @@
19 compatible = "nvidia,tegra30-mpe"; 28 compatible = "nvidia,tegra30-mpe";
20 reg = <0x54040000 0x00040000>; 29 reg = <0x54040000 0x00040000>;
21 interrupts = <0 68 0x04>; 30 interrupts = <0 68 0x04>;
31 clocks = <&tegra_car 60>;
22 }; 32 };
23 33
24 vi { 34 vi {
25 compatible = "nvidia,tegra30-vi"; 35 compatible = "nvidia,tegra30-vi";
26 reg = <0x54080000 0x00040000>; 36 reg = <0x54080000 0x00040000>;
27 interrupts = <0 69 0x04>; 37 interrupts = <0 69 0x04>;
38 clocks = <&tegra_car 164>;
28 }; 39 };
29 40
30 epp { 41 epp {
31 compatible = "nvidia,tegra30-epp"; 42 compatible = "nvidia,tegra30-epp";
32 reg = <0x540c0000 0x00040000>; 43 reg = <0x540c0000 0x00040000>;
33 interrupts = <0 70 0x04>; 44 interrupts = <0 70 0x04>;
45 clocks = <&tegra_car 19>;
34 }; 46 };
35 47
36 isp { 48 isp {
37 compatible = "nvidia,tegra30-isp"; 49 compatible = "nvidia,tegra30-isp";
38 reg = <0x54100000 0x00040000>; 50 reg = <0x54100000 0x00040000>;
39 interrupts = <0 71 0x04>; 51 interrupts = <0 71 0x04>;
52 clocks = <&tegra_car 23>;
40 }; 53 };
41 54
42 gr2d { 55 gr2d {
43 compatible = "nvidia,tegra30-gr2d"; 56 compatible = "nvidia,tegra30-gr2d";
44 reg = <0x54140000 0x00040000>; 57 reg = <0x54140000 0x00040000>;
45 interrupts = <0 72 0x04>; 58 interrupts = <0 72 0x04>;
59 clocks = <&tegra_car 21>;
46 }; 60 };
47 61
48 gr3d { 62 gr3d {
49 compatible = "nvidia,tegra30-gr3d"; 63 compatible = "nvidia,tegra30-gr3d";
50 reg = <0x54180000 0x00040000>; 64 reg = <0x54180000 0x00040000>;
65 clocks = <&tegra_car 24 &tegra_car 98>;
66 clock-names = "3d", "3d2";
51 }; 67 };
52 68
53 dc@54200000 { 69 dc@54200000 {
54 compatible = "nvidia,tegra30-dc"; 70 compatible = "nvidia,tegra30-dc";
55 reg = <0x54200000 0x00040000>; 71 reg = <0x54200000 0x00040000>;
56 interrupts = <0 73 0x04>; 72 interrupts = <0 73 0x04>;
73 clocks = <&tegra_car 27>, <&tegra_car 179>;
74 clock-names = "disp1", "parent";
57 75
58 rgb { 76 rgb {
59 status = "disabled"; 77 status = "disabled";
@@ -64,6 +82,8 @@
64 compatible = "nvidia,tegra30-dc"; 82 compatible = "nvidia,tegra30-dc";
65 reg = <0x54240000 0x00040000>; 83 reg = <0x54240000 0x00040000>;
66 interrupts = <0 74 0x04>; 84 interrupts = <0 74 0x04>;
85 clocks = <&tegra_car 26>, <&tegra_car 179>;
86 clock-names = "disp2", "parent";
67 87
68 rgb { 88 rgb {
69 status = "disabled"; 89 status = "disabled";
@@ -74,6 +94,8 @@
74 compatible = "nvidia,tegra30-hdmi"; 94 compatible = "nvidia,tegra30-hdmi";
75 reg = <0x54280000 0x00040000>; 95 reg = <0x54280000 0x00040000>;
76 interrupts = <0 75 0x04>; 96 interrupts = <0 75 0x04>;
97 clocks = <&tegra_car 51>, <&tegra_car 189>;
98 clock-names = "hdmi", "parent";
77 status = "disabled"; 99 status = "disabled";
78 }; 100 };
79 101
@@ -81,12 +103,14 @@
81 compatible = "nvidia,tegra30-tvo"; 103 compatible = "nvidia,tegra30-tvo";
82 reg = <0x542c0000 0x00040000>; 104 reg = <0x542c0000 0x00040000>;
83 interrupts = <0 76 0x04>; 105 interrupts = <0 76 0x04>;
106 clocks = <&tegra_car 169>;
84 status = "disabled"; 107 status = "disabled";
85 }; 108 };
86 109
87 dsi { 110 dsi {
88 compatible = "nvidia,tegra30-dsi"; 111 compatible = "nvidia,tegra30-dsi";
89 reg = <0x54300000 0x00040000>; 112 reg = <0x54300000 0x00040000>;
113 clocks = <&tegra_car 48>;
90 status = "disabled"; 114 status = "disabled";
91 }; 115 };
92 }; 116 };
@@ -97,15 +121,6 @@
97 interrupts = <1 13 0xf04>; 121 interrupts = <1 13 0xf04>;
98 }; 122 };
99 123
100 cache-controller@50043000 {
101 compatible = "arm,pl310-cache";
102 reg = <0x50043000 0x1000>;
103 arm,data-latency = <6 6 2>;
104 arm,tag-latency = <5 5 2>;
105 cache-unified;
106 cache-level = <2>;
107 };
108
109 intc: interrupt-controller { 124 intc: interrupt-controller {
110 compatible = "arm,cortex-a9-gic"; 125 compatible = "arm,cortex-a9-gic";
111 reg = <0x50041000 0x1000 126 reg = <0x50041000 0x1000
@@ -114,6 +129,15 @@
114 #interrupt-cells = <3>; 129 #interrupt-cells = <3>;
115 }; 130 };
116 131
132 cache-controller {
133 compatible = "arm,pl310-cache";
134 reg = <0x50043000 0x1000>;
135 arm,data-latency = <6 6 2>;
136 arm,tag-latency = <5 5 2>;
137 cache-unified;
138 cache-level = <2>;
139 };
140
117 timer@60005000 { 141 timer@60005000 {
118 compatible = "nvidia,tegra30-timer", "nvidia,tegra20-timer"; 142 compatible = "nvidia,tegra30-timer", "nvidia,tegra20-timer";
119 reg = <0x60005000 0x400>; 143 reg = <0x60005000 0x400>;
@@ -125,6 +149,12 @@
125 0 122 0x04>; 149 0 122 0x04>;
126 }; 150 };
127 151
152 tegra_car: clock {
153 compatible = "nvidia,tegra30-car";
154 reg = <0x60006000 0x1000>;
155 #clock-cells = <1>;
156 };
157
128 apbdma: dma { 158 apbdma: dma {
129 compatible = "nvidia,tegra30-apbdma", "nvidia,tegra20-apbdma"; 159 compatible = "nvidia,tegra30-apbdma", "nvidia,tegra20-apbdma";
130 reg = <0x6000a000 0x1400>; 160 reg = <0x6000a000 0x1400>;
@@ -160,6 +190,7 @@
160 0 141 0x04 190 0 141 0x04
161 0 142 0x04 191 0 142 0x04
162 0 143 0x04>; 192 0 143 0x04>;
193 clocks = <&tegra_car 34>;
163 }; 194 };
164 195
165 ahb: ahb { 196 ahb: ahb {
@@ -168,7 +199,7 @@
168 }; 199 };
169 200
170 gpio: gpio { 201 gpio: gpio {
171 compatible = "nvidia,tegra30-gpio", "nvidia,tegra20-gpio"; 202 compatible = "nvidia,tegra30-gpio";
172 reg = <0x6000d000 0x1000>; 203 reg = <0x6000d000 0x1000>;
173 interrupts = <0 32 0x04 204 interrupts = <0 32 0x04
174 0 33 0x04 205 0 33 0x04
@@ -190,43 +221,61 @@
190 0x70003000 0x3e4>; /* Mux registers */ 221 0x70003000 0x3e4>; /* Mux registers */
191 }; 222 };
192 223
193 serial@70006000 { 224 /*
225 * There are two serial driver i.e. 8250 based simple serial
226 * driver and APB DMA based serial driver for higher baudrate
227 * and performace. To enable the 8250 based driver, the compatible
228 * is "nvidia,tegra30-uart", "nvidia,tegra20-uart" and to enable
229 * the APB DMA based serial driver, the comptible is
230 * "nvidia,tegra30-hsuart", "nvidia,tegra20-hsuart".
231 */
232 uarta: serial@70006000 {
194 compatible = "nvidia,tegra30-uart", "nvidia,tegra20-uart"; 233 compatible = "nvidia,tegra30-uart", "nvidia,tegra20-uart";
195 reg = <0x70006000 0x40>; 234 reg = <0x70006000 0x40>;
196 reg-shift = <2>; 235 reg-shift = <2>;
197 interrupts = <0 36 0x04>; 236 interrupts = <0 36 0x04>;
237 nvidia,dma-request-selector = <&apbdma 8>;
238 clocks = <&tegra_car 6>;
198 status = "disabled"; 239 status = "disabled";
199 }; 240 };
200 241
201 serial@70006040 { 242 uartb: serial@70006040 {
202 compatible = "nvidia,tegra30-uart", "nvidia,tegra20-uart"; 243 compatible = "nvidia,tegra30-uart", "nvidia,tegra20-uart";
203 reg = <0x70006040 0x40>; 244 reg = <0x70006040 0x40>;
204 reg-shift = <2>; 245 reg-shift = <2>;
205 interrupts = <0 37 0x04>; 246 interrupts = <0 37 0x04>;
247 nvidia,dma-request-selector = <&apbdma 9>;
248 clocks = <&tegra_car 160>;
206 status = "disabled"; 249 status = "disabled";
207 }; 250 };
208 251
209 serial@70006200 { 252 uartc: serial@70006200 {
210 compatible = "nvidia,tegra30-uart", "nvidia,tegra20-uart"; 253 compatible = "nvidia,tegra30-uart", "nvidia,tegra20-uart";
211 reg = <0x70006200 0x100>; 254 reg = <0x70006200 0x100>;
212 reg-shift = <2>; 255 reg-shift = <2>;
213 interrupts = <0 46 0x04>; 256 interrupts = <0 46 0x04>;
257 nvidia,dma-request-selector = <&apbdma 10>;
258 clocks = <&tegra_car 55>;
214 status = "disabled"; 259 status = "disabled";
215 }; 260 };
216 261
217 serial@70006300 { 262 uartd: serial@70006300 {
218 compatible = "nvidia,tegra30-uart", "nvidia,tegra20-uart"; 263 compatible = "nvidia,tegra30-uart", "nvidia,tegra20-uart";
219 reg = <0x70006300 0x100>; 264 reg = <0x70006300 0x100>;
220 reg-shift = <2>; 265 reg-shift = <2>;
221 interrupts = <0 90 0x04>; 266 interrupts = <0 90 0x04>;
267 nvidia,dma-request-selector = <&apbdma 19>;
268 clocks = <&tegra_car 65>;
222 status = "disabled"; 269 status = "disabled";
223 }; 270 };
224 271
225 serial@70006400 { 272 uarte: serial@70006400 {
226 compatible = "nvidia,tegra30-uart", "nvidia,tegra20-uart"; 273 compatible = "nvidia,tegra30-uart", "nvidia,tegra20-uart";
227 reg = <0x70006400 0x100>; 274 reg = <0x70006400 0x100>;
228 reg-shift = <2>; 275 reg-shift = <2>;
229 interrupts = <0 91 0x04>; 276 interrupts = <0 91 0x04>;
277 nvidia,dma-request-selector = <&apbdma 20>;
278 clocks = <&tegra_car 66>;
230 status = "disabled"; 279 status = "disabled";
231 }; 280 };
232 281
@@ -234,6 +283,7 @@
234 compatible = "nvidia,tegra30-pwm", "nvidia,tegra20-pwm"; 283 compatible = "nvidia,tegra30-pwm", "nvidia,tegra20-pwm";
235 reg = <0x7000a000 0x100>; 284 reg = <0x7000a000 0x100>;
236 #pwm-cells = <2>; 285 #pwm-cells = <2>;
286 clocks = <&tegra_car 17>;
237 }; 287 };
238 288
239 rtc { 289 rtc {
@@ -248,6 +298,8 @@
248 interrupts = <0 38 0x04>; 298 interrupts = <0 38 0x04>;
249 #address-cells = <1>; 299 #address-cells = <1>;
250 #size-cells = <0>; 300 #size-cells = <0>;
301 clocks = <&tegra_car 12>, <&tegra_car 182>;
302 clock-names = "div-clk", "fast-clk";
251 status = "disabled"; 303 status = "disabled";
252 }; 304 };
253 305
@@ -257,6 +309,8 @@
257 interrupts = <0 84 0x04>; 309 interrupts = <0 84 0x04>;
258 #address-cells = <1>; 310 #address-cells = <1>;
259 #size-cells = <0>; 311 #size-cells = <0>;
312 clocks = <&tegra_car 54>, <&tegra_car 182>;
313 clock-names = "div-clk", "fast-clk";
260 status = "disabled"; 314 status = "disabled";
261 }; 315 };
262 316
@@ -266,6 +320,8 @@
266 interrupts = <0 92 0x04>; 320 interrupts = <0 92 0x04>;
267 #address-cells = <1>; 321 #address-cells = <1>;
268 #size-cells = <0>; 322 #size-cells = <0>;
323 clocks = <&tegra_car 67>, <&tegra_car 182>;
324 clock-names = "div-clk", "fast-clk";
269 status = "disabled"; 325 status = "disabled";
270 }; 326 };
271 327
@@ -275,6 +331,8 @@
275 interrupts = <0 120 0x04>; 331 interrupts = <0 120 0x04>;
276 #address-cells = <1>; 332 #address-cells = <1>;
277 #size-cells = <0>; 333 #size-cells = <0>;
334 clocks = <&tegra_car 103>, <&tegra_car 182>;
335 clock-names = "div-clk", "fast-clk";
278 status = "disabled"; 336 status = "disabled";
279 }; 337 };
280 338
@@ -284,6 +342,8 @@
284 interrupts = <0 53 0x04>; 342 interrupts = <0 53 0x04>;
285 #address-cells = <1>; 343 #address-cells = <1>;
286 #size-cells = <0>; 344 #size-cells = <0>;
345 clocks = <&tegra_car 47>, <&tegra_car 182>;
346 clock-names = "div-clk", "fast-clk";
287 status = "disabled"; 347 status = "disabled";
288 }; 348 };
289 349
@@ -294,6 +354,7 @@
294 nvidia,dma-request-selector = <&apbdma 15>; 354 nvidia,dma-request-selector = <&apbdma 15>;
295 #address-cells = <1>; 355 #address-cells = <1>;
296 #size-cells = <0>; 356 #size-cells = <0>;
357 clocks = <&tegra_car 41>;
297 status = "disabled"; 358 status = "disabled";
298 }; 359 };
299 360
@@ -304,6 +365,7 @@
304 nvidia,dma-request-selector = <&apbdma 16>; 365 nvidia,dma-request-selector = <&apbdma 16>;
305 #address-cells = <1>; 366 #address-cells = <1>;
306 #size-cells = <0>; 367 #size-cells = <0>;
368 clocks = <&tegra_car 44>;
307 status = "disabled"; 369 status = "disabled";
308 }; 370 };
309 371
@@ -314,6 +376,7 @@
314 nvidia,dma-request-selector = <&apbdma 17>; 376 nvidia,dma-request-selector = <&apbdma 17>;
315 #address-cells = <1>; 377 #address-cells = <1>;
316 #size-cells = <0>; 378 #size-cells = <0>;
379 clocks = <&tegra_car 46>;
317 status = "disabled"; 380 status = "disabled";
318 }; 381 };
319 382
@@ -324,6 +387,7 @@
324 nvidia,dma-request-selector = <&apbdma 18>; 387 nvidia,dma-request-selector = <&apbdma 18>;
325 #address-cells = <1>; 388 #address-cells = <1>;
326 #size-cells = <0>; 389 #size-cells = <0>;
390 clocks = <&tegra_car 68>;
327 status = "disabled"; 391 status = "disabled";
328 }; 392 };
329 393
@@ -334,6 +398,7 @@
334 nvidia,dma-request-selector = <&apbdma 27>; 398 nvidia,dma-request-selector = <&apbdma 27>;
335 #address-cells = <1>; 399 #address-cells = <1>;
336 #size-cells = <0>; 400 #size-cells = <0>;
401 clocks = <&tegra_car 104>;
337 status = "disabled"; 402 status = "disabled";
338 }; 403 };
339 404
@@ -344,6 +409,15 @@
344 nvidia,dma-request-selector = <&apbdma 28>; 409 nvidia,dma-request-selector = <&apbdma 28>;
345 #address-cells = <1>; 410 #address-cells = <1>;
346 #size-cells = <0>; 411 #size-cells = <0>;
412 clocks = <&tegra_car 105>;
413 status = "disabled";
414 };
415
416 kbc {
417 compatible = "nvidia,tegra30-kbc", "nvidia,tegra20-kbc";
418 reg = <0x7000e200 0x100>;
419 interrupts = <0 85 0x04>;
420 clocks = <&tegra_car 36>;
347 status = "disabled"; 421 status = "disabled";
348 }; 422 };
349 423
@@ -361,7 +435,7 @@
361 interrupts = <0 77 0x04>; 435 interrupts = <0 77 0x04>;
362 }; 436 };
363 437
364 smmu { 438 iommu {
365 compatible = "nvidia,tegra30-smmu"; 439 compatible = "nvidia,tegra30-smmu";
366 reg = <0x7000f010 0x02c 440 reg = <0x7000f010 0x02c
367 0x7000f1f0 0x010 441 0x7000f1f0 0x010
@@ -377,7 +451,13 @@
377 0x70080200 0x100>; 451 0x70080200 0x100>;
378 interrupts = <0 103 0x04>; 452 interrupts = <0 103 0x04>;
379 nvidia,dma-request-selector = <&apbdma 1>; 453 nvidia,dma-request-selector = <&apbdma 1>;
380 454 clocks = <&tegra_car 106>, <&tegra_car 107>, <&tegra_car 30>,
455 <&tegra_car 11>, <&tegra_car 18>, <&tegra_car 101>,
456 <&tegra_car 102>, <&tegra_car 108>, <&tegra_car 109>,
457 <&tegra_car 110>, <&tegra_car 162>;
458 clock-names = "d_audio", "apbif", "i2s0", "i2s1", "i2s2",
459 "i2s3", "i2s4", "dam0", "dam1", "dam2",
460 "spdif_in";
381 ranges; 461 ranges;
382 #address-cells = <1>; 462 #address-cells = <1>;
383 #size-cells = <1>; 463 #size-cells = <1>;
@@ -386,6 +466,7 @@
386 compatible = "nvidia,tegra30-i2s"; 466 compatible = "nvidia,tegra30-i2s";
387 reg = <0x70080300 0x100>; 467 reg = <0x70080300 0x100>;
388 nvidia,ahub-cif-ids = <4 4>; 468 nvidia,ahub-cif-ids = <4 4>;
469 clocks = <&tegra_car 30>;
389 status = "disabled"; 470 status = "disabled";
390 }; 471 };
391 472
@@ -393,6 +474,7 @@
393 compatible = "nvidia,tegra30-i2s"; 474 compatible = "nvidia,tegra30-i2s";
394 reg = <0x70080400 0x100>; 475 reg = <0x70080400 0x100>;
395 nvidia,ahub-cif-ids = <5 5>; 476 nvidia,ahub-cif-ids = <5 5>;
477 clocks = <&tegra_car 11>;
396 status = "disabled"; 478 status = "disabled";
397 }; 479 };
398 480
@@ -400,6 +482,7 @@
400 compatible = "nvidia,tegra30-i2s"; 482 compatible = "nvidia,tegra30-i2s";
401 reg = <0x70080500 0x100>; 483 reg = <0x70080500 0x100>;
402 nvidia,ahub-cif-ids = <6 6>; 484 nvidia,ahub-cif-ids = <6 6>;
485 clocks = <&tegra_car 18>;
403 status = "disabled"; 486 status = "disabled";
404 }; 487 };
405 488
@@ -407,6 +490,7 @@
407 compatible = "nvidia,tegra30-i2s"; 490 compatible = "nvidia,tegra30-i2s";
408 reg = <0x70080600 0x100>; 491 reg = <0x70080600 0x100>;
409 nvidia,ahub-cif-ids = <7 7>; 492 nvidia,ahub-cif-ids = <7 7>;
493 clocks = <&tegra_car 101>;
410 status = "disabled"; 494 status = "disabled";
411 }; 495 };
412 496
@@ -414,6 +498,7 @@
414 compatible = "nvidia,tegra30-i2s"; 498 compatible = "nvidia,tegra30-i2s";
415 reg = <0x70080700 0x100>; 499 reg = <0x70080700 0x100>;
416 nvidia,ahub-cif-ids = <8 8>; 500 nvidia,ahub-cif-ids = <8 8>;
501 clocks = <&tegra_car 102>;
417 status = "disabled"; 502 status = "disabled";
418 }; 503 };
419 }; 504 };
@@ -422,6 +507,7 @@
422 compatible = "nvidia,tegra30-sdhci", "nvidia,tegra20-sdhci"; 507 compatible = "nvidia,tegra30-sdhci", "nvidia,tegra20-sdhci";
423 reg = <0x78000000 0x200>; 508 reg = <0x78000000 0x200>;
424 interrupts = <0 14 0x04>; 509 interrupts = <0 14 0x04>;
510 clocks = <&tegra_car 14>;
425 status = "disabled"; 511 status = "disabled";
426 }; 512 };
427 513
@@ -429,6 +515,7 @@
429 compatible = "nvidia,tegra30-sdhci", "nvidia,tegra20-sdhci"; 515 compatible = "nvidia,tegra30-sdhci", "nvidia,tegra20-sdhci";
430 reg = <0x78000200 0x200>; 516 reg = <0x78000200 0x200>;
431 interrupts = <0 15 0x04>; 517 interrupts = <0 15 0x04>;
518 clocks = <&tegra_car 9>;
432 status = "disabled"; 519 status = "disabled";
433 }; 520 };
434 521
@@ -436,6 +523,7 @@
436 compatible = "nvidia,tegra30-sdhci", "nvidia,tegra20-sdhci"; 523 compatible = "nvidia,tegra30-sdhci", "nvidia,tegra20-sdhci";
437 reg = <0x78000400 0x200>; 524 reg = <0x78000400 0x200>;
438 interrupts = <0 19 0x04>; 525 interrupts = <0 19 0x04>;
526 clocks = <&tegra_car 69>;
439 status = "disabled"; 527 status = "disabled";
440 }; 528 };
441 529
@@ -443,9 +531,39 @@
443 compatible = "nvidia,tegra30-sdhci", "nvidia,tegra20-sdhci"; 531 compatible = "nvidia,tegra30-sdhci", "nvidia,tegra20-sdhci";
444 reg = <0x78000600 0x200>; 532 reg = <0x78000600 0x200>;
445 interrupts = <0 31 0x04>; 533 interrupts = <0 31 0x04>;
534 clocks = <&tegra_car 15>;
446 status = "disabled"; 535 status = "disabled";
447 }; 536 };
448 537
538 cpus {
539 #address-cells = <1>;
540 #size-cells = <0>;
541
542 cpu@0 {
543 device_type = "cpu";
544 compatible = "arm,cortex-a9";
545 reg = <0>;
546 };
547
548 cpu@1 {
549 device_type = "cpu";
550 compatible = "arm,cortex-a9";
551 reg = <1>;
552 };
553
554 cpu@2 {
555 device_type = "cpu";
556 compatible = "arm,cortex-a9";
557 reg = <2>;
558 };
559
560 cpu@3 {
561 device_type = "cpu";
562 compatible = "arm,cortex-a9";
563 reg = <3>;
564 };
565 };
566
449 pmu { 567 pmu {
450 compatible = "arm,cortex-a9-pmu"; 568 compatible = "arm,cortex-a9-pmu";
451 interrupts = <0 144 0x04 569 interrupts = <0 144 0x04
diff --git a/arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts b/arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts
index a3d37ec2655d..73187173117c 100644
--- a/arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts
+++ b/arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts
@@ -70,7 +70,7 @@
70 compatible = "arm,sp805", "arm,primecell"; 70 compatible = "arm,sp805", "arm,primecell";
71 status = "disabled"; 71 status = "disabled";
72 reg = <0 0x2b060000 0 0x1000>; 72 reg = <0 0x2b060000 0 0x1000>;
73 interrupts = <98>; 73 interrupts = <0 98 4>;
74 clocks = <&oscclk7>; 74 clocks = <&oscclk7>;
75 clock-names = "apb_pclk"; 75 clock-names = "apb_pclk";
76 }; 76 };
diff --git a/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts b/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts
index cf8071ad22d5..dfe371ec2749 100644
--- a/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts
+++ b/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts
@@ -72,7 +72,7 @@
72 wdt@2a490000 { 72 wdt@2a490000 {
73 compatible = "arm,sp805", "arm,primecell"; 73 compatible = "arm,sp805", "arm,primecell";
74 reg = <0 0x2a490000 0 0x1000>; 74 reg = <0 0x2a490000 0 0x1000>;
75 interrupts = <98>; 75 interrupts = <0 98 4>;
76 clocks = <&oscclk6a>, <&oscclk6a>; 76 clocks = <&oscclk6a>, <&oscclk6a>;
77 clock-names = "wdogclk", "apb_pclk"; 77 clock-names = "wdogclk", "apb_pclk";
78 }; 78 };
diff --git a/arch/arm/boot/dts/vt8500.dtsi b/arch/arm/boot/dts/vt8500.dtsi
index d8645e990b21..cf31ced46602 100644
--- a/arch/arm/boot/dts/vt8500.dtsi
+++ b/arch/arm/boot/dts/vt8500.dtsi
@@ -45,6 +45,38 @@
45 compatible = "fixed-clock"; 45 compatible = "fixed-clock";
46 clock-frequency = <24000000>; 46 clock-frequency = <24000000>;
47 }; 47 };
48
49 clkuart0: uart0 {
50 #clock-cells = <0>;
51 compatible = "via,vt8500-device-clock";
52 clocks = <&ref24>;
53 enable-reg = <0x250>;
54 enable-bit = <1>;
55 };
56
57 clkuart1: uart1 {
58 #clock-cells = <0>;
59 compatible = "via,vt8500-device-clock";
60 clocks = <&ref24>;
61 enable-reg = <0x250>;
62 enable-bit = <2>;
63 };
64
65 clkuart2: uart2 {
66 #clock-cells = <0>;
67 compatible = "via,vt8500-device-clock";
68 clocks = <&ref24>;
69 enable-reg = <0x250>;
70 enable-bit = <3>;
71 };
72
73 clkuart3: uart3 {
74 #clock-cells = <0>;
75 compatible = "via,vt8500-device-clock";
76 clocks = <&ref24>;
77 enable-reg = <0x250>;
78 enable-bit = <4>;
79 };
48 }; 80 };
49 }; 81 };
50 82
@@ -83,28 +115,28 @@
83 compatible = "via,vt8500-uart"; 115 compatible = "via,vt8500-uart";
84 reg = <0xd8200000 0x1040>; 116 reg = <0xd8200000 0x1040>;
85 interrupts = <32>; 117 interrupts = <32>;
86 clocks = <&ref24>; 118 clocks = <&clkuart0>;
87 }; 119 };
88 120
89 uart@d82b0000 { 121 uart@d82b0000 {
90 compatible = "via,vt8500-uart"; 122 compatible = "via,vt8500-uart";
91 reg = <0xd82b0000 0x1040>; 123 reg = <0xd82b0000 0x1040>;
92 interrupts = <33>; 124 interrupts = <33>;
93 clocks = <&ref24>; 125 clocks = <&clkuart1>;
94 }; 126 };
95 127
96 uart@d8210000 { 128 uart@d8210000 {
97 compatible = "via,vt8500-uart"; 129 compatible = "via,vt8500-uart";
98 reg = <0xd8210000 0x1040>; 130 reg = <0xd8210000 0x1040>;
99 interrupts = <47>; 131 interrupts = <47>;
100 clocks = <&ref24>; 132 clocks = <&clkuart2>;
101 }; 133 };
102 134
103 uart@d82c0000 { 135 uart@d82c0000 {
104 compatible = "via,vt8500-uart"; 136 compatible = "via,vt8500-uart";
105 reg = <0xd82c0000 0x1040>; 137 reg = <0xd82c0000 0x1040>;
106 interrupts = <50>; 138 interrupts = <50>;
107 clocks = <&ref24>; 139 clocks = <&clkuart3>;
108 }; 140 };
109 141
110 rtc@d8100000 { 142 rtc@d8100000 {
diff --git a/arch/arm/boot/dts/wm8505.dtsi b/arch/arm/boot/dts/wm8505.dtsi
index 330f833ac3b0..e74a1c0fb9a2 100644
--- a/arch/arm/boot/dts/wm8505.dtsi
+++ b/arch/arm/boot/dts/wm8505.dtsi
@@ -59,6 +59,54 @@
59 compatible = "fixed-clock"; 59 compatible = "fixed-clock";
60 clock-frequency = <24000000>; 60 clock-frequency = <24000000>;
61 }; 61 };
62
63 clkuart0: uart0 {
64 #clock-cells = <0>;
65 compatible = "via,vt8500-device-clock";
66 clocks = <&ref24>;
67 enable-reg = <0x250>;
68 enable-bit = <1>;
69 };
70
71 clkuart1: uart1 {
72 #clock-cells = <0>;
73 compatible = "via,vt8500-device-clock";
74 clocks = <&ref24>;
75 enable-reg = <0x250>;
76 enable-bit = <2>;
77 };
78
79 clkuart2: uart2 {
80 #clock-cells = <0>;
81 compatible = "via,vt8500-device-clock";
82 clocks = <&ref24>;
83 enable-reg = <0x250>;
84 enable-bit = <3>;
85 };
86
87 clkuart3: uart3 {
88 #clock-cells = <0>;
89 compatible = "via,vt8500-device-clock";
90 clocks = <&ref24>;
91 enable-reg = <0x250>;
92 enable-bit = <4>;
93 };
94
95 clkuart4: uart4 {
96 #clock-cells = <0>;
97 compatible = "via,vt8500-device-clock";
98 clocks = <&ref24>;
99 enable-reg = <0x250>;
100 enable-bit = <22>;
101 };
102
103 clkuart5: uart5 {
104 #clock-cells = <0>;
105 compatible = "via,vt8500-device-clock";
106 clocks = <&ref24>;
107 enable-reg = <0x250>;
108 enable-bit = <23>;
109 };
62 }; 110 };
63 }; 111 };
64 112
@@ -96,42 +144,42 @@
96 compatible = "via,vt8500-uart"; 144 compatible = "via,vt8500-uart";
97 reg = <0xd8200000 0x1040>; 145 reg = <0xd8200000 0x1040>;
98 interrupts = <32>; 146 interrupts = <32>;
99 clocks = <&ref24>; 147 clocks = <&clkuart0>;
100 }; 148 };
101 149
102 uart@d82b0000 { 150 uart@d82b0000 {
103 compatible = "via,vt8500-uart"; 151 compatible = "via,vt8500-uart";
104 reg = <0xd82b0000 0x1040>; 152 reg = <0xd82b0000 0x1040>;
105 interrupts = <33>; 153 interrupts = <33>;
106 clocks = <&ref24>; 154 clocks = <&clkuart1>;
107 }; 155 };
108 156
109 uart@d8210000 { 157 uart@d8210000 {
110 compatible = "via,vt8500-uart"; 158 compatible = "via,vt8500-uart";
111 reg = <0xd8210000 0x1040>; 159 reg = <0xd8210000 0x1040>;
112 interrupts = <47>; 160 interrupts = <47>;
113 clocks = <&ref24>; 161 clocks = <&clkuart2>;
114 }; 162 };
115 163
116 uart@d82c0000 { 164 uart@d82c0000 {
117 compatible = "via,vt8500-uart"; 165 compatible = "via,vt8500-uart";
118 reg = <0xd82c0000 0x1040>; 166 reg = <0xd82c0000 0x1040>;
119 interrupts = <50>; 167 interrupts = <50>;
120 clocks = <&ref24>; 168 clocks = <&clkuart3>;
121 }; 169 };
122 170
123 uart@d8370000 { 171 uart@d8370000 {
124 compatible = "via,vt8500-uart"; 172 compatible = "via,vt8500-uart";
125 reg = <0xd8370000 0x1040>; 173 reg = <0xd8370000 0x1040>;
126 interrupts = <31>; 174 interrupts = <31>;
127 clocks = <&ref24>; 175 clocks = <&clkuart4>;
128 }; 176 };
129 177
130 uart@d8380000 { 178 uart@d8380000 {
131 compatible = "via,vt8500-uart"; 179 compatible = "via,vt8500-uart";
132 reg = <0xd8380000 0x1040>; 180 reg = <0xd8380000 0x1040>;
133 interrupts = <30>; 181 interrupts = <30>;
134 clocks = <&ref24>; 182 clocks = <&clkuart5>;
135 }; 183 };
136 184
137 rtc@d8100000 { 185 rtc@d8100000 {
diff --git a/arch/arm/boot/dts/wm8650.dtsi b/arch/arm/boot/dts/wm8650.dtsi
index 83b9467559bb..db3c0a12e052 100644
--- a/arch/arm/boot/dts/wm8650.dtsi
+++ b/arch/arm/boot/dts/wm8650.dtsi
@@ -75,6 +75,22 @@
75 reg = <0x204>; 75 reg = <0x204>;
76 }; 76 };
77 77
78 clkuart0: uart0 {
79 #clock-cells = <0>;
80 compatible = "via,vt8500-device-clock";
81 clocks = <&ref24>;
82 enable-reg = <0x250>;
83 enable-bit = <1>;
84 };
85
86 clkuart1: uart1 {
87 #clock-cells = <0>;
88 compatible = "via,vt8500-device-clock";
89 clocks = <&ref24>;
90 enable-reg = <0x250>;
91 enable-bit = <2>;
92 };
93
78 arm: arm { 94 arm: arm {
79 #clock-cells = <0>; 95 #clock-cells = <0>;
80 compatible = "via,vt8500-device-clock"; 96 compatible = "via,vt8500-device-clock";
@@ -128,14 +144,14 @@
128 compatible = "via,vt8500-uart"; 144 compatible = "via,vt8500-uart";
129 reg = <0xd8200000 0x1040>; 145 reg = <0xd8200000 0x1040>;
130 interrupts = <32>; 146 interrupts = <32>;
131 clocks = <&ref24>; 147 clocks = <&clkuart0>;
132 }; 148 };
133 149
134 uart@d82b0000 { 150 uart@d82b0000 {
135 compatible = "via,vt8500-uart"; 151 compatible = "via,vt8500-uart";
136 reg = <0xd82b0000 0x1040>; 152 reg = <0xd82b0000 0x1040>;
137 interrupts = <33>; 153 interrupts = <33>;
138 clocks = <&ref24>; 154 clocks = <&clkuart1>;
139 }; 155 };
140 156
141 rtc@d8100000 { 157 rtc@d8100000 {
diff --git a/arch/arm/boot/dts/wm8850-w70v2.dts b/arch/arm/boot/dts/wm8850-w70v2.dts
new file mode 100644
index 000000000000..fcc660c89540
--- /dev/null
+++ b/arch/arm/boot/dts/wm8850-w70v2.dts
@@ -0,0 +1,47 @@
1/*
2 * wm8850-w70v2.dts
3 * - Device tree file for Wondermedia WM8850 Tablet
4 * - 'W70-V2' mainboard
5 * - HongLianYing 'HLY070ML268-21A' 7" LCD panel
6 *
7 * Copyright (C) 2012 Tony Prisk <linux@prisktech.co.nz>
8 *
9 * Licensed under GPLv2 or later
10 */
11
12/dts-v1/;
13/include/ "wm8850.dtsi"
14
15/ {
16 model = "Wondermedia WM8850-W70v2 Tablet";
17
18 /*
19 * Display node is based on Sascha Hauer's patch on dri-devel.
20 * Added a bpp property to calculate the size of the framebuffer
21 * until the binding is formalized.
22 */
23 display: display@0 {
24 modes {
25 mode0: mode@0 {
26 hactive = <800>;
27 vactive = <480>;
28 hback-porch = <88>;
29 hfront-porch = <40>;
30 hsync-len = <0>;
31 vback-porch = <32>;
32 vfront-porch = <11>;
33 vsync-len = <1>;
34 clock = <0>; /* unused but required */
35 bpp = <16>; /* non-standard but required */
36 };
37 };
38 };
39
40 backlight {
41 compatible = "pwm-backlight";
42 pwms = <&pwm 0 50000 1>; /* duty inverted */
43
44 brightness-levels = <0 40 60 80 100 130 190 255>;
45 default-brightness-level = <5>;
46 };
47};
diff --git a/arch/arm/boot/dts/wm8850.dtsi b/arch/arm/boot/dts/wm8850.dtsi
new file mode 100644
index 000000000000..e8cbfdc87bba
--- /dev/null
+++ b/arch/arm/boot/dts/wm8850.dtsi
@@ -0,0 +1,224 @@
1/*
2 * wm8850.dtsi - Device tree file for Wondermedia WM8850 SoC
3 *
4 * Copyright (C) 2012 Tony Prisk <linux@prisktech.co.nz>
5 *
6 * Licensed under GPLv2 or later
7 */
8
9/include/ "skeleton.dtsi"
10
11/ {
12 compatible = "wm,wm8850";
13
14 aliases {
15 serial0 = &uart0;
16 serial1 = &uart1;
17 serial2 = &uart2;
18 serial3 = &uart3;
19 };
20
21 soc {
22 #address-cells = <1>;
23 #size-cells = <1>;
24 compatible = "simple-bus";
25 ranges;
26 interrupt-parent = <&intc0>;
27
28 intc0: interrupt-controller@d8140000 {
29 compatible = "via,vt8500-intc";
30 interrupt-controller;
31 reg = <0xd8140000 0x10000>;
32 #interrupt-cells = <1>;
33 };
34
35 /* Secondary IC cascaded to intc0 */
36 intc1: interrupt-controller@d8150000 {
37 compatible = "via,vt8500-intc";
38 interrupt-controller;
39 #interrupt-cells = <1>;
40 reg = <0xD8150000 0x10000>;
41 interrupts = <56 57 58 59 60 61 62 63>;
42 };
43
44 gpio: gpio-controller@d8110000 {
45 compatible = "wm,wm8650-gpio";
46 gpio-controller;
47 reg = <0xd8110000 0x10000>;
48 #gpio-cells = <3>;
49 };
50
51 pmc@d8130000 {
52 compatible = "via,vt8500-pmc";
53 reg = <0xd8130000 0x1000>;
54
55 clocks {
56 #address-cells = <1>;
57 #size-cells = <0>;
58
59 ref25: ref25M {
60 #clock-cells = <0>;
61 compatible = "fixed-clock";
62 clock-frequency = <25000000>;
63 };
64
65 ref24: ref24M {
66 #clock-cells = <0>;
67 compatible = "fixed-clock";
68 clock-frequency = <24000000>;
69 };
70
71 plla: plla {
72 #clock-cells = <0>;
73 compatible = "wm,wm8750-pll-clock";
74 clocks = <&ref25>;
75 reg = <0x200>;
76 };
77
78 pllb: pllb {
79 #clock-cells = <0>;
80 compatible = "wm,wm8750-pll-clock";
81 clocks = <&ref25>;
82 reg = <0x204>;
83 };
84
85 clkuart0: uart0 {
86 #clock-cells = <0>;
87 compatible = "via,vt8500-device-clock";
88 clocks = <&ref24>;
89 enable-reg = <0x254>;
90 enable-bit = <24>;
91 };
92
93 clkuart1: uart1 {
94 #clock-cells = <0>;
95 compatible = "via,vt8500-device-clock";
96 clocks = <&ref24>;
97 enable-reg = <0x254>;
98 enable-bit = <25>;
99 };
100
101 clkuart2: uart2 {
102 #clock-cells = <0>;
103 compatible = "via,vt8500-device-clock";
104 clocks = <&ref24>;
105 enable-reg = <0x254>;
106 enable-bit = <26>;
107 };
108
109 clkuart3: uart3 {
110 #clock-cells = <0>;
111 compatible = "via,vt8500-device-clock";
112 clocks = <&ref24>;
113 enable-reg = <0x254>;
114 enable-bit = <27>;
115 };
116
117 clkpwm: pwm {
118 #clock-cells = <0>;
119 compatible = "via,vt8500-device-clock";
120 clocks = <&pllb>;
121 divisor-reg = <0x350>;
122 enable-reg = <0x250>;
123 enable-bit = <17>;
124 };
125
126 clksdhc: sdhc {
127 #clock-cells = <0>;
128 compatible = "via,vt8500-device-clock";
129 clocks = <&pllb>;
130 divisor-reg = <0x330>;
131 divisor-mask = <0x3f>;
132 enable-reg = <0x250>;
133 enable-bit = <0>;
134 };
135 };
136 };
137
138 fb@d8051700 {
139 compatible = "wm,wm8505-fb";
140 reg = <0xd8051700 0x200>;
141 display = <&display>;
142 default-mode = <&mode0>;
143 };
144
145 ge_rops@d8050400 {
146 compatible = "wm,prizm-ge-rops";
147 reg = <0xd8050400 0x100>;
148 };
149
150 pwm: pwm@d8220000 {
151 #pwm-cells = <3>;
152 compatible = "via,vt8500-pwm";
153 reg = <0xd8220000 0x100>;
154 clocks = <&clkpwm>;
155 };
156
157 timer@d8130100 {
158 compatible = "via,vt8500-timer";
159 reg = <0xd8130100 0x28>;
160 interrupts = <36>;
161 };
162
163 ehci@d8007900 {
164 compatible = "via,vt8500-ehci";
165 reg = <0xd8007900 0x200>;
166 interrupts = <26>;
167 };
168
169 uhci@d8007b00 {
170 compatible = "platform-uhci";
171 reg = <0xd8007b00 0x200>;
172 interrupts = <26>;
173 };
174
175 uhci@d8008d00 {
176 compatible = "platform-uhci";
177 reg = <0xd8008d00 0x200>;
178 interrupts = <26>;
179 };
180
181 uart0: uart@d8200000 {
182 compatible = "via,vt8500-uart";
183 reg = <0xd8200000 0x1040>;
184 interrupts = <32>;
185 clocks = <&clkuart0>;
186 };
187
188 uart1: uart@d82b0000 {
189 compatible = "via,vt8500-uart";
190 reg = <0xd82b0000 0x1040>;
191 interrupts = <33>;
192 clocks = <&clkuart1>;
193 };
194
195 uart2: uart@d8210000 {
196 compatible = "via,vt8500-uart";
197 reg = <0xd8210000 0x1040>;
198 interrupts = <47>;
199 clocks = <&clkuart2>;
200 };
201
202 uart3: uart@d82c0000 {
203 compatible = "via,vt8500-uart";
204 reg = <0xd82c0000 0x1040>;
205 interrupts = <50>;
206 clocks = <&clkuart3>;
207 };
208
209 rtc@d8100000 {
210 compatible = "via,vt8500-rtc";
211 reg = <0xd8100000 0x10000>;
212 interrupts = <48>;
213 };
214
215 sdhc@d800a000 {
216 compatible = "wm,wm8505-sdhc";
217 reg = <0xd800a000 0x1000>;
218 interrupts = <20 21>;
219 clocks = <&clksdhc>;
220 bus-width = <4>;
221 sdon-inverted;
222 };
223 };
224};
diff --git a/arch/arm/boot/dts/zynq-7000.dtsi b/arch/arm/boot/dts/zynq-7000.dtsi
index 401c1262d4ed..5914b5654591 100644
--- a/arch/arm/boot/dts/zynq-7000.dtsi
+++ b/arch/arm/boot/dts/zynq-7000.dtsi
@@ -44,14 +44,14 @@
44 compatible = "xlnx,xuartps"; 44 compatible = "xlnx,xuartps";
45 reg = <0xE0000000 0x1000>; 45 reg = <0xE0000000 0x1000>;
46 interrupts = <0 27 4>; 46 interrupts = <0 27 4>;
47 clock = <50000000>; 47 clocks = <&uart_clk 0>;
48 }; 48 };
49 49
50 uart1: uart@e0001000 { 50 uart1: uart@e0001000 {
51 compatible = "xlnx,xuartps"; 51 compatible = "xlnx,xuartps";
52 reg = <0xE0001000 0x1000>; 52 reg = <0xE0001000 0x1000>;
53 interrupts = <0 50 4>; 53 interrupts = <0 50 4>;
54 clock = <50000000>; 54 clocks = <&uart_clk 1>;
55 }; 55 };
56 56
57 slcr: slcr@f8000000 { 57 slcr: slcr@f8000000 {
diff --git a/arch/arm/common/Kconfig b/arch/arm/common/Kconfig
index 45ceeb0e93e0..9353184d730d 100644
--- a/arch/arm/common/Kconfig
+++ b/arch/arm/common/Kconfig
@@ -1,26 +1,3 @@
1config ARM_GIC
2 bool
3 select IRQ_DOMAIN
4 select MULTI_IRQ_HANDLER
5
6config GIC_NON_BANKED
7 bool
8
9config ARM_VIC
10 bool
11 select IRQ_DOMAIN
12 select MULTI_IRQ_HANDLER
13
14config ARM_VIC_NR
15 int
16 default 4 if ARCH_S5PV210
17 default 3 if ARCH_S5PC100
18 default 2
19 depends on ARM_VIC
20 help
21 The maximum number of VICs available in the system, for
22 power management.
23
24config ICST 1config ICST
25 bool 2 bool
26 3
diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile
index e8a4e58f1b82..dc8dd0de5c0f 100644
--- a/arch/arm/common/Makefile
+++ b/arch/arm/common/Makefile
@@ -2,8 +2,6 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5obj-$(CONFIG_ARM_GIC) += gic.o
6obj-$(CONFIG_ARM_VIC) += vic.o
7obj-$(CONFIG_ICST) += icst.o 5obj-$(CONFIG_ICST) += icst.o
8obj-$(CONFIG_SA1111) += sa1111.o 6obj-$(CONFIG_SA1111) += sa1111.o
9obj-$(CONFIG_PCI_HOST_VIA82C505) += via82c505.o 7obj-$(CONFIG_PCI_HOST_VIA82C505) += via82c505.o
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
deleted file mode 100644
index 36ae03a3f5d1..000000000000
--- a/arch/arm/common/gic.c
+++ /dev/null
@@ -1,811 +0,0 @@
1/*
2 * linux/arch/arm/common/gic.c
3 *
4 * Copyright (C) 2002 ARM Limited, All Rights Reserved.
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 * Interrupt architecture for the GIC:
11 *
12 * o There is one Interrupt Distributor, which receives interrupts
13 * from system devices and sends them to the Interrupt Controllers.
14 *
15 * o There is one CPU Interface per CPU, which sends interrupts sent
16 * by the Distributor, and interrupts generated locally, to the
17 * associated CPU. The base address of the CPU interface is usually
18 * aliased so that the same address points to different chips depending
19 * on the CPU it is accessed from.
20 *
21 * Note that IRQs 0-31 are special - they are local to each CPU.
22 * As such, the enable set/clear, pending set/clear and active bit
23 * registers are banked per-cpu for these sources.
24 */
25#include <linux/init.h>
26#include <linux/kernel.h>
27#include <linux/err.h>
28#include <linux/module.h>
29#include <linux/list.h>
30#include <linux/smp.h>
31#include <linux/cpu_pm.h>
32#include <linux/cpumask.h>
33#include <linux/io.h>
34#include <linux/of.h>
35#include <linux/of_address.h>
36#include <linux/of_irq.h>
37#include <linux/irqdomain.h>
38#include <linux/interrupt.h>
39#include <linux/percpu.h>
40#include <linux/slab.h>
41
42#include <asm/irq.h>
43#include <asm/exception.h>
44#include <asm/smp_plat.h>
45#include <asm/mach/irq.h>
46#include <asm/hardware/gic.h>
47
48union gic_base {
49 void __iomem *common_base;
50 void __percpu __iomem **percpu_base;
51};
52
53struct gic_chip_data {
54 union gic_base dist_base;
55 union gic_base cpu_base;
56#ifdef CONFIG_CPU_PM
57 u32 saved_spi_enable[DIV_ROUND_UP(1020, 32)];
58 u32 saved_spi_conf[DIV_ROUND_UP(1020, 16)];
59 u32 saved_spi_target[DIV_ROUND_UP(1020, 4)];
60 u32 __percpu *saved_ppi_enable;
61 u32 __percpu *saved_ppi_conf;
62#endif
63 struct irq_domain *domain;
64 unsigned int gic_irqs;
65#ifdef CONFIG_GIC_NON_BANKED
66 void __iomem *(*get_base)(union gic_base *);
67#endif
68};
69
70static DEFINE_RAW_SPINLOCK(irq_controller_lock);
71
72/*
73 * The GIC mapping of CPU interfaces does not necessarily match
74 * the logical CPU numbering. Let's use a mapping as returned
75 * by the GIC itself.
76 */
77#define NR_GIC_CPU_IF 8
78static u8 gic_cpu_map[NR_GIC_CPU_IF] __read_mostly;
79
80/*
81 * Supported arch specific GIC irq extension.
82 * Default make them NULL.
83 */
84struct irq_chip gic_arch_extn = {
85 .irq_eoi = NULL,
86 .irq_mask = NULL,
87 .irq_unmask = NULL,
88 .irq_retrigger = NULL,
89 .irq_set_type = NULL,
90 .irq_set_wake = NULL,
91};
92
93#ifndef MAX_GIC_NR
94#define MAX_GIC_NR 1
95#endif
96
97static struct gic_chip_data gic_data[MAX_GIC_NR] __read_mostly;
98
99#ifdef CONFIG_GIC_NON_BANKED
100static void __iomem *gic_get_percpu_base(union gic_base *base)
101{
102 return *__this_cpu_ptr(base->percpu_base);
103}
104
105static void __iomem *gic_get_common_base(union gic_base *base)
106{
107 return base->common_base;
108}
109
110static inline void __iomem *gic_data_dist_base(struct gic_chip_data *data)
111{
112 return data->get_base(&data->dist_base);
113}
114
115static inline void __iomem *gic_data_cpu_base(struct gic_chip_data *data)
116{
117 return data->get_base(&data->cpu_base);
118}
119
120static inline void gic_set_base_accessor(struct gic_chip_data *data,
121 void __iomem *(*f)(union gic_base *))
122{
123 data->get_base = f;
124}
125#else
126#define gic_data_dist_base(d) ((d)->dist_base.common_base)
127#define gic_data_cpu_base(d) ((d)->cpu_base.common_base)
128#define gic_set_base_accessor(d,f)
129#endif
130
131static inline void __iomem *gic_dist_base(struct irq_data *d)
132{
133 struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d);
134 return gic_data_dist_base(gic_data);
135}
136
137static inline void __iomem *gic_cpu_base(struct irq_data *d)
138{
139 struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d);
140 return gic_data_cpu_base(gic_data);
141}
142
143static inline unsigned int gic_irq(struct irq_data *d)
144{
145 return d->hwirq;
146}
147
148/*
149 * Routines to acknowledge, disable and enable interrupts
150 */
151static void gic_mask_irq(struct irq_data *d)
152{
153 u32 mask = 1 << (gic_irq(d) % 32);
154
155 raw_spin_lock(&irq_controller_lock);
156 writel_relaxed(mask, gic_dist_base(d) + GIC_DIST_ENABLE_CLEAR + (gic_irq(d) / 32) * 4);
157 if (gic_arch_extn.irq_mask)
158 gic_arch_extn.irq_mask(d);
159 raw_spin_unlock(&irq_controller_lock);
160}
161
162static void gic_unmask_irq(struct irq_data *d)
163{
164 u32 mask = 1 << (gic_irq(d) % 32);
165
166 raw_spin_lock(&irq_controller_lock);
167 if (gic_arch_extn.irq_unmask)
168 gic_arch_extn.irq_unmask(d);
169 writel_relaxed(mask, gic_dist_base(d) + GIC_DIST_ENABLE_SET + (gic_irq(d) / 32) * 4);
170 raw_spin_unlock(&irq_controller_lock);
171}
172
173static void gic_eoi_irq(struct irq_data *d)
174{
175 if (gic_arch_extn.irq_eoi) {
176 raw_spin_lock(&irq_controller_lock);
177 gic_arch_extn.irq_eoi(d);
178 raw_spin_unlock(&irq_controller_lock);
179 }
180
181 writel_relaxed(gic_irq(d), gic_cpu_base(d) + GIC_CPU_EOI);
182}
183
184static int gic_set_type(struct irq_data *d, unsigned int type)
185{
186 void __iomem *base = gic_dist_base(d);
187 unsigned int gicirq = gic_irq(d);
188 u32 enablemask = 1 << (gicirq % 32);
189 u32 enableoff = (gicirq / 32) * 4;
190 u32 confmask = 0x2 << ((gicirq % 16) * 2);
191 u32 confoff = (gicirq / 16) * 4;
192 bool enabled = false;
193 u32 val;
194
195 /* Interrupt configuration for SGIs can't be changed */
196 if (gicirq < 16)
197 return -EINVAL;
198
199 if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
200 return -EINVAL;
201
202 raw_spin_lock(&irq_controller_lock);
203
204 if (gic_arch_extn.irq_set_type)
205 gic_arch_extn.irq_set_type(d, type);
206
207 val = readl_relaxed(base + GIC_DIST_CONFIG + confoff);
208 if (type == IRQ_TYPE_LEVEL_HIGH)
209 val &= ~confmask;
210 else if (type == IRQ_TYPE_EDGE_RISING)
211 val |= confmask;
212
213 /*
214 * As recommended by the spec, disable the interrupt before changing
215 * the configuration
216 */
217 if (readl_relaxed(base + GIC_DIST_ENABLE_SET + enableoff) & enablemask) {
218 writel_relaxed(enablemask, base + GIC_DIST_ENABLE_CLEAR + enableoff);
219 enabled = true;
220 }
221
222 writel_relaxed(val, base + GIC_DIST_CONFIG + confoff);
223
224 if (enabled)
225 writel_relaxed(enablemask, base + GIC_DIST_ENABLE_SET + enableoff);
226
227 raw_spin_unlock(&irq_controller_lock);
228
229 return 0;
230}
231
232static int gic_retrigger(struct irq_data *d)
233{
234 if (gic_arch_extn.irq_retrigger)
235 return gic_arch_extn.irq_retrigger(d);
236
237 return -ENXIO;
238}
239
240#ifdef CONFIG_SMP
241static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
242 bool force)
243{
244 void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3);
245 unsigned int shift = (gic_irq(d) % 4) * 8;
246 unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask);
247 u32 val, mask, bit;
248
249 if (cpu >= NR_GIC_CPU_IF || cpu >= nr_cpu_ids)
250 return -EINVAL;
251
252 mask = 0xff << shift;
253 bit = gic_cpu_map[cpu] << shift;
254
255 raw_spin_lock(&irq_controller_lock);
256 val = readl_relaxed(reg) & ~mask;
257 writel_relaxed(val | bit, reg);
258 raw_spin_unlock(&irq_controller_lock);
259
260 return IRQ_SET_MASK_OK;
261}
262#endif
263
264#ifdef CONFIG_PM
265static int gic_set_wake(struct irq_data *d, unsigned int on)
266{
267 int ret = -ENXIO;
268
269 if (gic_arch_extn.irq_set_wake)
270 ret = gic_arch_extn.irq_set_wake(d, on);
271
272 return ret;
273}
274
275#else
276#define gic_set_wake NULL
277#endif
278
279asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
280{
281 u32 irqstat, irqnr;
282 struct gic_chip_data *gic = &gic_data[0];
283 void __iomem *cpu_base = gic_data_cpu_base(gic);
284
285 do {
286 irqstat = readl_relaxed(cpu_base + GIC_CPU_INTACK);
287 irqnr = irqstat & ~0x1c00;
288
289 if (likely(irqnr > 15 && irqnr < 1021)) {
290 irqnr = irq_find_mapping(gic->domain, irqnr);
291 handle_IRQ(irqnr, regs);
292 continue;
293 }
294 if (irqnr < 16) {
295 writel_relaxed(irqstat, cpu_base + GIC_CPU_EOI);
296#ifdef CONFIG_SMP
297 handle_IPI(irqnr, regs);
298#endif
299 continue;
300 }
301 break;
302 } while (1);
303}
304
305static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
306{
307 struct gic_chip_data *chip_data = irq_get_handler_data(irq);
308 struct irq_chip *chip = irq_get_chip(irq);
309 unsigned int cascade_irq, gic_irq;
310 unsigned long status;
311
312 chained_irq_enter(chip, desc);
313
314 raw_spin_lock(&irq_controller_lock);
315 status = readl_relaxed(gic_data_cpu_base(chip_data) + GIC_CPU_INTACK);
316 raw_spin_unlock(&irq_controller_lock);
317
318 gic_irq = (status & 0x3ff);
319 if (gic_irq == 1023)
320 goto out;
321
322 cascade_irq = irq_find_mapping(chip_data->domain, gic_irq);
323 if (unlikely(gic_irq < 32 || gic_irq > 1020))
324 do_bad_IRQ(cascade_irq, desc);
325 else
326 generic_handle_irq(cascade_irq);
327
328 out:
329 chained_irq_exit(chip, desc);
330}
331
332static struct irq_chip gic_chip = {
333 .name = "GIC",
334 .irq_mask = gic_mask_irq,
335 .irq_unmask = gic_unmask_irq,
336 .irq_eoi = gic_eoi_irq,
337 .irq_set_type = gic_set_type,
338 .irq_retrigger = gic_retrigger,
339#ifdef CONFIG_SMP
340 .irq_set_affinity = gic_set_affinity,
341#endif
342 .irq_set_wake = gic_set_wake,
343};
344
345void __init gic_cascade_irq(unsigned int gic_nr, unsigned int irq)
346{
347 if (gic_nr >= MAX_GIC_NR)
348 BUG();
349 if (irq_set_handler_data(irq, &gic_data[gic_nr]) != 0)
350 BUG();
351 irq_set_chained_handler(irq, gic_handle_cascade_irq);
352}
353
354static void __init gic_dist_init(struct gic_chip_data *gic)
355{
356 unsigned int i;
357 u32 cpumask;
358 unsigned int gic_irqs = gic->gic_irqs;
359 void __iomem *base = gic_data_dist_base(gic);
360
361 writel_relaxed(0, base + GIC_DIST_CTRL);
362
363 /*
364 * Set all global interrupts to be level triggered, active low.
365 */
366 for (i = 32; i < gic_irqs; i += 16)
367 writel_relaxed(0, base + GIC_DIST_CONFIG + i * 4 / 16);
368
369 /*
370 * Set all global interrupts to this CPU only.
371 */
372 cpumask = readl_relaxed(base + GIC_DIST_TARGET + 0);
373 for (i = 32; i < gic_irqs; i += 4)
374 writel_relaxed(cpumask, base + GIC_DIST_TARGET + i * 4 / 4);
375
376 /*
377 * Set priority on all global interrupts.
378 */
379 for (i = 32; i < gic_irqs; i += 4)
380 writel_relaxed(0xa0a0a0a0, base + GIC_DIST_PRI + i * 4 / 4);
381
382 /*
383 * Disable all interrupts. Leave the PPI and SGIs alone
384 * as these enables are banked registers.
385 */
386 for (i = 32; i < gic_irqs; i += 32)
387 writel_relaxed(0xffffffff, base + GIC_DIST_ENABLE_CLEAR + i * 4 / 32);
388
389 writel_relaxed(1, base + GIC_DIST_CTRL);
390}
391
392static void __cpuinit gic_cpu_init(struct gic_chip_data *gic)
393{
394 void __iomem *dist_base = gic_data_dist_base(gic);
395 void __iomem *base = gic_data_cpu_base(gic);
396 unsigned int cpu_mask, cpu = smp_processor_id();
397 int i;
398
399 /*
400 * Get what the GIC says our CPU mask is.
401 */
402 BUG_ON(cpu >= NR_GIC_CPU_IF);
403 cpu_mask = readl_relaxed(dist_base + GIC_DIST_TARGET + 0);
404 gic_cpu_map[cpu] = cpu_mask;
405
406 /*
407 * Clear our mask from the other map entries in case they're
408 * still undefined.
409 */
410 for (i = 0; i < NR_GIC_CPU_IF; i++)
411 if (i != cpu)
412 gic_cpu_map[i] &= ~cpu_mask;
413
414 /*
415 * Deal with the banked PPI and SGI interrupts - disable all
416 * PPI interrupts, ensure all SGI interrupts are enabled.
417 */
418 writel_relaxed(0xffff0000, dist_base + GIC_DIST_ENABLE_CLEAR);
419 writel_relaxed(0x0000ffff, dist_base + GIC_DIST_ENABLE_SET);
420
421 /*
422 * Set priority on PPI and SGI interrupts
423 */
424 for (i = 0; i < 32; i += 4)
425 writel_relaxed(0xa0a0a0a0, dist_base + GIC_DIST_PRI + i * 4 / 4);
426
427 writel_relaxed(0xf0, base + GIC_CPU_PRIMASK);
428 writel_relaxed(1, base + GIC_CPU_CTRL);
429}
430
431#ifdef CONFIG_CPU_PM
432/*
433 * Saves the GIC distributor registers during suspend or idle. Must be called
434 * with interrupts disabled but before powering down the GIC. After calling
435 * this function, no interrupts will be delivered by the GIC, and another
436 * platform-specific wakeup source must be enabled.
437 */
438static void gic_dist_save(unsigned int gic_nr)
439{
440 unsigned int gic_irqs;
441 void __iomem *dist_base;
442 int i;
443
444 if (gic_nr >= MAX_GIC_NR)
445 BUG();
446
447 gic_irqs = gic_data[gic_nr].gic_irqs;
448 dist_base = gic_data_dist_base(&gic_data[gic_nr]);
449
450 if (!dist_base)
451 return;
452
453 for (i = 0; i < DIV_ROUND_UP(gic_irqs, 16); i++)
454 gic_data[gic_nr].saved_spi_conf[i] =
455 readl_relaxed(dist_base + GIC_DIST_CONFIG + i * 4);
456
457 for (i = 0; i < DIV_ROUND_UP(gic_irqs, 4); i++)
458 gic_data[gic_nr].saved_spi_target[i] =
459 readl_relaxed(dist_base + GIC_DIST_TARGET + i * 4);
460
461 for (i = 0; i < DIV_ROUND_UP(gic_irqs, 32); i++)
462 gic_data[gic_nr].saved_spi_enable[i] =
463 readl_relaxed(dist_base + GIC_DIST_ENABLE_SET + i * 4);
464}
465
466/*
467 * Restores the GIC distributor registers during resume or when coming out of
468 * idle. Must be called before enabling interrupts. If a level interrupt
469 * that occured while the GIC was suspended is still present, it will be
470 * handled normally, but any edge interrupts that occured will not be seen by
471 * the GIC and need to be handled by the platform-specific wakeup source.
472 */
473static void gic_dist_restore(unsigned int gic_nr)
474{
475 unsigned int gic_irqs;
476 unsigned int i;
477 void __iomem *dist_base;
478
479 if (gic_nr >= MAX_GIC_NR)
480 BUG();
481
482 gic_irqs = gic_data[gic_nr].gic_irqs;
483 dist_base = gic_data_dist_base(&gic_data[gic_nr]);
484
485 if (!dist_base)
486 return;
487
488 writel_relaxed(0, dist_base + GIC_DIST_CTRL);
489
490 for (i = 0; i < DIV_ROUND_UP(gic_irqs, 16); i++)
491 writel_relaxed(gic_data[gic_nr].saved_spi_conf[i],
492 dist_base + GIC_DIST_CONFIG + i * 4);
493
494 for (i = 0; i < DIV_ROUND_UP(gic_irqs, 4); i++)
495 writel_relaxed(0xa0a0a0a0,
496 dist_base + GIC_DIST_PRI + i * 4);
497
498 for (i = 0; i < DIV_ROUND_UP(gic_irqs, 4); i++)
499 writel_relaxed(gic_data[gic_nr].saved_spi_target[i],
500 dist_base + GIC_DIST_TARGET + i * 4);
501
502 for (i = 0; i < DIV_ROUND_UP(gic_irqs, 32); i++)
503 writel_relaxed(gic_data[gic_nr].saved_spi_enable[i],
504 dist_base + GIC_DIST_ENABLE_SET + i * 4);
505
506 writel_relaxed(1, dist_base + GIC_DIST_CTRL);
507}
508
509static void gic_cpu_save(unsigned int gic_nr)
510{
511 int i;
512 u32 *ptr;
513 void __iomem *dist_base;
514 void __iomem *cpu_base;
515
516 if (gic_nr >= MAX_GIC_NR)
517 BUG();
518
519 dist_base = gic_data_dist_base(&gic_data[gic_nr]);
520 cpu_base = gic_data_cpu_base(&gic_data[gic_nr]);
521
522 if (!dist_base || !cpu_base)
523 return;
524
525 ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_enable);
526 for (i = 0; i < DIV_ROUND_UP(32, 32); i++)
527 ptr[i] = readl_relaxed(dist_base + GIC_DIST_ENABLE_SET + i * 4);
528
529 ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_conf);
530 for (i = 0; i < DIV_ROUND_UP(32, 16); i++)
531 ptr[i] = readl_relaxed(dist_base + GIC_DIST_CONFIG + i * 4);
532
533}
534
535static void gic_cpu_restore(unsigned int gic_nr)
536{
537 int i;
538 u32 *ptr;
539 void __iomem *dist_base;
540 void __iomem *cpu_base;
541
542 if (gic_nr >= MAX_GIC_NR)
543 BUG();
544
545 dist_base = gic_data_dist_base(&gic_data[gic_nr]);
546 cpu_base = gic_data_cpu_base(&gic_data[gic_nr]);
547
548 if (!dist_base || !cpu_base)
549 return;
550
551 ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_enable);
552 for (i = 0; i < DIV_ROUND_UP(32, 32); i++)
553 writel_relaxed(ptr[i], dist_base + GIC_DIST_ENABLE_SET + i * 4);
554
555 ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_conf);
556 for (i = 0; i < DIV_ROUND_UP(32, 16); i++)
557 writel_relaxed(ptr[i], dist_base + GIC_DIST_CONFIG + i * 4);
558
559 for (i = 0; i < DIV_ROUND_UP(32, 4); i++)
560 writel_relaxed(0xa0a0a0a0, dist_base + GIC_DIST_PRI + i * 4);
561
562 writel_relaxed(0xf0, cpu_base + GIC_CPU_PRIMASK);
563 writel_relaxed(1, cpu_base + GIC_CPU_CTRL);
564}
565
566static int gic_notifier(struct notifier_block *self, unsigned long cmd, void *v)
567{
568 int i;
569
570 for (i = 0; i < MAX_GIC_NR; i++) {
571#ifdef CONFIG_GIC_NON_BANKED
572 /* Skip over unused GICs */
573 if (!gic_data[i].get_base)
574 continue;
575#endif
576 switch (cmd) {
577 case CPU_PM_ENTER:
578 gic_cpu_save(i);
579 break;
580 case CPU_PM_ENTER_FAILED:
581 case CPU_PM_EXIT:
582 gic_cpu_restore(i);
583 break;
584 case CPU_CLUSTER_PM_ENTER:
585 gic_dist_save(i);
586 break;
587 case CPU_CLUSTER_PM_ENTER_FAILED:
588 case CPU_CLUSTER_PM_EXIT:
589 gic_dist_restore(i);
590 break;
591 }
592 }
593
594 return NOTIFY_OK;
595}
596
597static struct notifier_block gic_notifier_block = {
598 .notifier_call = gic_notifier,
599};
600
601static void __init gic_pm_init(struct gic_chip_data *gic)
602{
603 gic->saved_ppi_enable = __alloc_percpu(DIV_ROUND_UP(32, 32) * 4,
604 sizeof(u32));
605 BUG_ON(!gic->saved_ppi_enable);
606
607 gic->saved_ppi_conf = __alloc_percpu(DIV_ROUND_UP(32, 16) * 4,
608 sizeof(u32));
609 BUG_ON(!gic->saved_ppi_conf);
610
611 if (gic == &gic_data[0])
612 cpu_pm_register_notifier(&gic_notifier_block);
613}
614#else
615static void __init gic_pm_init(struct gic_chip_data *gic)
616{
617}
618#endif
619
620static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
621 irq_hw_number_t hw)
622{
623 if (hw < 32) {
624 irq_set_percpu_devid(irq);
625 irq_set_chip_and_handler(irq, &gic_chip,
626 handle_percpu_devid_irq);
627 set_irq_flags(irq, IRQF_VALID | IRQF_NOAUTOEN);
628 } else {
629 irq_set_chip_and_handler(irq, &gic_chip,
630 handle_fasteoi_irq);
631 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
632 }
633 irq_set_chip_data(irq, d->host_data);
634 return 0;
635}
636
637static int gic_irq_domain_xlate(struct irq_domain *d,
638 struct device_node *controller,
639 const u32 *intspec, unsigned int intsize,
640 unsigned long *out_hwirq, unsigned int *out_type)
641{
642 if (d->of_node != controller)
643 return -EINVAL;
644 if (intsize < 3)
645 return -EINVAL;
646
647 /* Get the interrupt number and add 16 to skip over SGIs */
648 *out_hwirq = intspec[1] + 16;
649
650 /* For SPIs, we need to add 16 more to get the GIC irq ID number */
651 if (!intspec[0])
652 *out_hwirq += 16;
653
654 *out_type = intspec[2] & IRQ_TYPE_SENSE_MASK;
655 return 0;
656}
657
658const struct irq_domain_ops gic_irq_domain_ops = {
659 .map = gic_irq_domain_map,
660 .xlate = gic_irq_domain_xlate,
661};
662
663void __init gic_init_bases(unsigned int gic_nr, int irq_start,
664 void __iomem *dist_base, void __iomem *cpu_base,
665 u32 percpu_offset, struct device_node *node)
666{
667 irq_hw_number_t hwirq_base;
668 struct gic_chip_data *gic;
669 int gic_irqs, irq_base, i;
670
671 BUG_ON(gic_nr >= MAX_GIC_NR);
672
673 gic = &gic_data[gic_nr];
674#ifdef CONFIG_GIC_NON_BANKED
675 if (percpu_offset) { /* Frankein-GIC without banked registers... */
676 unsigned int cpu;
677
678 gic->dist_base.percpu_base = alloc_percpu(void __iomem *);
679 gic->cpu_base.percpu_base = alloc_percpu(void __iomem *);
680 if (WARN_ON(!gic->dist_base.percpu_base ||
681 !gic->cpu_base.percpu_base)) {
682 free_percpu(gic->dist_base.percpu_base);
683 free_percpu(gic->cpu_base.percpu_base);
684 return;
685 }
686
687 for_each_possible_cpu(cpu) {
688 unsigned long offset = percpu_offset * cpu_logical_map(cpu);
689 *per_cpu_ptr(gic->dist_base.percpu_base, cpu) = dist_base + offset;
690 *per_cpu_ptr(gic->cpu_base.percpu_base, cpu) = cpu_base + offset;
691 }
692
693 gic_set_base_accessor(gic, gic_get_percpu_base);
694 } else
695#endif
696 { /* Normal, sane GIC... */
697 WARN(percpu_offset,
698 "GIC_NON_BANKED not enabled, ignoring %08x offset!",
699 percpu_offset);
700 gic->dist_base.common_base = dist_base;
701 gic->cpu_base.common_base = cpu_base;
702 gic_set_base_accessor(gic, gic_get_common_base);
703 }
704
705 /*
706 * Initialize the CPU interface map to all CPUs.
707 * It will be refined as each CPU probes its ID.
708 */
709 for (i = 0; i < NR_GIC_CPU_IF; i++)
710 gic_cpu_map[i] = 0xff;
711
712 /*
713 * For primary GICs, skip over SGIs.
714 * For secondary GICs, skip over PPIs, too.
715 */
716 if (gic_nr == 0 && (irq_start & 31) > 0) {
717 hwirq_base = 16;
718 if (irq_start != -1)
719 irq_start = (irq_start & ~31) + 16;
720 } else {
721 hwirq_base = 32;
722 }
723
724 /*
725 * Find out how many interrupts are supported.
726 * The GIC only supports up to 1020 interrupt sources.
727 */
728 gic_irqs = readl_relaxed(gic_data_dist_base(gic) + GIC_DIST_CTR) & 0x1f;
729 gic_irqs = (gic_irqs + 1) * 32;
730 if (gic_irqs > 1020)
731 gic_irqs = 1020;
732 gic->gic_irqs = gic_irqs;
733
734 gic_irqs -= hwirq_base; /* calculate # of irqs to allocate */
735 irq_base = irq_alloc_descs(irq_start, 16, gic_irqs, numa_node_id());
736 if (IS_ERR_VALUE(irq_base)) {
737 WARN(1, "Cannot allocate irq_descs @ IRQ%d, assuming pre-allocated\n",
738 irq_start);
739 irq_base = irq_start;
740 }
741 gic->domain = irq_domain_add_legacy(node, gic_irqs, irq_base,
742 hwirq_base, &gic_irq_domain_ops, gic);
743 if (WARN_ON(!gic->domain))
744 return;
745
746 gic_chip.flags |= gic_arch_extn.flags;
747 gic_dist_init(gic);
748 gic_cpu_init(gic);
749 gic_pm_init(gic);
750}
751
752void __cpuinit gic_secondary_init(unsigned int gic_nr)
753{
754 BUG_ON(gic_nr >= MAX_GIC_NR);
755
756 gic_cpu_init(&gic_data[gic_nr]);
757}
758
759#ifdef CONFIG_SMP
760void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
761{
762 int cpu;
763 unsigned long map = 0;
764
765 /* Convert our logical CPU mask into a physical one. */
766 for_each_cpu(cpu, mask)
767 map |= gic_cpu_map[cpu];
768
769 /*
770 * Ensure that stores to Normal memory are visible to the
771 * other CPUs before issuing the IPI.
772 */
773 dsb();
774
775 /* this always happens on GIC0 */
776 writel_relaxed(map << 16 | irq, gic_data_dist_base(&gic_data[0]) + GIC_DIST_SOFTINT);
777}
778#endif
779
780#ifdef CONFIG_OF
781static int gic_cnt __initdata = 0;
782
783int __init gic_of_init(struct device_node *node, struct device_node *parent)
784{
785 void __iomem *cpu_base;
786 void __iomem *dist_base;
787 u32 percpu_offset;
788 int irq;
789
790 if (WARN_ON(!node))
791 return -ENODEV;
792
793 dist_base = of_iomap(node, 0);
794 WARN(!dist_base, "unable to map gic dist registers\n");
795
796 cpu_base = of_iomap(node, 1);
797 WARN(!cpu_base, "unable to map gic cpu registers\n");
798
799 if (of_property_read_u32(node, "cpu-offset", &percpu_offset))
800 percpu_offset = 0;
801
802 gic_init_bases(gic_cnt, -1, dist_base, cpu_base, percpu_offset, node);
803
804 if (parent) {
805 irq = irq_of_parse_and_map(node, 0);
806 gic_cascade_irq(gic_cnt, irq);
807 }
808 gic_cnt++;
809 return 0;
810}
811#endif
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c
deleted file mode 100644
index 8f324b99416e..000000000000
--- a/arch/arm/common/vic.c
+++ /dev/null
@@ -1,464 +0,0 @@
1/*
2 * linux/arch/arm/common/vic.c
3 *
4 * Copyright (C) 1999 - 2003 ARM Limited
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 as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22#include <linux/export.h>
23#include <linux/init.h>
24#include <linux/list.h>
25#include <linux/io.h>
26#include <linux/irqdomain.h>
27#include <linux/of.h>
28#include <linux/of_address.h>
29#include <linux/of_irq.h>
30#include <linux/syscore_ops.h>
31#include <linux/device.h>
32#include <linux/amba/bus.h>
33
34#include <asm/exception.h>
35#include <asm/mach/irq.h>
36#include <asm/hardware/vic.h>
37
38/**
39 * struct vic_device - VIC PM device
40 * @irq: The IRQ number for the base of the VIC.
41 * @base: The register base for the VIC.
42 * @valid_sources: A bitmask of valid interrupts
43 * @resume_sources: A bitmask of interrupts for resume.
44 * @resume_irqs: The IRQs enabled for resume.
45 * @int_select: Save for VIC_INT_SELECT.
46 * @int_enable: Save for VIC_INT_ENABLE.
47 * @soft_int: Save for VIC_INT_SOFT.
48 * @protect: Save for VIC_PROTECT.
49 * @domain: The IRQ domain for the VIC.
50 */
51struct vic_device {
52 void __iomem *base;
53 int irq;
54 u32 valid_sources;
55 u32 resume_sources;
56 u32 resume_irqs;
57 u32 int_select;
58 u32 int_enable;
59 u32 soft_int;
60 u32 protect;
61 struct irq_domain *domain;
62};
63
64/* we cannot allocate memory when VICs are initially registered */
65static struct vic_device vic_devices[CONFIG_ARM_VIC_NR];
66
67static int vic_id;
68
69/**
70 * vic_init2 - common initialisation code
71 * @base: Base of the VIC.
72 *
73 * Common initialisation code for registration
74 * and resume.
75*/
76static void vic_init2(void __iomem *base)
77{
78 int i;
79
80 for (i = 0; i < 16; i++) {
81 void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4);
82 writel(VIC_VECT_CNTL_ENABLE | i, reg);
83 }
84
85 writel(32, base + VIC_PL190_DEF_VECT_ADDR);
86}
87
88#ifdef CONFIG_PM
89static void resume_one_vic(struct vic_device *vic)
90{
91 void __iomem *base = vic->base;
92
93 printk(KERN_DEBUG "%s: resuming vic at %p\n", __func__, base);
94
95 /* re-initialise static settings */
96 vic_init2(base);
97
98 writel(vic->int_select, base + VIC_INT_SELECT);
99 writel(vic->protect, base + VIC_PROTECT);
100
101 /* set the enabled ints and then clear the non-enabled */
102 writel(vic->int_enable, base + VIC_INT_ENABLE);
103 writel(~vic->int_enable, base + VIC_INT_ENABLE_CLEAR);
104
105 /* and the same for the soft-int register */
106
107 writel(vic->soft_int, base + VIC_INT_SOFT);
108 writel(~vic->soft_int, base + VIC_INT_SOFT_CLEAR);
109}
110
111static void vic_resume(void)
112{
113 int id;
114
115 for (id = vic_id - 1; id >= 0; id--)
116 resume_one_vic(vic_devices + id);
117}
118
119static void suspend_one_vic(struct vic_device *vic)
120{
121 void __iomem *base = vic->base;
122
123 printk(KERN_DEBUG "%s: suspending vic at %p\n", __func__, base);
124
125 vic->int_select = readl(base + VIC_INT_SELECT);
126 vic->int_enable = readl(base + VIC_INT_ENABLE);
127 vic->soft_int = readl(base + VIC_INT_SOFT);
128 vic->protect = readl(base + VIC_PROTECT);
129
130 /* set the interrupts (if any) that are used for
131 * resuming the system */
132
133 writel(vic->resume_irqs, base + VIC_INT_ENABLE);
134 writel(~vic->resume_irqs, base + VIC_INT_ENABLE_CLEAR);
135}
136
137static int vic_suspend(void)
138{
139 int id;
140
141 for (id = 0; id < vic_id; id++)
142 suspend_one_vic(vic_devices + id);
143
144 return 0;
145}
146
147struct syscore_ops vic_syscore_ops = {
148 .suspend = vic_suspend,
149 .resume = vic_resume,
150};
151
152/**
153 * vic_pm_init - initicall to register VIC pm
154 *
155 * This is called via late_initcall() to register
156 * the resources for the VICs due to the early
157 * nature of the VIC's registration.
158*/
159static int __init vic_pm_init(void)
160{
161 if (vic_id > 0)
162 register_syscore_ops(&vic_syscore_ops);
163
164 return 0;
165}
166late_initcall(vic_pm_init);
167#endif /* CONFIG_PM */
168
169static struct irq_chip vic_chip;
170
171static int vic_irqdomain_map(struct irq_domain *d, unsigned int irq,
172 irq_hw_number_t hwirq)
173{
174 struct vic_device *v = d->host_data;
175
176 /* Skip invalid IRQs, only register handlers for the real ones */
177 if (!(v->valid_sources & (1 << hwirq)))
178 return -ENOTSUPP;
179 irq_set_chip_and_handler(irq, &vic_chip, handle_level_irq);
180 irq_set_chip_data(irq, v->base);
181 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
182 return 0;
183}
184
185static struct irq_domain_ops vic_irqdomain_ops = {
186 .map = vic_irqdomain_map,
187 .xlate = irq_domain_xlate_onetwocell,
188};
189
190/**
191 * vic_register() - Register a VIC.
192 * @base: The base address of the VIC.
193 * @irq: The base IRQ for the VIC.
194 * @valid_sources: bitmask of valid interrupts
195 * @resume_sources: bitmask of interrupts allowed for resume sources.
196 * @node: The device tree node associated with the VIC.
197 *
198 * Register the VIC with the system device tree so that it can be notified
199 * of suspend and resume requests and ensure that the correct actions are
200 * taken to re-instate the settings on resume.
201 *
202 * This also configures the IRQ domain for the VIC.
203 */
204static void __init vic_register(void __iomem *base, unsigned int irq,
205 u32 valid_sources, u32 resume_sources,
206 struct device_node *node)
207{
208 struct vic_device *v;
209 int i;
210
211 if (vic_id >= ARRAY_SIZE(vic_devices)) {
212 printk(KERN_ERR "%s: too few VICs, increase CONFIG_ARM_VIC_NR\n", __func__);
213 return;
214 }
215
216 v = &vic_devices[vic_id];
217 v->base = base;
218 v->valid_sources = valid_sources;
219 v->resume_sources = resume_sources;
220 v->irq = irq;
221 vic_id++;
222 v->domain = irq_domain_add_simple(node, fls(valid_sources), irq,
223 &vic_irqdomain_ops, v);
224 /* create an IRQ mapping for each valid IRQ */
225 for (i = 0; i < fls(valid_sources); i++)
226 if (valid_sources & (1 << i))
227 irq_create_mapping(v->domain, i);
228}
229
230static void vic_ack_irq(struct irq_data *d)
231{
232 void __iomem *base = irq_data_get_irq_chip_data(d);
233 unsigned int irq = d->hwirq;
234 writel(1 << irq, base + VIC_INT_ENABLE_CLEAR);
235 /* moreover, clear the soft-triggered, in case it was the reason */
236 writel(1 << irq, base + VIC_INT_SOFT_CLEAR);
237}
238
239static void vic_mask_irq(struct irq_data *d)
240{
241 void __iomem *base = irq_data_get_irq_chip_data(d);
242 unsigned int irq = d->hwirq;
243 writel(1 << irq, base + VIC_INT_ENABLE_CLEAR);
244}
245
246static void vic_unmask_irq(struct irq_data *d)
247{
248 void __iomem *base = irq_data_get_irq_chip_data(d);
249 unsigned int irq = d->hwirq;
250 writel(1 << irq, base + VIC_INT_ENABLE);
251}
252
253#if defined(CONFIG_PM)
254static struct vic_device *vic_from_irq(unsigned int irq)
255{
256 struct vic_device *v = vic_devices;
257 unsigned int base_irq = irq & ~31;
258 int id;
259
260 for (id = 0; id < vic_id; id++, v++) {
261 if (v->irq == base_irq)
262 return v;
263 }
264
265 return NULL;
266}
267
268static int vic_set_wake(struct irq_data *d, unsigned int on)
269{
270 struct vic_device *v = vic_from_irq(d->irq);
271 unsigned int off = d->hwirq;
272 u32 bit = 1 << off;
273
274 if (!v)
275 return -EINVAL;
276
277 if (!(bit & v->resume_sources))
278 return -EINVAL;
279
280 if (on)
281 v->resume_irqs |= bit;
282 else
283 v->resume_irqs &= ~bit;
284
285 return 0;
286}
287#else
288#define vic_set_wake NULL
289#endif /* CONFIG_PM */
290
291static struct irq_chip vic_chip = {
292 .name = "VIC",
293 .irq_ack = vic_ack_irq,
294 .irq_mask = vic_mask_irq,
295 .irq_unmask = vic_unmask_irq,
296 .irq_set_wake = vic_set_wake,
297};
298
299static void __init vic_disable(void __iomem *base)
300{
301 writel(0, base + VIC_INT_SELECT);
302 writel(0, base + VIC_INT_ENABLE);
303 writel(~0, base + VIC_INT_ENABLE_CLEAR);
304 writel(0, base + VIC_ITCR);
305 writel(~0, base + VIC_INT_SOFT_CLEAR);
306}
307
308static void __init vic_clear_interrupts(void __iomem *base)
309{
310 unsigned int i;
311
312 writel(0, base + VIC_PL190_VECT_ADDR);
313 for (i = 0; i < 19; i++) {
314 unsigned int value;
315
316 value = readl(base + VIC_PL190_VECT_ADDR);
317 writel(value, base + VIC_PL190_VECT_ADDR);
318 }
319}
320
321/*
322 * The PL190 cell from ARM has been modified by ST to handle 64 interrupts.
323 * The original cell has 32 interrupts, while the modified one has 64,
324 * replocating two blocks 0x00..0x1f in 0x20..0x3f. In that case
325 * the probe function is called twice, with base set to offset 000
326 * and 020 within the page. We call this "second block".
327 */
328static void __init vic_init_st(void __iomem *base, unsigned int irq_start,
329 u32 vic_sources, struct device_node *node)
330{
331 unsigned int i;
332 int vic_2nd_block = ((unsigned long)base & ~PAGE_MASK) != 0;
333
334 /* Disable all interrupts initially. */
335 vic_disable(base);
336
337 /*
338 * Make sure we clear all existing interrupts. The vector registers
339 * in this cell are after the second block of general registers,
340 * so we can address them using standard offsets, but only from
341 * the second base address, which is 0x20 in the page
342 */
343 if (vic_2nd_block) {
344 vic_clear_interrupts(base);
345
346 /* ST has 16 vectors as well, but we don't enable them by now */
347 for (i = 0; i < 16; i++) {
348 void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4);
349 writel(0, reg);
350 }
351
352 writel(32, base + VIC_PL190_DEF_VECT_ADDR);
353 }
354
355 vic_register(base, irq_start, vic_sources, 0, node);
356}
357
358void __init __vic_init(void __iomem *base, int irq_start,
359 u32 vic_sources, u32 resume_sources,
360 struct device_node *node)
361{
362 unsigned int i;
363 u32 cellid = 0;
364 enum amba_vendor vendor;
365
366 /* Identify which VIC cell this one is, by reading the ID */
367 for (i = 0; i < 4; i++) {
368 void __iomem *addr;
369 addr = (void __iomem *)((u32)base & PAGE_MASK) + 0xfe0 + (i * 4);
370 cellid |= (readl(addr) & 0xff) << (8 * i);
371 }
372 vendor = (cellid >> 12) & 0xff;
373 printk(KERN_INFO "VIC @%p: id 0x%08x, vendor 0x%02x\n",
374 base, cellid, vendor);
375
376 switch(vendor) {
377 case AMBA_VENDOR_ST:
378 vic_init_st(base, irq_start, vic_sources, node);
379 return;
380 default:
381 printk(KERN_WARNING "VIC: unknown vendor, continuing anyways\n");
382 /* fall through */
383 case AMBA_VENDOR_ARM:
384 break;
385 }
386
387 /* Disable all interrupts initially. */
388 vic_disable(base);
389
390 /* Make sure we clear all existing interrupts */
391 vic_clear_interrupts(base);
392
393 vic_init2(base);
394
395 vic_register(base, irq_start, vic_sources, resume_sources, node);
396}
397
398/**
399 * vic_init() - initialise a vectored interrupt controller
400 * @base: iomem base address
401 * @irq_start: starting interrupt number, must be muliple of 32
402 * @vic_sources: bitmask of interrupt sources to allow
403 * @resume_sources: bitmask of interrupt sources to allow for resume
404 */
405void __init vic_init(void __iomem *base, unsigned int irq_start,
406 u32 vic_sources, u32 resume_sources)
407{
408 __vic_init(base, irq_start, vic_sources, resume_sources, NULL);
409}
410
411#ifdef CONFIG_OF
412int __init vic_of_init(struct device_node *node, struct device_node *parent)
413{
414 void __iomem *regs;
415
416 if (WARN(parent, "non-root VICs are not supported"))
417 return -EINVAL;
418
419 regs = of_iomap(node, 0);
420 if (WARN_ON(!regs))
421 return -EIO;
422
423 /*
424 * Passing 0 as first IRQ makes the simple domain allocate descriptors
425 */
426 __vic_init(regs, 0, ~0, ~0, node);
427
428 return 0;
429}
430#endif /* CONFIG OF */
431
432/*
433 * Handle each interrupt in a single VIC. Returns non-zero if we've
434 * handled at least one interrupt. This reads the status register
435 * before handling each interrupt, which is necessary given that
436 * handle_IRQ may briefly re-enable interrupts for soft IRQ handling.
437 */
438static int handle_one_vic(struct vic_device *vic, struct pt_regs *regs)
439{
440 u32 stat, irq;
441 int handled = 0;
442
443 while ((stat = readl_relaxed(vic->base + VIC_IRQ_STATUS))) {
444 irq = ffs(stat) - 1;
445 handle_IRQ(irq_find_mapping(vic->domain, irq), regs);
446 handled = 1;
447 }
448
449 return handled;
450}
451
452/*
453 * Keep iterating over all registered VIC's until there are no pending
454 * interrupts.
455 */
456asmlinkage void __exception_irq_entry vic_handle_irq(struct pt_regs *regs)
457{
458 int i, handled;
459
460 do {
461 for (i = 0, handled = 0; i < vic_id; ++i)
462 handled |= handle_one_vic(&vic_devices[i], regs);
463 } while (handled);
464}
diff --git a/arch/arm/configs/armadillo800eva_defconfig b/arch/arm/configs/armadillo800eva_defconfig
index 2e1a82577207..0b98100d2ae7 100644
--- a/arch/arm/configs/armadillo800eva_defconfig
+++ b/arch/arm/configs/armadillo800eva_defconfig
@@ -34,12 +34,11 @@ CONFIG_AEABI=y
34CONFIG_FORCE_MAX_ZONEORDER=13 34CONFIG_FORCE_MAX_ZONEORDER=13
35CONFIG_ZBOOT_ROM_TEXT=0x0 35CONFIG_ZBOOT_ROM_TEXT=0x0
36CONFIG_ZBOOT_ROM_BSS=0x0 36CONFIG_ZBOOT_ROM_BSS=0x0
37CONFIG_CMDLINE="console=tty0 console=ttySC1,115200 earlyprintk=sh-sci.1,115200 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096 rw" 37CONFIG_ARM_APPENDED_DTB=y
38CONFIG_CMDLINE_FORCE=y
39CONFIG_KEXEC=y 38CONFIG_KEXEC=y
40CONFIG_VFP=y 39CONFIG_VFP=y
41# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 40# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
42# CONFIG_SUSPEND is not set 41CONFIG_PM_RUNTIME=y
43CONFIG_NET=y 42CONFIG_NET=y
44CONFIG_PACKET=y 43CONFIG_PACKET=y
45CONFIG_UNIX=y 44CONFIG_UNIX=y
@@ -91,14 +90,11 @@ CONFIG_I2C_SH_MOBILE=y
91# CONFIG_HWMON is not set 90# CONFIG_HWMON is not set
92CONFIG_MEDIA_SUPPORT=y 91CONFIG_MEDIA_SUPPORT=y
93CONFIG_VIDEO_DEV=y 92CONFIG_VIDEO_DEV=y
94# CONFIG_RC_CORE is not set 93CONFIG_MEDIA_CAMERA_SUPPORT=y
95# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
96# CONFIG_V4L_USB_DRIVERS is not set
97CONFIG_V4L_PLATFORM_DRIVERS=y 94CONFIG_V4L_PLATFORM_DRIVERS=y
98CONFIG_SOC_CAMERA=y 95CONFIG_SOC_CAMERA=y
99CONFIG_SOC_CAMERA_MT9T112=y 96CONFIG_SOC_CAMERA_MT9T112=y
100CONFIG_VIDEO_SH_MOBILE_CEU=y 97CONFIG_VIDEO_SH_MOBILE_CEU=y
101# CONFIG_RADIO_ADAPTERS is not set
102CONFIG_FB=y 98CONFIG_FB=y
103CONFIG_FB_SH_MOBILE_LCDC=y 99CONFIG_FB_SH_MOBILE_LCDC=y
104CONFIG_FB_SH_MOBILE_HDMI=y 100CONFIG_FB_SH_MOBILE_HDMI=y
diff --git a/arch/arm/configs/at91sam9263_defconfig b/arch/arm/configs/at91sam9263_defconfig
index c5212f43eee6..36fed66bd4b5 100644
--- a/arch/arm/configs/at91sam9263_defconfig
+++ b/arch/arm/configs/at91sam9263_defconfig
@@ -18,7 +18,6 @@ CONFIG_ARCH_AT91=y
18CONFIG_ARCH_AT91SAM9263=y 18CONFIG_ARCH_AT91SAM9263=y
19CONFIG_MACH_AT91SAM9263EK=y 19CONFIG_MACH_AT91SAM9263EK=y
20CONFIG_MACH_USB_A9263=y 20CONFIG_MACH_USB_A9263=y
21CONFIG_MACH_NEOCORE926=y
22CONFIG_MTD_AT91_DATAFLASH_CARD=y 21CONFIG_MTD_AT91_DATAFLASH_CARD=y
23# CONFIG_ARM_THUMB is not set 22# CONFIG_ARM_THUMB is not set
24CONFIG_AEABI=y 23CONFIG_AEABI=y
diff --git a/arch/arm/configs/bcm2835_defconfig b/arch/arm/configs/bcm2835_defconfig
index 74e27f0ff6ad..af472e4ed451 100644
--- a/arch/arm/configs/bcm2835_defconfig
+++ b/arch/arm/configs/bcm2835_defconfig
@@ -1,11 +1,10 @@
1CONFIG_EXPERIMENTAL=y
2# CONFIG_LOCALVERSION_AUTO is not set 1# CONFIG_LOCALVERSION_AUTO is not set
3CONFIG_SYSVIPC=y 2CONFIG_SYSVIPC=y
4CONFIG_BSD_PROCESS_ACCT=y
5CONFIG_BSD_PROCESS_ACCT_V3=y
6CONFIG_FHANDLE=y 3CONFIG_FHANDLE=y
7CONFIG_NO_HZ=y 4CONFIG_NO_HZ=y
8CONFIG_HIGH_RES_TIMERS=y 5CONFIG_HIGH_RES_TIMERS=y
6CONFIG_BSD_PROCESS_ACCT=y
7CONFIG_BSD_PROCESS_ACCT_V3=y
9CONFIG_LOG_BUF_SHIFT=18 8CONFIG_LOG_BUF_SHIFT=18
10CONFIG_CGROUP_FREEZER=y 9CONFIG_CGROUP_FREEZER=y
11CONFIG_CGROUP_DEVICE=y 10CONFIG_CGROUP_DEVICE=y
@@ -30,13 +29,10 @@ CONFIG_EMBEDDED=y
30CONFIG_PROFILING=y 29CONFIG_PROFILING=y
31CONFIG_OPROFILE=y 30CONFIG_OPROFILE=y
32CONFIG_JUMP_LABEL=y 31CONFIG_JUMP_LABEL=y
33# CONFIG_BLOCK is not set
34CONFIG_ARCH_BCM2835=y 32CONFIG_ARCH_BCM2835=y
35CONFIG_PREEMPT_VOLUNTARY=y 33CONFIG_PREEMPT_VOLUNTARY=y
36CONFIG_AEABI=y 34CONFIG_AEABI=y
37CONFIG_COMPACTION=y
38CONFIG_KSM=y 35CONFIG_KSM=y
39CONFIG_DEFAULT_MMAP_MIN_ADDR=65536
40CONFIG_CLEANCACHE=y 36CONFIG_CLEANCACHE=y
41CONFIG_SECCOMP=y 37CONFIG_SECCOMP=y
42CONFIG_CC_STACKPROTECTOR=y 38CONFIG_CC_STACKPROTECTOR=y
@@ -45,6 +41,11 @@ CONFIG_CRASH_DUMP=y
45CONFIG_VFP=y 41CONFIG_VFP=y
46# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 42# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
47# CONFIG_SUSPEND is not set 43# CONFIG_SUSPEND is not set
44CONFIG_NET=y
45CONFIG_UNIX=y
46CONFIG_INET=y
47CONFIG_NETWORK_SECMARK=y
48# CONFIG_WIRELESS is not set
48CONFIG_DEVTMPFS=y 49CONFIG_DEVTMPFS=y
49CONFIG_DEVTMPFS_MOUNT=y 50CONFIG_DEVTMPFS_MOUNT=y
50# CONFIG_STANDALONE is not set 51# CONFIG_STANDALONE is not set
@@ -53,20 +54,42 @@ CONFIG_DEVTMPFS_MOUNT=y
53# CONFIG_INPUT_MOUSE is not set 54# CONFIG_INPUT_MOUSE is not set
54# CONFIG_SERIO is not set 55# CONFIG_SERIO is not set
55# CONFIG_VT is not set 56# CONFIG_VT is not set
56# CONFIG_UNIX98_PTYS is not set
57# CONFIG_LEGACY_PTYS is not set 57# CONFIG_LEGACY_PTYS is not set
58# CONFIG_DEVKMEM is not set 58# CONFIG_DEVKMEM is not set
59CONFIG_SERIAL_AMBA_PL011=y 59CONFIG_SERIAL_AMBA_PL011=y
60CONFIG_SERIAL_AMBA_PL011_CONSOLE=y 60CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
61CONFIG_TTY_PRINTK=y 61CONFIG_TTY_PRINTK=y
62# CONFIG_HW_RANDOM is not set 62# CONFIG_HW_RANDOM is not set
63CONFIG_I2C=y
64CONFIG_I2C_CHARDEV=y
65CONFIG_I2C_BCM2835=y
66CONFIG_GPIO_SYSFS=y
63# CONFIG_HWMON is not set 67# CONFIG_HWMON is not set
64# CONFIG_USB_SUPPORT is not set 68# CONFIG_USB_SUPPORT is not set
69CONFIG_MMC=y
70CONFIG_MMC_SDHCI=y
71CONFIG_MMC_SDHCI_PLTFM=y
72CONFIG_MMC_SDHCI_BCM2835=y
65# CONFIG_IOMMU_SUPPORT is not set 73# CONFIG_IOMMU_SUPPORT is not set
66# CONFIG_FILE_LOCKING is not set 74CONFIG_EXT2_FS=y
67# CONFIG_DNOTIFY is not set 75CONFIG_EXT2_FS_XATTR=y
68# CONFIG_INOTIFY_USER is not set 76CONFIG_EXT2_FS_POSIX_ACL=y
77CONFIG_EXT3_FS=y
78CONFIG_EXT3_FS_POSIX_ACL=y
79CONFIG_EXT4_FS=y
80CONFIG_EXT4_FS_POSIX_ACL=y
81CONFIG_FANOTIFY=y
82CONFIG_MSDOS_FS=y
83CONFIG_VFAT_FS=y
84CONFIG_TMPFS=y
85CONFIG_TMPFS_POSIX_ACL=y
69# CONFIG_MISC_FILESYSTEMS is not set 86# CONFIG_MISC_FILESYSTEMS is not set
87CONFIG_NFS_FS=y
88CONFIG_NFSD=y
89CONFIG_NLS_CODEPAGE_437=y
90CONFIG_NLS_ASCII=y
91CONFIG_NLS_ISO8859_1=y
92CONFIG_NLS_UTF8=y
70CONFIG_PRINTK_TIME=y 93CONFIG_PRINTK_TIME=y
71# CONFIG_ENABLE_WARN_DEPRECATED is not set 94# CONFIG_ENABLE_WARN_DEPRECATED is not set
72# CONFIG_ENABLE_MUST_CHECK is not set 95# CONFIG_ENABLE_MUST_CHECK is not set
diff --git a/arch/arm/configs/da8xx_omapl_defconfig b/arch/arm/configs/da8xx_omapl_defconfig
index f29223954af8..9aaad36a1728 100644
--- a/arch/arm/configs/da8xx_omapl_defconfig
+++ b/arch/arm/configs/da8xx_omapl_defconfig
@@ -36,6 +36,7 @@ CONFIG_CPU_FREQ_GOV_PERFORMANCE=m
36CONFIG_CPU_FREQ_GOV_POWERSAVE=m 36CONFIG_CPU_FREQ_GOV_POWERSAVE=m
37CONFIG_CPU_FREQ_GOV_ONDEMAND=m 37CONFIG_CPU_FREQ_GOV_ONDEMAND=m
38CONFIG_CPU_IDLE=y 38CONFIG_CPU_IDLE=y
39CONFIG_PM_RUNTIME=y
39CONFIG_NET=y 40CONFIG_NET=y
40CONFIG_PACKET=y 41CONFIG_PACKET=y
41CONFIG_UNIX=y 42CONFIG_UNIX=y
@@ -45,6 +46,8 @@ CONFIG_IP_PNP_DHCP=y
45# CONFIG_INET_LRO is not set 46# CONFIG_INET_LRO is not set
46CONFIG_NETFILTER=y 47CONFIG_NETFILTER=y
47CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 48CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
49CONFIG_DEVTMPFS=y
50CONFIG_DEVTMPFS_MOUNT=y
48# CONFIG_FW_LOADER is not set 51# CONFIG_FW_LOADER is not set
49CONFIG_BLK_DEV_LOOP=m 52CONFIG_BLK_DEV_LOOP=m
50CONFIG_BLK_DEV_RAM=y 53CONFIG_BLK_DEV_RAM=y
@@ -81,6 +84,7 @@ CONFIG_SERIAL_OF_PLATFORM=y
81CONFIG_I2C=y 84CONFIG_I2C=y
82CONFIG_I2C_CHARDEV=y 85CONFIG_I2C_CHARDEV=y
83CONFIG_I2C_DAVINCI=y 86CONFIG_I2C_DAVINCI=y
87CONFIG_PINCTRL_SINGLE=y
84# CONFIG_HWMON is not set 88# CONFIG_HWMON is not set
85CONFIG_WATCHDOG=y 89CONFIG_WATCHDOG=y
86CONFIG_REGULATOR=y 90CONFIG_REGULATOR=y
diff --git a/arch/arm/configs/davinci_all_defconfig b/arch/arm/configs/davinci_all_defconfig
index 4ea7c95719d2..3edc78a40b66 100644
--- a/arch/arm/configs/davinci_all_defconfig
+++ b/arch/arm/configs/davinci_all_defconfig
@@ -33,6 +33,7 @@ CONFIG_AEABI=y
33CONFIG_LEDS=y 33CONFIG_LEDS=y
34CONFIG_ZBOOT_ROM_TEXT=0x0 34CONFIG_ZBOOT_ROM_TEXT=0x0
35CONFIG_ZBOOT_ROM_BSS=0x0 35CONFIG_ZBOOT_ROM_BSS=0x0
36CONFIG_PM_RUNTIME=y
36CONFIG_NET=y 37CONFIG_NET=y
37CONFIG_PACKET=y 38CONFIG_PACKET=y
38CONFIG_UNIX=y 39CONFIG_UNIX=y
@@ -42,6 +43,8 @@ CONFIG_IP_PNP_DHCP=y
42# CONFIG_INET_LRO is not set 43# CONFIG_INET_LRO is not set
43CONFIG_NETFILTER=y 44CONFIG_NETFILTER=y
44CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 45CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
46CONFIG_DEVTMPFS=y
47CONFIG_DEVTMPFS_MOUNT=y
45# CONFIG_FW_LOADER is not set 48# CONFIG_FW_LOADER is not set
46CONFIG_MTD=m 49CONFIG_MTD=m
47CONFIG_MTD_PARTITIONS=y 50CONFIG_MTD_PARTITIONS=y
diff --git a/arch/arm/configs/dove_defconfig b/arch/arm/configs/dove_defconfig
index 0b7ee92c5713..3fe8dae8d32d 100644
--- a/arch/arm/configs/dove_defconfig
+++ b/arch/arm/configs/dove_defconfig
@@ -1,26 +1,24 @@
1CONFIG_EXPERIMENTAL=y 1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y 2CONFIG_SYSVIPC=y
3CONFIG_NO_HZ=y
4CONFIG_HIGH_RES_TIMERS=y
3CONFIG_LOG_BUF_SHIFT=14 5CONFIG_LOG_BUF_SHIFT=14
4CONFIG_EXPERT=y 6CONFIG_EXPERT=y
5CONFIG_SLAB=y 7CONFIG_SLAB=y
6CONFIG_MODULES=y 8CONFIG_MODULES=y
7CONFIG_MODULE_UNLOAD=y 9CONFIG_MODULE_UNLOAD=y
8# CONFIG_BLK_DEV_BSG is not set 10# CONFIG_BLK_DEV_BSG is not set
11CONFIG_PARTITION_ADVANCED=y
9CONFIG_ARCH_DOVE=y 12CONFIG_ARCH_DOVE=y
10CONFIG_MACH_DOVE_DB=y 13CONFIG_MACH_DOVE_DB=y
11CONFIG_MACH_CM_A510=y 14CONFIG_MACH_CM_A510=y
12CONFIG_MACH_DOVE_DT=y 15CONFIG_MACH_DOVE_DT=y
13CONFIG_NO_HZ=y
14CONFIG_HIGH_RES_TIMERS=y
15CONFIG_AEABI=y 16CONFIG_AEABI=y
17CONFIG_HIGHMEM=y
16CONFIG_ZBOOT_ROM_TEXT=0x0 18CONFIG_ZBOOT_ROM_TEXT=0x0
17CONFIG_ZBOOT_ROM_BSS=0x0 19CONFIG_ZBOOT_ROM_BSS=0x0
18CONFIG_HIGHMEM=y
19CONFIG_USE_OF=y
20CONFIG_ATAGS=y
21CONFIG_ARM_APPENDED_DTB=y 20CONFIG_ARM_APPENDED_DTB=y
22CONFIG_ARM_ATAG_DTB_COMPAT=y 21CONFIG_ARM_ATAG_DTB_COMPAT=y
23CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y
24CONFIG_VFP=y 22CONFIG_VFP=y
25CONFIG_NET=y 23CONFIG_NET=y
26CONFIG_PACKET=y 24CONFIG_PACKET=y
@@ -32,8 +30,9 @@ CONFIG_IP_PNP_DHCP=y
32CONFIG_IP_PNP_BOOTP=y 30CONFIG_IP_PNP_BOOTP=y
33# CONFIG_IPV6 is not set 31# CONFIG_IPV6 is not set
34CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 32CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
33CONFIG_DEVTMPFS=y
34CONFIG_DEVTMPFS_MOUNT=y
35CONFIG_MTD=y 35CONFIG_MTD=y
36CONFIG_MTD_PARTITIONS=y
37CONFIG_MTD_CMDLINE_PARTS=y 36CONFIG_MTD_CMDLINE_PARTS=y
38CONFIG_MTD_CHAR=y 37CONFIG_MTD_CHAR=y
39CONFIG_MTD_BLOCK=y 38CONFIG_MTD_BLOCK=y
@@ -57,7 +56,6 @@ CONFIG_ATA=y
57CONFIG_SATA_MV=y 56CONFIG_SATA_MV=y
58CONFIG_NETDEVICES=y 57CONFIG_NETDEVICES=y
59CONFIG_MV643XX_ETH=y 58CONFIG_MV643XX_ETH=y
60# CONFIG_NETDEV_10000 is not set
61CONFIG_INPUT_POLLDEV=y 59CONFIG_INPUT_POLLDEV=y
62# CONFIG_INPUT_MOUSEDEV is not set 60# CONFIG_INPUT_MOUSEDEV is not set
63CONFIG_INPUT_EVDEV=y 61CONFIG_INPUT_EVDEV=y
@@ -68,10 +66,7 @@ CONFIG_LEGACY_PTY_COUNT=16
68# CONFIG_DEVKMEM is not set 66# CONFIG_DEVKMEM is not set
69CONFIG_SERIAL_8250=y 67CONFIG_SERIAL_8250=y
70CONFIG_SERIAL_8250_CONSOLE=y 68CONFIG_SERIAL_8250_CONSOLE=y
71# CONFIG_SERIAL_8250_PCI is not set
72CONFIG_SERIAL_8250_RUNTIME_UARTS=2 69CONFIG_SERIAL_8250_RUNTIME_UARTS=2
73CONFIG_SERIAL_CORE=y
74CONFIG_SERIAL_CORE_CONSOLE=y
75CONFIG_SERIAL_OF_PLATFORM=y 70CONFIG_SERIAL_OF_PLATFORM=y
76# CONFIG_HW_RANDOM is not set 71# CONFIG_HW_RANDOM is not set
77CONFIG_I2C=y 72CONFIG_I2C=y
@@ -81,13 +76,11 @@ CONFIG_SPI=y
81CONFIG_SPI_ORION=y 76CONFIG_SPI_ORION=y
82# CONFIG_HWMON is not set 77# CONFIG_HWMON is not set
83CONFIG_USB=y 78CONFIG_USB=y
84CONFIG_USB_DEVICEFS=y
85CONFIG_USB_EHCI_HCD=y 79CONFIG_USB_EHCI_HCD=y
86CONFIG_USB_EHCI_ROOT_HUB_TT=y 80CONFIG_USB_EHCI_ROOT_HUB_TT=y
87CONFIG_USB_STORAGE=y 81CONFIG_USB_STORAGE=y
88CONFIG_MMC=y 82CONFIG_MMC=y
89CONFIG_MMC_SDHCI=y 83CONFIG_MMC_SDHCI=y
90CONFIG_MMC_SDHCI_IO_ACCESSORS=y
91CONFIG_MMC_SDHCI_PLTFM=y 84CONFIG_MMC_SDHCI_PLTFM=y
92CONFIG_MMC_SDHCI_DOVE=y 85CONFIG_MMC_SDHCI_DOVE=y
93CONFIG_NEW_LEDS=y 86CONFIG_NEW_LEDS=y
@@ -104,6 +97,7 @@ CONFIG_MV_XOR=y
104CONFIG_EXT2_FS=y 97CONFIG_EXT2_FS=y
105CONFIG_EXT3_FS=y 98CONFIG_EXT3_FS=y
106# CONFIG_EXT3_FS_XATTR is not set 99# CONFIG_EXT3_FS_XATTR is not set
100CONFIG_EXT4_FS=y
107CONFIG_ISO9660_FS=y 101CONFIG_ISO9660_FS=y
108CONFIG_JOLIET=y 102CONFIG_JOLIET=y
109CONFIG_UDF_FS=m 103CONFIG_UDF_FS=m
@@ -112,24 +106,20 @@ CONFIG_VFAT_FS=y
112CONFIG_TMPFS=y 106CONFIG_TMPFS=y
113CONFIG_JFFS2_FS=y 107CONFIG_JFFS2_FS=y
114CONFIG_NFS_FS=y 108CONFIG_NFS_FS=y
115CONFIG_NFS_V3=y
116CONFIG_ROOT_NFS=y 109CONFIG_ROOT_NFS=y
117CONFIG_PARTITION_ADVANCED=y
118CONFIG_NLS_CODEPAGE_437=y 110CONFIG_NLS_CODEPAGE_437=y
119CONFIG_NLS_CODEPAGE_850=y 111CONFIG_NLS_CODEPAGE_850=y
120CONFIG_NLS_ISO8859_1=y 112CONFIG_NLS_ISO8859_1=y
121CONFIG_NLS_ISO8859_2=y 113CONFIG_NLS_ISO8859_2=y
122CONFIG_NLS_UTF8=y 114CONFIG_NLS_UTF8=y
115CONFIG_PRINTK_TIME=y
123CONFIG_MAGIC_SYSRQ=y 116CONFIG_MAGIC_SYSRQ=y
124CONFIG_DEBUG_FS=y 117CONFIG_DEBUG_FS=y
125CONFIG_DEBUG_KERNEL=y
126# CONFIG_SCHED_DEBUG is not set 118# CONFIG_SCHED_DEBUG is not set
127CONFIG_TIMER_STATS=y 119CONFIG_TIMER_STATS=y
128# CONFIG_DEBUG_BUGVERBOSE is not set 120# CONFIG_DEBUG_BUGVERBOSE is not set
129CONFIG_DEBUG_INFO=y 121CONFIG_DEBUG_INFO=y
130CONFIG_SYSCTL_SYSCALL_CHECK=y
131CONFIG_DEBUG_USER=y 122CONFIG_DEBUG_USER=y
132CONFIG_DEBUG_ERRORS=y
133CONFIG_CRYPTO_NULL=y 123CONFIG_CRYPTO_NULL=y
134CONFIG_CRYPTO_ECB=m 124CONFIG_CRYPTO_ECB=m
135CONFIG_CRYPTO_PCBC=m 125CONFIG_CRYPTO_PCBC=m
@@ -138,7 +128,6 @@ CONFIG_CRYPTO_MD4=y
138CONFIG_CRYPTO_SHA1=y 128CONFIG_CRYPTO_SHA1=y
139CONFIG_CRYPTO_SHA256=y 129CONFIG_CRYPTO_SHA256=y
140CONFIG_CRYPTO_SHA512=y 130CONFIG_CRYPTO_SHA512=y
141CONFIG_CRYPTO_AES=y
142CONFIG_CRYPTO_BLOWFISH=y 131CONFIG_CRYPTO_BLOWFISH=y
143CONFIG_CRYPTO_TEA=y 132CONFIG_CRYPTO_TEA=y
144CONFIG_CRYPTO_TWOFISH=y 133CONFIG_CRYPTO_TWOFISH=y
@@ -147,5 +136,4 @@ CONFIG_CRYPTO_LZO=y
147# CONFIG_CRYPTO_ANSI_CPRNG is not set 136# CONFIG_CRYPTO_ANSI_CPRNG is not set
148CONFIG_CRYPTO_DEV_MV_CESA=y 137CONFIG_CRYPTO_DEV_MV_CESA=y
149CONFIG_CRC_CCITT=y 138CONFIG_CRC_CCITT=y
150CONFIG_CRC16=y
151CONFIG_LIBCRC32C=y 139CONFIG_LIBCRC32C=y
diff --git a/arch/arm/configs/imx_v4_v5_defconfig b/arch/arm/configs/imx_v4_v5_defconfig
index ebbfb27e0e74..02c657af4005 100644
--- a/arch/arm/configs/imx_v4_v5_defconfig
+++ b/arch/arm/configs/imx_v4_v5_defconfig
@@ -61,6 +61,7 @@ CONFIG_IP_PNP_DHCP=y
61# CONFIG_INET_LRO is not set 61# CONFIG_INET_LRO is not set
62# CONFIG_INET_DIAG is not set 62# CONFIG_INET_DIAG is not set
63# CONFIG_IPV6 is not set 63# CONFIG_IPV6 is not set
64CONFIG_NETFILTER=y
64CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 65CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
65CONFIG_DEVTMPFS=y 66CONFIG_DEVTMPFS=y
66CONFIG_DEVTMPFS_MOUNT=y 67CONFIG_DEVTMPFS_MOUNT=y
@@ -127,6 +128,8 @@ CONFIG_MEDIA_CAMERA_SUPPORT=y
127CONFIG_SOC_CAMERA=y 128CONFIG_SOC_CAMERA=y
128CONFIG_SOC_CAMERA_OV2640=y 129CONFIG_SOC_CAMERA_OV2640=y
129CONFIG_VIDEO_MX2=y 130CONFIG_VIDEO_MX2=y
131CONFIG_V4L_MEM2MEM_DRIVERS=y
132CONFIG_VIDEO_CODA=y
130CONFIG_FB=y 133CONFIG_FB=y
131CONFIG_FB_IMX=y 134CONFIG_FB_IMX=y
132CONFIG_BACKLIGHT_LCD_SUPPORT=y 135CONFIG_BACKLIGHT_LCD_SUPPORT=y
diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
index 69667133321f..e36b01025321 100644
--- a/arch/arm/configs/imx_v6_v7_defconfig
+++ b/arch/arm/configs/imx_v6_v7_defconfig
@@ -19,6 +19,7 @@ CONFIG_MODULE_SRCVERSION_ALL=y
19CONFIG_ARCH_MXC=y 19CONFIG_ARCH_MXC=y
20CONFIG_ARCH_MULTI_V6=y 20CONFIG_ARCH_MULTI_V6=y
21CONFIG_ARCH_MULTI_V7=y 21CONFIG_ARCH_MULTI_V7=y
22CONFIG_MACH_IMX31_DT=y
22CONFIG_MACH_MX31LILLY=y 23CONFIG_MACH_MX31LILLY=y
23CONFIG_MACH_MX31LITE=y 24CONFIG_MACH_MX31LITE=y
24CONFIG_MACH_PCM037=y 25CONFIG_MACH_PCM037=y
@@ -32,7 +33,6 @@ CONFIG_MACH_PCM043=y
32CONFIG_MACH_MX35_3DS=y 33CONFIG_MACH_MX35_3DS=y
33CONFIG_MACH_VPR200=y 34CONFIG_MACH_VPR200=y
34CONFIG_MACH_IMX51_DT=y 35CONFIG_MACH_IMX51_DT=y
35CONFIG_MACH_MX51_3DS=y
36CONFIG_MACH_EUKREA_CPUIMX51SD=y 36CONFIG_MACH_EUKREA_CPUIMX51SD=y
37CONFIG_SOC_IMX53=y 37CONFIG_SOC_IMX53=y
38CONFIG_SOC_IMX6Q=y 38CONFIG_SOC_IMX6Q=y
@@ -59,6 +59,7 @@ CONFIG_IP_PNP_DHCP=y
59# CONFIG_INET_XFRM_MODE_BEET is not set 59# CONFIG_INET_XFRM_MODE_BEET is not set
60# CONFIG_INET_LRO is not set 60# CONFIG_INET_LRO is not set
61CONFIG_IPV6=y 61CONFIG_IPV6=y
62CONFIG_NETFILTER=y
62# CONFIG_WIRELESS is not set 63# CONFIG_WIRELESS is not set
63CONFIG_DEVTMPFS=y 64CONFIG_DEVTMPFS=y
64CONFIG_DEVTMPFS_MOUNT=y 65CONFIG_DEVTMPFS_MOUNT=y
@@ -151,6 +152,7 @@ CONFIG_MFD_MC13XXX_I2C=y
151CONFIG_REGULATOR=y 152CONFIG_REGULATOR=y
152CONFIG_REGULATOR_FIXED_VOLTAGE=y 153CONFIG_REGULATOR_FIXED_VOLTAGE=y
153CONFIG_REGULATOR_DA9052=y 154CONFIG_REGULATOR_DA9052=y
155CONFIG_REGULATOR_ANATOP=y
154CONFIG_REGULATOR_MC13783=y 156CONFIG_REGULATOR_MC13783=y
155CONFIG_REGULATOR_MC13892=y 157CONFIG_REGULATOR_MC13892=y
156CONFIG_MEDIA_SUPPORT=y 158CONFIG_MEDIA_SUPPORT=y
@@ -159,6 +161,7 @@ CONFIG_V4L_PLATFORM_DRIVERS=y
159CONFIG_MEDIA_CAMERA_SUPPORT=y 161CONFIG_MEDIA_CAMERA_SUPPORT=y
160CONFIG_SOC_CAMERA=y 162CONFIG_SOC_CAMERA=y
161CONFIG_SOC_CAMERA_OV2640=y 163CONFIG_SOC_CAMERA_OV2640=y
164CONFIG_DRM=y
162CONFIG_VIDEO_MX3=y 165CONFIG_VIDEO_MX3=y
163CONFIG_FB=y 166CONFIG_FB=y
164CONFIG_LCD_PLATFORM=y 167CONFIG_LCD_PLATFORM=y
@@ -197,9 +200,14 @@ CONFIG_RTC_CLASS=y
197CONFIG_RTC_INTF_DEV_UIE_EMUL=y 200CONFIG_RTC_INTF_DEV_UIE_EMUL=y
198CONFIG_RTC_DRV_MC13XXX=y 201CONFIG_RTC_DRV_MC13XXX=y
199CONFIG_RTC_DRV_MXC=y 202CONFIG_RTC_DRV_MXC=y
203CONFIG_RTC_DRV_SNVS=y
200CONFIG_DMADEVICES=y 204CONFIG_DMADEVICES=y
201CONFIG_IMX_SDMA=y 205CONFIG_IMX_SDMA=y
202CONFIG_MXS_DMA=y 206CONFIG_MXS_DMA=y
207CONFIG_STAGING=y
208CONFIG_DRM_IMX=y
209CONFIG_DRM_IMX_IPUV3_CORE=y
210CONFIG_DRM_IMX_IPUV3=y
203CONFIG_COMMON_CLK_DEBUG=y 211CONFIG_COMMON_CLK_DEBUG=y
204# CONFIG_IOMMU_SUPPORT is not set 212# CONFIG_IOMMU_SUPPORT is not set
205CONFIG_EXT2_FS=y 213CONFIG_EXT2_FS=y
diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
index 93f3794ba5cb..13482ea58b09 100644
--- a/arch/arm/configs/kirkwood_defconfig
+++ b/arch/arm/configs/kirkwood_defconfig
@@ -56,6 +56,7 @@ CONFIG_AEABI=y
56CONFIG_ZBOOT_ROM_TEXT=0x0 56CONFIG_ZBOOT_ROM_TEXT=0x0
57CONFIG_ZBOOT_ROM_BSS=0x0 57CONFIG_ZBOOT_ROM_BSS=0x0
58CONFIG_CPU_IDLE=y 58CONFIG_CPU_IDLE=y
59CONFIG_CPU_IDLE_KIRKWOOD=y
59CONFIG_NET=y 60CONFIG_NET=y
60CONFIG_PACKET=y 61CONFIG_PACKET=y
61CONFIG_UNIX=y 62CONFIG_UNIX=y
diff --git a/arch/arm/configs/kota2_defconfig b/arch/arm/configs/kota2_defconfig
index fa83db1ef0eb..57ad3d47de70 100644
--- a/arch/arm/configs/kota2_defconfig
+++ b/arch/arm/configs/kota2_defconfig
@@ -21,7 +21,7 @@ CONFIG_ARCH_SHMOBILE=y
21CONFIG_KEYBOARD_GPIO_POLLED=y 21CONFIG_KEYBOARD_GPIO_POLLED=y
22CONFIG_ARCH_SH73A0=y 22CONFIG_ARCH_SH73A0=y
23CONFIG_MACH_KOTA2=y 23CONFIG_MACH_KOTA2=y
24CONFIG_MEMORY_SIZE=0x1e0000000 24CONFIG_MEMORY_SIZE=0x1e000000
25# CONFIG_SH_TIMER_TMU is not set 25# CONFIG_SH_TIMER_TMU is not set
26# CONFIG_SWP_EMULATE is not set 26# CONFIG_SWP_EMULATE is not set
27CONFIG_CPU_BPREDICT_DISABLE=y 27CONFIG_CPU_BPREDICT_DISABLE=y
diff --git a/arch/arm/configs/kzm9d_defconfig b/arch/arm/configs/kzm9d_defconfig
index 8c49df66cac3..6c37f4a98eb8 100644
--- a/arch/arm/configs/kzm9d_defconfig
+++ b/arch/arm/configs/kzm9d_defconfig
@@ -32,11 +32,9 @@ CONFIG_FORCE_MAX_ZONEORDER=13
32CONFIG_ZBOOT_ROM_TEXT=0x0 32CONFIG_ZBOOT_ROM_TEXT=0x0
33CONFIG_ZBOOT_ROM_BSS=0x0 33CONFIG_ZBOOT_ROM_BSS=0x0
34CONFIG_ARM_APPENDED_DTB=y 34CONFIG_ARM_APPENDED_DTB=y
35CONFIG_CMDLINE="console=tty0 console=ttyS1,115200n81 earlyprintk=serial8250-em.1,115200n81 mem=128M@0x40000000 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096"
36CONFIG_CMDLINE_FORCE=y
37CONFIG_VFP=y 35CONFIG_VFP=y
38# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 36# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
39# CONFIG_SUSPEND is not set 37CONFIG_PM_RUNTIME=y
40CONFIG_NET=y 38CONFIG_NET=y
41CONFIG_PACKET=y 39CONFIG_PACKET=y
42CONFIG_UNIX=y 40CONFIG_UNIX=y
diff --git a/arch/arm/configs/kzm9g_defconfig b/arch/arm/configs/kzm9g_defconfig
index afbae287436b..670c3b60f936 100644
--- a/arch/arm/configs/kzm9g_defconfig
+++ b/arch/arm/configs/kzm9g_defconfig
@@ -39,7 +39,7 @@ CONFIG_AEABI=y
39CONFIG_HIGHMEM=y 39CONFIG_HIGHMEM=y
40CONFIG_ZBOOT_ROM_TEXT=0x0 40CONFIG_ZBOOT_ROM_TEXT=0x0
41CONFIG_ZBOOT_ROM_BSS=0x0 41CONFIG_ZBOOT_ROM_BSS=0x0
42CONFIG_CMDLINE="console=tty0 console=ttySC4,115200 root=/dev/nfs ip=dhcp ignore_loglevel earlyprintk=sh-sci.4,115200" 42CONFIG_ARM_APPENDED_DTB=y
43CONFIG_KEXEC=y 43CONFIG_KEXEC=y
44CONFIG_VFP=y 44CONFIG_VFP=y
45CONFIG_NEON=y 45CONFIG_NEON=y
@@ -85,6 +85,8 @@ CONFIG_I2C_CHARDEV=y
85CONFIG_I2C_SH_MOBILE=y 85CONFIG_I2C_SH_MOBILE=y
86CONFIG_GPIO_PCF857X=y 86CONFIG_GPIO_PCF857X=y
87# CONFIG_HWMON is not set 87# CONFIG_HWMON is not set
88CONFIG_REGULATOR=y
89CONFIG_REGULATOR_DUMMY=y
88CONFIG_FB=y 90CONFIG_FB=y
89CONFIG_FB_SH_MOBILE_LCDC=y 91CONFIG_FB_SH_MOBILE_LCDC=y
90CONFIG_FRAMEBUFFER_CONSOLE=y 92CONFIG_FRAMEBUFFER_CONSOLE=y
diff --git a/arch/arm/configs/mackerel_defconfig b/arch/arm/configs/mackerel_defconfig
index 2098ce155542..7594b3aff259 100644
--- a/arch/arm/configs/mackerel_defconfig
+++ b/arch/arm/configs/mackerel_defconfig
@@ -23,8 +23,9 @@ CONFIG_AEABI=y
23CONFIG_FORCE_MAX_ZONEORDER=15 23CONFIG_FORCE_MAX_ZONEORDER=15
24CONFIG_ZBOOT_ROM_TEXT=0x0 24CONFIG_ZBOOT_ROM_TEXT=0x0
25CONFIG_ZBOOT_ROM_BSS=0x0 25CONFIG_ZBOOT_ROM_BSS=0x0
26CONFIG_CMDLINE="console=tty0, console=ttySC0,115200 earlyprintk=sh-sci.0,115200 root=/dev/nfs nfsroot=,tcp,v3 ip=dhcp memchunk.vpu=64m memchunk.veu0=8m memchunk.spu0=2m mem=240m" 26CONFIG_ARM_APPENDED_DTB=y
27CONFIG_KEXEC=y 27CONFIG_KEXEC=y
28CONFIG_VFP=y
28# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 29# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
29CONFIG_PM=y 30CONFIG_PM=y
30CONFIG_PM_RUNTIME=y 31CONFIG_PM_RUNTIME=y
diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig
index 728a43c446f8..afb17d630d44 100644
--- a/arch/arm/configs/marzen_defconfig
+++ b/arch/arm/configs/marzen_defconfig
@@ -83,7 +83,6 @@ CONFIG_USB=y
83CONFIG_USB_RCAR_PHY=y 83CONFIG_USB_RCAR_PHY=y
84CONFIG_MMC=y 84CONFIG_MMC=y
85CONFIG_MMC_SDHI=y 85CONFIG_MMC_SDHI=y
86CONFIG_USB=y
87CONFIG_USB_EHCI_HCD=y 86CONFIG_USB_EHCI_HCD=y
88CONFIG_USB_OHCI_HCD=y 87CONFIG_USB_OHCI_HCD=y
89CONFIG_USB_OHCI_HCD_PLATFORM=y 88CONFIG_USB_OHCI_HCD_PLATFORM=y
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index 2eeff1e64b6e..e31d442343c8 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -8,6 +8,7 @@ CONFIG_ARCH_HIGHBANK=y
8CONFIG_ARCH_SOCFPGA=y 8CONFIG_ARCH_SOCFPGA=y
9CONFIG_ARCH_SUNXI=y 9CONFIG_ARCH_SUNXI=y
10# CONFIG_ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA is not set 10# CONFIG_ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA is not set
11CONFIG_ARCH_ZYNQ=y
11CONFIG_ARM_ERRATA_754322=y 12CONFIG_ARM_ERRATA_754322=y
12CONFIG_SMP=y 13CONFIG_SMP=y
13CONFIG_ARM_ARCH_TIMER=y 14CONFIG_ARM_ARCH_TIMER=y
@@ -39,7 +40,6 @@ CONFIG_I2C=y
39CONFIG_I2C_DESIGNWARE_PLATFORM=y 40CONFIG_I2C_DESIGNWARE_PLATFORM=y
40CONFIG_SPI=y 41CONFIG_SPI=y
41CONFIG_SPI_PL022=y 42CONFIG_SPI_PL022=y
42CONFIG_GPIOLIB=y
43CONFIG_FB=y 43CONFIG_FB=y
44CONFIG_FB_ARMCLCD=y 44CONFIG_FB_ARMCLCD=y
45CONFIG_FRAMEBUFFER_CONSOLE=y 45CONFIG_FRAMEBUFFER_CONSOLE=y
diff --git a/arch/arm/configs/mvebu_defconfig b/arch/arm/configs/mvebu_defconfig
index b5bc96cb65a7..2ec8119cff73 100644
--- a/arch/arm/configs/mvebu_defconfig
+++ b/arch/arm/configs/mvebu_defconfig
@@ -14,16 +14,20 @@ CONFIG_MACH_ARMADA_XP=y
14# CONFIG_CACHE_L2X0 is not set 14# CONFIG_CACHE_L2X0 is not set
15# CONFIG_SWP_EMULATE is not set 15# CONFIG_SWP_EMULATE is not set
16CONFIG_SMP=y 16CONFIG_SMP=y
17# CONFIG_LOCAL_TIMERS is not set
18CONFIG_AEABI=y 17CONFIG_AEABI=y
19CONFIG_HIGHMEM=y 18CONFIG_HIGHMEM=y
20# CONFIG_COMPACTION is not set 19# CONFIG_COMPACTION is not set
21CONFIG_ZBOOT_ROM_TEXT=0x0 20CONFIG_ZBOOT_ROM_TEXT=0x0
22CONFIG_ZBOOT_ROM_BSS=0x0 21CONFIG_ZBOOT_ROM_BSS=0x0
23CONFIG_ARM_APPENDED_DTB=y 22CONFIG_ARM_APPENDED_DTB=y
23CONFIG_ARM_ATAG_DTB_COMPAT=y
24CONFIG_VFP=y 24CONFIG_VFP=y
25CONFIG_NET=y 25CONFIG_NET=y
26CONFIG_INET=y 26CONFIG_INET=y
27CONFIG_BT=y
28CONFIG_BT_MRVL=y
29CONFIG_BT_MRVL_SDIO=y
30CONFIG_CFG80211=y
27CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 31CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
28CONFIG_BLK_DEV_SD=y 32CONFIG_BLK_DEV_SD=y
29CONFIG_ATA=y 33CONFIG_ATA=y
@@ -31,14 +35,34 @@ CONFIG_SATA_MV=y
31CONFIG_NETDEVICES=y 35CONFIG_NETDEVICES=y
32CONFIG_MVNETA=y 36CONFIG_MVNETA=y
33CONFIG_MARVELL_PHY=y 37CONFIG_MARVELL_PHY=y
38CONFIG_MWIFIEX=y
39CONFIG_MWIFIEX_SDIO=y
34CONFIG_SERIAL_8250=y 40CONFIG_SERIAL_8250=y
35CONFIG_SERIAL_8250_CONSOLE=y 41CONFIG_SERIAL_8250_CONSOLE=y
42CONFIG_I2C=y
43CONFIG_SPI=y
44CONFIG_SPI_ORION=y
45CONFIG_I2C_MV64XXX=y
46CONFIG_MTD=y
47CONFIG_MTD_CHAR=y
48CONFIG_MTD_M25P80=y
36CONFIG_SERIAL_8250_DW=y 49CONFIG_SERIAL_8250_DW=y
37CONFIG_GPIOLIB=y 50CONFIG_GPIOLIB=y
38CONFIG_GPIO_SYSFS=y 51CONFIG_GPIO_SYSFS=y
39# CONFIG_USB_SUPPORT is not set 52CONFIG_USB_SUPPORT=y
53CONFIG_USB=y
54CONFIG_USB_EHCI_HCD=y
55CONFIG_USB_EHCI_ROOT_HUB_TT=y
56CONFIG_MMC=y
57CONFIG_MMC_MVSDIO=y
58CONFIG_NEW_LEDS=y
59CONFIG_LEDS_CLASS=m
60CONFIG_LEDS_TRIGGERS=y
61CONFIG_LEDS_TRIGGER_TIMER=y
62CONFIG_LEDS_TRIGGER_HEARTBEAT=y
40CONFIG_RTC_CLASS=y 63CONFIG_RTC_CLASS=y
41CONFIG_RTC_DRV_S35390A=y 64CONFIG_RTC_DRV_S35390A=y
65CONFIG_RTC_DRV_MV=y
42CONFIG_DMADEVICES=y 66CONFIG_DMADEVICES=y
43CONFIG_MV_XOR=y 67CONFIG_MV_XOR=y
44# CONFIG_IOMMU_SUPPORT is not set 68# CONFIG_IOMMU_SUPPORT is not set
diff --git a/arch/arm/configs/mxs_defconfig b/arch/arm/configs/mxs_defconfig
index 7bf535104e26..fbbc5bb022d5 100644
--- a/arch/arm/configs/mxs_defconfig
+++ b/arch/arm/configs/mxs_defconfig
@@ -1,5 +1,7 @@
1CONFIG_EXPERIMENTAL=y 1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y 2CONFIG_SYSVIPC=y
3CONFIG_NO_HZ=y
4CONFIG_HIGH_RES_TIMERS=y
3CONFIG_TASKSTATS=y 5CONFIG_TASKSTATS=y
4CONFIG_TASK_DELAY_ACCT=y 6CONFIG_TASK_DELAY_ACCT=y
5CONFIG_TASK_XACCT=y 7CONFIG_TASK_XACCT=y
@@ -8,7 +10,6 @@ CONFIG_IKCONFIG=y
8CONFIG_IKCONFIG_PROC=y 10CONFIG_IKCONFIG_PROC=y
9# CONFIG_UTS_NS is not set 11# CONFIG_UTS_NS is not set
10# CONFIG_IPC_NS is not set 12# CONFIG_IPC_NS is not set
11# CONFIG_USER_NS is not set
12# CONFIG_PID_NS is not set 13# CONFIG_PID_NS is not set
13# CONFIG_NET_NS is not set 14# CONFIG_NET_NS is not set
14CONFIG_PERF_EVENTS=y 15CONFIG_PERF_EVENTS=y
@@ -24,8 +25,6 @@ CONFIG_BLK_DEV_INTEGRITY=y
24CONFIG_ARCH_MXS=y 25CONFIG_ARCH_MXS=y
25CONFIG_MACH_MXS_DT=y 26CONFIG_MACH_MXS_DT=y
26# CONFIG_ARM_THUMB is not set 27# CONFIG_ARM_THUMB is not set
27CONFIG_NO_HZ=y
28CONFIG_HIGH_RES_TIMERS=y
29CONFIG_PREEMPT_VOLUNTARY=y 28CONFIG_PREEMPT_VOLUNTARY=y
30CONFIG_AEABI=y 29CONFIG_AEABI=y
31CONFIG_AUTO_ZRELADDR=y 30CONFIG_AUTO_ZRELADDR=y
@@ -46,25 +45,34 @@ CONFIG_SYN_COOKIES=y
46CONFIG_CAN=m 45CONFIG_CAN=m
47CONFIG_CAN_RAW=m 46CONFIG_CAN_RAW=m
48CONFIG_CAN_BCM=m 47CONFIG_CAN_BCM=m
49CONFIG_CAN_DEV=m
50CONFIG_CAN_FLEXCAN=m 48CONFIG_CAN_FLEXCAN=m
51# CONFIG_WIRELESS is not set 49# CONFIG_WIRELESS is not set
52CONFIG_DEVTMPFS=y 50CONFIG_DEVTMPFS=y
51CONFIG_DEVTMPFS_MOUNT=y
53# CONFIG_FIRMWARE_IN_KERNEL is not set 52# CONFIG_FIRMWARE_IN_KERNEL is not set
54# CONFIG_BLK_DEV is not set
55CONFIG_MTD=y 53CONFIG_MTD=y
54CONFIG_MTD_CMDLINE_PARTS=y
56CONFIG_MTD_CHAR=y 55CONFIG_MTD_CHAR=y
56CONFIG_MTD_BLOCK=y
57CONFIG_MTD_DATAFLASH=y 57CONFIG_MTD_DATAFLASH=y
58CONFIG_MTD_M25P80 58CONFIG_MTD_M25P80=y
59# CONFIG_M25PXX_USE_FAST_READ is not set
60CONFIG_MTD_SST25L=y
59CONFIG_MTD_NAND=y 61CONFIG_MTD_NAND=y
60CONFIG_MTD_NAND_GPMI_NAND=y 62CONFIG_MTD_NAND_GPMI_NAND=y
63CONFIG_MTD_UBI=y
64# CONFIG_BLK_DEV is not set
65CONFIG_EEPROM_AT24=y
66CONFIG_SCSI=y
67CONFIG_BLK_DEV_SD=y
61CONFIG_NETDEVICES=y 68CONFIG_NETDEVICES=y
62CONFIG_NET_ETHERNET=y
63CONFIG_ENC28J60=y 69CONFIG_ENC28J60=y
64CONFIG_USB_USBNET=y 70CONFIG_USB_USBNET=y
65CONFIG_USB_NET_SMSC95XX=y 71CONFIG_USB_NET_SMSC95XX=y
66# CONFIG_NETDEV_1000 is not set 72CONFIG_SMSC_PHY=y
67# CONFIG_NETDEV_10000 is not set 73CONFIG_ICPLUS_PHY=y
74CONFIG_REALTEK_PHY=y
75CONFIG_MICREL_PHY=y
68# CONFIG_WLAN is not set 76# CONFIG_WLAN is not set
69# CONFIG_INPUT_MOUSEDEV_PSAUX is not set 77# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
70CONFIG_INPUT_EVDEV=m 78CONFIG_INPUT_EVDEV=m
@@ -91,21 +99,6 @@ CONFIG_SPI_MXS=y
91CONFIG_DEBUG_GPIO=y 99CONFIG_DEBUG_GPIO=y
92CONFIG_GPIO_SYSFS=y 100CONFIG_GPIO_SYSFS=y
93# CONFIG_HWMON is not set 101# CONFIG_HWMON is not set
94# CONFIG_MFD_SUPPORT is not set
95CONFIG_DISPLAY_SUPPORT=m
96# CONFIG_HID_SUPPORT is not set
97CONFIG_SOUND=y
98CONFIG_SND=y
99CONFIG_SND_TIMER=y
100CONFIG_SND_PCM=y
101CONFIG_SND_JACK=y
102CONFIG_SND_DRIVERS=y
103CONFIG_SND_ARM=y
104CONFIG_SND_SOC=y
105CONFIG_SND_MXS_SOC=y
106CONFIG_SND_SOC_MXS_SGTL5000=y
107CONFIG_SND_SOC_I2C_AND_SPI=y
108CONFIG_SND_SOC_SGTL5000=y
109CONFIG_REGULATOR=y 102CONFIG_REGULATOR=y
110CONFIG_REGULATOR_FIXED_VOLTAGE=y 103CONFIG_REGULATOR_FIXED_VOLTAGE=y
111CONFIG_FB=y 104CONFIG_FB=y
@@ -117,13 +110,16 @@ CONFIG_BACKLIGHT_PWM=y
117CONFIG_FRAMEBUFFER_CONSOLE=y 110CONFIG_FRAMEBUFFER_CONSOLE=y
118CONFIG_FONTS=y 111CONFIG_FONTS=y
119CONFIG_LOGO=y 112CONFIG_LOGO=y
113CONFIG_SOUND=y
114CONFIG_SND=y
115CONFIG_SND_SOC=y
116CONFIG_SND_MXS_SOC=y
117CONFIG_SND_SOC_MXS_SGTL5000=y
120CONFIG_USB=y 118CONFIG_USB=y
121CONFIG_USB_CHIPIDEA=y 119CONFIG_USB_CHIPIDEA=y
122CONFIG_USB_CHIPIDEA_HOST=y 120CONFIG_USB_CHIPIDEA_HOST=y
123CONFIG_USB_STORAGE=y 121CONFIG_USB_STORAGE=y
124CONFIG_USB_MXS_PHY=y 122CONFIG_USB_MXS_PHY=y
125CONFIG_SCSI=y
126CONFIG_BLK_DEV_SD=y
127CONFIG_MMC=y 123CONFIG_MMC=y
128CONFIG_MMC_MXS=y 124CONFIG_MMC_MXS=y
129CONFIG_NEW_LEDS=y 125CONFIG_NEW_LEDS=y
@@ -147,16 +143,23 @@ CONFIG_COMMON_CLK_DEBUG=y
147CONFIG_IIO=y 143CONFIG_IIO=y
148CONFIG_PWM=y 144CONFIG_PWM=y
149CONFIG_PWM_MXS=y 145CONFIG_PWM_MXS=y
146CONFIG_EXT2_FS=y
147CONFIG_EXT2_FS_XATTR=y
150CONFIG_EXT3_FS=y 148CONFIG_EXT3_FS=y
149CONFIG_EXT4_FS=y
151# CONFIG_DNOTIFY is not set 150# CONFIG_DNOTIFY is not set
152CONFIG_FSCACHE=m 151CONFIG_FSCACHE=m
153CONFIG_FSCACHE_STATS=y 152CONFIG_FSCACHE_STATS=y
154CONFIG_CACHEFILES=m 153CONFIG_CACHEFILES=m
155CONFIG_TMPFS=y 154CONFIG_TMPFS=y
156CONFIG_TMPFS_POSIX_ACL=y 155CONFIG_TMPFS_POSIX_ACL=y
157# CONFIG_MISC_FILESYSTEMS is not set 156CONFIG_JFFS2_FS=y
157CONFIG_JFFS2_COMPRESSION_OPTIONS=y
158CONFIG_JFFS2_LZO=y
159CONFIG_JFFS2_RUBIN=y
160CONFIG_UBIFS_FS=y
161CONFIG_UBIFS_FS_ADVANCED_COMPR=y
158CONFIG_NFS_FS=y 162CONFIG_NFS_FS=y
159CONFIG_NFS_V3=y
160CONFIG_NFS_V3_ACL=y 163CONFIG_NFS_V3_ACL=y
161CONFIG_NFS_V4=y 164CONFIG_NFS_V4=y
162CONFIG_ROOT_NFS=y 165CONFIG_ROOT_NFS=y
@@ -170,17 +173,12 @@ CONFIG_MAGIC_SYSRQ=y
170CONFIG_UNUSED_SYMBOLS=y 173CONFIG_UNUSED_SYMBOLS=y
171CONFIG_DEBUG_KERNEL=y 174CONFIG_DEBUG_KERNEL=y
172CONFIG_LOCKUP_DETECTOR=y 175CONFIG_LOCKUP_DETECTOR=y
173CONFIG_DETECT_HUNG_TASK=y
174CONFIG_TIMER_STATS=y 176CONFIG_TIMER_STATS=y
175CONFIG_PROVE_LOCKING=y 177CONFIG_PROVE_LOCKING=y
176CONFIG_DEBUG_SPINLOCK_SLEEP=y
177CONFIG_DEBUG_INFO=y 178CONFIG_DEBUG_INFO=y
178CONFIG_SYSCTL_SYSCALL_CHECK=y
179CONFIG_BLK_DEV_IO_TRACE=y 179CONFIG_BLK_DEV_IO_TRACE=y
180CONFIG_STRICT_DEVMEM=y 180CONFIG_STRICT_DEVMEM=y
181CONFIG_DEBUG_USER=y 181CONFIG_DEBUG_USER=y
182CONFIG_CRYPTO=y
183CONFIG_CRYPTO_CRC32C=m
184# CONFIG_CRYPTO_ANSI_CPRNG is not set 182# CONFIG_CRYPTO_ANSI_CPRNG is not set
185# CONFIG_CRYPTO_HW is not set 183# CONFIG_CRYPTO_HW is not set
186CONFIG_CRC_ITU_T=m 184CONFIG_CRC_ITU_T=m
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index 82ce8d738fa1..b16bae2c9a60 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -20,9 +20,10 @@ CONFIG_MODULE_FORCE_UNLOAD=y
20CONFIG_MODVERSIONS=y 20CONFIG_MODVERSIONS=y
21CONFIG_MODULE_SRCVERSION_ALL=y 21CONFIG_MODULE_SRCVERSION_ALL=y
22# CONFIG_BLK_DEV_BSG is not set 22# CONFIG_BLK_DEV_BSG is not set
23CONFIG_ARCH_OMAP=y 23CONFIG_ARCH_OMAP2PLUS=y
24CONFIG_OMAP_RESET_CLOCKS=y 24CONFIG_OMAP_RESET_CLOCKS=y
25CONFIG_OMAP_MUX_DEBUG=y 25CONFIG_OMAP_MUX_DEBUG=y
26CONFIG_ARCH_VEXPRESS_CA9X4=y
26CONFIG_ARM_THUMBEE=y 27CONFIG_ARM_THUMBEE=y
27CONFIG_ARM_ERRATA_411920=y 28CONFIG_ARM_ERRATA_411920=y
28CONFIG_NO_HZ=y 29CONFIG_NO_HZ=y
@@ -52,6 +53,11 @@ CONFIG_IP_PNP_RARP=y
52# CONFIG_INET_LRO is not set 53# CONFIG_INET_LRO is not set
53# CONFIG_IPV6 is not set 54# CONFIG_IPV6 is not set
54CONFIG_NETFILTER=y 55CONFIG_NETFILTER=y
56CONFIG_CAN=m
57CONFIG_CAN_RAW=m
58CONFIG_CAN_BCM=m
59CONFIG_CAN_C_CAN=m
60CONFIG_CAN_C_CAN_PLATFORM=m
55CONFIG_BT=m 61CONFIG_BT=m
56CONFIG_BT_HCIUART=m 62CONFIG_BT_HCIUART=m
57CONFIG_BT_HCIUART_H4=y 63CONFIG_BT_HCIUART_H4=y
@@ -64,6 +70,7 @@ CONFIG_MAC80211=m
64CONFIG_MAC80211_RC_PID=y 70CONFIG_MAC80211_RC_PID=y
65CONFIG_MAC80211_RC_DEFAULT_PID=y 71CONFIG_MAC80211_RC_DEFAULT_PID=y
66CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 72CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
73CONFIG_CMA=y
67CONFIG_CONNECTOR=y 74CONFIG_CONNECTOR=y
68CONFIG_DEVTMPFS=y 75CONFIG_DEVTMPFS=y
69CONFIG_DEVTMPFS_MOUNT=y 76CONFIG_DEVTMPFS_MOUNT=y
@@ -83,6 +90,9 @@ CONFIG_MTD_UBI=y
83CONFIG_BLK_DEV_LOOP=y 90CONFIG_BLK_DEV_LOOP=y
84CONFIG_BLK_DEV_RAM=y 91CONFIG_BLK_DEV_RAM=y
85CONFIG_BLK_DEV_RAM_SIZE=16384 92CONFIG_BLK_DEV_RAM_SIZE=16384
93CONFIG_SENSORS_LIS3LV02D=m
94CONFIG_SENSORS_TSL2550=m
95CONFIG_SENSORS_LIS3_I2C=m
86CONFIG_SCSI=y 96CONFIG_SCSI=y
87CONFIG_BLK_DEV_SD=y 97CONFIG_BLK_DEV_SD=y
88CONFIG_SCSI_MULTI_LUN=y 98CONFIG_SCSI_MULTI_LUN=y
@@ -108,6 +118,7 @@ CONFIG_USB_KC2190=y
108CONFIG_INPUT_JOYDEV=y 118CONFIG_INPUT_JOYDEV=y
109CONFIG_INPUT_EVDEV=y 119CONFIG_INPUT_EVDEV=y
110CONFIG_KEYBOARD_GPIO=y 120CONFIG_KEYBOARD_GPIO=y
121CONFIG_KEYBOARD_MATRIX=m
111CONFIG_KEYBOARD_TWL4030=y 122CONFIG_KEYBOARD_TWL4030=y
112CONFIG_INPUT_TOUCHSCREEN=y 123CONFIG_INPUT_TOUCHSCREEN=y
113CONFIG_TOUCHSCREEN_ADS7846=y 124CONFIG_TOUCHSCREEN_ADS7846=y
@@ -121,6 +132,8 @@ CONFIG_SERIAL_8250_MANY_PORTS=y
121CONFIG_SERIAL_8250_SHARE_IRQ=y 132CONFIG_SERIAL_8250_SHARE_IRQ=y
122CONFIG_SERIAL_8250_DETECT_IRQ=y 133CONFIG_SERIAL_8250_DETECT_IRQ=y
123CONFIG_SERIAL_8250_RSA=y 134CONFIG_SERIAL_8250_RSA=y
135CONFIG_SERIAL_AMBA_PL011=y
136CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
124CONFIG_HW_RANDOM=y 137CONFIG_HW_RANDOM=y
125CONFIG_I2C_CHARDEV=y 138CONFIG_I2C_CHARDEV=y
126CONFIG_SPI=y 139CONFIG_SPI=y
@@ -131,14 +144,17 @@ CONFIG_GPIO_SYSFS=y
131CONFIG_GPIO_TWL4030=y 144CONFIG_GPIO_TWL4030=y
132CONFIG_W1=y 145CONFIG_W1=y
133CONFIG_POWER_SUPPLY=y 146CONFIG_POWER_SUPPLY=y
147CONFIG_SENSORS_LM75=m
134CONFIG_WATCHDOG=y 148CONFIG_WATCHDOG=y
135CONFIG_OMAP_WATCHDOG=y 149CONFIG_OMAP_WATCHDOG=y
136CONFIG_TWL4030_WATCHDOG=y 150CONFIG_TWL4030_WATCHDOG=y
137CONFIG_MFD_TPS65217=y 151CONFIG_MFD_TPS65217=y
152CONFIG_MFD_TPS65910=y
138CONFIG_REGULATOR_TWL4030=y 153CONFIG_REGULATOR_TWL4030=y
139CONFIG_REGULATOR_TPS65023=y 154CONFIG_REGULATOR_TPS65023=y
140CONFIG_REGULATOR_TPS6507X=y 155CONFIG_REGULATOR_TPS6507X=y
141CONFIG_REGULATOR_TPS65217=y 156CONFIG_REGULATOR_TPS65217=y
157CONFIG_REGULATOR_TPS65910=y
142CONFIG_FB=y 158CONFIG_FB=y
143CONFIG_FIRMWARE_EDID=y 159CONFIG_FIRMWARE_EDID=y
144CONFIG_FB_MODE_HELPERS=y 160CONFIG_FB_MODE_HELPERS=y
@@ -150,6 +166,7 @@ CONFIG_OMAP2_DSS_SDI=y
150CONFIG_OMAP2_DSS_DSI=y 166CONFIG_OMAP2_DSS_DSI=y
151CONFIG_FB_OMAP2=m 167CONFIG_FB_OMAP2=m
152CONFIG_PANEL_GENERIC_DPI=m 168CONFIG_PANEL_GENERIC_DPI=m
169CONFIG_PANEL_TFP410=m
153CONFIG_PANEL_SHARP_LS037V7DW01=m 170CONFIG_PANEL_SHARP_LS037V7DW01=m
154CONFIG_PANEL_NEC_NL8048HL11_01B=m 171CONFIG_PANEL_NEC_NL8048HL11_01B=m
155CONFIG_PANEL_TAAL=m 172CONFIG_PANEL_TAAL=m
@@ -194,11 +211,23 @@ CONFIG_USB_ZERO=m
194CONFIG_MMC=y 211CONFIG_MMC=y
195CONFIG_MMC_UNSAFE_RESUME=y 212CONFIG_MMC_UNSAFE_RESUME=y
196CONFIG_SDIO_UART=y 213CONFIG_SDIO_UART=y
214CONFIG_MMC_ARMMMCI=y
197CONFIG_MMC_OMAP=y 215CONFIG_MMC_OMAP=y
198CONFIG_MMC_OMAP_HS=y 216CONFIG_MMC_OMAP_HS=y
217CONFIG_NEW_LEDS=y
218CONFIG_LEDS_GPIO=y
219CONFIG_LEDS_TRIGGERS=y
220CONFIG_LEDS_TRIGGER_TIMER=y
221CONFIG_LEDS_TRIGGER_ONESHOT=y
222CONFIG_LEDS_TRIGGER_HEARTBEAT=y
223CONFIG_LEDS_TRIGGER_BACKLIGHT=y
224CONFIG_LEDS_TRIGGER_CPU=y
225CONFIG_LEDS_TRIGGER_GPIO=y
226CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
199CONFIG_RTC_CLASS=y 227CONFIG_RTC_CLASS=y
200CONFIG_RTC_DRV_TWL92330=y 228CONFIG_RTC_DRV_TWL92330=y
201CONFIG_RTC_DRV_TWL4030=y 229CONFIG_RTC_DRV_TWL4030=y
230CONFIG_RTC_DRV_OMAP=y
202CONFIG_DMADEVICES=y 231CONFIG_DMADEVICES=y
203CONFIG_DMA_OMAP=y 232CONFIG_DMA_OMAP=y
204CONFIG_EXT2_FS=y 233CONFIG_EXT2_FS=y
diff --git a/arch/arm/configs/prima2_defconfig b/arch/arm/configs/prima2_defconfig
index 6a936c7c078a..002a1ceadceb 100644
--- a/arch/arm/configs/prima2_defconfig
+++ b/arch/arm/configs/prima2_defconfig
@@ -11,6 +11,9 @@ CONFIG_PARTITION_ADVANCED=y
11CONFIG_BSD_DISKLABEL=y 11CONFIG_BSD_DISKLABEL=y
12CONFIG_SOLARIS_X86_PARTITION=y 12CONFIG_SOLARIS_X86_PARTITION=y
13CONFIG_ARCH_SIRF=y 13CONFIG_ARCH_SIRF=y
14# CONFIG_SWP_EMULATE is not set
15CONFIG_SMP=y
16CONFIG_SCHED_MC=y
14CONFIG_PREEMPT=y 17CONFIG_PREEMPT=y
15CONFIG_AEABI=y 18CONFIG_AEABI=y
16CONFIG_KEXEC=y 19CONFIG_KEXEC=y
diff --git a/arch/arm/configs/pxa910_defconfig b/arch/arm/configs/pxa910_defconfig
index 191118caa5c0..3bb7771d3c19 100644
--- a/arch/arm/configs/pxa910_defconfig
+++ b/arch/arm/configs/pxa910_defconfig
@@ -42,6 +42,14 @@ CONFIG_SMC91X=y
42# CONFIG_SERIO is not set 42# CONFIG_SERIO is not set
43CONFIG_SERIAL_PXA=y 43CONFIG_SERIAL_PXA=y
44CONFIG_SERIAL_PXA_CONSOLE=y 44CONFIG_SERIAL_PXA_CONSOLE=y
45CONFIG_SPI=y
46CONFIG_FB=y
47CONFIG_MMP_DISP=y
48CONFIG_MMP_DISP_CONTROLLER=y
49CONFIG_MMP_SPI=y
50CONFIG_MMP_PANEL_TPOHVGA=y
51CONFIG_MMP_FB=y
52CONFIG_LOGO=y
45# CONFIG_LEGACY_PTYS is not set 53# CONFIG_LEGACY_PTYS is not set
46# CONFIG_HW_RANDOM is not set 54# CONFIG_HW_RANDOM is not set
47# CONFIG_HWMON is not set 55# CONFIG_HWMON is not set
diff --git a/arch/arm/configs/shark_defconfig b/arch/arm/configs/shark_defconfig
index caa07db90cf5..e319b2c56f11 100644
--- a/arch/arm/configs/shark_defconfig
+++ b/arch/arm/configs/shark_defconfig
@@ -73,7 +73,6 @@ CONFIG_PARTITION_ADVANCED=y
73CONFIG_NLS_CODEPAGE_437=m 73CONFIG_NLS_CODEPAGE_437=m
74CONFIG_NLS_CODEPAGE_850=m 74CONFIG_NLS_CODEPAGE_850=m
75CONFIG_NLS_ISO8859_1=m 75CONFIG_NLS_ISO8859_1=m
76# CONFIG_ENABLE_WARN_DEPRECATED is not set
77# CONFIG_ENABLE_MUST_CHECK is not set 76# CONFIG_ENABLE_MUST_CHECK is not set
78CONFIG_DEBUG_KERNEL=y 77CONFIG_DEBUG_KERNEL=y
79# CONFIG_SCHED_DEBUG is not set 78# CONFIG_SCHED_DEBUG is not set
diff --git a/arch/arm/configs/tegra_defconfig b/arch/arm/configs/tegra_defconfig
index a7827fd0616f..aba4881d20e5 100644
--- a/arch/arm/configs/tegra_defconfig
+++ b/arch/arm/configs/tegra_defconfig
@@ -38,6 +38,7 @@ CONFIG_HIGHMEM=y
38CONFIG_ZBOOT_ROM_TEXT=0x0 38CONFIG_ZBOOT_ROM_TEXT=0x0
39CONFIG_ZBOOT_ROM_BSS=0x0 39CONFIG_ZBOOT_ROM_BSS=0x0
40CONFIG_AUTO_ZRELADDR=y 40CONFIG_AUTO_ZRELADDR=y
41CONFIG_KEXEC=y
41CONFIG_CPU_FREQ=y 42CONFIG_CPU_FREQ=y
42CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y 43CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
43CONFIG_CPU_IDLE=y 44CONFIG_CPU_IDLE=y
@@ -106,12 +107,14 @@ CONFIG_BRCMFMAC=m
106CONFIG_RT2X00=y 107CONFIG_RT2X00=y
107CONFIG_RT2800USB=m 108CONFIG_RT2800USB=m
108CONFIG_INPUT_EVDEV=y 109CONFIG_INPUT_EVDEV=y
110CONFIG_KEYBOARD_TEGRA=y
109CONFIG_INPUT_MISC=y 111CONFIG_INPUT_MISC=y
110CONFIG_INPUT_MPU3050=y 112CONFIG_INPUT_MPU3050=y
111# CONFIG_LEGACY_PTYS is not set 113# CONFIG_LEGACY_PTYS is not set
112# CONFIG_DEVKMEM is not set 114# CONFIG_DEVKMEM is not set
113CONFIG_SERIAL_8250=y 115CONFIG_SERIAL_8250=y
114CONFIG_SERIAL_8250_CONSOLE=y 116CONFIG_SERIAL_8250_CONSOLE=y
117CONFIG_SERIAL_TEGRA=y
115CONFIG_SERIAL_OF_PLATFORM=y 118CONFIG_SERIAL_OF_PLATFORM=y
116# CONFIG_HW_RANDOM is not set 119# CONFIG_HW_RANDOM is not set
117CONFIG_I2C=y 120CONFIG_I2C=y
@@ -127,6 +130,8 @@ CONFIG_GPIO_TPS6586X=y
127CONFIG_GPIO_TPS65910=y 130CONFIG_GPIO_TPS65910=y
128CONFIG_POWER_SUPPLY=y 131CONFIG_POWER_SUPPLY=y
129CONFIG_BATTERY_SBS=y 132CONFIG_BATTERY_SBS=y
133CONFIG_POWER_RESET=y
134CONFIG_POWER_RESET_GPIO=y
130CONFIG_SENSORS_LM90=y 135CONFIG_SENSORS_LM90=y
131CONFIG_MFD_TPS6586X=y 136CONFIG_MFD_TPS6586X=y
132CONFIG_MFD_TPS65910=y 137CONFIG_MFD_TPS65910=y
@@ -186,6 +191,7 @@ CONFIG_RTC_INTF_SYSFS=y
186CONFIG_RTC_INTF_PROC=y 191CONFIG_RTC_INTF_PROC=y
187CONFIG_RTC_INTF_DEV=y 192CONFIG_RTC_INTF_DEV=y
188CONFIG_RTC_DRV_MAX8907=y 193CONFIG_RTC_DRV_MAX8907=y
194CONFIG_RTC_DRV_TPS6586X=y
189CONFIG_RTC_DRV_TPS65910=y 195CONFIG_RTC_DRV_TPS65910=y
190CONFIG_RTC_DRV_EM3027=y 196CONFIG_RTC_DRV_EM3027=y
191CONFIG_RTC_DRV_TEGRA=y 197CONFIG_RTC_DRV_TEGRA=y
diff --git a/arch/arm/configs/u8500_defconfig b/arch/arm/configs/u8500_defconfig
index 231dca604737..426270fe080d 100644
--- a/arch/arm/configs/u8500_defconfig
+++ b/arch/arm/configs/u8500_defconfig
@@ -66,9 +66,9 @@ CONFIG_SPI=y
66CONFIG_SPI_PL022=y 66CONFIG_SPI_PL022=y
67CONFIG_GPIO_STMPE=y 67CONFIG_GPIO_STMPE=y
68CONFIG_GPIO_TC3589X=y 68CONFIG_GPIO_TC3589X=y
69CONFIG_POWER_SUPPLY=y 69# CONFIG_POWER_SUPPLY is not set
70CONFIG_AB8500_BM=y 70# CONFIG_AB8500_BM is not set
71CONFIG_AB8500_BATTERY_THERM_ON_BATCTRL=y 71# CONFIG_AB8500_BATTERY_THERM_ON_BATCTRL is not set
72CONFIG_THERMAL=y 72CONFIG_THERMAL=y
73CONFIG_CPU_THERMAL=y 73CONFIG_CPU_THERMAL=y
74CONFIG_MFD_STMPE=y 74CONFIG_MFD_STMPE=y
diff --git a/arch/arm/crypto/aes-armv4.S b/arch/arm/crypto/aes-armv4.S
index e59b1d505d6c..19d6cd6f29f9 100644
--- a/arch/arm/crypto/aes-armv4.S
+++ b/arch/arm/crypto/aes-armv4.S
@@ -34,8 +34,9 @@
34@ A little glue here to select the correct code below for the ARM CPU 34@ A little glue here to select the correct code below for the ARM CPU
35@ that is being targetted. 35@ that is being targetted.
36 36
37#include <linux/linkage.h>
38
37.text 39.text
38.code 32
39 40
40.type AES_Te,%object 41.type AES_Te,%object
41.align 5 42.align 5
@@ -145,10 +146,8 @@ AES_Te:
145 146
146@ void AES_encrypt(const unsigned char *in, unsigned char *out, 147@ void AES_encrypt(const unsigned char *in, unsigned char *out,
147@ const AES_KEY *key) { 148@ const AES_KEY *key) {
148.global AES_encrypt
149.type AES_encrypt,%function
150.align 5 149.align 5
151AES_encrypt: 150ENTRY(AES_encrypt)
152 sub r3,pc,#8 @ AES_encrypt 151 sub r3,pc,#8 @ AES_encrypt
153 stmdb sp!,{r1,r4-r12,lr} 152 stmdb sp!,{r1,r4-r12,lr}
154 mov r12,r0 @ inp 153 mov r12,r0 @ inp
@@ -239,15 +238,8 @@ AES_encrypt:
239 strb r6,[r12,#14] 238 strb r6,[r12,#14]
240 strb r3,[r12,#15] 239 strb r3,[r12,#15]
241#endif 240#endif
242#if __ARM_ARCH__>=5
243 ldmia sp!,{r4-r12,pc} 241 ldmia sp!,{r4-r12,pc}
244#else 242ENDPROC(AES_encrypt)
245 ldmia sp!,{r4-r12,lr}
246 tst lr,#1
247 moveq pc,lr @ be binary compatible with V4, yet
248 .word 0xe12fff1e @ interoperable with Thumb ISA:-)
249#endif
250.size AES_encrypt,.-AES_encrypt
251 243
252.type _armv4_AES_encrypt,%function 244.type _armv4_AES_encrypt,%function
253.align 2 245.align 2
@@ -386,10 +378,8 @@ _armv4_AES_encrypt:
386 ldr pc,[sp],#4 @ pop and return 378 ldr pc,[sp],#4 @ pop and return
387.size _armv4_AES_encrypt,.-_armv4_AES_encrypt 379.size _armv4_AES_encrypt,.-_armv4_AES_encrypt
388 380
389.global private_AES_set_encrypt_key
390.type private_AES_set_encrypt_key,%function
391.align 5 381.align 5
392private_AES_set_encrypt_key: 382ENTRY(private_AES_set_encrypt_key)
393_armv4_AES_set_encrypt_key: 383_armv4_AES_set_encrypt_key:
394 sub r3,pc,#8 @ AES_set_encrypt_key 384 sub r3,pc,#8 @ AES_set_encrypt_key
395 teq r0,#0 385 teq r0,#0
@@ -658,15 +648,11 @@ _armv4_AES_set_encrypt_key:
658 648
659.Ldone: mov r0,#0 649.Ldone: mov r0,#0
660 ldmia sp!,{r4-r12,lr} 650 ldmia sp!,{r4-r12,lr}
661.Labrt: tst lr,#1 651.Labrt: mov pc,lr
662 moveq pc,lr @ be binary compatible with V4, yet 652ENDPROC(private_AES_set_encrypt_key)
663 .word 0xe12fff1e @ interoperable with Thumb ISA:-)
664.size private_AES_set_encrypt_key,.-private_AES_set_encrypt_key
665 653
666.global private_AES_set_decrypt_key
667.type private_AES_set_decrypt_key,%function
668.align 5 654.align 5
669private_AES_set_decrypt_key: 655ENTRY(private_AES_set_decrypt_key)
670 str lr,[sp,#-4]! @ push lr 656 str lr,[sp,#-4]! @ push lr
671#if 0 657#if 0
672 @ kernel does both of these in setkey so optimise this bit out by 658 @ kernel does both of these in setkey so optimise this bit out by
@@ -748,15 +734,8 @@ private_AES_set_decrypt_key:
748 bne .Lmix 734 bne .Lmix
749 735
750 mov r0,#0 736 mov r0,#0
751#if __ARM_ARCH__>=5
752 ldmia sp!,{r4-r12,pc} 737 ldmia sp!,{r4-r12,pc}
753#else 738ENDPROC(private_AES_set_decrypt_key)
754 ldmia sp!,{r4-r12,lr}
755 tst lr,#1
756 moveq pc,lr @ be binary compatible with V4, yet
757 .word 0xe12fff1e @ interoperable with Thumb ISA:-)
758#endif
759.size private_AES_set_decrypt_key,.-private_AES_set_decrypt_key
760 739
761.type AES_Td,%object 740.type AES_Td,%object
762.align 5 741.align 5
@@ -862,10 +841,8 @@ AES_Td:
862 841
863@ void AES_decrypt(const unsigned char *in, unsigned char *out, 842@ void AES_decrypt(const unsigned char *in, unsigned char *out,
864@ const AES_KEY *key) { 843@ const AES_KEY *key) {
865.global AES_decrypt
866.type AES_decrypt,%function
867.align 5 844.align 5
868AES_decrypt: 845ENTRY(AES_decrypt)
869 sub r3,pc,#8 @ AES_decrypt 846 sub r3,pc,#8 @ AES_decrypt
870 stmdb sp!,{r1,r4-r12,lr} 847 stmdb sp!,{r1,r4-r12,lr}
871 mov r12,r0 @ inp 848 mov r12,r0 @ inp
@@ -956,15 +933,8 @@ AES_decrypt:
956 strb r6,[r12,#14] 933 strb r6,[r12,#14]
957 strb r3,[r12,#15] 934 strb r3,[r12,#15]
958#endif 935#endif
959#if __ARM_ARCH__>=5
960 ldmia sp!,{r4-r12,pc} 936 ldmia sp!,{r4-r12,pc}
961#else 937ENDPROC(AES_decrypt)
962 ldmia sp!,{r4-r12,lr}
963 tst lr,#1
964 moveq pc,lr @ be binary compatible with V4, yet
965 .word 0xe12fff1e @ interoperable with Thumb ISA:-)
966#endif
967.size AES_decrypt,.-AES_decrypt
968 938
969.type _armv4_AES_decrypt,%function 939.type _armv4_AES_decrypt,%function
970.align 2 940.align 2
@@ -1064,7 +1034,9 @@ _armv4_AES_decrypt:
1064 and r9,lr,r1,lsr#8 1034 and r9,lr,r1,lsr#8
1065 1035
1066 ldrb r7,[r10,r7] @ Td4[s1>>0] 1036 ldrb r7,[r10,r7] @ Td4[s1>>0]
1067 ldrb r1,[r10,r1,lsr#24] @ Td4[s1>>24] 1037 ARM( ldrb r1,[r10,r1,lsr#24] ) @ Td4[s1>>24]
1038 THUMB( add r1,r10,r1,lsr#24 ) @ Td4[s1>>24]
1039 THUMB( ldrb r1,[r1] )
1068 ldrb r8,[r10,r8] @ Td4[s1>>16] 1040 ldrb r8,[r10,r8] @ Td4[s1>>16]
1069 eor r0,r7,r0,lsl#24 1041 eor r0,r7,r0,lsl#24
1070 ldrb r9,[r10,r9] @ Td4[s1>>8] 1042 ldrb r9,[r10,r9] @ Td4[s1>>8]
@@ -1077,7 +1049,9 @@ _armv4_AES_decrypt:
1077 ldrb r8,[r10,r8] @ Td4[s2>>0] 1049 ldrb r8,[r10,r8] @ Td4[s2>>0]
1078 and r9,lr,r2,lsr#16 1050 and r9,lr,r2,lsr#16
1079 1051
1080 ldrb r2,[r10,r2,lsr#24] @ Td4[s2>>24] 1052 ARM( ldrb r2,[r10,r2,lsr#24] ) @ Td4[s2>>24]
1053 THUMB( add r2,r10,r2,lsr#24 ) @ Td4[s2>>24]
1054 THUMB( ldrb r2,[r2] )
1081 eor r0,r0,r7,lsl#8 1055 eor r0,r0,r7,lsl#8
1082 ldrb r9,[r10,r9] @ Td4[s2>>16] 1056 ldrb r9,[r10,r9] @ Td4[s2>>16]
1083 eor r1,r8,r1,lsl#16 1057 eor r1,r8,r1,lsl#16
@@ -1090,7 +1064,9 @@ _armv4_AES_decrypt:
1090 and r9,lr,r3 @ i2 1064 and r9,lr,r3 @ i2
1091 1065
1092 ldrb r9,[r10,r9] @ Td4[s3>>0] 1066 ldrb r9,[r10,r9] @ Td4[s3>>0]
1093 ldrb r3,[r10,r3,lsr#24] @ Td4[s3>>24] 1067 ARM( ldrb r3,[r10,r3,lsr#24] ) @ Td4[s3>>24]
1068 THUMB( add r3,r10,r3,lsr#24 ) @ Td4[s3>>24]
1069 THUMB( ldrb r3,[r3] )
1094 eor r0,r0,r7,lsl#16 1070 eor r0,r0,r7,lsl#16
1095 ldr r7,[r11,#0] 1071 ldr r7,[r11,#0]
1096 eor r1,r1,r8,lsl#8 1072 eor r1,r1,r8,lsl#8
diff --git a/arch/arm/crypto/sha1-armv4-large.S b/arch/arm/crypto/sha1-armv4-large.S
index 7050ab133b9d..92c6eed7aac9 100644
--- a/arch/arm/crypto/sha1-armv4-large.S
+++ b/arch/arm/crypto/sha1-armv4-large.S
@@ -51,13 +51,12 @@
51@ Profiler-assisted and platform-specific optimization resulted in 10% 51@ Profiler-assisted and platform-specific optimization resulted in 10%
52@ improvement on Cortex A8 core and 12.2 cycles per byte. 52@ improvement on Cortex A8 core and 12.2 cycles per byte.
53 53
54.text 54#include <linux/linkage.h>
55 55
56.global sha1_block_data_order 56.text
57.type sha1_block_data_order,%function
58 57
59.align 2 58.align 2
60sha1_block_data_order: 59ENTRY(sha1_block_data_order)
61 stmdb sp!,{r4-r12,lr} 60 stmdb sp!,{r4-r12,lr}
62 add r2,r1,r2,lsl#6 @ r2 to point at the end of r1 61 add r2,r1,r2,lsl#6 @ r2 to point at the end of r1
63 ldmia r0,{r3,r4,r5,r6,r7} 62 ldmia r0,{r3,r4,r5,r6,r7}
@@ -194,7 +193,7 @@ sha1_block_data_order:
194 eor r10,r10,r7,ror#2 @ F_00_19(B,C,D) 193 eor r10,r10,r7,ror#2 @ F_00_19(B,C,D)
195 str r9,[r14,#-4]! 194 str r9,[r14,#-4]!
196 add r3,r3,r10 @ E+=F_00_19(B,C,D) 195 add r3,r3,r10 @ E+=F_00_19(B,C,D)
197 teq r14,sp 196 cmp r14,sp
198 bne .L_00_15 @ [((11+4)*5+2)*3] 197 bne .L_00_15 @ [((11+4)*5+2)*3]
199#if __ARM_ARCH__<7 198#if __ARM_ARCH__<7
200 ldrb r10,[r1,#2] 199 ldrb r10,[r1,#2]
@@ -374,7 +373,9 @@ sha1_block_data_order:
374 @ F_xx_xx 373 @ F_xx_xx
375 add r3,r3,r9 @ E+=X[i] 374 add r3,r3,r9 @ E+=X[i]
376 add r3,r3,r10 @ E+=F_20_39(B,C,D) 375 add r3,r3,r10 @ E+=F_20_39(B,C,D)
377 teq r14,sp @ preserve carry 376 ARM( teq r14,sp ) @ preserve carry
377 THUMB( mov r11,sp )
378 THUMB( teq r14,r11 ) @ preserve carry
378 bne .L_20_39_or_60_79 @ [+((12+3)*5+2)*4] 379 bne .L_20_39_or_60_79 @ [+((12+3)*5+2)*4]
379 bcs .L_done @ [+((12+3)*5+2)*4], spare 300 bytes 380 bcs .L_done @ [+((12+3)*5+2)*4], spare 300 bytes
380 381
@@ -466,7 +467,7 @@ sha1_block_data_order:
466 add r3,r3,r9 @ E+=X[i] 467 add r3,r3,r9 @ E+=X[i]
467 add r3,r3,r10 @ E+=F_40_59(B,C,D) 468 add r3,r3,r10 @ E+=F_40_59(B,C,D)
468 add r3,r3,r11,ror#2 469 add r3,r3,r11,ror#2
469 teq r14,sp 470 cmp r14,sp
470 bne .L_40_59 @ [+((12+5)*5+2)*4] 471 bne .L_40_59 @ [+((12+5)*5+2)*4]
471 472
472 ldr r8,.LK_60_79 473 ldr r8,.LK_60_79
@@ -485,19 +486,12 @@ sha1_block_data_order:
485 teq r1,r2 486 teq r1,r2
486 bne .Lloop @ [+18], total 1307 487 bne .Lloop @ [+18], total 1307
487 488
488#if __ARM_ARCH__>=5
489 ldmia sp!,{r4-r12,pc} 489 ldmia sp!,{r4-r12,pc}
490#else
491 ldmia sp!,{r4-r12,lr}
492 tst lr,#1
493 moveq pc,lr @ be binary compatible with V4, yet
494 .word 0xe12fff1e @ interoperable with Thumb ISA:-)
495#endif
496.align 2 490.align 2
497.LK_00_19: .word 0x5a827999 491.LK_00_19: .word 0x5a827999
498.LK_20_39: .word 0x6ed9eba1 492.LK_20_39: .word 0x6ed9eba1
499.LK_40_59: .word 0x8f1bbcdc 493.LK_40_59: .word 0x8f1bbcdc
500.LK_60_79: .word 0xca62c1d6 494.LK_60_79: .word 0xca62c1d6
501.size sha1_block_data_order,.-sha1_block_data_order 495ENDPROC(sha1_block_data_order)
502.asciz "SHA1 block transform for ARMv4, CRYPTOGAMS by <appro@openssl.org>" 496.asciz "SHA1 block transform for ARMv4, CRYPTOGAMS by <appro@openssl.org>"
503.align 2 497.align 2
diff --git a/arch/arm/include/asm/arch_timer.h b/arch/arm/include/asm/arch_timer.h
index d40229d9a1c9..7ade91d8cc6f 100644
--- a/arch/arm/include/asm/arch_timer.h
+++ b/arch/arm/include/asm/arch_timer.h
@@ -1,13 +1,115 @@
1#ifndef __ASMARM_ARCH_TIMER_H 1#ifndef __ASMARM_ARCH_TIMER_H
2#define __ASMARM_ARCH_TIMER_H 2#define __ASMARM_ARCH_TIMER_H
3 3
4#include <asm/barrier.h>
4#include <asm/errno.h> 5#include <asm/errno.h>
5#include <linux/clocksource.h> 6#include <linux/clocksource.h>
7#include <linux/init.h>
8#include <linux/types.h>
9
10#include <clocksource/arm_arch_timer.h>
6 11
7#ifdef CONFIG_ARM_ARCH_TIMER 12#ifdef CONFIG_ARM_ARCH_TIMER
8int arch_timer_of_register(void); 13int arch_timer_of_register(void);
9int arch_timer_sched_clock_init(void); 14int arch_timer_sched_clock_init(void);
10struct timecounter *arch_timer_get_timecounter(void); 15
16/*
17 * These register accessors are marked inline so the compiler can
18 * nicely work out which register we want, and chuck away the rest of
19 * the code. At least it does so with a recent GCC (4.6.3).
20 */
21static inline void arch_timer_reg_write(const int access, const int reg, u32 val)
22{
23 if (access == ARCH_TIMER_PHYS_ACCESS) {
24 switch (reg) {
25 case ARCH_TIMER_REG_CTRL:
26 asm volatile("mcr p15, 0, %0, c14, c2, 1" : : "r" (val));
27 break;
28 case ARCH_TIMER_REG_TVAL:
29 asm volatile("mcr p15, 0, %0, c14, c2, 0" : : "r" (val));
30 break;
31 }
32 }
33
34 if (access == ARCH_TIMER_VIRT_ACCESS) {
35 switch (reg) {
36 case ARCH_TIMER_REG_CTRL:
37 asm volatile("mcr p15, 0, %0, c14, c3, 1" : : "r" (val));
38 break;
39 case ARCH_TIMER_REG_TVAL:
40 asm volatile("mcr p15, 0, %0, c14, c3, 0" : : "r" (val));
41 break;
42 }
43 }
44
45 isb();
46}
47
48static inline u32 arch_timer_reg_read(const int access, const int reg)
49{
50 u32 val = 0;
51
52 if (access == ARCH_TIMER_PHYS_ACCESS) {
53 switch (reg) {
54 case ARCH_TIMER_REG_CTRL:
55 asm volatile("mrc p15, 0, %0, c14, c2, 1" : "=r" (val));
56 break;
57 case ARCH_TIMER_REG_TVAL:
58 asm volatile("mrc p15, 0, %0, c14, c2, 0" : "=r" (val));
59 break;
60 }
61 }
62
63 if (access == ARCH_TIMER_VIRT_ACCESS) {
64 switch (reg) {
65 case ARCH_TIMER_REG_CTRL:
66 asm volatile("mrc p15, 0, %0, c14, c3, 1" : "=r" (val));
67 break;
68 case ARCH_TIMER_REG_TVAL:
69 asm volatile("mrc p15, 0, %0, c14, c3, 0" : "=r" (val));
70 break;
71 }
72 }
73
74 return val;
75}
76
77static inline u32 arch_timer_get_cntfrq(void)
78{
79 u32 val;
80 asm volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (val));
81 return val;
82}
83
84static inline u64 arch_counter_get_cntpct(void)
85{
86 u64 cval;
87
88 isb();
89 asm volatile("mrrc p15, 0, %Q0, %R0, c14" : "=r" (cval));
90 return cval;
91}
92
93static inline u64 arch_counter_get_cntvct(void)
94{
95 u64 cval;
96
97 isb();
98 asm volatile("mrrc p15, 1, %Q0, %R0, c14" : "=r" (cval));
99 return cval;
100}
101
102static inline void __cpuinit arch_counter_set_user_access(void)
103{
104 u32 cntkctl;
105
106 asm volatile("mrc p15, 0, %0, c14, c1, 0" : "=r" (cntkctl));
107
108 /* disable user access to everything */
109 cntkctl &= ~((3 << 8) | (7 << 0));
110
111 asm volatile("mcr p15, 0, %0, c14, c1, 0" : : "r" (cntkctl));
112}
11#else 113#else
12static inline int arch_timer_of_register(void) 114static inline int arch_timer_of_register(void)
13{ 115{
@@ -18,11 +120,6 @@ static inline int arch_timer_sched_clock_init(void)
18{ 120{
19 return -ENXIO; 121 return -ENXIO;
20} 122}
21
22static inline struct timecounter *arch_timer_get_timecounter(void)
23{
24 return NULL;
25}
26#endif 123#endif
27 124
28#endif 125#endif
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
index eb87200aa4b5..05ee9eebad6b 100644
--- a/arch/arm/include/asm/assembler.h
+++ b/arch/arm/include/asm/assembler.h
@@ -246,18 +246,14 @@
246 * 246 *
247 * This macro is intended for forcing the CPU into SVC mode at boot time. 247 * This macro is intended for forcing the CPU into SVC mode at boot time.
248 * you cannot return to the original mode. 248 * you cannot return to the original mode.
249 *
250 * Beware, it also clobers LR.
251 */ 249 */
252.macro safe_svcmode_maskall reg:req 250.macro safe_svcmode_maskall reg:req
253#if __LINUX_ARM_ARCH__ >= 6 251#if __LINUX_ARM_ARCH__ >= 6
254 mrs \reg , cpsr 252 mrs \reg , cpsr
255 mov lr , \reg 253 eor \reg, \reg, #HYP_MODE
256 and lr , lr , #MODE_MASK 254 tst \reg, #MODE_MASK
257 cmp lr , #HYP_MODE
258 orr \reg , \reg , #PSR_I_BIT | PSR_F_BIT
259 bic \reg , \reg , #MODE_MASK 255 bic \reg , \reg , #MODE_MASK
260 orr \reg , \reg , #SVC_MODE 256 orr \reg , \reg , #PSR_I_BIT | PSR_F_BIT | SVC_MODE
261THUMB( orr \reg , \reg , #PSR_T_BIT ) 257THUMB( orr \reg , \reg , #PSR_T_BIT )
262 bne 1f 258 bne 1f
263 orr \reg, \reg, #PSR_A_BIT 259 orr \reg, \reg, #PSR_A_BIT
diff --git a/arch/arm/include/asm/cputype.h b/arch/arm/include/asm/cputype.h
index 574269ed2232..7652712d1d14 100644
--- a/arch/arm/include/asm/cputype.h
+++ b/arch/arm/include/asm/cputype.h
@@ -38,6 +38,24 @@
38#define MPIDR_AFFINITY_LEVEL(mpidr, level) \ 38#define MPIDR_AFFINITY_LEVEL(mpidr, level) \
39 ((mpidr >> (MPIDR_LEVEL_BITS * level)) & MPIDR_LEVEL_MASK) 39 ((mpidr >> (MPIDR_LEVEL_BITS * level)) & MPIDR_LEVEL_MASK)
40 40
41#define ARM_CPU_IMP_ARM 0x41
42#define ARM_CPU_IMP_INTEL 0x69
43
44#define ARM_CPU_PART_ARM1136 0xB360
45#define ARM_CPU_PART_ARM1156 0xB560
46#define ARM_CPU_PART_ARM1176 0xB760
47#define ARM_CPU_PART_ARM11MPCORE 0xB020
48#define ARM_CPU_PART_CORTEX_A8 0xC080
49#define ARM_CPU_PART_CORTEX_A9 0xC090
50#define ARM_CPU_PART_CORTEX_A5 0xC050
51#define ARM_CPU_PART_CORTEX_A15 0xC0F0
52#define ARM_CPU_PART_CORTEX_A7 0xC070
53
54#define ARM_CPU_XSCALE_ARCH_MASK 0xe000
55#define ARM_CPU_XSCALE_ARCH_V1 0x2000
56#define ARM_CPU_XSCALE_ARCH_V2 0x4000
57#define ARM_CPU_XSCALE_ARCH_V3 0x6000
58
41extern unsigned int processor_id; 59extern unsigned int processor_id;
42 60
43#ifdef CONFIG_CPU_CP15 61#ifdef CONFIG_CPU_CP15
@@ -97,6 +115,21 @@ static inline unsigned int __attribute_const__ read_cpuid_id(void)
97 115
98#endif /* ifdef CONFIG_CPU_CP15 / else */ 116#endif /* ifdef CONFIG_CPU_CP15 / else */
99 117
118static inline unsigned int __attribute_const__ read_cpuid_implementor(void)
119{
120 return (read_cpuid_id() & 0xFF000000) >> 24;
121}
122
123static inline unsigned int __attribute_const__ read_cpuid_part_number(void)
124{
125 return read_cpuid_id() & 0xFFF0;
126}
127
128static inline unsigned int __attribute_const__ xscale_cpu_arch_version(void)
129{
130 return read_cpuid_part_number() & ARM_CPU_XSCALE_ARCH_MASK;
131}
132
100static inline unsigned int __attribute_const__ read_cpuid_cachetype(void) 133static inline unsigned int __attribute_const__ read_cpuid_cachetype(void)
101{ 134{
102 return read_cpuid(CPUID_CACHETYPE); 135 return read_cpuid(CPUID_CACHETYPE);
diff --git a/arch/arm/include/asm/cti.h b/arch/arm/include/asm/cti.h
index f2e5cad3f306..2381199acb7d 100644
--- a/arch/arm/include/asm/cti.h
+++ b/arch/arm/include/asm/cti.h
@@ -2,6 +2,7 @@
2#define __ASMARM_CTI_H 2#define __ASMARM_CTI_H
3 3
4#include <asm/io.h> 4#include <asm/io.h>
5#include <asm/hardware/coresight.h>
5 6
6/* The registers' definition is from section 3.2 of 7/* The registers' definition is from section 3.2 of
7 * Embedded Cross Trigger Revision: r0p0 8 * Embedded Cross Trigger Revision: r0p0
@@ -35,11 +36,6 @@
35#define LOCKACCESS 0xFB0 36#define LOCKACCESS 0xFB0
36#define LOCKSTATUS 0xFB4 37#define LOCKSTATUS 0xFB4
37 38
38/* write this value to LOCKACCESS will unlock the module, and
39 * other value will lock the module
40 */
41#define LOCKCODE 0xC5ACCE55
42
43/** 39/**
44 * struct cti - cross trigger interface struct 40 * struct cti - cross trigger interface struct
45 * @base: mapped virtual address for the cti base 41 * @base: mapped virtual address for the cti base
@@ -146,7 +142,7 @@ static inline void cti_irq_ack(struct cti *cti)
146 */ 142 */
147static inline void cti_unlock(struct cti *cti) 143static inline void cti_unlock(struct cti *cti)
148{ 144{
149 __raw_writel(LOCKCODE, cti->base + LOCKACCESS); 145 __raw_writel(CS_LAR_KEY, cti->base + LOCKACCESS);
150} 146}
151 147
152/** 148/**
@@ -158,6 +154,6 @@ static inline void cti_unlock(struct cti *cti)
158 */ 154 */
159static inline void cti_lock(struct cti *cti) 155static inline void cti_lock(struct cti *cti)
160{ 156{
161 __raw_writel(~LOCKCODE, cti->base + LOCKACCESS); 157 __raw_writel(~CS_LAR_KEY, cti->base + LOCKACCESS);
162} 158}
163#endif 159#endif
diff --git a/arch/arm/include/asm/delay.h b/arch/arm/include/asm/delay.h
index ab98fdd083bd..720799fd3a81 100644
--- a/arch/arm/include/asm/delay.h
+++ b/arch/arm/include/asm/delay.h
@@ -24,6 +24,7 @@ extern struct arm_delay_ops {
24 void (*delay)(unsigned long); 24 void (*delay)(unsigned long);
25 void (*const_udelay)(unsigned long); 25 void (*const_udelay)(unsigned long);
26 void (*udelay)(unsigned long); 26 void (*udelay)(unsigned long);
27 bool const_clock;
27} arm_delay_ops; 28} arm_delay_ops;
28 29
29#define __delay(n) arm_delay_ops.delay(n) 30#define __delay(n) arm_delay_ops.delay(n)
diff --git a/arch/arm/include/asm/device.h b/arch/arm/include/asm/device.h
index b69c0d3285f8..dc662fca9230 100644
--- a/arch/arm/include/asm/device.h
+++ b/arch/arm/include/asm/device.h
@@ -27,4 +27,10 @@ struct pdev_archdata {
27#endif 27#endif
28}; 28};
29 29
30#ifdef CONFIG_ARM_DMA_USE_IOMMU
31#define to_dma_iommu_mapping(dev) ((dev)->archdata.mapping)
32#else
33#define to_dma_iommu_mapping(dev) NULL
34#endif
35
30#endif 36#endif
diff --git a/arch/arm/include/asm/dma-iommu.h b/arch/arm/include/asm/dma-iommu.h
index 799b09409fad..a8c56acc8c98 100644
--- a/arch/arm/include/asm/dma-iommu.h
+++ b/arch/arm/include/asm/dma-iommu.h
@@ -7,6 +7,7 @@
7#include <linux/scatterlist.h> 7#include <linux/scatterlist.h>
8#include <linux/dma-debug.h> 8#include <linux/dma-debug.h>
9#include <linux/kmemcheck.h> 9#include <linux/kmemcheck.h>
10#include <linux/kref.h>
10 11
11struct dma_iommu_mapping { 12struct dma_iommu_mapping {
12 /* iommu specific data */ 13 /* iommu specific data */
@@ -29,6 +30,7 @@ void arm_iommu_release_mapping(struct dma_iommu_mapping *mapping);
29 30
30int arm_iommu_attach_device(struct device *dev, 31int arm_iommu_attach_device(struct device *dev,
31 struct dma_iommu_mapping *mapping); 32 struct dma_iommu_mapping *mapping);
33void arm_iommu_detach_device(struct device *dev);
32 34
33#endif /* __KERNEL__ */ 35#endif /* __KERNEL__ */
34#endif 36#endif
diff --git a/arch/arm/include/asm/dma.h b/arch/arm/include/asm/dma.h
index 5694a0d6576b..58b8c6a0ab1f 100644
--- a/arch/arm/include/asm/dma.h
+++ b/arch/arm/include/asm/dma.h
@@ -105,7 +105,7 @@ extern void set_dma_sg(unsigned int chan, struct scatterlist *sg, int nr_sg);
105 */ 105 */
106extern void __set_dma_addr(unsigned int chan, void *addr); 106extern void __set_dma_addr(unsigned int chan, void *addr);
107#define set_dma_addr(chan, addr) \ 107#define set_dma_addr(chan, addr) \
108 __set_dma_addr(chan, bus_to_virt(addr)) 108 __set_dma_addr(chan, (void *)__bus_to_virt(addr))
109 109
110/* Set the DMA byte count for this channel 110/* Set the DMA byte count for this channel
111 * 111 *
diff --git a/arch/arm/include/asm/hardware/coresight.h b/arch/arm/include/asm/hardware/coresight.h
index 7ecd793b8f5a..0cf7a6b842ff 100644
--- a/arch/arm/include/asm/hardware/coresight.h
+++ b/arch/arm/include/asm/hardware/coresight.h
@@ -36,7 +36,7 @@
36/* CoreSight Component Registers */ 36/* CoreSight Component Registers */
37#define CSCR_CLASS 0xff4 37#define CSCR_CLASS 0xff4
38 38
39#define UNLOCK_MAGIC 0xc5acce55 39#define CS_LAR_KEY 0xc5acce55
40 40
41/* ETM control register, "ETM Architecture", 3.3.1 */ 41/* ETM control register, "ETM Architecture", 3.3.1 */
42#define ETMR_CTRL 0 42#define ETMR_CTRL 0
@@ -147,11 +147,11 @@
147 147
148#define etm_lock(t) do { etm_writel((t), 0, CSMR_LOCKACCESS); } while (0) 148#define etm_lock(t) do { etm_writel((t), 0, CSMR_LOCKACCESS); } while (0)
149#define etm_unlock(t) \ 149#define etm_unlock(t) \
150 do { etm_writel((t), UNLOCK_MAGIC, CSMR_LOCKACCESS); } while (0) 150 do { etm_writel((t), CS_LAR_KEY, CSMR_LOCKACCESS); } while (0)
151 151
152#define etb_lock(t) do { etb_writel((t), 0, CSMR_LOCKACCESS); } while (0) 152#define etb_lock(t) do { etb_writel((t), 0, CSMR_LOCKACCESS); } while (0)
153#define etb_unlock(t) \ 153#define etb_unlock(t) \
154 do { etb_writel((t), UNLOCK_MAGIC, CSMR_LOCKACCESS); } while (0) 154 do { etb_writel((t), CS_LAR_KEY, CSMR_LOCKACCESS); } while (0)
155 155
156#endif /* __ASM_HARDWARE_CORESIGHT_H */ 156#endif /* __ASM_HARDWARE_CORESIGHT_H */
157 157
diff --git a/arch/arm/include/asm/hardware/gic.h b/arch/arm/include/asm/hardware/gic.h
deleted file mode 100644
index 4b1ce6cd477f..000000000000
--- a/arch/arm/include/asm/hardware/gic.h
+++ /dev/null
@@ -1,57 +0,0 @@
1/*
2 * arch/arm/include/asm/hardware/gic.h
3 *
4 * Copyright (C) 2002 ARM Limited, All Rights Reserved.
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_ARM_HARDWARE_GIC_H
11#define __ASM_ARM_HARDWARE_GIC_H
12
13#include <linux/compiler.h>
14
15#define GIC_CPU_CTRL 0x00
16#define GIC_CPU_PRIMASK 0x04
17#define GIC_CPU_BINPOINT 0x08
18#define GIC_CPU_INTACK 0x0c
19#define GIC_CPU_EOI 0x10
20#define GIC_CPU_RUNNINGPRI 0x14
21#define GIC_CPU_HIGHPRI 0x18
22
23#define GIC_DIST_CTRL 0x000
24#define GIC_DIST_CTR 0x004
25#define GIC_DIST_ENABLE_SET 0x100
26#define GIC_DIST_ENABLE_CLEAR 0x180
27#define GIC_DIST_PENDING_SET 0x200
28#define GIC_DIST_PENDING_CLEAR 0x280
29#define GIC_DIST_ACTIVE_BIT 0x300
30#define GIC_DIST_PRI 0x400
31#define GIC_DIST_TARGET 0x800
32#define GIC_DIST_CONFIG 0xc00
33#define GIC_DIST_SOFTINT 0xf00
34
35#ifndef __ASSEMBLY__
36#include <linux/irqdomain.h>
37struct device_node;
38
39extern struct irq_chip gic_arch_extn;
40
41void gic_init_bases(unsigned int, int, void __iomem *, void __iomem *,
42 u32 offset, struct device_node *);
43int gic_of_init(struct device_node *node, struct device_node *parent);
44void gic_secondary_init(unsigned int);
45void gic_handle_irq(struct pt_regs *regs);
46void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
47void gic_raise_softirq(const struct cpumask *mask, unsigned int irq);
48
49static inline void gic_init(unsigned int nr, int start,
50 void __iomem *dist , void __iomem *cpu)
51{
52 gic_init_bases(nr, start, dist, cpu, 0, NULL);
53}
54
55#endif
56
57#endif
diff --git a/arch/arm/include/asm/hardware/pl080.h b/arch/arm/include/asm/hardware/pl080.h
deleted file mode 100644
index 4eea2107214b..000000000000
--- a/arch/arm/include/asm/hardware/pl080.h
+++ /dev/null
@@ -1,146 +0,0 @@
1/* arch/arm/include/asm/hardware/pl080.h
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * http://armlinux.simtec.co.uk/
6 * Ben Dooks <ben@simtec.co.uk>
7 *
8 * ARM PrimeCell PL080 DMA controller
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/* Note, there are some Samsung updates to this controller block which
16 * make it not entierly compatible with the PL080 specification from
17 * ARM. When in doubt, check the Samsung documentation first.
18 *
19 * The Samsung defines are PL080S, and add an extra control register,
20 * the ability to move more than 2^11 counts of data and some extra
21 * OneNAND features.
22*/
23
24#ifndef ASM_PL080_H
25#define ASM_PL080_H
26
27#define PL080_INT_STATUS (0x00)
28#define PL080_TC_STATUS (0x04)
29#define PL080_TC_CLEAR (0x08)
30#define PL080_ERR_STATUS (0x0C)
31#define PL080_ERR_CLEAR (0x10)
32#define PL080_RAW_TC_STATUS (0x14)
33#define PL080_RAW_ERR_STATUS (0x18)
34#define PL080_EN_CHAN (0x1c)
35#define PL080_SOFT_BREQ (0x20)
36#define PL080_SOFT_SREQ (0x24)
37#define PL080_SOFT_LBREQ (0x28)
38#define PL080_SOFT_LSREQ (0x2C)
39
40#define PL080_CONFIG (0x30)
41#define PL080_CONFIG_M2_BE (1 << 2)
42#define PL080_CONFIG_M1_BE (1 << 1)
43#define PL080_CONFIG_ENABLE (1 << 0)
44
45#define PL080_SYNC (0x34)
46
47/* Per channel configuration registers */
48
49#define PL080_Cx_STRIDE (0x20)
50#define PL080_Cx_BASE(x) ((0x100 + (x * 0x20)))
51#define PL080_Cx_SRC_ADDR(x) ((0x100 + (x * 0x20)))
52#define PL080_Cx_DST_ADDR(x) ((0x104 + (x * 0x20)))
53#define PL080_Cx_LLI(x) ((0x108 + (x * 0x20)))
54#define PL080_Cx_CONTROL(x) ((0x10C + (x * 0x20)))
55#define PL080_Cx_CONFIG(x) ((0x110 + (x * 0x20)))
56#define PL080S_Cx_CONTROL2(x) ((0x110 + (x * 0x20)))
57#define PL080S_Cx_CONFIG(x) ((0x114 + (x * 0x20)))
58
59#define PL080_CH_SRC_ADDR (0x00)
60#define PL080_CH_DST_ADDR (0x04)
61#define PL080_CH_LLI (0x08)
62#define PL080_CH_CONTROL (0x0C)
63#define PL080_CH_CONFIG (0x10)
64#define PL080S_CH_CONTROL2 (0x10)
65#define PL080S_CH_CONFIG (0x14)
66
67#define PL080_LLI_ADDR_MASK (0x3fffffff << 2)
68#define PL080_LLI_ADDR_SHIFT (2)
69#define PL080_LLI_LM_AHB2 (1 << 0)
70
71#define PL080_CONTROL_TC_IRQ_EN (1 << 31)
72#define PL080_CONTROL_PROT_MASK (0x7 << 28)
73#define PL080_CONTROL_PROT_SHIFT (28)
74#define PL080_CONTROL_PROT_CACHE (1 << 30)
75#define PL080_CONTROL_PROT_BUFF (1 << 29)
76#define PL080_CONTROL_PROT_SYS (1 << 28)
77#define PL080_CONTROL_DST_INCR (1 << 27)
78#define PL080_CONTROL_SRC_INCR (1 << 26)
79#define PL080_CONTROL_DST_AHB2 (1 << 25)
80#define PL080_CONTROL_SRC_AHB2 (1 << 24)
81#define PL080_CONTROL_DWIDTH_MASK (0x7 << 21)
82#define PL080_CONTROL_DWIDTH_SHIFT (21)
83#define PL080_CONTROL_SWIDTH_MASK (0x7 << 18)
84#define PL080_CONTROL_SWIDTH_SHIFT (18)
85#define PL080_CONTROL_DB_SIZE_MASK (0x7 << 15)
86#define PL080_CONTROL_DB_SIZE_SHIFT (15)
87#define PL080_CONTROL_SB_SIZE_MASK (0x7 << 12)
88#define PL080_CONTROL_SB_SIZE_SHIFT (12)
89#define PL080_CONTROL_TRANSFER_SIZE_MASK (0xfff << 0)
90#define PL080_CONTROL_TRANSFER_SIZE_SHIFT (0)
91
92#define PL080_BSIZE_1 (0x0)
93#define PL080_BSIZE_4 (0x1)
94#define PL080_BSIZE_8 (0x2)
95#define PL080_BSIZE_16 (0x3)
96#define PL080_BSIZE_32 (0x4)
97#define PL080_BSIZE_64 (0x5)
98#define PL080_BSIZE_128 (0x6)
99#define PL080_BSIZE_256 (0x7)
100
101#define PL080_WIDTH_8BIT (0x0)
102#define PL080_WIDTH_16BIT (0x1)
103#define PL080_WIDTH_32BIT (0x2)
104
105#define PL080N_CONFIG_ITPROT (1 << 20)
106#define PL080N_CONFIG_SECPROT (1 << 19)
107#define PL080_CONFIG_HALT (1 << 18)
108#define PL080_CONFIG_ACTIVE (1 << 17) /* RO */
109#define PL080_CONFIG_LOCK (1 << 16)
110#define PL080_CONFIG_TC_IRQ_MASK (1 << 15)
111#define PL080_CONFIG_ERR_IRQ_MASK (1 << 14)
112#define PL080_CONFIG_FLOW_CONTROL_MASK (0x7 << 11)
113#define PL080_CONFIG_FLOW_CONTROL_SHIFT (11)
114#define PL080_CONFIG_DST_SEL_MASK (0xf << 6)
115#define PL080_CONFIG_DST_SEL_SHIFT (6)
116#define PL080_CONFIG_SRC_SEL_MASK (0xf << 1)
117#define PL080_CONFIG_SRC_SEL_SHIFT (1)
118#define PL080_CONFIG_ENABLE (1 << 0)
119
120#define PL080_FLOW_MEM2MEM (0x0)
121#define PL080_FLOW_MEM2PER (0x1)
122#define PL080_FLOW_PER2MEM (0x2)
123#define PL080_FLOW_SRC2DST (0x3)
124#define PL080_FLOW_SRC2DST_DST (0x4)
125#define PL080_FLOW_MEM2PER_PER (0x5)
126#define PL080_FLOW_PER2MEM_PER (0x6)
127#define PL080_FLOW_SRC2DST_SRC (0x7)
128
129/* DMA linked list chain structure */
130
131struct pl080_lli {
132 u32 src_addr;
133 u32 dst_addr;
134 u32 next_lli;
135 u32 control0;
136};
137
138struct pl080s_lli {
139 u32 src_addr;
140 u32 dst_addr;
141 u32 next_lli;
142 u32 control0;
143 u32 control1;
144};
145
146#endif /* ASM_PL080_H */
diff --git a/arch/arm/include/asm/hardware/sp810.h b/arch/arm/include/asm/hardware/sp810.h
deleted file mode 100644
index 6636430dd0e6..000000000000
--- a/arch/arm/include/asm/hardware/sp810.h
+++ /dev/null
@@ -1,64 +0,0 @@
1/*
2 * arch/arm/include/asm/hardware/sp810.h
3 *
4 * ARM PrimeXsys System Controller SP810 header file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar <viresh.linux@gmail.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 __ASM_ARM_SP810_H
15#define __ASM_ARM_SP810_H
16
17#include <linux/io.h>
18
19/* sysctl registers offset */
20#define SCCTRL 0x000
21#define SCSYSSTAT 0x004
22#define SCIMCTRL 0x008
23#define SCIMSTAT 0x00C
24#define SCXTALCTRL 0x010
25#define SCPLLCTRL 0x014
26#define SCPLLFCTRL 0x018
27#define SCPERCTRL0 0x01C
28#define SCPERCTRL1 0x020
29#define SCPEREN 0x024
30#define SCPERDIS 0x028
31#define SCPERCLKEN 0x02C
32#define SCPERSTAT 0x030
33#define SCSYSID0 0xEE0
34#define SCSYSID1 0xEE4
35#define SCSYSID2 0xEE8
36#define SCSYSID3 0xEEC
37#define SCITCR 0xF00
38#define SCITIR0 0xF04
39#define SCITIR1 0xF08
40#define SCITOR 0xF0C
41#define SCCNTCTRL 0xF10
42#define SCCNTDATA 0xF14
43#define SCCNTSTEP 0xF18
44#define SCPERIPHID0 0xFE0
45#define SCPERIPHID1 0xFE4
46#define SCPERIPHID2 0xFE8
47#define SCPERIPHID3 0xFEC
48#define SCPCELLID0 0xFF0
49#define SCPCELLID1 0xFF4
50#define SCPCELLID2 0xFF8
51#define SCPCELLID3 0xFFC
52
53#define SCCTRL_TIMERENnSEL_SHIFT(n) (15 + ((n) * 2))
54
55static inline void sysctl_soft_reset(void __iomem *base)
56{
57 /* switch to slow mode */
58 writel(0x2, base + SCCTRL);
59
60 /* writing any value to SCSYSSTAT reg will reset system */
61 writel(0, base + SCSYSSTAT);
62}
63
64#endif /* __ASM_ARM_SP810_H */
diff --git a/arch/arm/include/asm/hardware/vic.h b/arch/arm/include/asm/hardware/vic.h
deleted file mode 100644
index 2bebad36fc83..000000000000
--- a/arch/arm/include/asm/hardware/vic.h
+++ /dev/null
@@ -1,57 +0,0 @@
1/*
2 * arch/arm/include/asm/hardware/vic.h
3 *
4 * Copyright (c) ARM Limited 2003. All rights reserved.
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_HARDWARE_VIC_H
21#define __ASM_ARM_HARDWARE_VIC_H
22
23#define VIC_IRQ_STATUS 0x00
24#define VIC_FIQ_STATUS 0x04
25#define VIC_RAW_STATUS 0x08
26#define VIC_INT_SELECT 0x0c /* 1 = FIQ, 0 = IRQ */
27#define VIC_INT_ENABLE 0x10 /* 1 = enable, 0 = disable */
28#define VIC_INT_ENABLE_CLEAR 0x14
29#define VIC_INT_SOFT 0x18
30#define VIC_INT_SOFT_CLEAR 0x1c
31#define VIC_PROTECT 0x20
32#define VIC_PL190_VECT_ADDR 0x30 /* PL190 only */
33#define VIC_PL190_DEF_VECT_ADDR 0x34 /* PL190 only */
34
35#define VIC_VECT_ADDR0 0x100 /* 0 to 15 (0..31 PL192) */
36#define VIC_VECT_CNTL0 0x200 /* 0 to 15 (0..31 PL192) */
37#define VIC_ITCR 0x300 /* VIC test control register */
38
39#define VIC_VECT_CNTL_ENABLE (1 << 5)
40
41#define VIC_PL192_VECT_ADDR 0xF00
42
43#ifndef __ASSEMBLY__
44#include <linux/compiler.h>
45#include <linux/types.h>
46
47struct device_node;
48struct pt_regs;
49
50void __vic_init(void __iomem *base, int irq_start, u32 vic_sources,
51 u32 resume_sources, struct device_node *node);
52void vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources, u32 resume_sources);
53int vic_of_init(struct device_node *node, struct device_node *parent);
54void vic_handle_irq(struct pt_regs *regs);
55
56#endif /* __ASSEMBLY__ */
57#endif
diff --git a/arch/arm/include/asm/hw_breakpoint.h b/arch/arm/include/asm/hw_breakpoint.h
index 01169dd723f1..eef55ea9ef00 100644
--- a/arch/arm/include/asm/hw_breakpoint.h
+++ b/arch/arm/include/asm/hw_breakpoint.h
@@ -85,6 +85,9 @@ static inline void decode_ctrl_reg(u32 reg,
85#define ARM_DSCR_HDBGEN (1 << 14) 85#define ARM_DSCR_HDBGEN (1 << 14)
86#define ARM_DSCR_MDBGEN (1 << 15) 86#define ARM_DSCR_MDBGEN (1 << 15)
87 87
88/* OSLSR os lock model bits */
89#define ARM_OSLSR_OSLM0 (1 << 0)
90
88/* opcode2 numbers for the co-processor instructions. */ 91/* opcode2 numbers for the co-processor instructions. */
89#define ARM_OP2_BVR 4 92#define ARM_OP2_BVR 4
90#define ARM_OP2_BCR 5 93#define ARM_OP2_BCR 5
diff --git a/arch/arm/include/asm/idmap.h b/arch/arm/include/asm/idmap.h
index bf863edb517d..1a66f907e5cc 100644
--- a/arch/arm/include/asm/idmap.h
+++ b/arch/arm/include/asm/idmap.h
@@ -8,6 +8,7 @@
8#define __idmap __section(.idmap.text) noinline notrace 8#define __idmap __section(.idmap.text) noinline notrace
9 9
10extern pgd_t *idmap_pgd; 10extern pgd_t *idmap_pgd;
11extern pgd_t *hyp_pgd;
11 12
12void setup_mm_for_reboot(void); 13void setup_mm_for_reboot(void);
13 14
diff --git a/arch/arm/include/asm/kvm_arch_timer.h b/arch/arm/include/asm/kvm_arch_timer.h
new file mode 100644
index 000000000000..68cb9e1dfb81
--- /dev/null
+++ b/arch/arm/include/asm/kvm_arch_timer.h
@@ -0,0 +1,85 @@
1/*
2 * Copyright (C) 2012 ARM Ltd.
3 * Author: Marc Zyngier <marc.zyngier@arm.com>
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 * 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 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef __ASM_ARM_KVM_ARCH_TIMER_H
20#define __ASM_ARM_KVM_ARCH_TIMER_H
21
22#include <linux/clocksource.h>
23#include <linux/hrtimer.h>
24#include <linux/workqueue.h>
25
26struct arch_timer_kvm {
27#ifdef CONFIG_KVM_ARM_TIMER
28 /* Is the timer enabled */
29 bool enabled;
30
31 /* Virtual offset */
32 cycle_t cntvoff;
33#endif
34};
35
36struct arch_timer_cpu {
37#ifdef CONFIG_KVM_ARM_TIMER
38 /* Registers: control register, timer value */
39 u32 cntv_ctl; /* Saved/restored */
40 cycle_t cntv_cval; /* Saved/restored */
41
42 /*
43 * Anything that is not used directly from assembly code goes
44 * here.
45 */
46
47 /* Background timer used when the guest is not running */
48 struct hrtimer timer;
49
50 /* Work queued with the above timer expires */
51 struct work_struct expired;
52
53 /* Background timer active */
54 bool armed;
55
56 /* Timer IRQ */
57 const struct kvm_irq_level *irq;
58#endif
59};
60
61#ifdef CONFIG_KVM_ARM_TIMER
62int kvm_timer_hyp_init(void);
63int kvm_timer_init(struct kvm *kvm);
64void kvm_timer_vcpu_init(struct kvm_vcpu *vcpu);
65void kvm_timer_flush_hwstate(struct kvm_vcpu *vcpu);
66void kvm_timer_sync_hwstate(struct kvm_vcpu *vcpu);
67void kvm_timer_vcpu_terminate(struct kvm_vcpu *vcpu);
68#else
69static inline int kvm_timer_hyp_init(void)
70{
71 return 0;
72};
73
74static inline int kvm_timer_init(struct kvm *kvm)
75{
76 return 0;
77}
78
79static inline void kvm_timer_vcpu_init(struct kvm_vcpu *vcpu) {}
80static inline void kvm_timer_flush_hwstate(struct kvm_vcpu *vcpu) {}
81static inline void kvm_timer_sync_hwstate(struct kvm_vcpu *vcpu) {}
82static inline void kvm_timer_vcpu_terminate(struct kvm_vcpu *vcpu) {}
83#endif
84
85#endif
diff --git a/arch/arm/include/asm/kvm_arm.h b/arch/arm/include/asm/kvm_arm.h
new file mode 100644
index 000000000000..7c3d813e15df
--- /dev/null
+++ b/arch/arm/include/asm/kvm_arm.h
@@ -0,0 +1,214 @@
1/*
2 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
3 * Author: Christoffer Dall <c.dall@virtualopensystems.com>
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 * 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 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#ifndef __ARM_KVM_ARM_H__
20#define __ARM_KVM_ARM_H__
21
22#include <linux/types.h>
23
24/* Hyp Configuration Register (HCR) bits */
25#define HCR_TGE (1 << 27)
26#define HCR_TVM (1 << 26)
27#define HCR_TTLB (1 << 25)
28#define HCR_TPU (1 << 24)
29#define HCR_TPC (1 << 23)
30#define HCR_TSW (1 << 22)
31#define HCR_TAC (1 << 21)
32#define HCR_TIDCP (1 << 20)
33#define HCR_TSC (1 << 19)
34#define HCR_TID3 (1 << 18)
35#define HCR_TID2 (1 << 17)
36#define HCR_TID1 (1 << 16)
37#define HCR_TID0 (1 << 15)
38#define HCR_TWE (1 << 14)
39#define HCR_TWI (1 << 13)
40#define HCR_DC (1 << 12)
41#define HCR_BSU (3 << 10)
42#define HCR_BSU_IS (1 << 10)
43#define HCR_FB (1 << 9)
44#define HCR_VA (1 << 8)
45#define HCR_VI (1 << 7)
46#define HCR_VF (1 << 6)
47#define HCR_AMO (1 << 5)
48#define HCR_IMO (1 << 4)
49#define HCR_FMO (1 << 3)
50#define HCR_PTW (1 << 2)
51#define HCR_SWIO (1 << 1)
52#define HCR_VM 1
53
54/*
55 * The bits we set in HCR:
56 * TAC: Trap ACTLR
57 * TSC: Trap SMC
58 * TSW: Trap cache operations by set/way
59 * TWI: Trap WFI
60 * TIDCP: Trap L2CTLR/L2ECTLR
61 * BSU_IS: Upgrade barriers to the inner shareable domain
62 * FB: Force broadcast of all maintainance operations
63 * AMO: Override CPSR.A and enable signaling with VA
64 * IMO: Override CPSR.I and enable signaling with VI
65 * FMO: Override CPSR.F and enable signaling with VF
66 * SWIO: Turn set/way invalidates into set/way clean+invalidate
67 */
68#define HCR_GUEST_MASK (HCR_TSC | HCR_TSW | HCR_TWI | HCR_VM | HCR_BSU_IS | \
69 HCR_FB | HCR_TAC | HCR_AMO | HCR_IMO | HCR_FMO | \
70 HCR_SWIO | HCR_TIDCP)
71#define HCR_VIRT_EXCP_MASK (HCR_VA | HCR_VI | HCR_VF)
72
73/* System Control Register (SCTLR) bits */
74#define SCTLR_TE (1 << 30)
75#define SCTLR_EE (1 << 25)
76#define SCTLR_V (1 << 13)
77
78/* Hyp System Control Register (HSCTLR) bits */
79#define HSCTLR_TE (1 << 30)
80#define HSCTLR_EE (1 << 25)
81#define HSCTLR_FI (1 << 21)
82#define HSCTLR_WXN (1 << 19)
83#define HSCTLR_I (1 << 12)
84#define HSCTLR_C (1 << 2)
85#define HSCTLR_A (1 << 1)
86#define HSCTLR_M 1
87#define HSCTLR_MASK (HSCTLR_M | HSCTLR_A | HSCTLR_C | HSCTLR_I | \
88 HSCTLR_WXN | HSCTLR_FI | HSCTLR_EE | HSCTLR_TE)
89
90/* TTBCR and HTCR Registers bits */
91#define TTBCR_EAE (1 << 31)
92#define TTBCR_IMP (1 << 30)
93#define TTBCR_SH1 (3 << 28)
94#define TTBCR_ORGN1 (3 << 26)
95#define TTBCR_IRGN1 (3 << 24)
96#define TTBCR_EPD1 (1 << 23)
97#define TTBCR_A1 (1 << 22)
98#define TTBCR_T1SZ (3 << 16)
99#define TTBCR_SH0 (3 << 12)
100#define TTBCR_ORGN0 (3 << 10)
101#define TTBCR_IRGN0 (3 << 8)
102#define TTBCR_EPD0 (1 << 7)
103#define TTBCR_T0SZ 3
104#define HTCR_MASK (TTBCR_T0SZ | TTBCR_IRGN0 | TTBCR_ORGN0 | TTBCR_SH0)
105
106/* Hyp System Trap Register */
107#define HSTR_T(x) (1 << x)
108#define HSTR_TTEE (1 << 16)
109#define HSTR_TJDBX (1 << 17)
110
111/* Hyp Coprocessor Trap Register */
112#define HCPTR_TCP(x) (1 << x)
113#define HCPTR_TCP_MASK (0x3fff)
114#define HCPTR_TASE (1 << 15)
115#define HCPTR_TTA (1 << 20)
116#define HCPTR_TCPAC (1 << 31)
117
118/* Hyp Debug Configuration Register bits */
119#define HDCR_TDRA (1 << 11)
120#define HDCR_TDOSA (1 << 10)
121#define HDCR_TDA (1 << 9)
122#define HDCR_TDE (1 << 8)
123#define HDCR_HPME (1 << 7)
124#define HDCR_TPM (1 << 6)
125#define HDCR_TPMCR (1 << 5)
126#define HDCR_HPMN_MASK (0x1F)
127
128/*
129 * The architecture supports 40-bit IPA as input to the 2nd stage translations
130 * and PTRS_PER_S2_PGD becomes 1024, because each entry covers 1GB of address
131 * space.
132 */
133#define KVM_PHYS_SHIFT (40)
134#define KVM_PHYS_SIZE (1ULL << KVM_PHYS_SHIFT)
135#define KVM_PHYS_MASK (KVM_PHYS_SIZE - 1ULL)
136#define PTRS_PER_S2_PGD (1ULL << (KVM_PHYS_SHIFT - 30))
137#define S2_PGD_ORDER get_order(PTRS_PER_S2_PGD * sizeof(pgd_t))
138#define S2_PGD_SIZE (1 << S2_PGD_ORDER)
139
140/* Virtualization Translation Control Register (VTCR) bits */
141#define VTCR_SH0 (3 << 12)
142#define VTCR_ORGN0 (3 << 10)
143#define VTCR_IRGN0 (3 << 8)
144#define VTCR_SL0 (3 << 6)
145#define VTCR_S (1 << 4)
146#define VTCR_T0SZ (0xf)
147#define VTCR_MASK (VTCR_SH0 | VTCR_ORGN0 | VTCR_IRGN0 | VTCR_SL0 | \
148 VTCR_S | VTCR_T0SZ)
149#define VTCR_HTCR_SH (VTCR_SH0 | VTCR_ORGN0 | VTCR_IRGN0)
150#define VTCR_SL_L2 (0 << 6) /* Starting-level: 2 */
151#define VTCR_SL_L1 (1 << 6) /* Starting-level: 1 */
152#define KVM_VTCR_SL0 VTCR_SL_L1
153/* stage-2 input address range defined as 2^(32-T0SZ) */
154#define KVM_T0SZ (32 - KVM_PHYS_SHIFT)
155#define KVM_VTCR_T0SZ (KVM_T0SZ & VTCR_T0SZ)
156#define KVM_VTCR_S ((KVM_VTCR_T0SZ << 1) & VTCR_S)
157
158/* Virtualization Translation Table Base Register (VTTBR) bits */
159#if KVM_VTCR_SL0 == VTCR_SL_L2 /* see ARM DDI 0406C: B4-1720 */
160#define VTTBR_X (14 - KVM_T0SZ)
161#else
162#define VTTBR_X (5 - KVM_T0SZ)
163#endif
164#define VTTBR_BADDR_SHIFT (VTTBR_X - 1)
165#define VTTBR_BADDR_MASK (((1LLU << (40 - VTTBR_X)) - 1) << VTTBR_BADDR_SHIFT)
166#define VTTBR_VMID_SHIFT (48LLU)
167#define VTTBR_VMID_MASK (0xffLLU << VTTBR_VMID_SHIFT)
168
169/* Hyp Syndrome Register (HSR) bits */
170#define HSR_EC_SHIFT (26)
171#define HSR_EC (0x3fU << HSR_EC_SHIFT)
172#define HSR_IL (1U << 25)
173#define HSR_ISS (HSR_IL - 1)
174#define HSR_ISV_SHIFT (24)
175#define HSR_ISV (1U << HSR_ISV_SHIFT)
176#define HSR_SRT_SHIFT (16)
177#define HSR_SRT_MASK (0xf << HSR_SRT_SHIFT)
178#define HSR_FSC (0x3f)
179#define HSR_FSC_TYPE (0x3c)
180#define HSR_SSE (1 << 21)
181#define HSR_WNR (1 << 6)
182#define HSR_CV_SHIFT (24)
183#define HSR_CV (1U << HSR_CV_SHIFT)
184#define HSR_COND_SHIFT (20)
185#define HSR_COND (0xfU << HSR_COND_SHIFT)
186
187#define FSC_FAULT (0x04)
188#define FSC_PERM (0x0c)
189
190/* Hyp Prefetch Fault Address Register (HPFAR/HDFAR) */
191#define HPFAR_MASK (~0xf)
192
193#define HSR_EC_UNKNOWN (0x00)
194#define HSR_EC_WFI (0x01)
195#define HSR_EC_CP15_32 (0x03)
196#define HSR_EC_CP15_64 (0x04)
197#define HSR_EC_CP14_MR (0x05)
198#define HSR_EC_CP14_LS (0x06)
199#define HSR_EC_CP_0_13 (0x07)
200#define HSR_EC_CP10_ID (0x08)
201#define HSR_EC_JAZELLE (0x09)
202#define HSR_EC_BXJ (0x0A)
203#define HSR_EC_CP14_64 (0x0C)
204#define HSR_EC_SVC_HYP (0x11)
205#define HSR_EC_HVC (0x12)
206#define HSR_EC_SMC (0x13)
207#define HSR_EC_IABT (0x20)
208#define HSR_EC_IABT_HYP (0x21)
209#define HSR_EC_DABT (0x24)
210#define HSR_EC_DABT_HYP (0x25)
211
212#define HSR_HVC_IMM_MASK ((1UL << 16) - 1)
213
214#endif /* __ARM_KVM_ARM_H__ */
diff --git a/arch/arm/include/asm/kvm_asm.h b/arch/arm/include/asm/kvm_asm.h
new file mode 100644
index 000000000000..e4956f4e23e1
--- /dev/null
+++ b/arch/arm/include/asm/kvm_asm.h
@@ -0,0 +1,83 @@
1/*
2 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
3 * Author: Christoffer Dall <c.dall@virtualopensystems.com>
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 * 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 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#ifndef __ARM_KVM_ASM_H__
20#define __ARM_KVM_ASM_H__
21
22/* 0 is reserved as an invalid value. */
23#define c0_MPIDR 1 /* MultiProcessor ID Register */
24#define c0_CSSELR 2 /* Cache Size Selection Register */
25#define c1_SCTLR 3 /* System Control Register */
26#define c1_ACTLR 4 /* Auxilliary Control Register */
27#define c1_CPACR 5 /* Coprocessor Access Control */
28#define c2_TTBR0 6 /* Translation Table Base Register 0 */
29#define c2_TTBR0_high 7 /* TTBR0 top 32 bits */
30#define c2_TTBR1 8 /* Translation Table Base Register 1 */
31#define c2_TTBR1_high 9 /* TTBR1 top 32 bits */
32#define c2_TTBCR 10 /* Translation Table Base Control R. */
33#define c3_DACR 11 /* Domain Access Control Register */
34#define c5_DFSR 12 /* Data Fault Status Register */
35#define c5_IFSR 13 /* Instruction Fault Status Register */
36#define c5_ADFSR 14 /* Auxilary Data Fault Status R */
37#define c5_AIFSR 15 /* Auxilary Instrunction Fault Status R */
38#define c6_DFAR 16 /* Data Fault Address Register */
39#define c6_IFAR 17 /* Instruction Fault Address Register */
40#define c9_L2CTLR 18 /* Cortex A15 L2 Control Register */
41#define c10_PRRR 19 /* Primary Region Remap Register */
42#define c10_NMRR 20 /* Normal Memory Remap Register */
43#define c12_VBAR 21 /* Vector Base Address Register */
44#define c13_CID 22 /* Context ID Register */
45#define c13_TID_URW 23 /* Thread ID, User R/W */
46#define c13_TID_URO 24 /* Thread ID, User R/O */
47#define c13_TID_PRIV 25 /* Thread ID, Privileged */
48#define c14_CNTKCTL 26 /* Timer Control Register (PL1) */
49#define NR_CP15_REGS 27 /* Number of regs (incl. invalid) */
50
51#define ARM_EXCEPTION_RESET 0
52#define ARM_EXCEPTION_UNDEFINED 1
53#define ARM_EXCEPTION_SOFTWARE 2
54#define ARM_EXCEPTION_PREF_ABORT 3
55#define ARM_EXCEPTION_DATA_ABORT 4
56#define ARM_EXCEPTION_IRQ 5
57#define ARM_EXCEPTION_FIQ 6
58#define ARM_EXCEPTION_HVC 7
59
60#ifndef __ASSEMBLY__
61struct kvm;
62struct kvm_vcpu;
63
64extern char __kvm_hyp_init[];
65extern char __kvm_hyp_init_end[];
66
67extern char __kvm_hyp_exit[];
68extern char __kvm_hyp_exit_end[];
69
70extern char __kvm_hyp_vector[];
71
72extern char __kvm_hyp_code_start[];
73extern char __kvm_hyp_code_end[];
74
75extern void __kvm_tlb_flush_vmid(struct kvm *kvm);
76
77extern void __kvm_flush_vm_context(void);
78extern void __kvm_tlb_flush_vmid(struct kvm *kvm);
79
80extern int __kvm_vcpu_run(struct kvm_vcpu *vcpu);
81#endif
82
83#endif /* __ARM_KVM_ASM_H__ */
diff --git a/arch/arm/include/asm/kvm_coproc.h b/arch/arm/include/asm/kvm_coproc.h
new file mode 100644
index 000000000000..4917c2f7e459
--- /dev/null
+++ b/arch/arm/include/asm/kvm_coproc.h
@@ -0,0 +1,47 @@
1/*
2 * Copyright (C) 2012 Rusty Russell IBM Corporation
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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 */
17
18#ifndef __ARM_KVM_COPROC_H__
19#define __ARM_KVM_COPROC_H__
20#include <linux/kvm_host.h>
21
22void kvm_reset_coprocs(struct kvm_vcpu *vcpu);
23
24struct kvm_coproc_target_table {
25 unsigned target;
26 const struct coproc_reg *table;
27 size_t num;
28};
29void kvm_register_target_coproc_table(struct kvm_coproc_target_table *table);
30
31int kvm_handle_cp10_id(struct kvm_vcpu *vcpu, struct kvm_run *run);
32int kvm_handle_cp_0_13_access(struct kvm_vcpu *vcpu, struct kvm_run *run);
33int kvm_handle_cp14_load_store(struct kvm_vcpu *vcpu, struct kvm_run *run);
34int kvm_handle_cp14_access(struct kvm_vcpu *vcpu, struct kvm_run *run);
35int kvm_handle_cp15_32(struct kvm_vcpu *vcpu, struct kvm_run *run);
36int kvm_handle_cp15_64(struct kvm_vcpu *vcpu, struct kvm_run *run);
37
38unsigned long kvm_arm_num_guest_msrs(struct kvm_vcpu *vcpu);
39int kvm_arm_copy_msrindices(struct kvm_vcpu *vcpu, u64 __user *uindices);
40void kvm_coproc_table_init(void);
41
42struct kvm_one_reg;
43int kvm_arm_copy_coproc_indices(struct kvm_vcpu *vcpu, u64 __user *uindices);
44int kvm_arm_coproc_get_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *);
45int kvm_arm_coproc_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *);
46unsigned long kvm_arm_num_coproc_regs(struct kvm_vcpu *vcpu);
47#endif /* __ARM_KVM_COPROC_H__ */
diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h
new file mode 100644
index 000000000000..fd611996bfb5
--- /dev/null
+++ b/arch/arm/include/asm/kvm_emulate.h
@@ -0,0 +1,72 @@
1/*
2 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
3 * Author: Christoffer Dall <c.dall@virtualopensystems.com>
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 * 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 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#ifndef __ARM_KVM_EMULATE_H__
20#define __ARM_KVM_EMULATE_H__
21
22#include <linux/kvm_host.h>
23#include <asm/kvm_asm.h>
24#include <asm/kvm_mmio.h>
25
26u32 *vcpu_reg(struct kvm_vcpu *vcpu, u8 reg_num);
27u32 *vcpu_spsr(struct kvm_vcpu *vcpu);
28
29int kvm_handle_wfi(struct kvm_vcpu *vcpu, struct kvm_run *run);
30void kvm_skip_instr(struct kvm_vcpu *vcpu, bool is_wide_instr);
31void kvm_inject_undefined(struct kvm_vcpu *vcpu);
32void kvm_inject_dabt(struct kvm_vcpu *vcpu, unsigned long addr);
33void kvm_inject_pabt(struct kvm_vcpu *vcpu, unsigned long addr);
34
35static inline bool vcpu_mode_is_32bit(struct kvm_vcpu *vcpu)
36{
37 return 1;
38}
39
40static inline u32 *vcpu_pc(struct kvm_vcpu *vcpu)
41{
42 return (u32 *)&vcpu->arch.regs.usr_regs.ARM_pc;
43}
44
45static inline u32 *vcpu_cpsr(struct kvm_vcpu *vcpu)
46{
47 return (u32 *)&vcpu->arch.regs.usr_regs.ARM_cpsr;
48}
49
50static inline void vcpu_set_thumb(struct kvm_vcpu *vcpu)
51{
52 *vcpu_cpsr(vcpu) |= PSR_T_BIT;
53}
54
55static inline bool mode_has_spsr(struct kvm_vcpu *vcpu)
56{
57 unsigned long cpsr_mode = vcpu->arch.regs.usr_regs.ARM_cpsr & MODE_MASK;
58 return (cpsr_mode > USR_MODE && cpsr_mode < SYSTEM_MODE);
59}
60
61static inline bool vcpu_mode_priv(struct kvm_vcpu *vcpu)
62{
63 unsigned long cpsr_mode = vcpu->arch.regs.usr_regs.ARM_cpsr & MODE_MASK;
64 return cpsr_mode > USR_MODE;;
65}
66
67static inline bool kvm_vcpu_reg_is_pc(struct kvm_vcpu *vcpu, int reg)
68{
69 return reg == 15;
70}
71
72#endif /* __ARM_KVM_EMULATE_H__ */
diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
new file mode 100644
index 000000000000..d1736a53b12d
--- /dev/null
+++ b/arch/arm/include/asm/kvm_host.h
@@ -0,0 +1,184 @@
1/*
2 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
3 * Author: Christoffer Dall <c.dall@virtualopensystems.com>
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 * 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 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#ifndef __ARM_KVM_HOST_H__
20#define __ARM_KVM_HOST_H__
21
22#include <asm/kvm.h>
23#include <asm/kvm_asm.h>
24#include <asm/kvm_mmio.h>
25#include <asm/fpstate.h>
26#include <asm/kvm_arch_timer.h>
27
28#define KVM_MAX_VCPUS CONFIG_KVM_ARM_MAX_VCPUS
29#define KVM_USER_MEM_SLOTS 32
30#define KVM_PRIVATE_MEM_SLOTS 4
31#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
32#define KVM_HAVE_ONE_REG
33
34#define KVM_VCPU_MAX_FEATURES 1
35
36/* We don't currently support large pages. */
37#define KVM_HPAGE_GFN_SHIFT(x) 0
38#define KVM_NR_PAGE_SIZES 1
39#define KVM_PAGES_PER_HPAGE(x) (1UL<<31)
40
41#include <asm/kvm_vgic.h>
42
43struct kvm_vcpu;
44u32 *kvm_vcpu_reg(struct kvm_vcpu *vcpu, u8 reg_num, u32 mode);
45int kvm_target_cpu(void);
46int kvm_reset_vcpu(struct kvm_vcpu *vcpu);
47void kvm_reset_coprocs(struct kvm_vcpu *vcpu);
48
49struct kvm_arch {
50 /* VTTBR value associated with below pgd and vmid */
51 u64 vttbr;
52
53 /* Timer */
54 struct arch_timer_kvm timer;
55
56 /*
57 * Anything that is not used directly from assembly code goes
58 * here.
59 */
60
61 /* The VMID generation used for the virt. memory system */
62 u64 vmid_gen;
63 u32 vmid;
64
65 /* Stage-2 page table */
66 pgd_t *pgd;
67
68 /* Interrupt controller */
69 struct vgic_dist vgic;
70};
71
72#define KVM_NR_MEM_OBJS 40
73
74/*
75 * We don't want allocation failures within the mmu code, so we preallocate
76 * enough memory for a single page fault in a cache.
77 */
78struct kvm_mmu_memory_cache {
79 int nobjs;
80 void *objects[KVM_NR_MEM_OBJS];
81};
82
83struct kvm_vcpu_arch {
84 struct kvm_regs regs;
85
86 int target; /* Processor target */
87 DECLARE_BITMAP(features, KVM_VCPU_MAX_FEATURES);
88
89 /* System control coprocessor (cp15) */
90 u32 cp15[NR_CP15_REGS];
91
92 /* The CPU type we expose to the VM */
93 u32 midr;
94
95 /* Exception Information */
96 u32 hsr; /* Hyp Syndrome Register */
97 u32 hxfar; /* Hyp Data/Inst Fault Address Register */
98 u32 hpfar; /* Hyp IPA Fault Address Register */
99
100 /* Floating point registers (VFP and Advanced SIMD/NEON) */
101 struct vfp_hard_struct vfp_guest;
102 struct vfp_hard_struct *vfp_host;
103
104 /* VGIC state */
105 struct vgic_cpu vgic_cpu;
106 struct arch_timer_cpu timer_cpu;
107
108 /*
109 * Anything that is not used directly from assembly code goes
110 * here.
111 */
112 /* dcache set/way operation pending */
113 int last_pcpu;
114 cpumask_t require_dcache_flush;
115
116 /* Don't run the guest on this vcpu */
117 bool pause;
118
119 /* IO related fields */
120 struct kvm_decode mmio_decode;
121
122 /* Interrupt related fields */
123 u32 irq_lines; /* IRQ and FIQ levels */
124
125 /* Hyp exception information */
126 u32 hyp_pc; /* PC when exception was taken from Hyp mode */
127
128 /* Cache some mmu pages needed inside spinlock regions */
129 struct kvm_mmu_memory_cache mmu_page_cache;
130
131 /* Detect first run of a vcpu */
132 bool has_run_once;
133};
134
135struct kvm_vm_stat {
136 u32 remote_tlb_flush;
137};
138
139struct kvm_vcpu_stat {
140 u32 halt_wakeup;
141};
142
143struct kvm_vcpu_init;
144int kvm_vcpu_set_target(struct kvm_vcpu *vcpu,
145 const struct kvm_vcpu_init *init);
146unsigned long kvm_arm_num_regs(struct kvm_vcpu *vcpu);
147int kvm_arm_copy_reg_indices(struct kvm_vcpu *vcpu, u64 __user *indices);
148struct kvm_one_reg;
149int kvm_arm_get_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg);
150int kvm_arm_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg);
151u64 kvm_call_hyp(void *hypfn, ...);
152void force_vm_exit(const cpumask_t *mask);
153
154#define KVM_ARCH_WANT_MMU_NOTIFIER
155struct kvm;
156int kvm_unmap_hva(struct kvm *kvm, unsigned long hva);
157int kvm_unmap_hva_range(struct kvm *kvm,
158 unsigned long start, unsigned long end);
159void kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte);
160
161unsigned long kvm_arm_num_regs(struct kvm_vcpu *vcpu);
162int kvm_arm_copy_reg_indices(struct kvm_vcpu *vcpu, u64 __user *indices);
163
164/* We do not have shadow page tables, hence the empty hooks */
165static inline int kvm_age_hva(struct kvm *kvm, unsigned long hva)
166{
167 return 0;
168}
169
170static inline int kvm_test_age_hva(struct kvm *kvm, unsigned long hva)
171{
172 return 0;
173}
174
175struct kvm_vcpu *kvm_arm_get_running_vcpu(void);
176struct kvm_vcpu __percpu **kvm_get_running_vcpus(void);
177
178int kvm_arm_copy_coproc_indices(struct kvm_vcpu *vcpu, u64 __user *uindices);
179unsigned long kvm_arm_num_coproc_regs(struct kvm_vcpu *vcpu);
180struct kvm_one_reg;
181int kvm_arm_coproc_get_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *);
182int kvm_arm_coproc_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *);
183
184#endif /* __ARM_KVM_HOST_H__ */
diff --git a/arch/arm/include/asm/kvm_mmio.h b/arch/arm/include/asm/kvm_mmio.h
new file mode 100644
index 000000000000..adcc0d7d3175
--- /dev/null
+++ b/arch/arm/include/asm/kvm_mmio.h
@@ -0,0 +1,56 @@
1/*
2 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
3 * Author: Christoffer Dall <c.dall@virtualopensystems.com>
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 * 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 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#ifndef __ARM_KVM_MMIO_H__
20#define __ARM_KVM_MMIO_H__
21
22#include <linux/kvm_host.h>
23#include <asm/kvm_asm.h>
24#include <asm/kvm_arm.h>
25
26struct kvm_decode {
27 unsigned long rt;
28 bool sign_extend;
29};
30
31/*
32 * The in-kernel MMIO emulation code wants to use a copy of run->mmio,
33 * which is an anonymous type. Use our own type instead.
34 */
35struct kvm_exit_mmio {
36 phys_addr_t phys_addr;
37 u8 data[8];
38 u32 len;
39 bool is_write;
40};
41
42static inline void kvm_prepare_mmio(struct kvm_run *run,
43 struct kvm_exit_mmio *mmio)
44{
45 run->mmio.phys_addr = mmio->phys_addr;
46 run->mmio.len = mmio->len;
47 run->mmio.is_write = mmio->is_write;
48 memcpy(run->mmio.data, mmio->data, mmio->len);
49 run->exit_reason = KVM_EXIT_MMIO;
50}
51
52int kvm_handle_mmio_return(struct kvm_vcpu *vcpu, struct kvm_run *run);
53int io_mem_abort(struct kvm_vcpu *vcpu, struct kvm_run *run,
54 phys_addr_t fault_ipa);
55
56#endif /* __ARM_KVM_MMIO_H__ */
diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h
new file mode 100644
index 000000000000..421a20b34874
--- /dev/null
+++ b/arch/arm/include/asm/kvm_mmu.h
@@ -0,0 +1,50 @@
1/*
2 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
3 * Author: Christoffer Dall <c.dall@virtualopensystems.com>
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 * 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 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#ifndef __ARM_KVM_MMU_H__
20#define __ARM_KVM_MMU_H__
21
22int create_hyp_mappings(void *from, void *to);
23int create_hyp_io_mappings(void *from, void *to, phys_addr_t);
24void free_hyp_pmds(void);
25
26int kvm_alloc_stage2_pgd(struct kvm *kvm);
27void kvm_free_stage2_pgd(struct kvm *kvm);
28int kvm_phys_addr_ioremap(struct kvm *kvm, phys_addr_t guest_ipa,
29 phys_addr_t pa, unsigned long size);
30
31int kvm_handle_guest_abort(struct kvm_vcpu *vcpu, struct kvm_run *run);
32
33void kvm_mmu_free_memory_caches(struct kvm_vcpu *vcpu);
34
35phys_addr_t kvm_mmu_get_httbr(void);
36int kvm_mmu_init(void);
37void kvm_clear_hyp_idmap(void);
38
39static inline bool kvm_is_write_fault(unsigned long hsr)
40{
41 unsigned long hsr_ec = hsr >> HSR_EC_SHIFT;
42 if (hsr_ec == HSR_EC_IABT)
43 return false;
44 else if ((hsr & HSR_ISV) && !(hsr & HSR_WNR))
45 return false;
46 else
47 return true;
48}
49
50#endif /* __ARM_KVM_MMU_H__ */
diff --git a/arch/arm/include/asm/kvm_psci.h b/arch/arm/include/asm/kvm_psci.h
new file mode 100644
index 000000000000..9a83d98bf170
--- /dev/null
+++ b/arch/arm/include/asm/kvm_psci.h
@@ -0,0 +1,23 @@
1/*
2 * Copyright (C) 2012 - ARM Ltd
3 * Author: Marc Zyngier <marc.zyngier@arm.com>
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 * 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 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __ARM_KVM_PSCI_H__
19#define __ARM_KVM_PSCI_H__
20
21bool kvm_psci_call(struct kvm_vcpu *vcpu);
22
23#endif /* __ARM_KVM_PSCI_H__ */
diff --git a/arch/arm/include/asm/kvm_vgic.h b/arch/arm/include/asm/kvm_vgic.h
new file mode 100644
index 000000000000..ab97207d9cd3
--- /dev/null
+++ b/arch/arm/include/asm/kvm_vgic.h
@@ -0,0 +1,221 @@
1/*
2 * Copyright (C) 2012 ARM Ltd.
3 * Author: Marc Zyngier <marc.zyngier@arm.com>
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 * 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 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef __ASM_ARM_KVM_VGIC_H
20#define __ASM_ARM_KVM_VGIC_H
21
22#include <linux/kernel.h>
23#include <linux/kvm.h>
24#include <linux/kvm_host.h>
25#include <linux/irqreturn.h>
26#include <linux/spinlock.h>
27#include <linux/types.h>
28#include <linux/irqchip/arm-gic.h>
29
30#define VGIC_NR_IRQS 128
31#define VGIC_NR_SGIS 16
32#define VGIC_NR_PPIS 16
33#define VGIC_NR_PRIVATE_IRQS (VGIC_NR_SGIS + VGIC_NR_PPIS)
34#define VGIC_NR_SHARED_IRQS (VGIC_NR_IRQS - VGIC_NR_PRIVATE_IRQS)
35#define VGIC_MAX_CPUS KVM_MAX_VCPUS
36#define VGIC_MAX_LRS (1 << 6)
37
38/* Sanity checks... */
39#if (VGIC_MAX_CPUS > 8)
40#error Invalid number of CPU interfaces
41#endif
42
43#if (VGIC_NR_IRQS & 31)
44#error "VGIC_NR_IRQS must be a multiple of 32"
45#endif
46
47#if (VGIC_NR_IRQS > 1024)
48#error "VGIC_NR_IRQS must be <= 1024"
49#endif
50
51/*
52 * The GIC distributor registers describing interrupts have two parts:
53 * - 32 per-CPU interrupts (SGI + PPI)
54 * - a bunch of shared interrupts (SPI)
55 */
56struct vgic_bitmap {
57 union {
58 u32 reg[VGIC_NR_PRIVATE_IRQS / 32];
59 DECLARE_BITMAP(reg_ul, VGIC_NR_PRIVATE_IRQS);
60 } percpu[VGIC_MAX_CPUS];
61 union {
62 u32 reg[VGIC_NR_SHARED_IRQS / 32];
63 DECLARE_BITMAP(reg_ul, VGIC_NR_SHARED_IRQS);
64 } shared;
65};
66
67struct vgic_bytemap {
68 u32 percpu[VGIC_MAX_CPUS][VGIC_NR_PRIVATE_IRQS / 4];
69 u32 shared[VGIC_NR_SHARED_IRQS / 4];
70};
71
72struct vgic_dist {
73#ifdef CONFIG_KVM_ARM_VGIC
74 spinlock_t lock;
75 bool ready;
76
77 /* Virtual control interface mapping */
78 void __iomem *vctrl_base;
79
80 /* Distributor and vcpu interface mapping in the guest */
81 phys_addr_t vgic_dist_base;
82 phys_addr_t vgic_cpu_base;
83
84 /* Distributor enabled */
85 u32 enabled;
86
87 /* Interrupt enabled (one bit per IRQ) */
88 struct vgic_bitmap irq_enabled;
89
90 /* Interrupt 'pin' level */
91 struct vgic_bitmap irq_state;
92
93 /* Level-triggered interrupt in progress */
94 struct vgic_bitmap irq_active;
95
96 /* Interrupt priority. Not used yet. */
97 struct vgic_bytemap irq_priority;
98
99 /* Level/edge triggered */
100 struct vgic_bitmap irq_cfg;
101
102 /* Source CPU per SGI and target CPU */
103 u8 irq_sgi_sources[VGIC_MAX_CPUS][VGIC_NR_SGIS];
104
105 /* Target CPU for each IRQ */
106 u8 irq_spi_cpu[VGIC_NR_SHARED_IRQS];
107 struct vgic_bitmap irq_spi_target[VGIC_MAX_CPUS];
108
109 /* Bitmap indicating which CPU has something pending */
110 unsigned long irq_pending_on_cpu;
111#endif
112};
113
114struct vgic_cpu {
115#ifdef CONFIG_KVM_ARM_VGIC
116 /* per IRQ to LR mapping */
117 u8 vgic_irq_lr_map[VGIC_NR_IRQS];
118
119 /* Pending interrupts on this VCPU */
120 DECLARE_BITMAP( pending_percpu, VGIC_NR_PRIVATE_IRQS);
121 DECLARE_BITMAP( pending_shared, VGIC_NR_SHARED_IRQS);
122
123 /* Bitmap of used/free list registers */
124 DECLARE_BITMAP( lr_used, VGIC_MAX_LRS);
125
126 /* Number of list registers on this CPU */
127 int nr_lr;
128
129 /* CPU vif control registers for world switch */
130 u32 vgic_hcr;
131 u32 vgic_vmcr;
132 u32 vgic_misr; /* Saved only */
133 u32 vgic_eisr[2]; /* Saved only */
134 u32 vgic_elrsr[2]; /* Saved only */
135 u32 vgic_apr;
136 u32 vgic_lr[VGIC_MAX_LRS];
137#endif
138};
139
140#define LR_EMPTY 0xff
141
142struct kvm;
143struct kvm_vcpu;
144struct kvm_run;
145struct kvm_exit_mmio;
146
147#ifdef CONFIG_KVM_ARM_VGIC
148int kvm_vgic_set_addr(struct kvm *kvm, unsigned long type, u64 addr);
149int kvm_vgic_hyp_init(void);
150int kvm_vgic_init(struct kvm *kvm);
151int kvm_vgic_create(struct kvm *kvm);
152int kvm_vgic_vcpu_init(struct kvm_vcpu *vcpu);
153void kvm_vgic_flush_hwstate(struct kvm_vcpu *vcpu);
154void kvm_vgic_sync_hwstate(struct kvm_vcpu *vcpu);
155int kvm_vgic_inject_irq(struct kvm *kvm, int cpuid, unsigned int irq_num,
156 bool level);
157int kvm_vgic_vcpu_pending_irq(struct kvm_vcpu *vcpu);
158bool vgic_handle_mmio(struct kvm_vcpu *vcpu, struct kvm_run *run,
159 struct kvm_exit_mmio *mmio);
160
161#define irqchip_in_kernel(k) (!!((k)->arch.vgic.vctrl_base))
162#define vgic_initialized(k) ((k)->arch.vgic.ready)
163
164#else
165static inline int kvm_vgic_hyp_init(void)
166{
167 return 0;
168}
169
170static inline int kvm_vgic_set_addr(struct kvm *kvm, unsigned long type, u64 addr)
171{
172 return 0;
173}
174
175static inline int kvm_vgic_init(struct kvm *kvm)
176{
177 return 0;
178}
179
180static inline int kvm_vgic_create(struct kvm *kvm)
181{
182 return 0;
183}
184
185static inline int kvm_vgic_vcpu_init(struct kvm_vcpu *vcpu)
186{
187 return 0;
188}
189
190static inline void kvm_vgic_flush_hwstate(struct kvm_vcpu *vcpu) {}
191static inline void kvm_vgic_sync_hwstate(struct kvm_vcpu *vcpu) {}
192
193static inline int kvm_vgic_inject_irq(struct kvm *kvm, int cpuid,
194 unsigned int irq_num, bool level)
195{
196 return 0;
197}
198
199static inline int kvm_vgic_vcpu_pending_irq(struct kvm_vcpu *vcpu)
200{
201 return 0;
202}
203
204static inline bool vgic_handle_mmio(struct kvm_vcpu *vcpu, struct kvm_run *run,
205 struct kvm_exit_mmio *mmio)
206{
207 return false;
208}
209
210static inline int irqchip_in_kernel(struct kvm *kvm)
211{
212 return 0;
213}
214
215static inline bool vgic_initialized(struct kvm *kvm)
216{
217 return true;
218}
219#endif
220
221#endif
diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
index 917d4fcfd9b4..308ad7d6f98b 100644
--- a/arch/arm/include/asm/mach/arch.h
+++ b/arch/arm/include/asm/mach/arch.h
@@ -12,7 +12,6 @@
12 12
13struct tag; 13struct tag;
14struct meminfo; 14struct meminfo;
15struct sys_timer;
16struct pt_regs; 15struct pt_regs;
17struct smp_operations; 16struct smp_operations;
18#ifdef CONFIG_SMP 17#ifdef CONFIG_SMP
@@ -48,7 +47,7 @@ struct machine_desc {
48 void (*map_io)(void);/* IO mapping function */ 47 void (*map_io)(void);/* IO mapping function */
49 void (*init_early)(void); 48 void (*init_early)(void);
50 void (*init_irq)(void); 49 void (*init_irq)(void);
51 struct sys_timer *timer; /* system tick timer */ 50 void (*init_time)(void);
52 void (*init_machine)(void); 51 void (*init_machine)(void);
53 void (*init_late)(void); 52 void (*init_late)(void);
54#ifdef CONFIG_MULTI_IRQ_HANDLER 53#ifdef CONFIG_MULTI_IRQ_HANDLER
diff --git a/arch/arm/include/asm/mach/irq.h b/arch/arm/include/asm/mach/irq.h
index 15cb035309f7..18c883023339 100644
--- a/arch/arm/include/asm/mach/irq.h
+++ b/arch/arm/include/asm/mach/irq.h
@@ -22,6 +22,7 @@ extern int show_fiq_list(struct seq_file *, int);
22 22
23#ifdef CONFIG_MULTI_IRQ_HANDLER 23#ifdef CONFIG_MULTI_IRQ_HANDLER
24extern void (*handle_arch_irq)(struct pt_regs *); 24extern void (*handle_arch_irq)(struct pt_regs *);
25extern void set_handle_irq(void (*handle_irq)(struct pt_regs *));
25#endif 26#endif
26 27
27/* 28/*
diff --git a/arch/arm/include/asm/mach/pci.h b/arch/arm/include/asm/mach/pci.h
index db9fedb57f2c..5cf2e979b4be 100644
--- a/arch/arm/include/asm/mach/pci.h
+++ b/arch/arm/include/asm/mach/pci.h
@@ -23,6 +23,7 @@ struct hw_pci {
23#endif 23#endif
24 struct pci_ops *ops; 24 struct pci_ops *ops;
25 int nr_controllers; 25 int nr_controllers;
26 void **private_data;
26 int (*setup)(int nr, struct pci_sys_data *); 27 int (*setup)(int nr, struct pci_sys_data *);
27 struct pci_bus *(*scan)(int nr, struct pci_sys_data *); 28 struct pci_bus *(*scan)(int nr, struct pci_sys_data *);
28 void (*preinit)(void); 29 void (*preinit)(void);
diff --git a/arch/arm/include/asm/mach/time.h b/arch/arm/include/asm/mach/time.h
index 6ca945f534ab..90c12e1e695c 100644
--- a/arch/arm/include/asm/mach/time.h
+++ b/arch/arm/include/asm/mach/time.h
@@ -10,36 +10,6 @@
10#ifndef __ASM_ARM_MACH_TIME_H 10#ifndef __ASM_ARM_MACH_TIME_H
11#define __ASM_ARM_MACH_TIME_H 11#define __ASM_ARM_MACH_TIME_H
12 12
13/*
14 * This is our kernel timer structure.
15 *
16 * - init
17 * Initialise the kernels jiffy timer source, claim interrupt
18 * using setup_irq. This is called early on during initialisation
19 * while interrupts are still disabled on the local CPU.
20 * - suspend
21 * Suspend the kernel jiffy timer source, if necessary. This
22 * is called with interrupts disabled, after all normal devices
23 * have been suspended. If no action is required, set this to
24 * NULL.
25 * - resume
26 * Resume the kernel jiffy timer source, if necessary. This
27 * is called with interrupts disabled before any normal devices
28 * are resumed. If no action is required, set this to NULL.
29 * - offset
30 * Return the timer offset in microseconds since the last timer
31 * interrupt. Note: this must take account of any unprocessed
32 * timer interrupt which may be pending.
33 */
34struct sys_timer {
35 void (*init)(void);
36 void (*suspend)(void);
37 void (*resume)(void);
38#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
39 unsigned long (*offset)(void);
40#endif
41};
42
43extern void timer_tick(void); 13extern void timer_tick(void);
44 14
45struct timespec; 15struct timespec;
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index 73cf03aa981e..57870ab313c5 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -36,23 +36,23 @@
36 * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area 36 * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area
37 */ 37 */
38#define PAGE_OFFSET UL(CONFIG_PAGE_OFFSET) 38#define PAGE_OFFSET UL(CONFIG_PAGE_OFFSET)
39#define TASK_SIZE (UL(CONFIG_PAGE_OFFSET) - UL(0x01000000)) 39#define TASK_SIZE (UL(CONFIG_PAGE_OFFSET) - UL(SZ_16M))
40#define TASK_UNMAPPED_BASE (UL(CONFIG_PAGE_OFFSET) / 3) 40#define TASK_UNMAPPED_BASE ALIGN(TASK_SIZE / 3, SZ_16M)
41 41
42/* 42/*
43 * The maximum size of a 26-bit user space task. 43 * The maximum size of a 26-bit user space task.
44 */ 44 */
45#define TASK_SIZE_26 UL(0x04000000) 45#define TASK_SIZE_26 (UL(1) << 26)
46 46
47/* 47/*
48 * The module space lives between the addresses given by TASK_SIZE 48 * The module space lives between the addresses given by TASK_SIZE
49 * and PAGE_OFFSET - it must be within 32MB of the kernel text. 49 * and PAGE_OFFSET - it must be within 32MB of the kernel text.
50 */ 50 */
51#ifndef CONFIG_THUMB2_KERNEL 51#ifndef CONFIG_THUMB2_KERNEL
52#define MODULES_VADDR (PAGE_OFFSET - 16*1024*1024) 52#define MODULES_VADDR (PAGE_OFFSET - SZ_16M)
53#else 53#else
54/* smaller range for Thumb-2 symbols relocation (2^24)*/ 54/* smaller range for Thumb-2 symbols relocation (2^24)*/
55#define MODULES_VADDR (PAGE_OFFSET - 8*1024*1024) 55#define MODULES_VADDR (PAGE_OFFSET - SZ_8M)
56#endif 56#endif
57 57
58#if TASK_SIZE > MODULES_VADDR 58#if TASK_SIZE > MODULES_VADDR
@@ -245,6 +245,7 @@ static inline void *phys_to_virt(phys_addr_t x)
245#define __bus_to_pfn(x) __phys_to_pfn(x) 245#define __bus_to_pfn(x) __phys_to_pfn(x)
246#endif 246#endif
247 247
248#ifdef CONFIG_VIRT_TO_BUS
248static inline __deprecated unsigned long virt_to_bus(void *x) 249static inline __deprecated unsigned long virt_to_bus(void *x)
249{ 250{
250 return __virt_to_bus((unsigned long)x); 251 return __virt_to_bus((unsigned long)x);
@@ -254,6 +255,7 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
254{ 255{
255 return (void *)__bus_to_virt(x); 256 return (void *)__bus_to_virt(x);
256} 257}
258#endif
257 259
258/* 260/*
259 * Conversion between a struct page and a physical address. 261 * Conversion between a struct page and a physical address.
diff --git a/arch/arm/include/asm/opcodes-sec.h b/arch/arm/include/asm/opcodes-sec.h
new file mode 100644
index 000000000000..bc3a9174417c
--- /dev/null
+++ b/arch/arm/include/asm/opcodes-sec.h
@@ -0,0 +1,24 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License version 2 as
4 * published by the Free Software Foundation.
5 *
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 * Copyright (C) 2012 ARM Limited
12 */
13
14#ifndef __ASM_ARM_OPCODES_SEC_H
15#define __ASM_ARM_OPCODES_SEC_H
16
17#include <asm/opcodes.h>
18
19#define __SMC(imm4) __inst_arm_thumb32( \
20 0xE1600070 | (((imm4) & 0xF) << 0), \
21 0xF7F08000 | (((imm4) & 0xF) << 16) \
22)
23
24#endif /* __ASM_ARM_OPCODES_SEC_H */
diff --git a/arch/arm/include/asm/opcodes.h b/arch/arm/include/asm/opcodes.h
index 74e211a6fb24..e796c598513b 100644
--- a/arch/arm/include/asm/opcodes.h
+++ b/arch/arm/include/asm/opcodes.h
@@ -10,6 +10,7 @@
10#define __ASM_ARM_OPCODES_H 10#define __ASM_ARM_OPCODES_H
11 11
12#ifndef __ASSEMBLY__ 12#ifndef __ASSEMBLY__
13#include <linux/linkage.h>
13extern asmlinkage unsigned int arm_check_condition(u32 opcode, u32 psr); 14extern asmlinkage unsigned int arm_check_condition(u32 opcode, u32 psr);
14#endif 15#endif
15 16
diff --git a/arch/arm/include/asm/outercache.h b/arch/arm/include/asm/outercache.h
index 53426c66352a..12f71a190422 100644
--- a/arch/arm/include/asm/outercache.h
+++ b/arch/arm/include/asm/outercache.h
@@ -92,6 +92,7 @@ static inline void outer_flush_range(phys_addr_t start, phys_addr_t end)
92static inline void outer_flush_all(void) { } 92static inline void outer_flush_all(void) { }
93static inline void outer_inv_all(void) { } 93static inline void outer_inv_all(void) { }
94static inline void outer_disable(void) { } 94static inline void outer_disable(void) { }
95static inline void outer_resume(void) { }
95 96
96#endif 97#endif
97 98
diff --git a/arch/arm/include/asm/pgtable-3level-hwdef.h b/arch/arm/include/asm/pgtable-3level-hwdef.h
index d7952824c5c4..18f5cef82ad5 100644
--- a/arch/arm/include/asm/pgtable-3level-hwdef.h
+++ b/arch/arm/include/asm/pgtable-3level-hwdef.h
@@ -32,6 +32,9 @@
32#define PMD_TYPE_SECT (_AT(pmdval_t, 1) << 0) 32#define PMD_TYPE_SECT (_AT(pmdval_t, 1) << 0)
33#define PMD_BIT4 (_AT(pmdval_t, 0)) 33#define PMD_BIT4 (_AT(pmdval_t, 0))
34#define PMD_DOMAIN(x) (_AT(pmdval_t, 0)) 34#define PMD_DOMAIN(x) (_AT(pmdval_t, 0))
35#define PMD_APTABLE_SHIFT (61)
36#define PMD_APTABLE (_AT(pgdval_t, 3) << PGD_APTABLE_SHIFT)
37#define PMD_PXNTABLE (_AT(pgdval_t, 1) << 59)
35 38
36/* 39/*
37 * - section 40 * - section
@@ -41,9 +44,11 @@
41#define PMD_SECT_S (_AT(pmdval_t, 3) << 8) 44#define PMD_SECT_S (_AT(pmdval_t, 3) << 8)
42#define PMD_SECT_AF (_AT(pmdval_t, 1) << 10) 45#define PMD_SECT_AF (_AT(pmdval_t, 1) << 10)
43#define PMD_SECT_nG (_AT(pmdval_t, 1) << 11) 46#define PMD_SECT_nG (_AT(pmdval_t, 1) << 11)
47#define PMD_SECT_PXN (_AT(pmdval_t, 1) << 53)
44#define PMD_SECT_XN (_AT(pmdval_t, 1) << 54) 48#define PMD_SECT_XN (_AT(pmdval_t, 1) << 54)
45#define PMD_SECT_AP_WRITE (_AT(pmdval_t, 0)) 49#define PMD_SECT_AP_WRITE (_AT(pmdval_t, 0))
46#define PMD_SECT_AP_READ (_AT(pmdval_t, 0)) 50#define PMD_SECT_AP_READ (_AT(pmdval_t, 0))
51#define PMD_SECT_AP1 (_AT(pmdval_t, 1) << 6)
47#define PMD_SECT_TEX(x) (_AT(pmdval_t, 0)) 52#define PMD_SECT_TEX(x) (_AT(pmdval_t, 0))
48 53
49/* 54/*
diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h
index a3f37929940a..6ef8afd1b64c 100644
--- a/arch/arm/include/asm/pgtable-3level.h
+++ b/arch/arm/include/asm/pgtable-3level.h
@@ -104,11 +104,29 @@
104 */ 104 */
105#define L_PGD_SWAPPER (_AT(pgdval_t, 1) << 55) /* swapper_pg_dir entry */ 105#define L_PGD_SWAPPER (_AT(pgdval_t, 1) << 55) /* swapper_pg_dir entry */
106 106
107/*
108 * 2nd stage PTE definitions for LPAE.
109 */
110#define L_PTE_S2_MT_UNCACHED (_AT(pteval_t, 0x5) << 2) /* MemAttr[3:0] */
111#define L_PTE_S2_MT_WRITETHROUGH (_AT(pteval_t, 0xa) << 2) /* MemAttr[3:0] */
112#define L_PTE_S2_MT_WRITEBACK (_AT(pteval_t, 0xf) << 2) /* MemAttr[3:0] */
113#define L_PTE_S2_RDONLY (_AT(pteval_t, 1) << 6) /* HAP[1] */
114#define L_PTE_S2_RDWR (_AT(pteval_t, 2) << 6) /* HAP[2:1] */
115
116/*
117 * Hyp-mode PL2 PTE definitions for LPAE.
118 */
119#define L_PTE_HYP L_PTE_USER
120
107#ifndef __ASSEMBLY__ 121#ifndef __ASSEMBLY__
108 122
109#define pud_none(pud) (!pud_val(pud)) 123#define pud_none(pud) (!pud_val(pud))
110#define pud_bad(pud) (!(pud_val(pud) & 2)) 124#define pud_bad(pud) (!(pud_val(pud) & 2))
111#define pud_present(pud) (pud_val(pud)) 125#define pud_present(pud) (pud_val(pud))
126#define pmd_table(pmd) ((pmd_val(pmd) & PMD_TYPE_MASK) == \
127 PMD_TYPE_TABLE)
128#define pmd_sect(pmd) ((pmd_val(pmd) & PMD_TYPE_MASK) == \
129 PMD_TYPE_SECT)
112 130
113#define pud_clear(pudp) \ 131#define pud_clear(pudp) \
114 do { \ 132 do { \
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index 9c82f988c0e3..80d6fc4dbe4a 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -70,6 +70,9 @@ extern void __pgd_error(const char *file, int line, pgd_t);
70 70
71extern pgprot_t pgprot_user; 71extern pgprot_t pgprot_user;
72extern pgprot_t pgprot_kernel; 72extern pgprot_t pgprot_kernel;
73extern pgprot_t pgprot_hyp_device;
74extern pgprot_t pgprot_s2;
75extern pgprot_t pgprot_s2_device;
73 76
74#define _MOD_PROT(p, b) __pgprot(pgprot_val(p) | (b)) 77#define _MOD_PROT(p, b) __pgprot(pgprot_val(p) | (b))
75 78
@@ -82,6 +85,10 @@ extern pgprot_t pgprot_kernel;
82#define PAGE_READONLY_EXEC _MOD_PROT(pgprot_user, L_PTE_USER | L_PTE_RDONLY) 85#define PAGE_READONLY_EXEC _MOD_PROT(pgprot_user, L_PTE_USER | L_PTE_RDONLY)
83#define PAGE_KERNEL _MOD_PROT(pgprot_kernel, L_PTE_XN) 86#define PAGE_KERNEL _MOD_PROT(pgprot_kernel, L_PTE_XN)
84#define PAGE_KERNEL_EXEC pgprot_kernel 87#define PAGE_KERNEL_EXEC pgprot_kernel
88#define PAGE_HYP _MOD_PROT(pgprot_kernel, L_PTE_HYP)
89#define PAGE_HYP_DEVICE _MOD_PROT(pgprot_hyp_device, L_PTE_HYP)
90#define PAGE_S2 _MOD_PROT(pgprot_s2, L_PTE_S2_RDONLY)
91#define PAGE_S2_DEVICE _MOD_PROT(pgprot_s2_device, L_PTE_USER | L_PTE_S2_RDONLY)
85 92
86#define __PAGE_NONE __pgprot(_L_PTE_DEFAULT | L_PTE_RDONLY | L_PTE_XN | L_PTE_NONE) 93#define __PAGE_NONE __pgprot(_L_PTE_DEFAULT | L_PTE_RDONLY | L_PTE_XN | L_PTE_NONE)
87#define __PAGE_SHARED __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_XN) 94#define __PAGE_SHARED __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_XN)
@@ -240,7 +247,8 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
240 247
241static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) 248static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
242{ 249{
243 const pteval_t mask = L_PTE_XN | L_PTE_RDONLY | L_PTE_USER | L_PTE_NONE; 250 const pteval_t mask = L_PTE_XN | L_PTE_RDONLY | L_PTE_USER |
251 L_PTE_NONE | L_PTE_VALID;
244 pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask); 252 pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask);
245 return pte; 253 return pte;
246} 254}
diff --git a/arch/arm/include/asm/psci.h b/arch/arm/include/asm/psci.h
new file mode 100644
index 000000000000..ce0dbe7c1625
--- /dev/null
+++ b/arch/arm/include/asm/psci.h
@@ -0,0 +1,36 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License version 2 as
4 * published by the Free Software Foundation.
5 *
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 * Copyright (C) 2012 ARM Limited
12 */
13
14#ifndef __ASM_ARM_PSCI_H
15#define __ASM_ARM_PSCI_H
16
17#define PSCI_POWER_STATE_TYPE_STANDBY 0
18#define PSCI_POWER_STATE_TYPE_POWER_DOWN 1
19
20struct psci_power_state {
21 u16 id;
22 u8 type;
23 u8 affinity_level;
24};
25
26struct psci_operations {
27 int (*cpu_suspend)(struct psci_power_state state,
28 unsigned long entry_point);
29 int (*cpu_off)(struct psci_power_state state);
30 int (*cpu_on)(unsigned long cpuid, unsigned long entry_point);
31 int (*migrate)(unsigned long cpuid);
32};
33
34extern struct psci_operations psci_ops;
35
36#endif /* __ASM_ARM_PSCI_H */
diff --git a/arch/arm/include/asm/signal.h b/arch/arm/include/asm/signal.h
index 9a0ea6ab988f..c0eb412aff04 100644
--- a/arch/arm/include/asm/signal.h
+++ b/arch/arm/include/asm/signal.h
@@ -16,23 +16,7 @@ typedef struct {
16 unsigned long sig[_NSIG_WORDS]; 16 unsigned long sig[_NSIG_WORDS];
17} sigset_t; 17} sigset_t;
18 18
19struct old_sigaction { 19#define __ARCH_HAS_SA_RESTORER
20 __sighandler_t sa_handler;
21 old_sigset_t sa_mask;
22 unsigned long sa_flags;
23 __sigrestore_t sa_restorer;
24};
25
26struct sigaction {
27 __sighandler_t sa_handler;
28 unsigned long sa_flags;
29 __sigrestore_t sa_restorer;
30 sigset_t sa_mask; /* mask last for extensibility */
31};
32
33struct k_sigaction {
34 struct sigaction sa;
35};
36 20
37#include <asm/sigcontext.h> 21#include <asm/sigcontext.h>
38#endif 22#endif
diff --git a/arch/arm/include/asm/smp_scu.h b/arch/arm/include/asm/smp_scu.h
index 4eb6d005ffaa..18d169373612 100644
--- a/arch/arm/include/asm/smp_scu.h
+++ b/arch/arm/include/asm/smp_scu.h
@@ -6,9 +6,32 @@
6#define SCU_PM_POWEROFF 3 6#define SCU_PM_POWEROFF 3
7 7
8#ifndef __ASSEMBLER__ 8#ifndef __ASSEMBLER__
9
10#include <asm/cputype.h>
11
12static inline bool scu_a9_has_base(void)
13{
14 return read_cpuid_part_number() == ARM_CPU_PART_CORTEX_A9;
15}
16
17static inline unsigned long scu_a9_get_base(void)
18{
19 unsigned long pa;
20
21 asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (pa));
22
23 return pa;
24}
25
9unsigned int scu_get_core_count(void __iomem *); 26unsigned int scu_get_core_count(void __iomem *);
10void scu_enable(void __iomem *);
11int scu_power_mode(void __iomem *, unsigned int); 27int scu_power_mode(void __iomem *, unsigned int);
28
29#ifdef CONFIG_SMP
30void scu_enable(void __iomem *scu_base);
31#else
32static inline void scu_enable(void __iomem *scu_base) {}
33#endif
34
12#endif 35#endif
13 36
14#endif 37#endif
diff --git a/arch/arm/include/asm/spinlock.h b/arch/arm/include/asm/spinlock.h
index b4ca707d0a69..6220e9fdf4c7 100644
--- a/arch/arm/include/asm/spinlock.h
+++ b/arch/arm/include/asm/spinlock.h
@@ -119,22 +119,8 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock)
119 119
120static inline void arch_spin_unlock(arch_spinlock_t *lock) 120static inline void arch_spin_unlock(arch_spinlock_t *lock)
121{ 121{
122 unsigned long tmp;
123 u32 slock;
124
125 smp_mb(); 122 smp_mb();
126 123 lock->tickets.owner++;
127 __asm__ __volatile__(
128" mov %1, #1\n"
129"1: ldrex %0, [%2]\n"
130" uadd16 %0, %0, %1\n"
131" strex %1, %0, [%2]\n"
132" teq %1, #0\n"
133" bne 1b"
134 : "=&r" (slock), "=&r" (tmp)
135 : "r" (&lock->slock)
136 : "cc");
137
138 dsb_sev(); 124 dsb_sev();
139} 125}
140 126
diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h
index 21a2700d2957..e4ddfb39ca34 100644
--- a/arch/arm/include/asm/unistd.h
+++ b/arch/arm/include/asm/unistd.h
@@ -26,8 +26,6 @@
26#define __ARCH_WANT_SYS_NICE 26#define __ARCH_WANT_SYS_NICE
27#define __ARCH_WANT_SYS_SIGPENDING 27#define __ARCH_WANT_SYS_SIGPENDING
28#define __ARCH_WANT_SYS_SIGPROCMASK 28#define __ARCH_WANT_SYS_SIGPROCMASK
29#define __ARCH_WANT_SYS_RT_SIGACTION
30#define __ARCH_WANT_SYS_RT_SIGSUSPEND
31#define __ARCH_WANT_SYS_OLD_MMAP 29#define __ARCH_WANT_SYS_OLD_MMAP
32#define __ARCH_WANT_SYS_OLD_SELECT 30#define __ARCH_WANT_SYS_OLD_SELECT
33 31
diff --git a/arch/arm/include/asm/virt.h b/arch/arm/include/asm/virt.h
index 86164df86cb4..50af92bac737 100644
--- a/arch/arm/include/asm/virt.h
+++ b/arch/arm/include/asm/virt.h
@@ -24,9 +24,9 @@
24/* 24/*
25 * Flag indicating that the kernel was not entered in the same mode on every 25 * Flag indicating that the kernel was not entered in the same mode on every
26 * CPU. The zImage loader stashes this value in an SPSR, so we need an 26 * CPU. The zImage loader stashes this value in an SPSR, so we need an
27 * architecturally defined flag bit here (the N flag, as it happens) 27 * architecturally defined flag bit here.
28 */ 28 */
29#define BOOT_CPU_MODE_MISMATCH (1<<31) 29#define BOOT_CPU_MODE_MISMATCH PSR_N_BIT
30 30
31#ifndef __ASSEMBLY__ 31#ifndef __ASSEMBLY__
32 32
diff --git a/arch/arm/include/asm/xen/events.h b/arch/arm/include/asm/xen/events.h
index 94b4e9020b02..5c27696de14f 100644
--- a/arch/arm/include/asm/xen/events.h
+++ b/arch/arm/include/asm/xen/events.h
@@ -15,4 +15,26 @@ static inline int xen_irqs_disabled(struct pt_regs *regs)
15 return raw_irqs_disabled_flags(regs->ARM_cpsr); 15 return raw_irqs_disabled_flags(regs->ARM_cpsr);
16} 16}
17 17
18/*
19 * We cannot use xchg because it does not support 8-byte
20 * values. However it is safe to use {ldr,dtd}exd directly because all
21 * platforms which Xen can run on support those instructions.
22 */
23static inline xen_ulong_t xchg_xen_ulong(xen_ulong_t *ptr, xen_ulong_t val)
24{
25 xen_ulong_t oldval;
26 unsigned int tmp;
27
28 wmb();
29 asm volatile("@ xchg_xen_ulong\n"
30 "1: ldrexd %0, %H0, [%3]\n"
31 " strexd %1, %2, %H2, [%3]\n"
32 " teq %1, #0\n"
33 " bne 1b"
34 : "=&r" (oldval), "=&r" (tmp)
35 : "r" (val), "r" (ptr)
36 : "memory", "cc");
37 return oldval;
38}
39
18#endif /* _ASM_ARM_XEN_EVENTS_H */ 40#endif /* _ASM_ARM_XEN_EVENTS_H */
diff --git a/arch/arm/include/asm/xen/page.h b/arch/arm/include/asm/xen/page.h
index c6b9096cef95..30cdacb675af 100644
--- a/arch/arm/include/asm/xen/page.h
+++ b/arch/arm/include/asm/xen/page.h
@@ -1,6 +1,7 @@
1#ifndef _ASM_ARM_XEN_PAGE_H 1#ifndef _ASM_ARM_XEN_PAGE_H
2#define _ASM_ARM_XEN_PAGE_H 2#define _ASM_ARM_XEN_PAGE_H
3 3
4#include <asm/mach/map.h>
4#include <asm/page.h> 5#include <asm/page.h>
5#include <asm/pgtable.h> 6#include <asm/pgtable.h>
6 7
@@ -86,4 +87,7 @@ static inline bool set_phys_to_machine(unsigned long pfn, unsigned long mfn)
86{ 87{
87 return __set_phys_to_machine(pfn, mfn); 88 return __set_phys_to_machine(pfn, mfn);
88} 89}
90
91#define xen_remap(cookie, size) __arm_ioremap((cookie), (size), MT_MEMORY);
92
89#endif /* _ASM_ARM_XEN_PAGE_H */ 93#endif /* _ASM_ARM_XEN_PAGE_H */
diff --git a/arch/arm/include/debug/imx-uart.h b/arch/arm/include/debug/imx-uart.h
new file mode 100644
index 000000000000..91d38e38a0b4
--- /dev/null
+++ b/arch/arm/include/debug/imx-uart.h
@@ -0,0 +1,88 @@
1/*
2 * Copyright (C) 2012 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef __DEBUG_IMX_UART_H
10#define __DEBUG_IMX_UART_H
11
12#define IMX1_UART1_BASE_ADDR 0x00206000
13#define IMX1_UART2_BASE_ADDR 0x00207000
14#define IMX1_UART_BASE_ADDR(n) IMX1_UART##n##_BASE_ADDR
15#define IMX1_UART_BASE(n) IMX1_UART_BASE_ADDR(n)
16
17#define IMX21_UART1_BASE_ADDR 0x1000a000
18#define IMX21_UART2_BASE_ADDR 0x1000b000
19#define IMX21_UART3_BASE_ADDR 0x1000c000
20#define IMX21_UART4_BASE_ADDR 0x1000d000
21#define IMX21_UART_BASE_ADDR(n) IMX21_UART##n##_BASE_ADDR
22#define IMX21_UART_BASE(n) IMX21_UART_BASE_ADDR(n)
23
24#define IMX25_UART1_BASE_ADDR 0x43f90000
25#define IMX25_UART2_BASE_ADDR 0x43f94000
26#define IMX25_UART3_BASE_ADDR 0x5000c000
27#define IMX25_UART4_BASE_ADDR 0x50008000
28#define IMX25_UART5_BASE_ADDR 0x5002c000
29#define IMX25_UART_BASE_ADDR(n) IMX25_UART##n##_BASE_ADDR
30#define IMX25_UART_BASE(n) IMX25_UART_BASE_ADDR(n)
31
32#define IMX31_UART1_BASE_ADDR 0x43f90000
33#define IMX31_UART2_BASE_ADDR 0x43f94000
34#define IMX31_UART3_BASE_ADDR 0x5000c000
35#define IMX31_UART4_BASE_ADDR 0x43fb0000
36#define IMX31_UART5_BASE_ADDR 0x43fb4000
37#define IMX31_UART_BASE_ADDR(n) IMX31_UART##n##_BASE_ADDR
38#define IMX31_UART_BASE(n) IMX31_UART_BASE_ADDR(n)
39
40#define IMX35_UART1_BASE_ADDR 0x43f90000
41#define IMX35_UART2_BASE_ADDR 0x43f94000
42#define IMX35_UART3_BASE_ADDR 0x5000c000
43#define IMX35_UART_BASE_ADDR(n) IMX35_UART##n##_BASE_ADDR
44#define IMX35_UART_BASE(n) IMX35_UART_BASE_ADDR(n)
45
46#define IMX51_UART1_BASE_ADDR 0x73fbc000
47#define IMX51_UART2_BASE_ADDR 0x73fc0000
48#define IMX51_UART3_BASE_ADDR 0x7000c000
49#define IMX51_UART_BASE_ADDR(n) IMX51_UART##n##_BASE_ADDR
50#define IMX51_UART_BASE(n) IMX51_UART_BASE_ADDR(n)
51
52#define IMX53_UART1_BASE_ADDR 0x53fbc000
53#define IMX53_UART2_BASE_ADDR 0x53fc0000
54#define IMX53_UART3_BASE_ADDR 0x5000c000
55#define IMX53_UART4_BASE_ADDR 0x53ff0000
56#define IMX53_UART5_BASE_ADDR 0x63f90000
57#define IMX53_UART_BASE_ADDR(n) IMX53_UART##n##_BASE_ADDR
58#define IMX53_UART_BASE(n) IMX53_UART_BASE_ADDR(n)
59
60#define IMX6Q_UART1_BASE_ADDR 0x02020000
61#define IMX6Q_UART2_BASE_ADDR 0x021e8000
62#define IMX6Q_UART3_BASE_ADDR 0x021ec000
63#define IMX6Q_UART4_BASE_ADDR 0x021f0000
64#define IMX6Q_UART5_BASE_ADDR 0x021f4000
65#define IMX6Q_UART_BASE_ADDR(n) IMX6Q_UART##n##_BASE_ADDR
66#define IMX6Q_UART_BASE(n) IMX6Q_UART_BASE_ADDR(n)
67
68#define IMX_DEBUG_UART_BASE(soc) soc##_UART_BASE(CONFIG_DEBUG_IMX_UART_PORT)
69
70#ifdef CONFIG_DEBUG_IMX1_UART
71#define UART_PADDR IMX_DEBUG_UART_BASE(IMX1)
72#elif defined(CONFIG_DEBUG_IMX21_IMX27_UART)
73#define UART_PADDR IMX_DEBUG_UART_BASE(IMX21)
74#elif defined(CONFIG_DEBUG_IMX25_UART)
75#define UART_PADDR IMX_DEBUG_UART_BASE(IMX25)
76#elif defined(CONFIG_DEBUG_IMX31_UART)
77#define UART_PADDR IMX_DEBUG_UART_BASE(IMX31)
78#elif defined(CONFIG_DEBUG_IMX35_UART)
79#define UART_PADDR IMX_DEBUG_UART_BASE(IMX35)
80#elif defined(CONFIG_DEBUG_IMX51_UART)
81#define UART_PADDR IMX_DEBUG_UART_BASE(IMX51)
82#elif defined(CONFIG_DEBUG_IMX53_UART)
83#define UART_PADDR IMX_DEBUG_UART_BASE(IMX53)
84#elif defined(CONFIG_DEBUG_IMX6Q_UART)
85#define UART_PADDR IMX_DEBUG_UART_BASE(IMX6Q)
86#endif
87
88#endif /* __DEBUG_IMX_UART_H */
diff --git a/arch/arm/include/debug/imx.S b/arch/arm/include/debug/imx.S
index 0c4e17d4d359..619d8cc1ac12 100644
--- a/arch/arm/include/debug/imx.S
+++ b/arch/arm/include/debug/imx.S
@@ -10,35 +10,8 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 * 11 *
12 */ 12 */
13#define IMX6Q_UART1_BASE_ADDR 0x02020000
14#define IMX6Q_UART2_BASE_ADDR 0x021e8000
15#define IMX6Q_UART3_BASE_ADDR 0x021ec000
16#define IMX6Q_UART4_BASE_ADDR 0x021f0000
17#define IMX6Q_UART5_BASE_ADDR 0x021f4000
18 13
19/* 14#include "imx-uart.h"
20 * IMX6Q_UART_BASE_ADDR is put in the middle to force the expansion
21 * of IMX6Q_UART##n##_BASE_ADDR.
22 */
23#define IMX6Q_UART_BASE_ADDR(n) IMX6Q_UART##n##_BASE_ADDR
24#define IMX6Q_UART_BASE(n) IMX6Q_UART_BASE_ADDR(n)
25#define IMX6Q_DEBUG_UART_BASE IMX6Q_UART_BASE(CONFIG_DEBUG_IMX6Q_UART_PORT)
26
27#ifdef CONFIG_DEBUG_IMX1_UART
28#define UART_PADDR 0x00206000
29#elif defined (CONFIG_DEBUG_IMX25_UART)
30#define UART_PADDR 0x43f90000
31#elif defined (CONFIG_DEBUG_IMX21_IMX27_UART)
32#define UART_PADDR 0x1000a000
33#elif defined (CONFIG_DEBUG_IMX31_IMX35_UART)
34#define UART_PADDR 0x43f90000
35#elif defined (CONFIG_DEBUG_IMX51_UART)
36#define UART_PADDR 0x73fbc000
37#elif defined (CONFIG_DEBUG_IMX50_IMX53_UART)
38#define UART_PADDR 0x53fbc000
39#elif defined (CONFIG_DEBUG_IMX6Q_UART)
40#define UART_PADDR IMX6Q_DEBUG_UART_BASE
41#endif
42 15
43/* 16/*
44 * FIXME: This is a copy of IMX_IO_P2V in hardware.h, and needs to 17 * FIXME: This is a copy of IMX_IO_P2V in hardware.h, and needs to
diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/include/debug/omap2plus.S
index cfaed13d0040..6d867aef18eb 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/include/debug/omap2plus.S
@@ -1,5 +1,4 @@
1/* arch/arm/mach-omap2/include/mach/debug-macro.S 1/*
2 *
3 * Debugging macro include header 2 * Debugging macro include header
4 * 3 *
5 * Copyright (C) 1994-1999 Russell King 4 * Copyright (C) 1994-1999 Russell King
@@ -13,7 +12,49 @@
13 12
14#include <linux/serial_reg.h> 13#include <linux/serial_reg.h>
15 14
16#include <mach/serial.h> 15/* OMAP2 serial ports */
16#define OMAP2_UART1_BASE 0x4806a000
17#define OMAP2_UART2_BASE 0x4806c000
18#define OMAP2_UART3_BASE 0x4806e000
19
20/* OMAP3 serial ports */
21#define OMAP3_UART1_BASE OMAP2_UART1_BASE
22#define OMAP3_UART2_BASE OMAP2_UART2_BASE
23#define OMAP3_UART3_BASE 0x49020000
24#define OMAP3_UART4_BASE 0x49042000 /* Only on 36xx */
25#define OMAP3_UART4_AM35XX_BASE 0x4809E000 /* Only on AM35xx */
26
27/* OMAP4 serial ports */
28#define OMAP4_UART1_BASE OMAP2_UART1_BASE
29#define OMAP4_UART2_BASE OMAP2_UART2_BASE
30#define OMAP4_UART3_BASE 0x48020000
31#define OMAP4_UART4_BASE 0x4806e000
32
33/* TI81XX serial ports */
34#define TI81XX_UART1_BASE 0x48020000
35#define TI81XX_UART2_BASE 0x48022000
36#define TI81XX_UART3_BASE 0x48024000
37
38/* AM3505/3517 UART4 */
39#define AM35XX_UART4_BASE 0x4809E000 /* Only on AM3505/3517 */
40
41/* AM33XX serial port */
42#define AM33XX_UART1_BASE 0x44E09000
43
44/* OMAP5 serial ports */
45#define OMAP5_UART1_BASE OMAP2_UART1_BASE
46#define OMAP5_UART2_BASE OMAP2_UART2_BASE
47#define OMAP5_UART3_BASE OMAP4_UART3_BASE
48#define OMAP5_UART4_BASE OMAP4_UART4_BASE
49#define OMAP5_UART5_BASE 0x48066000
50#define OMAP5_UART6_BASE 0x48068000
51
52/* External port on Zoom2/3 */
53#define ZOOM_UART_BASE 0x10000000
54#define ZOOM_UART_VIRT 0xfa400000
55
56#define OMAP_PORT_SHIFT 2
57#define ZOOM_PORT_SHIFT 1
17 58
18#define UART_OFFSET(addr) ((addr) & 0x00ffffff) 59#define UART_OFFSET(addr) ((addr) & 0x00ffffff)
19 60
@@ -23,12 +64,6 @@ omap_uart_virt: .word 0
23omap_uart_lsr: .word 0 64omap_uart_lsr: .word 0
24 .popsection 65 .popsection
25 66
26 /*
27 * Note that this code won't work if the bootloader passes
28 * a wrong machine ID number in r1. To debug, just hardcode
29 * the desired UART phys and virt addresses temporarily into
30 * the omap_uart_phys and omap_uart_virt above.
31 */
32 .macro addruart, rp, rv, tmp 67 .macro addruart, rp, rv, tmp
33 68
34 /* Use omap_uart_phys/virt if already configured */ 69 /* Use omap_uart_phys/virt if already configured */
@@ -43,74 +78,64 @@ omap_uart_lsr: .word 0
43 cmpne \rv, #0 78 cmpne \rv, #0
44 bne 100f @ already configured 79 bne 100f @ already configured
45 80
46 /* Check the debug UART configuration set in uncompress.h */
47 mov \rp, pc
48 ldr \rv, =OMAP_UART_INFO_OFS
49 and \rp, \rp, #0xff000000
50 ldr \rp, [\rp, \rv]
51
52 /* Select the UART to use based on the UART1 scratchpad value */
53 cmp \rp, #0 @ no port configured?
54 beq 21f @ if none, try to use UART1
55 cmp \rp, #OMAP2UART1 @ OMAP2/3/4UART1
56 beq 21f @ configure OMAP2/3/4UART1
57 cmp \rp, #OMAP2UART2 @ OMAP2/3/4UART2
58 beq 22f @ configure OMAP2/3/4UART2
59 cmp \rp, #OMAP2UART3 @ only on 24xx
60 beq 23f @ configure OMAP2UART3
61 cmp \rp, #OMAP3UART3 @ only on 34xx
62 beq 33f @ configure OMAP3UART3
63 cmp \rp, #OMAP4UART3 @ only on 44xx/54xx
64 beq 43f @ configure OMAP4/5UART3
65 cmp \rp, #OMAP3UART4 @ only on 36xx
66 beq 34f @ configure OMAP3UART4
67 cmp \rp, #OMAP4UART4 @ only on 44xx/54xx
68 beq 44f @ configure OMAP4/5UART4
69 cmp \rp, #TI81XXUART1 @ ti81Xx UART offsets different
70 beq 81f @ configure UART1
71 cmp \rp, #TI81XXUART2 @ ti81Xx UART offsets different
72 beq 82f @ configure UART2
73 cmp \rp, #TI81XXUART3 @ ti81Xx UART offsets different
74 beq 83f @ configure UART3
75 cmp \rp, #AM33XXUART1 @ AM33XX UART offsets different
76 beq 84f @ configure UART1
77 cmp \rp, #ZOOM_UART @ only on zoom2/3
78 beq 95f @ configure ZOOM_UART
79
80 /* Configure the UART offset from the phys/virt base */ 81 /* Configure the UART offset from the phys/virt base */
8121: mov \rp, #UART_OFFSET(OMAP2_UART1_BASE) @ omap2/3/4 82#ifdef CONFIG_DEBUG_OMAP2UART1
83 mov \rp, #UART_OFFSET(OMAP2_UART1_BASE) @ omap2/3/4
82 b 98f 84 b 98f
8322: mov \rp, #UART_OFFSET(OMAP2_UART2_BASE) @ omap2/3/4 85#endif
86#ifdef CONFIG_DEBUG_OMAP2UART2
87 mov \rp, #UART_OFFSET(OMAP2_UART2_BASE) @ omap2/3/4
84 b 98f 88 b 98f
8523: mov \rp, #UART_OFFSET(OMAP2_UART3_BASE) 89#endif
90#ifdef CONFIG_DEBUG_OMAP2UART3
91 mov \rp, #UART_OFFSET(OMAP2_UART3_BASE)
86 b 98f 92 b 98f
8733: mov \rp, #UART_OFFSET(OMAP3_UART1_BASE) 93#endif
94#ifdef CONFIG_DEBUG_OMAP3UART3
95 mov \rp, #UART_OFFSET(OMAP3_UART1_BASE)
88 add \rp, \rp, #0x00fb0000 96 add \rp, \rp, #0x00fb0000
89 add \rp, \rp, #0x00006000 @ OMAP3_UART3_BASE 97 add \rp, \rp, #0x00006000 @ OMAP3_UART3_BASE
90 b 98f 98 b 98f
9134: mov \rp, #UART_OFFSET(OMAP3_UART1_BASE) 99#endif
100#ifdef CONFIG_DEBUG_OMAP4UART3
101 mov \rp, #UART_OFFSET(OMAP4_UART3_BASE)
102 b 98f
103#endif
104#ifdef CONFIG_DEBUG_OMAP3UART4
105 mov \rp, #UART_OFFSET(OMAP3_UART1_BASE)
92 add \rp, \rp, #0x00fb0000 106 add \rp, \rp, #0x00fb0000
93 add \rp, \rp, #0x00028000 @ OMAP3_UART4_BASE 107 add \rp, \rp, #0x00028000 @ OMAP3_UART4_BASE
94 b 98f 108 b 98f
9543: mov \rp, #UART_OFFSET(OMAP4_UART3_BASE) 109#endif
96 b 98f 110#ifdef CONFIG_DEBUG_OMAP4UART4
9744: mov \rp, #UART_OFFSET(OMAP4_UART4_BASE) 111 mov \rp, #UART_OFFSET(OMAP4_UART4_BASE)
98 b 98f 112 b 98f
9981: mov \rp, #UART_OFFSET(TI81XX_UART1_BASE) 113#endif
114#ifdef CONFIG_DEBUG_TI81XXUART1
115 mov \rp, #UART_OFFSET(TI81XX_UART1_BASE)
100 b 98f 116 b 98f
10182: mov \rp, #UART_OFFSET(TI81XX_UART2_BASE) 117#endif
118#ifdef CONFIG_DEBUG_TI81XXUART2
119 mov \rp, #UART_OFFSET(TI81XX_UART2_BASE)
102 b 98f 120 b 98f
10383: mov \rp, #UART_OFFSET(TI81XX_UART3_BASE) 121#endif
122#ifdef CONFIG_DEBUG_TI81XXUART3
123 mov \rp, #UART_OFFSET(TI81XX_UART3_BASE)
104 b 98f 124 b 98f
10584: ldr \rp, =AM33XX_UART1_BASE 125#endif
126#ifdef CONFIG_DEBUG_AM33XXUART1
127 ldr \rp, =AM33XX_UART1_BASE
106 and \rp, \rp, #0x00ffffff 128 and \rp, \rp, #0x00ffffff
107 b 97f 129 b 97f
10895: ldr \rp, =ZOOM_UART_BASE 130#endif
131#ifdef CONFIG_DEBUG_ZOOM_UART
132 ldr \rp, =ZOOM_UART_BASE
109 str \rp, [\tmp, #0] @ omap_uart_phys 133 str \rp, [\tmp, #0] @ omap_uart_phys
110 ldr \rp, =ZOOM_UART_VIRT 134 ldr \rp, =ZOOM_UART_VIRT
111 str \rp, [\tmp, #4] @ omap_uart_virt 135 str \rp, [\tmp, #4] @ omap_uart_virt
112 mov \rp, #(UART_LSR << ZOOM_PORT_SHIFT) 136 mov \rp, #(UART_LSR << ZOOM_PORT_SHIFT)
113 str \rp, [\tmp, #8] @ omap_uart_lsr 137 str \rp, [\tmp, #8] @ omap_uart_lsr
138#endif
114 b 10b 139 b 10b
115 140
116 /* AM33XX: Store both phys and virt address for the uart */ 141 /* AM33XX: Store both phys and virt address for the uart */
diff --git a/arch/arm/mach-vt8500/include/mach/debug-macro.S b/arch/arm/include/debug/vt8500.S
index ca292f29d4a3..0e0ca0869da7 100644
--- a/arch/arm/mach-vt8500/include/mach/debug-macro.S
+++ b/arch/arm/include/debug/vt8500.S
@@ -1,20 +1,24 @@
1/* 1/*
2 * arch/arm/mach-vt8500/include/mach/debug-macro.S 2 * Debugging macro include header
3 * 3 *
4 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com> 4 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
5 * 5 * Moved from arch/arm/mach-vt8500/include/mach/debug-macro.S
6 * Debugging macro include header 6 * Minor changes for readability.
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#define DEBUG_LL_PHYS_BASE 0xD8000000
14#define DEBUG_LL_VIRT_BASE 0xF8000000
15#define DEBUG_LL_UART_OFFSET 0x00200000
13 16
17#if defined(CONFIG_DEBUG_VT8500_UART0)
14 .macro addruart, rp, rv, tmp 18 .macro addruart, rp, rv, tmp
15 mov \rp, #0x00200000 19 mov \rp, #DEBUG_LL_UART_OFFSET
16 orr \rv, \rp, #0xf8000000 20 orr \rv, \rp, #DEBUG_LL_VIRT_BASE
17 orr \rp, \rp, #0xd8000000 21 orr \rp, \rp, #DEBUG_LL_PHYS_BASE
18 .endm 22 .endm
19 23
20 .macro senduart,rd,rx 24 .macro senduart,rd,rx
@@ -29,3 +33,5 @@
29 33
30 .macro waituart,rd,rx 34 .macro waituart,rd,rx
31 .endm 35 .endm
36
37#endif
diff --git a/arch/arm/include/uapi/asm/kvm.h b/arch/arm/include/uapi/asm/kvm.h
new file mode 100644
index 000000000000..023bfeb367bf
--- /dev/null
+++ b/arch/arm/include/uapi/asm/kvm.h
@@ -0,0 +1,180 @@
1/*
2 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
3 * Author: Christoffer Dall <c.dall@virtualopensystems.com>
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 * 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 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#ifndef __ARM_KVM_H__
20#define __ARM_KVM_H__
21
22#include <linux/types.h>
23#include <asm/ptrace.h>
24
25#define __KVM_HAVE_GUEST_DEBUG
26#define __KVM_HAVE_IRQ_LINE
27
28#define KVM_REG_SIZE(id) \
29 (1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT))
30
31/* Valid for svc_regs, abt_regs, und_regs, irq_regs in struct kvm_regs */
32#define KVM_ARM_SVC_sp svc_regs[0]
33#define KVM_ARM_SVC_lr svc_regs[1]
34#define KVM_ARM_SVC_spsr svc_regs[2]
35#define KVM_ARM_ABT_sp abt_regs[0]
36#define KVM_ARM_ABT_lr abt_regs[1]
37#define KVM_ARM_ABT_spsr abt_regs[2]
38#define KVM_ARM_UND_sp und_regs[0]
39#define KVM_ARM_UND_lr und_regs[1]
40#define KVM_ARM_UND_spsr und_regs[2]
41#define KVM_ARM_IRQ_sp irq_regs[0]
42#define KVM_ARM_IRQ_lr irq_regs[1]
43#define KVM_ARM_IRQ_spsr irq_regs[2]
44
45/* Valid only for fiq_regs in struct kvm_regs */
46#define KVM_ARM_FIQ_r8 fiq_regs[0]
47#define KVM_ARM_FIQ_r9 fiq_regs[1]
48#define KVM_ARM_FIQ_r10 fiq_regs[2]
49#define KVM_ARM_FIQ_fp fiq_regs[3]
50#define KVM_ARM_FIQ_ip fiq_regs[4]
51#define KVM_ARM_FIQ_sp fiq_regs[5]
52#define KVM_ARM_FIQ_lr fiq_regs[6]
53#define KVM_ARM_FIQ_spsr fiq_regs[7]
54
55struct kvm_regs {
56 struct pt_regs usr_regs;/* R0_usr - R14_usr, PC, CPSR */
57 __u32 svc_regs[3]; /* SP_svc, LR_svc, SPSR_svc */
58 __u32 abt_regs[3]; /* SP_abt, LR_abt, SPSR_abt */
59 __u32 und_regs[3]; /* SP_und, LR_und, SPSR_und */
60 __u32 irq_regs[3]; /* SP_irq, LR_irq, SPSR_irq */
61 __u32 fiq_regs[8]; /* R8_fiq - R14_fiq, SPSR_fiq */
62};
63
64/* Supported Processor Types */
65#define KVM_ARM_TARGET_CORTEX_A15 0
66#define KVM_ARM_NUM_TARGETS 1
67
68/* KVM_ARM_SET_DEVICE_ADDR ioctl id encoding */
69#define KVM_ARM_DEVICE_TYPE_SHIFT 0
70#define KVM_ARM_DEVICE_TYPE_MASK (0xffff << KVM_ARM_DEVICE_TYPE_SHIFT)
71#define KVM_ARM_DEVICE_ID_SHIFT 16
72#define KVM_ARM_DEVICE_ID_MASK (0xffff << KVM_ARM_DEVICE_ID_SHIFT)
73
74/* Supported device IDs */
75#define KVM_ARM_DEVICE_VGIC_V2 0
76
77/* Supported VGIC address types */
78#define KVM_VGIC_V2_ADDR_TYPE_DIST 0
79#define KVM_VGIC_V2_ADDR_TYPE_CPU 1
80
81#define KVM_VGIC_V2_DIST_SIZE 0x1000
82#define KVM_VGIC_V2_CPU_SIZE 0x2000
83
84#define KVM_ARM_VCPU_POWER_OFF 0 /* CPU is started in OFF state */
85
86struct kvm_vcpu_init {
87 __u32 target;
88 __u32 features[7];
89};
90
91struct kvm_sregs {
92};
93
94struct kvm_fpu {
95};
96
97struct kvm_guest_debug_arch {
98};
99
100struct kvm_debug_exit_arch {
101};
102
103struct kvm_sync_regs {
104};
105
106struct kvm_arch_memory_slot {
107};
108
109/* If you need to interpret the index values, here is the key: */
110#define KVM_REG_ARM_COPROC_MASK 0x000000000FFF0000
111#define KVM_REG_ARM_COPROC_SHIFT 16
112#define KVM_REG_ARM_32_OPC2_MASK 0x0000000000000007
113#define KVM_REG_ARM_32_OPC2_SHIFT 0
114#define KVM_REG_ARM_OPC1_MASK 0x0000000000000078
115#define KVM_REG_ARM_OPC1_SHIFT 3
116#define KVM_REG_ARM_CRM_MASK 0x0000000000000780
117#define KVM_REG_ARM_CRM_SHIFT 7
118#define KVM_REG_ARM_32_CRN_MASK 0x0000000000007800
119#define KVM_REG_ARM_32_CRN_SHIFT 11
120
121/* Normal registers are mapped as coprocessor 16. */
122#define KVM_REG_ARM_CORE (0x0010 << KVM_REG_ARM_COPROC_SHIFT)
123#define KVM_REG_ARM_CORE_REG(name) (offsetof(struct kvm_regs, name) / 4)
124
125/* Some registers need more space to represent values. */
126#define KVM_REG_ARM_DEMUX (0x0011 << KVM_REG_ARM_COPROC_SHIFT)
127#define KVM_REG_ARM_DEMUX_ID_MASK 0x000000000000FF00
128#define KVM_REG_ARM_DEMUX_ID_SHIFT 8
129#define KVM_REG_ARM_DEMUX_ID_CCSIDR (0x00 << KVM_REG_ARM_DEMUX_ID_SHIFT)
130#define KVM_REG_ARM_DEMUX_VAL_MASK 0x00000000000000FF
131#define KVM_REG_ARM_DEMUX_VAL_SHIFT 0
132
133/* VFP registers: we could overload CP10 like ARM does, but that's ugly. */
134#define KVM_REG_ARM_VFP (0x0012 << KVM_REG_ARM_COPROC_SHIFT)
135#define KVM_REG_ARM_VFP_MASK 0x000000000000FFFF
136#define KVM_REG_ARM_VFP_BASE_REG 0x0
137#define KVM_REG_ARM_VFP_FPSID 0x1000
138#define KVM_REG_ARM_VFP_FPSCR 0x1001
139#define KVM_REG_ARM_VFP_MVFR1 0x1006
140#define KVM_REG_ARM_VFP_MVFR0 0x1007
141#define KVM_REG_ARM_VFP_FPEXC 0x1008
142#define KVM_REG_ARM_VFP_FPINST 0x1009
143#define KVM_REG_ARM_VFP_FPINST2 0x100A
144
145
146/* KVM_IRQ_LINE irq field index values */
147#define KVM_ARM_IRQ_TYPE_SHIFT 24
148#define KVM_ARM_IRQ_TYPE_MASK 0xff
149#define KVM_ARM_IRQ_VCPU_SHIFT 16
150#define KVM_ARM_IRQ_VCPU_MASK 0xff
151#define KVM_ARM_IRQ_NUM_SHIFT 0
152#define KVM_ARM_IRQ_NUM_MASK 0xffff
153
154/* irq_type field */
155#define KVM_ARM_IRQ_TYPE_CPU 0
156#define KVM_ARM_IRQ_TYPE_SPI 1
157#define KVM_ARM_IRQ_TYPE_PPI 2
158
159/* out-of-kernel GIC cpu interrupt injection irq_number field */
160#define KVM_ARM_IRQ_CPU_IRQ 0
161#define KVM_ARM_IRQ_CPU_FIQ 1
162
163/* Highest supported SPI, from VGIC_NR_IRQS */
164#define KVM_ARM_IRQ_GIC_MAX 127
165
166/* PSCI interface */
167#define KVM_PSCI_FN_BASE 0x95c1ba5e
168#define KVM_PSCI_FN(n) (KVM_PSCI_FN_BASE + (n))
169
170#define KVM_PSCI_FN_CPU_SUSPEND KVM_PSCI_FN(0)
171#define KVM_PSCI_FN_CPU_OFF KVM_PSCI_FN(1)
172#define KVM_PSCI_FN_CPU_ON KVM_PSCI_FN(2)
173#define KVM_PSCI_FN_MIGRATE KVM_PSCI_FN(3)
174
175#define KVM_PSCI_RET_SUCCESS 0
176#define KVM_PSCI_RET_NI ((unsigned long)-1)
177#define KVM_PSCI_RET_INVAL ((unsigned long)-2)
178#define KVM_PSCI_RET_DENIED ((unsigned long)-3)
179
180#endif /* __ARM_KVM_H__ */
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 5bbec7b8183e..5f3338eacad2 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -82,5 +82,6 @@ obj-$(CONFIG_DEBUG_LL) += debug.o
82obj-$(CONFIG_EARLY_PRINTK) += early_printk.o 82obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
83 83
84obj-$(CONFIG_ARM_VIRT_EXT) += hyp-stub.o 84obj-$(CONFIG_ARM_VIRT_EXT) += hyp-stub.o
85obj-$(CONFIG_ARM_PSCI) += psci.o
85 86
86extra-y := $(head-y) vmlinux.lds 87extra-y := $(head-y) vmlinux.lds
diff --git a/arch/arm/kernel/arch_timer.c b/arch/arm/kernel/arch_timer.c
index c8ef20747ee7..d957a51435d8 100644
--- a/arch/arm/kernel/arch_timer.c
+++ b/arch/arm/kernel/arch_timer.c
@@ -9,516 +9,53 @@
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/kernel.h> 12#include <linux/types.h>
13#include <linux/delay.h> 13#include <linux/errno.h>
14#include <linux/device.h>
15#include <linux/smp.h>
16#include <linux/cpu.h>
17#include <linux/jiffies.h>
18#include <linux/clockchips.h>
19#include <linux/interrupt.h>
20#include <linux/of_irq.h>
21#include <linux/io.h>
22 14
23#include <asm/cputype.h>
24#include <asm/delay.h> 15#include <asm/delay.h>
25#include <asm/localtimer.h>
26#include <asm/arch_timer.h>
27#include <asm/system_info.h>
28#include <asm/sched_clock.h> 16#include <asm/sched_clock.h>
29 17
30static unsigned long arch_timer_rate; 18#include <clocksource/arm_arch_timer.h>
31 19
32enum ppi_nr { 20static unsigned long arch_timer_read_counter_long(void)
33 PHYS_SECURE_PPI,
34 PHYS_NONSECURE_PPI,
35 VIRT_PPI,
36 HYP_PPI,
37 MAX_TIMER_PPI
38};
39
40static int arch_timer_ppi[MAX_TIMER_PPI];
41
42static struct clock_event_device __percpu **arch_timer_evt;
43static struct delay_timer arch_delay_timer;
44
45static bool arch_timer_use_virtual = true;
46
47/*
48 * Architected system timer support.
49 */
50
51#define ARCH_TIMER_CTRL_ENABLE (1 << 0)
52#define ARCH_TIMER_CTRL_IT_MASK (1 << 1)
53#define ARCH_TIMER_CTRL_IT_STAT (1 << 2)
54
55#define ARCH_TIMER_REG_CTRL 0
56#define ARCH_TIMER_REG_FREQ 1
57#define ARCH_TIMER_REG_TVAL 2
58
59#define ARCH_TIMER_PHYS_ACCESS 0
60#define ARCH_TIMER_VIRT_ACCESS 1
61
62/*
63 * These register accessors are marked inline so the compiler can
64 * nicely work out which register we want, and chuck away the rest of
65 * the code. At least it does so with a recent GCC (4.6.3).
66 */
67static inline void arch_timer_reg_write(const int access, const int reg, u32 val)
68{
69 if (access == ARCH_TIMER_PHYS_ACCESS) {
70 switch (reg) {
71 case ARCH_TIMER_REG_CTRL:
72 asm volatile("mcr p15, 0, %0, c14, c2, 1" : : "r" (val));
73 break;
74 case ARCH_TIMER_REG_TVAL:
75 asm volatile("mcr p15, 0, %0, c14, c2, 0" : : "r" (val));
76 break;
77 }
78 }
79
80 if (access == ARCH_TIMER_VIRT_ACCESS) {
81 switch (reg) {
82 case ARCH_TIMER_REG_CTRL:
83 asm volatile("mcr p15, 0, %0, c14, c3, 1" : : "r" (val));
84 break;
85 case ARCH_TIMER_REG_TVAL:
86 asm volatile("mcr p15, 0, %0, c14, c3, 0" : : "r" (val));
87 break;
88 }
89 }
90
91 isb();
92}
93
94static inline u32 arch_timer_reg_read(const int access, const int reg)
95{
96 u32 val = 0;
97
98 if (access == ARCH_TIMER_PHYS_ACCESS) {
99 switch (reg) {
100 case ARCH_TIMER_REG_CTRL:
101 asm volatile("mrc p15, 0, %0, c14, c2, 1" : "=r" (val));
102 break;
103 case ARCH_TIMER_REG_TVAL:
104 asm volatile("mrc p15, 0, %0, c14, c2, 0" : "=r" (val));
105 break;
106 case ARCH_TIMER_REG_FREQ:
107 asm volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (val));
108 break;
109 }
110 }
111
112 if (access == ARCH_TIMER_VIRT_ACCESS) {
113 switch (reg) {
114 case ARCH_TIMER_REG_CTRL:
115 asm volatile("mrc p15, 0, %0, c14, c3, 1" : "=r" (val));
116 break;
117 case ARCH_TIMER_REG_TVAL:
118 asm volatile("mrc p15, 0, %0, c14, c3, 0" : "=r" (val));
119 break;
120 }
121 }
122
123 return val;
124}
125
126static inline cycle_t arch_timer_counter_read(const int access)
127{
128 cycle_t cval = 0;
129
130 if (access == ARCH_TIMER_PHYS_ACCESS)
131 asm volatile("mrrc p15, 0, %Q0, %R0, c14" : "=r" (cval));
132
133 if (access == ARCH_TIMER_VIRT_ACCESS)
134 asm volatile("mrrc p15, 1, %Q0, %R0, c14" : "=r" (cval));
135
136 return cval;
137}
138
139static inline cycle_t arch_counter_get_cntpct(void)
140{
141 return arch_timer_counter_read(ARCH_TIMER_PHYS_ACCESS);
142}
143
144static inline cycle_t arch_counter_get_cntvct(void)
145{
146 return arch_timer_counter_read(ARCH_TIMER_VIRT_ACCESS);
147}
148
149static irqreturn_t inline timer_handler(const int access,
150 struct clock_event_device *evt)
151{
152 unsigned long ctrl;
153 ctrl = arch_timer_reg_read(access, ARCH_TIMER_REG_CTRL);
154 if (ctrl & ARCH_TIMER_CTRL_IT_STAT) {
155 ctrl |= ARCH_TIMER_CTRL_IT_MASK;
156 arch_timer_reg_write(access, ARCH_TIMER_REG_CTRL, ctrl);
157 evt->event_handler(evt);
158 return IRQ_HANDLED;
159 }
160
161 return IRQ_NONE;
162}
163
164static irqreturn_t arch_timer_handler_virt(int irq, void *dev_id)
165{
166 struct clock_event_device *evt = *(struct clock_event_device **)dev_id;
167
168 return timer_handler(ARCH_TIMER_VIRT_ACCESS, evt);
169}
170
171static irqreturn_t arch_timer_handler_phys(int irq, void *dev_id)
172{
173 struct clock_event_device *evt = *(struct clock_event_device **)dev_id;
174
175 return timer_handler(ARCH_TIMER_PHYS_ACCESS, evt);
176}
177
178static inline void timer_set_mode(const int access, int mode)
179{
180 unsigned long ctrl;
181 switch (mode) {
182 case CLOCK_EVT_MODE_UNUSED:
183 case CLOCK_EVT_MODE_SHUTDOWN:
184 ctrl = arch_timer_reg_read(access, ARCH_TIMER_REG_CTRL);
185 ctrl &= ~ARCH_TIMER_CTRL_ENABLE;
186 arch_timer_reg_write(access, ARCH_TIMER_REG_CTRL, ctrl);
187 break;
188 default:
189 break;
190 }
191}
192
193static void arch_timer_set_mode_virt(enum clock_event_mode mode,
194 struct clock_event_device *clk)
195{
196 timer_set_mode(ARCH_TIMER_VIRT_ACCESS, mode);
197}
198
199static void arch_timer_set_mode_phys(enum clock_event_mode mode,
200 struct clock_event_device *clk)
201{
202 timer_set_mode(ARCH_TIMER_PHYS_ACCESS, mode);
203}
204
205static inline void set_next_event(const int access, unsigned long evt)
206{
207 unsigned long ctrl;
208 ctrl = arch_timer_reg_read(access, ARCH_TIMER_REG_CTRL);
209 ctrl |= ARCH_TIMER_CTRL_ENABLE;
210 ctrl &= ~ARCH_TIMER_CTRL_IT_MASK;
211 arch_timer_reg_write(access, ARCH_TIMER_REG_TVAL, evt);
212 arch_timer_reg_write(access, ARCH_TIMER_REG_CTRL, ctrl);
213}
214
215static int arch_timer_set_next_event_virt(unsigned long evt,
216 struct clock_event_device *unused)
217{
218 set_next_event(ARCH_TIMER_VIRT_ACCESS, evt);
219 return 0;
220}
221
222static int arch_timer_set_next_event_phys(unsigned long evt,
223 struct clock_event_device *unused)
224{
225 set_next_event(ARCH_TIMER_PHYS_ACCESS, evt);
226 return 0;
227}
228
229static int __cpuinit arch_timer_setup(struct clock_event_device *clk)
230{
231 clk->features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_C3STOP;
232 clk->name = "arch_sys_timer";
233 clk->rating = 450;
234 if (arch_timer_use_virtual) {
235 clk->irq = arch_timer_ppi[VIRT_PPI];
236 clk->set_mode = arch_timer_set_mode_virt;
237 clk->set_next_event = arch_timer_set_next_event_virt;
238 } else {
239 clk->irq = arch_timer_ppi[PHYS_SECURE_PPI];
240 clk->set_mode = arch_timer_set_mode_phys;
241 clk->set_next_event = arch_timer_set_next_event_phys;
242 }
243
244 clk->set_mode(CLOCK_EVT_MODE_SHUTDOWN, NULL);
245
246 clockevents_config_and_register(clk, arch_timer_rate,
247 0xf, 0x7fffffff);
248
249 *__this_cpu_ptr(arch_timer_evt) = clk;
250
251 if (arch_timer_use_virtual)
252 enable_percpu_irq(arch_timer_ppi[VIRT_PPI], 0);
253 else {
254 enable_percpu_irq(arch_timer_ppi[PHYS_SECURE_PPI], 0);
255 if (arch_timer_ppi[PHYS_NONSECURE_PPI])
256 enable_percpu_irq(arch_timer_ppi[PHYS_NONSECURE_PPI], 0);
257 }
258
259 return 0;
260}
261
262/* Is the optional system timer available? */
263static int local_timer_is_architected(void)
264{
265 return (cpu_architecture() >= CPU_ARCH_ARMv7) &&
266 ((read_cpuid_ext(CPUID_EXT_PFR1) >> 16) & 0xf) == 1;
267}
268
269static int arch_timer_available(void)
270{
271 unsigned long freq;
272
273 if (!local_timer_is_architected())
274 return -ENXIO;
275
276 if (arch_timer_rate == 0) {
277 freq = arch_timer_reg_read(ARCH_TIMER_PHYS_ACCESS,
278 ARCH_TIMER_REG_FREQ);
279
280 /* Check the timer frequency. */
281 if (freq == 0) {
282 pr_warn("Architected timer frequency not available\n");
283 return -EINVAL;
284 }
285
286 arch_timer_rate = freq;
287 }
288
289 pr_info_once("Architected local timer running at %lu.%02luMHz (%s).\n",
290 arch_timer_rate / 1000000, (arch_timer_rate / 10000) % 100,
291 arch_timer_use_virtual ? "virt" : "phys");
292 return 0;
293}
294
295static u32 notrace arch_counter_get_cntpct32(void)
296{
297 cycle_t cnt = arch_counter_get_cntpct();
298
299 /*
300 * The sched_clock infrastructure only knows about counters
301 * with at most 32bits. Forget about the upper 24 bits for the
302 * time being...
303 */
304 return (u32)cnt;
305}
306
307static u32 notrace arch_counter_get_cntvct32(void)
308{
309 cycle_t cnt = arch_counter_get_cntvct();
310
311 /*
312 * The sched_clock infrastructure only knows about counters
313 * with at most 32bits. Forget about the upper 24 bits for the
314 * time being...
315 */
316 return (u32)cnt;
317}
318
319static cycle_t arch_counter_read(struct clocksource *cs)
320{
321 /*
322 * Always use the physical counter for the clocksource.
323 * CNTHCTL.PL1PCTEN must be set to 1.
324 */
325 return arch_counter_get_cntpct();
326}
327
328static unsigned long arch_timer_read_current_timer(void)
329{ 21{
330 return arch_counter_get_cntpct(); 22 return arch_timer_read_counter();
331} 23}
332 24
333static cycle_t arch_counter_read_cc(const struct cyclecounter *cc) 25static u32 arch_timer_read_counter_u32(void)
334{ 26{
335 /* 27 return arch_timer_read_counter();
336 * Always use the physical counter for the clocksource.
337 * CNTHCTL.PL1PCTEN must be set to 1.
338 */
339 return arch_counter_get_cntpct();
340} 28}
341 29
342static struct clocksource clocksource_counter = { 30static struct delay_timer arch_delay_timer;
343 .name = "arch_sys_counter",
344 .rating = 400,
345 .read = arch_counter_read,
346 .mask = CLOCKSOURCE_MASK(56),
347 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
348};
349
350static struct cyclecounter cyclecounter = {
351 .read = arch_counter_read_cc,
352 .mask = CLOCKSOURCE_MASK(56),
353};
354
355static struct timecounter timecounter;
356
357struct timecounter *arch_timer_get_timecounter(void)
358{
359 return &timecounter;
360}
361
362static void __cpuinit arch_timer_stop(struct clock_event_device *clk)
363{
364 pr_debug("arch_timer_teardown disable IRQ%d cpu #%d\n",
365 clk->irq, smp_processor_id());
366
367 if (arch_timer_use_virtual)
368 disable_percpu_irq(arch_timer_ppi[VIRT_PPI]);
369 else {
370 disable_percpu_irq(arch_timer_ppi[PHYS_SECURE_PPI]);
371 if (arch_timer_ppi[PHYS_NONSECURE_PPI])
372 disable_percpu_irq(arch_timer_ppi[PHYS_NONSECURE_PPI]);
373 }
374
375 clk->set_mode(CLOCK_EVT_MODE_UNUSED, clk);
376}
377
378static struct local_timer_ops arch_timer_ops __cpuinitdata = {
379 .setup = arch_timer_setup,
380 .stop = arch_timer_stop,
381};
382
383static struct clock_event_device arch_timer_global_evt;
384 31
385static int __init arch_timer_register(void) 32static void __init arch_timer_delay_timer_register(void)
386{ 33{
387 int err;
388 int ppi;
389
390 err = arch_timer_available();
391 if (err)
392 goto out;
393
394 arch_timer_evt = alloc_percpu(struct clock_event_device *);
395 if (!arch_timer_evt) {
396 err = -ENOMEM;
397 goto out;
398 }
399
400 clocksource_register_hz(&clocksource_counter, arch_timer_rate);
401 cyclecounter.mult = clocksource_counter.mult;
402 cyclecounter.shift = clocksource_counter.shift;
403 timecounter_init(&timecounter, &cyclecounter,
404 arch_counter_get_cntpct());
405
406 if (arch_timer_use_virtual) {
407 ppi = arch_timer_ppi[VIRT_PPI];
408 err = request_percpu_irq(ppi, arch_timer_handler_virt,
409 "arch_timer", arch_timer_evt);
410 } else {
411 ppi = arch_timer_ppi[PHYS_SECURE_PPI];
412 err = request_percpu_irq(ppi, arch_timer_handler_phys,
413 "arch_timer", arch_timer_evt);
414 if (!err && arch_timer_ppi[PHYS_NONSECURE_PPI]) {
415 ppi = arch_timer_ppi[PHYS_NONSECURE_PPI];
416 err = request_percpu_irq(ppi, arch_timer_handler_phys,
417 "arch_timer", arch_timer_evt);
418 if (err)
419 free_percpu_irq(arch_timer_ppi[PHYS_SECURE_PPI],
420 arch_timer_evt);
421 }
422 }
423
424 if (err) {
425 pr_err("arch_timer: can't register interrupt %d (%d)\n",
426 ppi, err);
427 goto out_free;
428 }
429
430 err = local_timer_register(&arch_timer_ops);
431 if (err) {
432 /*
433 * We couldn't register as a local timer (could be
434 * because we're on a UP platform, or because some
435 * other local timer is already present...). Try as a
436 * global timer instead.
437 */
438 arch_timer_global_evt.cpumask = cpumask_of(0);
439 err = arch_timer_setup(&arch_timer_global_evt);
440 }
441 if (err)
442 goto out_free_irq;
443
444 /* Use the architected timer for the delay loop. */ 34 /* Use the architected timer for the delay loop. */
445 arch_delay_timer.read_current_timer = &arch_timer_read_current_timer; 35 arch_delay_timer.read_current_timer = arch_timer_read_counter_long;
446 arch_delay_timer.freq = arch_timer_rate; 36 arch_delay_timer.freq = arch_timer_get_rate();
447 register_current_timer_delay(&arch_delay_timer); 37 register_current_timer_delay(&arch_delay_timer);
448 return 0;
449
450out_free_irq:
451 if (arch_timer_use_virtual)
452 free_percpu_irq(arch_timer_ppi[VIRT_PPI], arch_timer_evt);
453 else {
454 free_percpu_irq(arch_timer_ppi[PHYS_SECURE_PPI],
455 arch_timer_evt);
456 if (arch_timer_ppi[PHYS_NONSECURE_PPI])
457 free_percpu_irq(arch_timer_ppi[PHYS_NONSECURE_PPI],
458 arch_timer_evt);
459 }
460
461out_free:
462 free_percpu(arch_timer_evt);
463out:
464 return err;
465} 38}
466 39
467static const struct of_device_id arch_timer_of_match[] __initconst = {
468 { .compatible = "arm,armv7-timer", },
469 {},
470};
471
472int __init arch_timer_of_register(void) 40int __init arch_timer_of_register(void)
473{ 41{
474 struct device_node *np; 42 int ret;
475 u32 freq;
476 int i;
477
478 np = of_find_matching_node(NULL, arch_timer_of_match);
479 if (!np) {
480 pr_err("arch_timer: can't find DT node\n");
481 return -ENODEV;
482 }
483
484 /* Try to determine the frequency from the device tree or CNTFRQ */
485 if (!of_property_read_u32(np, "clock-frequency", &freq))
486 arch_timer_rate = freq;
487
488 for (i = PHYS_SECURE_PPI; i < MAX_TIMER_PPI; i++)
489 arch_timer_ppi[i] = irq_of_parse_and_map(np, i);
490 43
491 /* 44 ret = arch_timer_init();
492 * If no interrupt provided for virtual timer, we'll have to 45 if (ret)
493 * stick to the physical timer. It'd better be accessible... 46 return ret;
494 */
495 if (!arch_timer_ppi[VIRT_PPI]) {
496 arch_timer_use_virtual = false;
497 47
498 if (!arch_timer_ppi[PHYS_SECURE_PPI] || 48 arch_timer_delay_timer_register();
499 !arch_timer_ppi[PHYS_NONSECURE_PPI]) {
500 pr_warn("arch_timer: No interrupt available, giving up\n");
501 return -EINVAL;
502 }
503 }
504 49
505 return arch_timer_register(); 50 return 0;
506} 51}
507 52
508int __init arch_timer_sched_clock_init(void) 53int __init arch_timer_sched_clock_init(void)
509{ 54{
510 u32 (*cnt32)(void); 55 if (arch_timer_get_rate() == 0)
511 int err; 56 return -ENXIO;
512
513 err = arch_timer_available();
514 if (err)
515 return err;
516
517 if (arch_timer_use_virtual)
518 cnt32 = arch_counter_get_cntvct32;
519 else
520 cnt32 = arch_counter_get_cntpct32;
521 57
522 setup_sched_clock(cnt32, 32, arch_timer_rate); 58 setup_sched_clock(arch_timer_read_counter_u32,
59 32, arch_timer_get_rate());
523 return 0; 60 return 0;
524} 61}
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c
index c985b481192c..5ce738b43508 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#ifdef CONFIG_KVM_ARM_HOST
17#include <linux/kvm_host.h>
18#endif
16#include <asm/cacheflush.h> 19#include <asm/cacheflush.h>
17#include <asm/glue-df.h> 20#include <asm/glue-df.h>
18#include <asm/glue-pf.h> 21#include <asm/glue-pf.h>
@@ -146,5 +149,45 @@ int main(void)
146 DEFINE(DMA_BIDIRECTIONAL, DMA_BIDIRECTIONAL); 149 DEFINE(DMA_BIDIRECTIONAL, DMA_BIDIRECTIONAL);
147 DEFINE(DMA_TO_DEVICE, DMA_TO_DEVICE); 150 DEFINE(DMA_TO_DEVICE, DMA_TO_DEVICE);
148 DEFINE(DMA_FROM_DEVICE, DMA_FROM_DEVICE); 151 DEFINE(DMA_FROM_DEVICE, DMA_FROM_DEVICE);
152#ifdef CONFIG_KVM_ARM_HOST
153 DEFINE(VCPU_KVM, offsetof(struct kvm_vcpu, kvm));
154 DEFINE(VCPU_MIDR, offsetof(struct kvm_vcpu, arch.midr));
155 DEFINE(VCPU_CP15, offsetof(struct kvm_vcpu, arch.cp15));
156 DEFINE(VCPU_VFP_GUEST, offsetof(struct kvm_vcpu, arch.vfp_guest));
157 DEFINE(VCPU_VFP_HOST, offsetof(struct kvm_vcpu, arch.vfp_host));
158 DEFINE(VCPU_REGS, offsetof(struct kvm_vcpu, arch.regs));
159 DEFINE(VCPU_USR_REGS, offsetof(struct kvm_vcpu, arch.regs.usr_regs));
160 DEFINE(VCPU_SVC_REGS, offsetof(struct kvm_vcpu, arch.regs.svc_regs));
161 DEFINE(VCPU_ABT_REGS, offsetof(struct kvm_vcpu, arch.regs.abt_regs));
162 DEFINE(VCPU_UND_REGS, offsetof(struct kvm_vcpu, arch.regs.und_regs));
163 DEFINE(VCPU_IRQ_REGS, offsetof(struct kvm_vcpu, arch.regs.irq_regs));
164 DEFINE(VCPU_FIQ_REGS, offsetof(struct kvm_vcpu, arch.regs.fiq_regs));
165 DEFINE(VCPU_PC, offsetof(struct kvm_vcpu, arch.regs.usr_regs.ARM_pc));
166 DEFINE(VCPU_CPSR, offsetof(struct kvm_vcpu, arch.regs.usr_regs.ARM_cpsr));
167 DEFINE(VCPU_IRQ_LINES, offsetof(struct kvm_vcpu, arch.irq_lines));
168 DEFINE(VCPU_HSR, offsetof(struct kvm_vcpu, arch.hsr));
169 DEFINE(VCPU_HxFAR, offsetof(struct kvm_vcpu, arch.hxfar));
170 DEFINE(VCPU_HPFAR, offsetof(struct kvm_vcpu, arch.hpfar));
171 DEFINE(VCPU_HYP_PC, offsetof(struct kvm_vcpu, arch.hyp_pc));
172#ifdef CONFIG_KVM_ARM_VGIC
173 DEFINE(VCPU_VGIC_CPU, offsetof(struct kvm_vcpu, arch.vgic_cpu));
174 DEFINE(VGIC_CPU_HCR, offsetof(struct vgic_cpu, vgic_hcr));
175 DEFINE(VGIC_CPU_VMCR, offsetof(struct vgic_cpu, vgic_vmcr));
176 DEFINE(VGIC_CPU_MISR, offsetof(struct vgic_cpu, vgic_misr));
177 DEFINE(VGIC_CPU_EISR, offsetof(struct vgic_cpu, vgic_eisr));
178 DEFINE(VGIC_CPU_ELRSR, offsetof(struct vgic_cpu, vgic_elrsr));
179 DEFINE(VGIC_CPU_APR, offsetof(struct vgic_cpu, vgic_apr));
180 DEFINE(VGIC_CPU_LR, offsetof(struct vgic_cpu, vgic_lr));
181 DEFINE(VGIC_CPU_NR_LR, offsetof(struct vgic_cpu, nr_lr));
182#ifdef CONFIG_KVM_ARM_TIMER
183 DEFINE(VCPU_TIMER_CNTV_CTL, offsetof(struct kvm_vcpu, arch.timer_cpu.cntv_ctl));
184 DEFINE(VCPU_TIMER_CNTV_CVAL, offsetof(struct kvm_vcpu, arch.timer_cpu.cntv_cval));
185 DEFINE(KVM_TIMER_CNTVOFF, offsetof(struct kvm, arch.timer.cntvoff));
186 DEFINE(KVM_TIMER_ENABLED, offsetof(struct kvm, arch.timer.enabled));
187#endif
188 DEFINE(KVM_VGIC_VCTRL, offsetof(struct kvm, arch.vgic.vctrl_base));
189#endif
190 DEFINE(KVM_VTTBR, offsetof(struct kvm, arch.vttbr));
191#endif
149 return 0; 192 return 0;
150} 193}
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 379cf3292390..a1f73b502ef0 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -413,7 +413,7 @@ static int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
413 return irq; 413 return irq;
414} 414}
415 415
416static int __init pcibios_init_resources(int busnr, struct pci_sys_data *sys) 416static int pcibios_init_resources(int busnr, struct pci_sys_data *sys)
417{ 417{
418 int ret; 418 int ret;
419 struct pci_host_bridge_window *window; 419 struct pci_host_bridge_window *window;
@@ -445,7 +445,7 @@ static int __init pcibios_init_resources(int busnr, struct pci_sys_data *sys)
445 return 0; 445 return 0;
446} 446}
447 447
448static void __init pcibios_init_hw(struct hw_pci *hw, struct list_head *head) 448static void pcibios_init_hw(struct hw_pci *hw, struct list_head *head)
449{ 449{
450 struct pci_sys_data *sys = NULL; 450 struct pci_sys_data *sys = NULL;
451 int ret; 451 int ret;
@@ -464,6 +464,9 @@ static void __init pcibios_init_hw(struct hw_pci *hw, struct list_head *head)
464 sys->map_irq = hw->map_irq; 464 sys->map_irq = hw->map_irq;
465 INIT_LIST_HEAD(&sys->resources); 465 INIT_LIST_HEAD(&sys->resources);
466 466
467 if (hw->private_data)
468 sys->private_data = hw->private_data[nr];
469
467 ret = hw->setup(nr, sys); 470 ret = hw->setup(nr, sys);
468 471
469 if (ret > 0) { 472 if (ret > 0) {
@@ -493,7 +496,7 @@ static void __init pcibios_init_hw(struct hw_pci *hw, struct list_head *head)
493 } 496 }
494} 497}
495 498
496void __init pci_common_init(struct hw_pci *hw) 499void pci_common_init(struct hw_pci *hw)
497{ 500{
498 struct pci_sys_data *sys; 501 struct pci_sys_data *sys;
499 LIST_HEAD(head); 502 LIST_HEAD(head);
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
index a4fda4e7a372..0cc57611fc4f 100644
--- a/arch/arm/kernel/calls.S
+++ b/arch/arm/kernel/calls.S
@@ -195,7 +195,7 @@
195 CALL(sys_getcwd) 195 CALL(sys_getcwd)
196 CALL(sys_capget) 196 CALL(sys_capget)
197/* 185 */ CALL(sys_capset) 197/* 185 */ CALL(sys_capset)
198 CALL(sys_sigaltstack_wrapper) 198 CALL(sys_sigaltstack)
199 CALL(sys_sendfile) 199 CALL(sys_sendfile)
200 CALL(sys_ni_syscall) /* getpmsg */ 200 CALL(sys_ni_syscall) /* getpmsg */
201 CALL(sys_ni_syscall) /* putpmsg */ 201 CALL(sys_ni_syscall) /* putpmsg */
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index a6c301e90a3b..3248cde504ed 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -514,11 +514,6 @@ sys_rt_sigreturn_wrapper:
514 b sys_rt_sigreturn 514 b sys_rt_sigreturn
515ENDPROC(sys_rt_sigreturn_wrapper) 515ENDPROC(sys_rt_sigreturn_wrapper)
516 516
517sys_sigaltstack_wrapper:
518 ldr r2, [sp, #S_OFF + S_SP]
519 b do_sigaltstack
520ENDPROC(sys_sigaltstack_wrapper)
521
522sys_statfs64_wrapper: 517sys_statfs64_wrapper:
523 teq r1, #88 518 teq r1, #88
524 moveq r1, #84 519 moveq r1, #84
diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c
index 5ff2e77782b1..5eae53e7a2e1 100644
--- a/arch/arm/kernel/hw_breakpoint.c
+++ b/arch/arm/kernel/hw_breakpoint.c
@@ -28,6 +28,7 @@
28#include <linux/perf_event.h> 28#include <linux/perf_event.h>
29#include <linux/hw_breakpoint.h> 29#include <linux/hw_breakpoint.h>
30#include <linux/smp.h> 30#include <linux/smp.h>
31#include <linux/cpu_pm.h>
31 32
32#include <asm/cacheflush.h> 33#include <asm/cacheflush.h>
33#include <asm/cputype.h> 34#include <asm/cputype.h>
@@ -35,6 +36,7 @@
35#include <asm/hw_breakpoint.h> 36#include <asm/hw_breakpoint.h>
36#include <asm/kdebug.h> 37#include <asm/kdebug.h>
37#include <asm/traps.h> 38#include <asm/traps.h>
39#include <asm/hardware/coresight.h>
38 40
39/* Breakpoint currently in use for each BRP. */ 41/* Breakpoint currently in use for each BRP. */
40static DEFINE_PER_CPU(struct perf_event *, bp_on_reg[ARM_MAX_BRP]); 42static DEFINE_PER_CPU(struct perf_event *, bp_on_reg[ARM_MAX_BRP]);
@@ -49,6 +51,9 @@ static int core_num_wrps;
49/* Debug architecture version. */ 51/* Debug architecture version. */
50static u8 debug_arch; 52static u8 debug_arch;
51 53
54/* Does debug architecture support OS Save and Restore? */
55static bool has_ossr;
56
52/* Maximum supported watchpoint length. */ 57/* Maximum supported watchpoint length. */
53static u8 max_watchpoint_len; 58static u8 max_watchpoint_len;
54 59
@@ -903,6 +908,23 @@ static struct undef_hook debug_reg_hook = {
903 .fn = debug_reg_trap, 908 .fn = debug_reg_trap,
904}; 909};
905 910
911/* Does this core support OS Save and Restore? */
912static bool core_has_os_save_restore(void)
913{
914 u32 oslsr;
915
916 switch (get_debug_arch()) {
917 case ARM_DEBUG_ARCH_V7_1:
918 return true;
919 case ARM_DEBUG_ARCH_V7_ECP14:
920 ARM_DBG_READ(c1, c1, 4, oslsr);
921 if (oslsr & ARM_OSLSR_OSLM0)
922 return true;
923 default:
924 return false;
925 }
926}
927
906static void reset_ctrl_regs(void *unused) 928static void reset_ctrl_regs(void *unused)
907{ 929{
908 int i, raw_num_brps, err = 0, cpu = smp_processor_id(); 930 int i, raw_num_brps, err = 0, cpu = smp_processor_id();
@@ -930,11 +952,7 @@ static void reset_ctrl_regs(void *unused)
930 if ((val & 0x1) == 0) 952 if ((val & 0x1) == 0)
931 err = -EPERM; 953 err = -EPERM;
932 954
933 /* 955 if (!has_ossr)
934 * Check whether we implement OS save and restore.
935 */
936 ARM_DBG_READ(c1, c1, 4, val);
937 if ((val & 0x9) == 0)
938 goto clear_vcr; 956 goto clear_vcr;
939 break; 957 break;
940 case ARM_DEBUG_ARCH_V7_1: 958 case ARM_DEBUG_ARCH_V7_1:
@@ -955,9 +973,9 @@ static void reset_ctrl_regs(void *unused)
955 973
956 /* 974 /*
957 * Unconditionally clear the OS lock by writing a value 975 * Unconditionally clear the OS lock by writing a value
958 * other than 0xC5ACCE55 to the access register. 976 * other than CS_LAR_KEY to the access register.
959 */ 977 */
960 ARM_DBG_WRITE(c1, c0, 4, 0); 978 ARM_DBG_WRITE(c1, c0, 4, ~CS_LAR_KEY);
961 isb(); 979 isb();
962 980
963 /* 981 /*
@@ -1015,6 +1033,30 @@ static struct notifier_block __cpuinitdata dbg_reset_nb = {
1015 .notifier_call = dbg_reset_notify, 1033 .notifier_call = dbg_reset_notify,
1016}; 1034};
1017 1035
1036#ifdef CONFIG_CPU_PM
1037static int dbg_cpu_pm_notify(struct notifier_block *self, unsigned long action,
1038 void *v)
1039{
1040 if (action == CPU_PM_EXIT)
1041 reset_ctrl_regs(NULL);
1042
1043 return NOTIFY_OK;
1044}
1045
1046static struct notifier_block __cpuinitdata dbg_cpu_pm_nb = {
1047 .notifier_call = dbg_cpu_pm_notify,
1048};
1049
1050static void __init pm_init(void)
1051{
1052 cpu_pm_register_notifier(&dbg_cpu_pm_nb);
1053}
1054#else
1055static inline void pm_init(void)
1056{
1057}
1058#endif
1059
1018static int __init arch_hw_breakpoint_init(void) 1060static int __init arch_hw_breakpoint_init(void)
1019{ 1061{
1020 debug_arch = get_debug_arch(); 1062 debug_arch = get_debug_arch();
@@ -1024,6 +1066,8 @@ static int __init arch_hw_breakpoint_init(void)
1024 return 0; 1066 return 0;
1025 } 1067 }
1026 1068
1069 has_ossr = core_has_os_save_restore();
1070
1027 /* Determine how many BRPs/WRPs are available. */ 1071 /* Determine how many BRPs/WRPs are available. */
1028 core_num_brps = get_num_brps(); 1072 core_num_brps = get_num_brps();
1029 core_num_wrps = get_num_wrps(); 1073 core_num_wrps = get_num_wrps();
@@ -1062,8 +1106,9 @@ static int __init arch_hw_breakpoint_init(void)
1062 hook_ifault_code(FAULT_CODE_DEBUG, hw_breakpoint_pending, SIGTRAP, 1106 hook_ifault_code(FAULT_CODE_DEBUG, hw_breakpoint_pending, SIGTRAP,
1063 TRAP_HWBKPT, "breakpoint debug exception"); 1107 TRAP_HWBKPT, "breakpoint debug exception");
1064 1108
1065 /* Register hotplug notifier. */ 1109 /* Register hotplug and PM notifiers. */
1066 register_cpu_notifier(&dbg_reset_nb); 1110 register_cpu_notifier(&dbg_reset_nb);
1111 pm_init();
1067 return 0; 1112 return 0;
1068} 1113}
1069arch_initcall(arch_hw_breakpoint_init); 1114arch_initcall(arch_hw_breakpoint_init);
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 896165096d6a..8e4ef4c83a74 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -117,6 +117,16 @@ void __init init_IRQ(void)
117 machine_desc->init_irq(); 117 machine_desc->init_irq();
118} 118}
119 119
120#ifdef CONFIG_MULTI_IRQ_HANDLER
121void __init set_handle_irq(void (*handle_irq)(struct pt_regs *))
122{
123 if (handle_arch_irq)
124 return;
125
126 handle_arch_irq = handle_irq;
127}
128#endif
129
120#ifdef CONFIG_SPARSE_IRQ 130#ifdef CONFIG_SPARSE_IRQ
121int __init arch_probe_nr_irqs(void) 131int __init arch_probe_nr_irqs(void)
122{ 132{
diff --git a/arch/arm/kernel/kprobes.c b/arch/arm/kernel/kprobes.c
index 4dd41fc9e235..170e9f34003f 100644
--- a/arch/arm/kernel/kprobes.c
+++ b/arch/arm/kernel/kprobes.c
@@ -395,7 +395,7 @@ static __used __kprobes void *trampoline_handler(struct pt_regs *regs)
395{ 395{
396 struct kretprobe_instance *ri = NULL; 396 struct kretprobe_instance *ri = NULL;
397 struct hlist_head *head, empty_rp; 397 struct hlist_head *head, empty_rp;
398 struct hlist_node *node, *tmp; 398 struct hlist_node *tmp;
399 unsigned long flags, orig_ret_address = 0; 399 unsigned long flags, orig_ret_address = 0;
400 unsigned long trampoline_address = (unsigned long)&kretprobe_trampoline; 400 unsigned long trampoline_address = (unsigned long)&kretprobe_trampoline;
401 401
@@ -415,7 +415,7 @@ static __used __kprobes void *trampoline_handler(struct pt_regs *regs)
415 * real return address, and all the rest will point to 415 * real return address, and all the rest will point to
416 * kretprobe_trampoline 416 * kretprobe_trampoline
417 */ 417 */
418 hlist_for_each_entry_safe(ri, node, tmp, head, hlist) { 418 hlist_for_each_entry_safe(ri, tmp, head, hlist) {
419 if (ri->task != current) 419 if (ri->task != current)
420 /* another task is sharing our hash bucket */ 420 /* another task is sharing our hash bucket */
421 continue; 421 continue;
@@ -442,7 +442,7 @@ static __used __kprobes void *trampoline_handler(struct pt_regs *regs)
442 kretprobe_assert(ri, orig_ret_address, trampoline_address); 442 kretprobe_assert(ri, orig_ret_address, trampoline_address);
443 kretprobe_hash_unlock(current, &flags); 443 kretprobe_hash_unlock(current, &flags);
444 444
445 hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) { 445 hlist_for_each_entry_safe(ri, tmp, &empty_rp, hlist) {
446 hlist_del(&ri->hlist); 446 hlist_del(&ri->hlist);
447 kfree(ri); 447 kfree(ri);
448 } 448 }
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index f9e8657dd241..31e0eb353cd8 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -149,12 +149,6 @@ again:
149static void 149static void
150armpmu_read(struct perf_event *event) 150armpmu_read(struct perf_event *event)
151{ 151{
152 struct hw_perf_event *hwc = &event->hw;
153
154 /* Don't read disabled counters! */
155 if (hwc->idx < 0)
156 return;
157
158 armpmu_event_update(event); 152 armpmu_event_update(event);
159} 153}
160 154
@@ -207,8 +201,6 @@ armpmu_del(struct perf_event *event, int flags)
207 struct hw_perf_event *hwc = &event->hw; 201 struct hw_perf_event *hwc = &event->hw;
208 int idx = hwc->idx; 202 int idx = hwc->idx;
209 203
210 WARN_ON(idx < 0);
211
212 armpmu_stop(event, PERF_EF_UPDATE); 204 armpmu_stop(event, PERF_EF_UPDATE);
213 hw_events->events[idx] = NULL; 205 hw_events->events[idx] = NULL;
214 clear_bit(idx, hw_events->used_mask); 206 clear_bit(idx, hw_events->used_mask);
@@ -358,7 +350,7 @@ __hw_perf_event_init(struct perf_event *event)
358{ 350{
359 struct arm_pmu *armpmu = to_arm_pmu(event->pmu); 351 struct arm_pmu *armpmu = to_arm_pmu(event->pmu);
360 struct hw_perf_event *hwc = &event->hw; 352 struct hw_perf_event *hwc = &event->hw;
361 int mapping, err; 353 int mapping;
362 354
363 mapping = armpmu->map_event(event); 355 mapping = armpmu->map_event(event);
364 356
@@ -407,14 +399,12 @@ __hw_perf_event_init(struct perf_event *event)
407 local64_set(&hwc->period_left, hwc->sample_period); 399 local64_set(&hwc->period_left, hwc->sample_period);
408 } 400 }
409 401
410 err = 0;
411 if (event->group_leader != event) { 402 if (event->group_leader != event) {
412 err = validate_group(event); 403 if (validate_group(event) != 0);
413 if (err)
414 return -EINVAL; 404 return -EINVAL;
415 } 405 }
416 406
417 return err; 407 return 0;
418} 408}
419 409
420static int armpmu_event_init(struct perf_event *event) 410static int armpmu_event_init(struct perf_event *event)
diff --git a/arch/arm/kernel/perf_event_cpu.c b/arch/arm/kernel/perf_event_cpu.c
index 5f6620684e25..1f2740e3dbc0 100644
--- a/arch/arm/kernel/perf_event_cpu.c
+++ b/arch/arm/kernel/perf_event_cpu.c
@@ -147,7 +147,7 @@ static void cpu_pmu_init(struct arm_pmu *cpu_pmu)
147 cpu_pmu->free_irq = cpu_pmu_free_irq; 147 cpu_pmu->free_irq = cpu_pmu_free_irq;
148 148
149 /* Ensure the PMU has sane values out of reset. */ 149 /* Ensure the PMU has sane values out of reset. */
150 if (cpu_pmu && cpu_pmu->reset) 150 if (cpu_pmu->reset)
151 on_each_cpu(cpu_pmu->reset, cpu_pmu, 1); 151 on_each_cpu(cpu_pmu->reset, cpu_pmu, 1);
152} 152}
153 153
@@ -201,48 +201,46 @@ static struct platform_device_id cpu_pmu_plat_device_ids[] = {
201static int probe_current_pmu(struct arm_pmu *pmu) 201static int probe_current_pmu(struct arm_pmu *pmu)
202{ 202{
203 int cpu = get_cpu(); 203 int cpu = get_cpu();
204 unsigned long cpuid = read_cpuid_id(); 204 unsigned long implementor = read_cpuid_implementor();
205 unsigned long implementor = (cpuid & 0xFF000000) >> 24; 205 unsigned long part_number = read_cpuid_part_number();
206 unsigned long part_number = (cpuid & 0xFFF0);
207 int ret = -ENODEV; 206 int ret = -ENODEV;
208 207
209 pr_info("probing PMU on CPU %d\n", cpu); 208 pr_info("probing PMU on CPU %d\n", cpu);
210 209
211 /* ARM Ltd CPUs. */ 210 /* ARM Ltd CPUs. */
212 if (0x41 == implementor) { 211 if (implementor == ARM_CPU_IMP_ARM) {
213 switch (part_number) { 212 switch (part_number) {
214 case 0xB360: /* ARM1136 */ 213 case ARM_CPU_PART_ARM1136:
215 case 0xB560: /* ARM1156 */ 214 case ARM_CPU_PART_ARM1156:
216 case 0xB760: /* ARM1176 */ 215 case ARM_CPU_PART_ARM1176:
217 ret = armv6pmu_init(pmu); 216 ret = armv6pmu_init(pmu);
218 break; 217 break;
219 case 0xB020: /* ARM11mpcore */ 218 case ARM_CPU_PART_ARM11MPCORE:
220 ret = armv6mpcore_pmu_init(pmu); 219 ret = armv6mpcore_pmu_init(pmu);
221 break; 220 break;
222 case 0xC080: /* Cortex-A8 */ 221 case ARM_CPU_PART_CORTEX_A8:
223 ret = armv7_a8_pmu_init(pmu); 222 ret = armv7_a8_pmu_init(pmu);
224 break; 223 break;
225 case 0xC090: /* Cortex-A9 */ 224 case ARM_CPU_PART_CORTEX_A9:
226 ret = armv7_a9_pmu_init(pmu); 225 ret = armv7_a9_pmu_init(pmu);
227 break; 226 break;
228 case 0xC050: /* Cortex-A5 */ 227 case ARM_CPU_PART_CORTEX_A5:
229 ret = armv7_a5_pmu_init(pmu); 228 ret = armv7_a5_pmu_init(pmu);
230 break; 229 break;
231 case 0xC0F0: /* Cortex-A15 */ 230 case ARM_CPU_PART_CORTEX_A15:
232 ret = armv7_a15_pmu_init(pmu); 231 ret = armv7_a15_pmu_init(pmu);
233 break; 232 break;
234 case 0xC070: /* Cortex-A7 */ 233 case ARM_CPU_PART_CORTEX_A7:
235 ret = armv7_a7_pmu_init(pmu); 234 ret = armv7_a7_pmu_init(pmu);
236 break; 235 break;
237 } 236 }
238 /* Intel CPUs [xscale]. */ 237 /* Intel CPUs [xscale]. */
239 } else if (0x69 == implementor) { 238 } else if (implementor == ARM_CPU_IMP_INTEL) {
240 part_number = (cpuid >> 13) & 0x7; 239 switch (xscale_cpu_arch_version()) {
241 switch (part_number) { 240 case ARM_CPU_XSCALE_ARCH_V1:
242 case 1:
243 ret = xscale1pmu_init(pmu); 241 ret = xscale1pmu_init(pmu);
244 break; 242 break;
245 case 2: 243 case ARM_CPU_XSCALE_ARCH_V2:
246 ret = xscale2pmu_init(pmu); 244 ret = xscale2pmu_init(pmu);
247 break; 245 break;
248 } 246 }
@@ -279,17 +277,22 @@ static int cpu_pmu_device_probe(struct platform_device *pdev)
279 } 277 }
280 278
281 if (ret) { 279 if (ret) {
282 pr_info("failed to register PMU devices!"); 280 pr_info("failed to probe PMU!");
283 kfree(pmu); 281 goto out_free;
284 return ret;
285 } 282 }
286 283
287 cpu_pmu = pmu; 284 cpu_pmu = pmu;
288 cpu_pmu->plat_device = pdev; 285 cpu_pmu->plat_device = pdev;
289 cpu_pmu_init(cpu_pmu); 286 cpu_pmu_init(cpu_pmu);
290 armpmu_register(cpu_pmu, PERF_TYPE_RAW); 287 ret = armpmu_register(cpu_pmu, PERF_TYPE_RAW);
291 288
292 return 0; 289 if (!ret)
290 return 0;
291
292out_free:
293 pr_info("failed to register PMU devices!");
294 kfree(pmu);
295 return ret;
293} 296}
294 297
295static struct platform_driver cpu_pmu_driver = { 298static struct platform_driver cpu_pmu_driver = {
diff --git a/arch/arm/kernel/perf_event_v6.c b/arch/arm/kernel/perf_event_v6.c
index 041d0526a288..03664b0e8fa4 100644
--- a/arch/arm/kernel/perf_event_v6.c
+++ b/arch/arm/kernel/perf_event_v6.c
@@ -106,7 +106,7 @@ static const unsigned armv6_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
106 }, 106 },
107 [C(OP_WRITE)] = { 107 [C(OP_WRITE)] = {
108 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 108 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
109 [C(RESULT_MISS)] = ARMV6_PERFCTR_ICACHE_MISS, 109 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
110 }, 110 },
111 [C(OP_PREFETCH)] = { 111 [C(OP_PREFETCH)] = {
112 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 112 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
@@ -259,7 +259,7 @@ static const unsigned armv6mpcore_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
259 }, 259 },
260 [C(OP_WRITE)] = { 260 [C(OP_WRITE)] = {
261 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 261 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
262 [C(RESULT_MISS)] = ARMV6MPCORE_PERFCTR_ICACHE_MISS, 262 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
263 }, 263 },
264 [C(OP_PREFETCH)] = { 264 [C(OP_PREFETCH)] = {
265 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 265 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
diff --git a/arch/arm/kernel/perf_event_v7.c b/arch/arm/kernel/perf_event_v7.c
index 4fbc757d9cff..8c79a9e70b83 100644
--- a/arch/arm/kernel/perf_event_v7.c
+++ b/arch/arm/kernel/perf_event_v7.c
@@ -157,8 +157,8 @@ static const unsigned armv7_a8_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
157 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL, 157 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL,
158 }, 158 },
159 [C(OP_WRITE)] = { 159 [C(OP_WRITE)] = {
160 [C(RESULT_ACCESS)] = ARMV7_A8_PERFCTR_L1_ICACHE_ACCESS, 160 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
161 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL, 161 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
162 }, 162 },
163 [C(OP_PREFETCH)] = { 163 [C(OP_PREFETCH)] = {
164 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 164 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
@@ -282,7 +282,7 @@ static const unsigned armv7_a9_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
282 }, 282 },
283 [C(OP_WRITE)] = { 283 [C(OP_WRITE)] = {
284 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 284 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
285 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL, 285 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
286 }, 286 },
287 [C(OP_PREFETCH)] = { 287 [C(OP_PREFETCH)] = {
288 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 288 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
@@ -399,8 +399,8 @@ static const unsigned armv7_a5_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
399 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL, 399 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL,
400 }, 400 },
401 [C(OP_WRITE)] = { 401 [C(OP_WRITE)] = {
402 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_ICACHE_ACCESS, 402 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
403 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL, 403 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
404 }, 404 },
405 /* 405 /*
406 * The prefetch counters don't differentiate between the I 406 * The prefetch counters don't differentiate between the I
@@ -527,8 +527,8 @@ static const unsigned armv7_a15_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
527 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL, 527 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL,
528 }, 528 },
529 [C(OP_WRITE)] = { 529 [C(OP_WRITE)] = {
530 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_ICACHE_ACCESS, 530 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
531 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL, 531 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
532 }, 532 },
533 [C(OP_PREFETCH)] = { 533 [C(OP_PREFETCH)] = {
534 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 534 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
@@ -651,8 +651,8 @@ static const unsigned armv7_a7_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
651 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL, 651 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL,
652 }, 652 },
653 [C(OP_WRITE)] = { 653 [C(OP_WRITE)] = {
654 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_ICACHE_ACCESS, 654 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
655 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL, 655 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
656 }, 656 },
657 [C(OP_PREFETCH)] = { 657 [C(OP_PREFETCH)] = {
658 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 658 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
diff --git a/arch/arm/kernel/perf_event_xscale.c b/arch/arm/kernel/perf_event_xscale.c
index 2b0fe30ec12e..63990c42fac9 100644
--- a/arch/arm/kernel/perf_event_xscale.c
+++ b/arch/arm/kernel/perf_event_xscale.c
@@ -83,7 +83,7 @@ static const unsigned xscale_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
83 }, 83 },
84 [C(OP_WRITE)] = { 84 [C(OP_WRITE)] = {
85 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 85 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
86 [C(RESULT_MISS)] = XSCALE_PERFCTR_ICACHE_MISS, 86 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
87 }, 87 },
88 [C(OP_PREFETCH)] = { 88 [C(OP_PREFETCH)] = {
89 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 89 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index c6dec5fc20aa..047d3e40e470 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -172,14 +172,9 @@ static void default_idle(void)
172 local_irq_enable(); 172 local_irq_enable();
173} 173}
174 174
175void (*pm_idle)(void) = default_idle;
176EXPORT_SYMBOL(pm_idle);
177
178/* 175/*
179 * The idle thread, has rather strange semantics for calling pm_idle, 176 * The idle thread.
180 * but this is what x86 does and we need to do the same, so that 177 * We always respect 'hlt_counter' to prevent low power idle.
181 * things like cpuidle get called in the same way. The only difference
182 * is that we always respect 'hlt_counter' to prevent low power idle.
183 */ 178 */
184void cpu_idle(void) 179void cpu_idle(void)
185{ 180{
@@ -210,10 +205,10 @@ void cpu_idle(void)
210 } else if (!need_resched()) { 205 } else if (!need_resched()) {
211 stop_critical_timings(); 206 stop_critical_timings();
212 if (cpuidle_idle_call()) 207 if (cpuidle_idle_call())
213 pm_idle(); 208 default_idle();
214 start_critical_timings(); 209 start_critical_timings();
215 /* 210 /*
216 * pm_idle functions must always 211 * default_idle functions must always
217 * return with IRQs enabled. 212 * return with IRQs enabled.
218 */ 213 */
219 WARN_ON(irqs_disabled()); 214 WARN_ON(irqs_disabled());
diff --git a/arch/arm/kernel/psci.c b/arch/arm/kernel/psci.c
new file mode 100644
index 000000000000..36531643cc2c
--- /dev/null
+++ b/arch/arm/kernel/psci.c
@@ -0,0 +1,211 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License version 2 as
4 * published by the Free Software Foundation.
5 *
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 * Copyright (C) 2012 ARM Limited
12 *
13 * Author: Will Deacon <will.deacon@arm.com>
14 */
15
16#define pr_fmt(fmt) "psci: " fmt
17
18#include <linux/init.h>
19#include <linux/of.h>
20
21#include <asm/compiler.h>
22#include <asm/errno.h>
23#include <asm/opcodes-sec.h>
24#include <asm/opcodes-virt.h>
25#include <asm/psci.h>
26
27struct psci_operations psci_ops;
28
29static int (*invoke_psci_fn)(u32, u32, u32, u32);
30
31enum psci_function {
32 PSCI_FN_CPU_SUSPEND,
33 PSCI_FN_CPU_ON,
34 PSCI_FN_CPU_OFF,
35 PSCI_FN_MIGRATE,
36 PSCI_FN_MAX,
37};
38
39static u32 psci_function_id[PSCI_FN_MAX];
40
41#define PSCI_RET_SUCCESS 0
42#define PSCI_RET_EOPNOTSUPP -1
43#define PSCI_RET_EINVAL -2
44#define PSCI_RET_EPERM -3
45
46static int psci_to_linux_errno(int errno)
47{
48 switch (errno) {
49 case PSCI_RET_SUCCESS:
50 return 0;
51 case PSCI_RET_EOPNOTSUPP:
52 return -EOPNOTSUPP;
53 case PSCI_RET_EINVAL:
54 return -EINVAL;
55 case PSCI_RET_EPERM:
56 return -EPERM;
57 };
58
59 return -EINVAL;
60}
61
62#define PSCI_POWER_STATE_ID_MASK 0xffff
63#define PSCI_POWER_STATE_ID_SHIFT 0
64#define PSCI_POWER_STATE_TYPE_MASK 0x1
65#define PSCI_POWER_STATE_TYPE_SHIFT 16
66#define PSCI_POWER_STATE_AFFL_MASK 0x3
67#define PSCI_POWER_STATE_AFFL_SHIFT 24
68
69static u32 psci_power_state_pack(struct psci_power_state state)
70{
71 return ((state.id & PSCI_POWER_STATE_ID_MASK)
72 << PSCI_POWER_STATE_ID_SHIFT) |
73 ((state.type & PSCI_POWER_STATE_TYPE_MASK)
74 << PSCI_POWER_STATE_TYPE_SHIFT) |
75 ((state.affinity_level & PSCI_POWER_STATE_AFFL_MASK)
76 << PSCI_POWER_STATE_AFFL_SHIFT);
77}
78
79/*
80 * The following two functions are invoked via the invoke_psci_fn pointer
81 * and will not be inlined, allowing us to piggyback on the AAPCS.
82 */
83static noinline int __invoke_psci_fn_hvc(u32 function_id, u32 arg0, u32 arg1,
84 u32 arg2)
85{
86 asm volatile(
87 __asmeq("%0", "r0")
88 __asmeq("%1", "r1")
89 __asmeq("%2", "r2")
90 __asmeq("%3", "r3")
91 __HVC(0)
92 : "+r" (function_id)
93 : "r" (arg0), "r" (arg1), "r" (arg2));
94
95 return function_id;
96}
97
98static noinline int __invoke_psci_fn_smc(u32 function_id, u32 arg0, u32 arg1,
99 u32 arg2)
100{
101 asm volatile(
102 __asmeq("%0", "r0")
103 __asmeq("%1", "r1")
104 __asmeq("%2", "r2")
105 __asmeq("%3", "r3")
106 __SMC(0)
107 : "+r" (function_id)
108 : "r" (arg0), "r" (arg1), "r" (arg2));
109
110 return function_id;
111}
112
113static int psci_cpu_suspend(struct psci_power_state state,
114 unsigned long entry_point)
115{
116 int err;
117 u32 fn, power_state;
118
119 fn = psci_function_id[PSCI_FN_CPU_SUSPEND];
120 power_state = psci_power_state_pack(state);
121 err = invoke_psci_fn(fn, power_state, entry_point, 0);
122 return psci_to_linux_errno(err);
123}
124
125static int psci_cpu_off(struct psci_power_state state)
126{
127 int err;
128 u32 fn, power_state;
129
130 fn = psci_function_id[PSCI_FN_CPU_OFF];
131 power_state = psci_power_state_pack(state);
132 err = invoke_psci_fn(fn, power_state, 0, 0);
133 return psci_to_linux_errno(err);
134}
135
136static int psci_cpu_on(unsigned long cpuid, unsigned long entry_point)
137{
138 int err;
139 u32 fn;
140
141 fn = psci_function_id[PSCI_FN_CPU_ON];
142 err = invoke_psci_fn(fn, cpuid, entry_point, 0);
143 return psci_to_linux_errno(err);
144}
145
146static int psci_migrate(unsigned long cpuid)
147{
148 int err;
149 u32 fn;
150
151 fn = psci_function_id[PSCI_FN_MIGRATE];
152 err = invoke_psci_fn(fn, cpuid, 0, 0);
153 return psci_to_linux_errno(err);
154}
155
156static const struct of_device_id psci_of_match[] __initconst = {
157 { .compatible = "arm,psci", },
158 {},
159};
160
161static int __init psci_init(void)
162{
163 struct device_node *np;
164 const char *method;
165 u32 id;
166
167 np = of_find_matching_node(NULL, psci_of_match);
168 if (!np)
169 return 0;
170
171 pr_info("probing function IDs from device-tree\n");
172
173 if (of_property_read_string(np, "method", &method)) {
174 pr_warning("missing \"method\" property\n");
175 goto out_put_node;
176 }
177
178 if (!strcmp("hvc", method)) {
179 invoke_psci_fn = __invoke_psci_fn_hvc;
180 } else if (!strcmp("smc", method)) {
181 invoke_psci_fn = __invoke_psci_fn_smc;
182 } else {
183 pr_warning("invalid \"method\" property: %s\n", method);
184 goto out_put_node;
185 }
186
187 if (!of_property_read_u32(np, "cpu_suspend", &id)) {
188 psci_function_id[PSCI_FN_CPU_SUSPEND] = id;
189 psci_ops.cpu_suspend = psci_cpu_suspend;
190 }
191
192 if (!of_property_read_u32(np, "cpu_off", &id)) {
193 psci_function_id[PSCI_FN_CPU_OFF] = id;
194 psci_ops.cpu_off = psci_cpu_off;
195 }
196
197 if (!of_property_read_u32(np, "cpu_on", &id)) {
198 psci_function_id[PSCI_FN_CPU_ON] = id;
199 psci_ops.cpu_on = psci_cpu_on;
200 }
201
202 if (!of_property_read_u32(np, "migrate", &id)) {
203 psci_function_id[PSCI_FN_MIGRATE] = id;
204 psci_ops.migrate = psci_migrate;
205 }
206
207out_put_node:
208 of_node_put(np);
209 return 0;
210}
211early_initcall(psci_init);
diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c
index fc6692e2b603..bd6f56b9ec21 100644
--- a/arch/arm/kernel/sched_clock.c
+++ b/arch/arm/kernel/sched_clock.c
@@ -93,11 +93,11 @@ static void notrace update_sched_clock(void)
93 * detectable in cyc_to_fixed_sched_clock(). 93 * detectable in cyc_to_fixed_sched_clock().
94 */ 94 */
95 raw_local_irq_save(flags); 95 raw_local_irq_save(flags);
96 cd.epoch_cyc = cyc; 96 cd.epoch_cyc_copy = cyc;
97 smp_wmb(); 97 smp_wmb();
98 cd.epoch_ns = ns; 98 cd.epoch_ns = ns;
99 smp_wmb(); 99 smp_wmb();
100 cd.epoch_cyc_copy = cyc; 100 cd.epoch_cyc = cyc;
101 raw_local_irq_restore(flags); 101 raw_local_irq_restore(flags);
102} 102}
103 103
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 56f72d257ebd..296786bdbb73 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -45,48 +45,6 @@ const unsigned long sigreturn_codes[7] = {
45 MOV_R7_NR_RT_SIGRETURN, SWI_SYS_RT_SIGRETURN, SWI_THUMB_RT_SIGRETURN, 45 MOV_R7_NR_RT_SIGRETURN, SWI_SYS_RT_SIGRETURN, SWI_THUMB_RT_SIGRETURN,
46}; 46};
47 47
48/*
49 * atomically swap in the new signal mask, and wait for a signal.
50 */
51asmlinkage int sys_sigsuspend(int restart, unsigned long oldmask, old_sigset_t mask)
52{
53 sigset_t blocked;
54 siginitset(&blocked, mask);
55 return sigsuspend(&blocked);
56}
57
58asmlinkage int
59sys_sigaction(int sig, const struct old_sigaction __user *act,
60 struct old_sigaction __user *oact)
61{
62 struct k_sigaction new_ka, old_ka;
63 int ret;
64
65 if (act) {
66 old_sigset_t mask;
67 if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
68 __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
69 __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) ||
70 __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
71 __get_user(mask, &act->sa_mask))
72 return -EFAULT;
73 siginitset(&new_ka.sa.sa_mask, mask);
74 }
75
76 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
77
78 if (!ret && oact) {
79 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
80 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
81 __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) ||
82 __put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
83 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
84 return -EFAULT;
85 }
86
87 return ret;
88}
89
90#ifdef CONFIG_CRUNCH 48#ifdef CONFIG_CRUNCH
91static int preserve_crunch_context(struct crunch_sigframe __user *frame) 49static int preserve_crunch_context(struct crunch_sigframe __user *frame)
92{ 50{
@@ -300,7 +258,7 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
300 if (restore_sigframe(regs, &frame->sig)) 258 if (restore_sigframe(regs, &frame->sig))
301 goto badframe; 259 goto badframe;
302 260
303 if (do_sigaltstack(&frame->sig.uc.uc_stack, NULL, regs->ARM_sp) == -EFAULT) 261 if (restore_altstack(&frame->sig.uc.uc_stack))
304 goto badframe; 262 goto badframe;
305 263
306 return regs->ARM_r0; 264 return regs->ARM_r0;
@@ -360,18 +318,12 @@ setup_sigframe(struct sigframe __user *sf, struct pt_regs *regs, sigset_t *set)
360} 318}
361 319
362static inline void __user * 320static inline void __user *
363get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, int framesize) 321get_sigframe(struct ksignal *ksig, struct pt_regs *regs, int framesize)
364{ 322{
365 unsigned long sp = regs->ARM_sp; 323 unsigned long sp = sigsp(regs->ARM_sp, ksig);
366 void __user *frame; 324 void __user *frame;
367 325
368 /* 326 /*
369 * This is the X/Open sanctioned signal stack switching.
370 */
371 if ((ka->sa.sa_flags & SA_ONSTACK) && !sas_ss_flags(sp))
372 sp = current->sas_ss_sp + current->sas_ss_size;
373
374 /*
375 * ATPCS B01 mandates 8-byte alignment 327 * ATPCS B01 mandates 8-byte alignment
376 */ 328 */
377 frame = (void __user *)((sp - framesize) & ~7); 329 frame = (void __user *)((sp - framesize) & ~7);
@@ -385,11 +337,22 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, int framesize)
385 return frame; 337 return frame;
386} 338}
387 339
340/*
341 * translate the signal
342 */
343static inline int map_sig(int sig)
344{
345 struct thread_info *thread = current_thread_info();
346 if (sig < 32 && thread->exec_domain && thread->exec_domain->signal_invmap)
347 sig = thread->exec_domain->signal_invmap[sig];
348 return sig;
349}
350
388static int 351static int
389setup_return(struct pt_regs *regs, struct k_sigaction *ka, 352setup_return(struct pt_regs *regs, struct ksignal *ksig,
390 unsigned long __user *rc, void __user *frame, int usig) 353 unsigned long __user *rc, void __user *frame)
391{ 354{
392 unsigned long handler = (unsigned long)ka->sa.sa_handler; 355 unsigned long handler = (unsigned long)ksig->ka.sa.sa_handler;
393 unsigned long retcode; 356 unsigned long retcode;
394 int thumb = 0; 357 int thumb = 0;
395 unsigned long cpsr = regs->ARM_cpsr & ~(PSR_f | PSR_E_BIT); 358 unsigned long cpsr = regs->ARM_cpsr & ~(PSR_f | PSR_E_BIT);
@@ -399,7 +362,7 @@ setup_return(struct pt_regs *regs, struct k_sigaction *ka,
399 /* 362 /*
400 * Maybe we need to deliver a 32-bit signal to a 26-bit task. 363 * Maybe we need to deliver a 32-bit signal to a 26-bit task.
401 */ 364 */
402 if (ka->sa.sa_flags & SA_THIRTYTWO) 365 if (ksig->ka.sa.sa_flags & SA_THIRTYTWO)
403 cpsr = (cpsr & ~MODE_MASK) | USR_MODE; 366 cpsr = (cpsr & ~MODE_MASK) | USR_MODE;
404 367
405#ifdef CONFIG_ARM_THUMB 368#ifdef CONFIG_ARM_THUMB
@@ -421,12 +384,12 @@ setup_return(struct pt_regs *regs, struct k_sigaction *ka,
421 } 384 }
422#endif 385#endif
423 386
424 if (ka->sa.sa_flags & SA_RESTORER) { 387 if (ksig->ka.sa.sa_flags & SA_RESTORER) {
425 retcode = (unsigned long)ka->sa.sa_restorer; 388 retcode = (unsigned long)ksig->ka.sa.sa_restorer;
426 } else { 389 } else {
427 unsigned int idx = thumb << 1; 390 unsigned int idx = thumb << 1;
428 391
429 if (ka->sa.sa_flags & SA_SIGINFO) 392 if (ksig->ka.sa.sa_flags & SA_SIGINFO)
430 idx += 3; 393 idx += 3;
431 394
432 if (__put_user(sigreturn_codes[idx], rc) || 395 if (__put_user(sigreturn_codes[idx], rc) ||
@@ -451,7 +414,7 @@ setup_return(struct pt_regs *regs, struct k_sigaction *ka,
451 } 414 }
452 } 415 }
453 416
454 regs->ARM_r0 = usig; 417 regs->ARM_r0 = map_sig(ksig->sig);
455 regs->ARM_sp = (unsigned long)frame; 418 regs->ARM_sp = (unsigned long)frame;
456 regs->ARM_lr = retcode; 419 regs->ARM_lr = retcode;
457 regs->ARM_pc = handler; 420 regs->ARM_pc = handler;
@@ -461,9 +424,9 @@ setup_return(struct pt_regs *regs, struct k_sigaction *ka,
461} 424}
462 425
463static int 426static int
464setup_frame(int usig, struct k_sigaction *ka, sigset_t *set, struct pt_regs *regs) 427setup_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs)
465{ 428{
466 struct sigframe __user *frame = get_sigframe(ka, regs, sizeof(*frame)); 429 struct sigframe __user *frame = get_sigframe(ksig, regs, sizeof(*frame));
467 int err = 0; 430 int err = 0;
468 431
469 if (!frame) 432 if (!frame)
@@ -476,36 +439,29 @@ setup_frame(int usig, struct k_sigaction *ka, sigset_t *set, struct pt_regs *reg
476 439
477 err |= setup_sigframe(frame, regs, set); 440 err |= setup_sigframe(frame, regs, set);
478 if (err == 0) 441 if (err == 0)
479 err = setup_return(regs, ka, frame->retcode, frame, usig); 442 err = setup_return(regs, ksig, frame->retcode, frame);
480 443
481 return err; 444 return err;
482} 445}
483 446
484static int 447static int
485setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info, 448setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs)
486 sigset_t *set, struct pt_regs *regs)
487{ 449{
488 struct rt_sigframe __user *frame = get_sigframe(ka, regs, sizeof(*frame)); 450 struct rt_sigframe __user *frame = get_sigframe(ksig, regs, sizeof(*frame));
489 stack_t stack;
490 int err = 0; 451 int err = 0;
491 452
492 if (!frame) 453 if (!frame)
493 return 1; 454 return 1;
494 455
495 err |= copy_siginfo_to_user(&frame->info, info); 456 err |= copy_siginfo_to_user(&frame->info, &ksig->info);
496 457
497 __put_user_error(0, &frame->sig.uc.uc_flags, err); 458 __put_user_error(0, &frame->sig.uc.uc_flags, err);
498 __put_user_error(NULL, &frame->sig.uc.uc_link, err); 459 __put_user_error(NULL, &frame->sig.uc.uc_link, err);
499 460
500 memset(&stack, 0, sizeof(stack)); 461 err |= __save_altstack(&frame->sig.uc.uc_stack, regs->ARM_sp);
501 stack.ss_sp = (void __user *)current->sas_ss_sp;
502 stack.ss_flags = sas_ss_flags(regs->ARM_sp);
503 stack.ss_size = current->sas_ss_size;
504 err |= __copy_to_user(&frame->sig.uc.uc_stack, &stack, sizeof(stack));
505
506 err |= setup_sigframe(&frame->sig, regs, set); 462 err |= setup_sigframe(&frame->sig, regs, set);
507 if (err == 0) 463 if (err == 0)
508 err = setup_return(regs, ka, frame->sig.retcode, frame, usig); 464 err = setup_return(regs, ksig, frame->sig.retcode, frame);
509 465
510 if (err == 0) { 466 if (err == 0) {
511 /* 467 /*
@@ -523,40 +479,25 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
523/* 479/*
524 * OK, we're invoking a handler 480 * OK, we're invoking a handler
525 */ 481 */
526static void 482static void handle_signal(struct ksignal *ksig, struct pt_regs *regs)
527handle_signal(unsigned long sig, struct k_sigaction *ka,
528 siginfo_t *info, struct pt_regs *regs)
529{ 483{
530 struct thread_info *thread = current_thread_info();
531 struct task_struct *tsk = current;
532 sigset_t *oldset = sigmask_to_save(); 484 sigset_t *oldset = sigmask_to_save();
533 int usig = sig;
534 int ret; 485 int ret;
535 486
536 /* 487 /*
537 * translate the signal
538 */
539 if (usig < 32 && thread->exec_domain && thread->exec_domain->signal_invmap)
540 usig = thread->exec_domain->signal_invmap[usig];
541
542 /*
543 * Set up the stack frame 488 * Set up the stack frame
544 */ 489 */
545 if (ka->sa.sa_flags & SA_SIGINFO) 490 if (ksig->ka.sa.sa_flags & SA_SIGINFO)
546 ret = setup_rt_frame(usig, ka, info, oldset, regs); 491 ret = setup_rt_frame(ksig, oldset, regs);
547 else 492 else
548 ret = setup_frame(usig, ka, oldset, regs); 493 ret = setup_frame(ksig, oldset, regs);
549 494
550 /* 495 /*
551 * Check that the resulting registers are actually sane. 496 * Check that the resulting registers are actually sane.
552 */ 497 */
553 ret |= !valid_user_regs(regs); 498 ret |= !valid_user_regs(regs);
554 499
555 if (ret != 0) { 500 signal_setup_done(ret, ksig, 0);
556 force_sigsegv(sig, tsk);
557 return;
558 }
559 signal_delivered(sig, info, ka, regs, 0);
560} 501}
561 502
562/* 503/*
@@ -571,9 +512,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
571static int do_signal(struct pt_regs *regs, int syscall) 512static int do_signal(struct pt_regs *regs, int syscall)
572{ 513{
573 unsigned int retval = 0, continue_addr = 0, restart_addr = 0; 514 unsigned int retval = 0, continue_addr = 0, restart_addr = 0;
574 struct k_sigaction ka; 515 struct ksignal ksig;
575 siginfo_t info;
576 int signr;
577 int restart = 0; 516 int restart = 0;
578 517
579 /* 518 /*
@@ -605,33 +544,32 @@ static int do_signal(struct pt_regs *regs, int syscall)
605 * Get the signal to deliver. When running under ptrace, at this 544 * Get the signal to deliver. When running under ptrace, at this
606 * point the debugger may change all our registers ... 545 * point the debugger may change all our registers ...
607 */ 546 */
608 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
609 /* 547 /*
610 * Depending on the signal settings we may need to revert the 548 * Depending on the signal settings we may need to revert the
611 * decision to restart the system call. But skip this if a 549 * decision to restart the system call. But skip this if a
612 * debugger has chosen to restart at a different PC. 550 * debugger has chosen to restart at a different PC.
613 */ 551 */
614 if (regs->ARM_pc != restart_addr) 552 if (get_signal(&ksig)) {
615 restart = 0; 553 /* handler */
616 if (signr > 0) { 554 if (unlikely(restart) && regs->ARM_pc == restart_addr) {
617 if (unlikely(restart)) {
618 if (retval == -ERESTARTNOHAND || 555 if (retval == -ERESTARTNOHAND ||
619 retval == -ERESTART_RESTARTBLOCK 556 retval == -ERESTART_RESTARTBLOCK
620 || (retval == -ERESTARTSYS 557 || (retval == -ERESTARTSYS
621 && !(ka.sa.sa_flags & SA_RESTART))) { 558 && !(ksig.ka.sa.sa_flags & SA_RESTART))) {
622 regs->ARM_r0 = -EINTR; 559 regs->ARM_r0 = -EINTR;
623 regs->ARM_pc = continue_addr; 560 regs->ARM_pc = continue_addr;
624 } 561 }
625 } 562 }
626 563 handle_signal(&ksig, regs);
627 handle_signal(signr, &ka, &info, regs); 564 } else {
628 return 0; 565 /* no handler */
566 restore_saved_sigmask();
567 if (unlikely(restart) && regs->ARM_pc == restart_addr) {
568 regs->ARM_pc = continue_addr;
569 return restart;
570 }
629 } 571 }
630 572 return 0;
631 restore_saved_sigmask();
632 if (unlikely(restart))
633 regs->ARM_pc = continue_addr;
634 return restart;
635} 573}
636 574
637asmlinkage int 575asmlinkage int
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 84f4cbf652e5..1bdfd87c8e41 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -125,18 +125,6 @@ void __init smp_init_cpus(void)
125 smp_ops.smp_init_cpus(); 125 smp_ops.smp_init_cpus();
126} 126}
127 127
128static void __init platform_smp_prepare_cpus(unsigned int max_cpus)
129{
130 if (smp_ops.smp_prepare_cpus)
131 smp_ops.smp_prepare_cpus(max_cpus);
132}
133
134static void __cpuinit platform_secondary_init(unsigned int cpu)
135{
136 if (smp_ops.smp_secondary_init)
137 smp_ops.smp_secondary_init(cpu);
138}
139
140int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) 128int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
141{ 129{
142 if (smp_ops.smp_boot_secondary) 130 if (smp_ops.smp_boot_secondary)
@@ -154,12 +142,6 @@ static int platform_cpu_kill(unsigned int cpu)
154 return 1; 142 return 1;
155} 143}
156 144
157static void platform_cpu_die(unsigned int cpu)
158{
159 if (smp_ops.cpu_die)
160 smp_ops.cpu_die(cpu);
161}
162
163static int platform_cpu_disable(unsigned int cpu) 145static int platform_cpu_disable(unsigned int cpu)
164{ 146{
165 if (smp_ops.cpu_disable) 147 if (smp_ops.cpu_disable)
@@ -257,7 +239,8 @@ void __ref cpu_die(void)
257 * actual CPU shutdown procedure is at least platform (if not 239 * actual CPU shutdown procedure is at least platform (if not
258 * CPU) specific. 240 * CPU) specific.
259 */ 241 */
260 platform_cpu_die(cpu); 242 if (smp_ops.cpu_die)
243 smp_ops.cpu_die(cpu);
261 244
262 /* 245 /*
263 * Do not return to the idle loop - jump back to the secondary 246 * Do not return to the idle loop - jump back to the secondary
@@ -324,7 +307,8 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
324 /* 307 /*
325 * Give the platform a chance to do its own initialisation. 308 * Give the platform a chance to do its own initialisation.
326 */ 309 */
327 platform_secondary_init(cpu); 310 if (smp_ops.smp_secondary_init)
311 smp_ops.smp_secondary_init(cpu);
328 312
329 notify_cpu_starting(cpu); 313 notify_cpu_starting(cpu);
330 314
@@ -399,8 +383,8 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
399 /* 383 /*
400 * Initialise the present map, which describes the set of CPUs 384 * Initialise the present map, which describes the set of CPUs
401 * actually populated at the present time. A platform should 385 * actually populated at the present time. A platform should
402 * re-initialize the map in platform_smp_prepare_cpus() if 386 * re-initialize the map in the platforms smp_prepare_cpus()
403 * present != possible (e.g. physical hotplug). 387 * if present != possible (e.g. physical hotplug).
404 */ 388 */
405 init_cpu_present(cpu_possible_mask); 389 init_cpu_present(cpu_possible_mask);
406 390
@@ -408,7 +392,8 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
408 * Initialise the SCU if there are more than one CPU 392 * Initialise the SCU if there are more than one CPU
409 * and let them know where to start. 393 * and let them know where to start.
410 */ 394 */
411 platform_smp_prepare_cpus(max_cpus); 395 if (smp_ops.smp_prepare_cpus)
396 smp_ops.smp_prepare_cpus(max_cpus);
412 } 397 }
413} 398}
414 399
@@ -416,7 +401,8 @@ static void (*smp_cross_call)(const struct cpumask *, unsigned int);
416 401
417void __init set_smp_cross_call(void (*fn)(const struct cpumask *, unsigned int)) 402void __init set_smp_cross_call(void (*fn)(const struct cpumask *, unsigned int))
418{ 403{
419 smp_cross_call = fn; 404 if (!smp_cross_call)
405 smp_cross_call = fn;
420} 406}
421 407
422void arch_send_call_function_ipi_mask(const struct cpumask *mask) 408void arch_send_call_function_ipi_mask(const struct cpumask *mask)
@@ -475,19 +461,11 @@ u64 smp_irq_stat_cpu(unsigned int cpu)
475 */ 461 */
476static DEFINE_PER_CPU(struct clock_event_device, percpu_clockevent); 462static DEFINE_PER_CPU(struct clock_event_device, percpu_clockevent);
477 463
478static void ipi_timer(void)
479{
480 struct clock_event_device *evt = &__get_cpu_var(percpu_clockevent);
481 evt->event_handler(evt);
482}
483
484#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST 464#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
485static void smp_timer_broadcast(const struct cpumask *mask) 465void tick_broadcast(const struct cpumask *mask)
486{ 466{
487 smp_cross_call(mask, IPI_TIMER); 467 smp_cross_call(mask, IPI_TIMER);
488} 468}
489#else
490#define smp_timer_broadcast NULL
491#endif 469#endif
492 470
493static void broadcast_timer_set_mode(enum clock_event_mode mode, 471static void broadcast_timer_set_mode(enum clock_event_mode mode,
@@ -530,7 +508,6 @@ static void __cpuinit percpu_timer_setup(void)
530 struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu); 508 struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu);
531 509
532 evt->cpumask = cpumask_of(cpu); 510 evt->cpumask = cpumask_of(cpu);
533 evt->broadcast = smp_timer_broadcast;
534 511
535 if (!lt_ops || lt_ops->setup(evt)) 512 if (!lt_ops || lt_ops->setup(evt))
536 broadcast_timer_setup(evt); 513 broadcast_timer_setup(evt);
@@ -596,11 +573,13 @@ void handle_IPI(int ipinr, struct pt_regs *regs)
596 case IPI_WAKEUP: 573 case IPI_WAKEUP:
597 break; 574 break;
598 575
576#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
599 case IPI_TIMER: 577 case IPI_TIMER:
600 irq_enter(); 578 irq_enter();
601 ipi_timer(); 579 tick_receive_broadcast();
602 irq_exit(); 580 irq_exit();
603 break; 581 break;
582#endif
604 583
605 case IPI_RESCHEDULE: 584 case IPI_RESCHEDULE:
606 scheduler_ipi(); 585 scheduler_ipi();
@@ -693,6 +672,9 @@ static int cpufreq_callback(struct notifier_block *nb,
693 if (freq->flags & CPUFREQ_CONST_LOOPS) 672 if (freq->flags & CPUFREQ_CONST_LOOPS)
694 return NOTIFY_OK; 673 return NOTIFY_OK;
695 674
675 if (arm_delay_ops.const_clock)
676 return NOTIFY_OK;
677
696 if (!per_cpu(l_p_j_ref, cpu)) { 678 if (!per_cpu(l_p_j_ref, cpu)) {
697 per_cpu(l_p_j_ref, cpu) = 679 per_cpu(l_p_j_ref, cpu) =
698 per_cpu(cpu_data, cpu).loops_per_jiffy; 680 per_cpu(cpu_data, cpu).loops_per_jiffy;
diff --git a/arch/arm/kernel/smp_scu.c b/arch/arm/kernel/smp_scu.c
index 743a3bfe6a67..5bc1a63284e3 100644
--- a/arch/arm/kernel/smp_scu.c
+++ b/arch/arm/kernel/smp_scu.c
@@ -75,7 +75,7 @@ void scu_enable(void __iomem *scu_base)
75int scu_power_mode(void __iomem *scu_base, unsigned int mode) 75int scu_power_mode(void __iomem *scu_base, unsigned int mode)
76{ 76{
77 unsigned int val; 77 unsigned int val;
78 int cpu = cpu_logical_map(smp_processor_id()); 78 int cpu = MPIDR_AFFINITY_LEVEL(cpu_logical_map(smp_processor_id()), 0);
79 79
80 if (mode > 3 || mode == 1 || cpu > 3) 80 if (mode > 3 || mode == 1 || cpu > 3)
81 return -EINVAL; 81 return -EINVAL;
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index 49f335d301ba..c092115d903a 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -24,14 +24,12 @@
24 24
25#include <asm/smp_twd.h> 25#include <asm/smp_twd.h>
26#include <asm/localtimer.h> 26#include <asm/localtimer.h>
27#include <asm/hardware/gic.h>
28 27
29/* set up by the platform code */ 28/* set up by the platform code */
30static void __iomem *twd_base; 29static void __iomem *twd_base;
31 30
32static struct clk *twd_clk; 31static struct clk *twd_clk;
33static unsigned long twd_timer_rate; 32static unsigned long twd_timer_rate;
34static bool common_setup_called;
35static DEFINE_PER_CPU(bool, percpu_setup_called); 33static DEFINE_PER_CPU(bool, percpu_setup_called);
36 34
37static struct clock_event_device __percpu **twd_evt; 35static struct clock_event_device __percpu **twd_evt;
@@ -239,25 +237,28 @@ static irqreturn_t twd_handler(int irq, void *dev_id)
239 return IRQ_NONE; 237 return IRQ_NONE;
240} 238}
241 239
242static struct clk *twd_get_clock(void) 240static void twd_get_clock(struct device_node *np)
243{ 241{
244 struct clk *clk;
245 int err; 242 int err;
246 243
247 clk = clk_get_sys("smp_twd", NULL); 244 if (np)
248 if (IS_ERR(clk)) { 245 twd_clk = of_clk_get(np, 0);
249 pr_err("smp_twd: clock not found: %d\n", (int)PTR_ERR(clk)); 246 else
250 return clk; 247 twd_clk = clk_get_sys("smp_twd", NULL);
248
249 if (IS_ERR(twd_clk)) {
250 pr_err("smp_twd: clock not found %d\n", (int) PTR_ERR(twd_clk));
251 return;
251 } 252 }
252 253
253 err = clk_prepare_enable(clk); 254 err = clk_prepare_enable(twd_clk);
254 if (err) { 255 if (err) {
255 pr_err("smp_twd: clock failed to prepare+enable: %d\n", err); 256 pr_err("smp_twd: clock failed to prepare+enable: %d\n", err);
256 clk_put(clk); 257 clk_put(twd_clk);
257 return ERR_PTR(err); 258 return;
258 } 259 }
259 260
260 return clk; 261 twd_timer_rate = clk_get_rate(twd_clk);
261} 262}
262 263
263/* 264/*
@@ -280,26 +281,7 @@ static int __cpuinit twd_timer_setup(struct clock_event_device *clk)
280 } 281 }
281 per_cpu(percpu_setup_called, cpu) = true; 282 per_cpu(percpu_setup_called, cpu) = true;
282 283
283 /* 284 twd_calibrate_rate();
284 * This stuff only need to be done once for the entire TWD cluster
285 * during the runtime of the system.
286 */
287 if (!common_setup_called) {
288 twd_clk = twd_get_clock();
289
290 /*
291 * We use IS_ERR_OR_NULL() here, because if the clock stubs
292 * are active we will get a valid clk reference which is
293 * however NULL and will return the rate 0. In that case we
294 * need to calibrate the rate instead.
295 */
296 if (!IS_ERR_OR_NULL(twd_clk))
297 twd_timer_rate = clk_get_rate(twd_clk);
298 else
299 twd_calibrate_rate();
300
301 common_setup_called = true;
302 }
303 285
304 /* 286 /*
305 * The following is done once per CPU the first time .setup() is 287 * The following is done once per CPU the first time .setup() is
@@ -330,7 +312,7 @@ static struct local_timer_ops twd_lt_ops __cpuinitdata = {
330 .stop = twd_timer_stop, 312 .stop = twd_timer_stop,
331}; 313};
332 314
333static int __init twd_local_timer_common_register(void) 315static int __init twd_local_timer_common_register(struct device_node *np)
334{ 316{
335 int err; 317 int err;
336 318
@@ -350,6 +332,8 @@ static int __init twd_local_timer_common_register(void)
350 if (err) 332 if (err)
351 goto out_irq; 333 goto out_irq;
352 334
335 twd_get_clock(np);
336
353 return 0; 337 return 0;
354 338
355out_irq: 339out_irq:
@@ -373,7 +357,7 @@ int __init twd_local_timer_register(struct twd_local_timer *tlt)
373 if (!twd_base) 357 if (!twd_base)
374 return -ENOMEM; 358 return -ENOMEM;
375 359
376 return twd_local_timer_common_register(); 360 return twd_local_timer_common_register(NULL);
377} 361}
378 362
379#ifdef CONFIG_OF 363#ifdef CONFIG_OF
@@ -405,7 +389,7 @@ void __init twd_local_timer_of_register(void)
405 goto out; 389 goto out;
406 } 390 }
407 391
408 err = twd_local_timer_common_register(); 392 err = twd_local_timer_common_register(np);
409 393
410out: 394out:
411 WARN(err, "twd_local_timer_of_register failed (%d)\n", err); 395 WARN(err, "twd_local_timer_of_register failed (%d)\n", err);
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index 09be0c3c9069..955d92d265e5 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -21,7 +21,6 @@
21#include <linux/timex.h> 21#include <linux/timex.h>
22#include <linux/errno.h> 22#include <linux/errno.h>
23#include <linux/profile.h> 23#include <linux/profile.h>
24#include <linux/syscore_ops.h>
25#include <linux/timer.h> 24#include <linux/timer.h>
26#include <linux/irq.h> 25#include <linux/irq.h>
27 26
@@ -31,11 +30,6 @@
31#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
32#include <asm/mach/time.h> 31#include <asm/mach/time.h>
33 32
34/*
35 * Our system timer.
36 */
37static struct sys_timer *system_timer;
38
39#if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) || \ 33#if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) || \
40 defined(CONFIG_NVRAM) || defined(CONFIG_NVRAM_MODULE) 34 defined(CONFIG_NVRAM) || defined(CONFIG_NVRAM_MODULE)
41/* this needs a better home */ 35/* this needs a better home */
@@ -69,16 +63,6 @@ unsigned long profile_pc(struct pt_regs *regs)
69EXPORT_SYMBOL(profile_pc); 63EXPORT_SYMBOL(profile_pc);
70#endif 64#endif
71 65
72#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
73u32 arch_gettimeoffset(void)
74{
75 if (system_timer->offset != NULL)
76 return system_timer->offset() * 1000;
77
78 return 0;
79}
80#endif /* CONFIG_ARCH_USES_GETTIMEOFFSET */
81
82#ifndef CONFIG_GENERIC_CLOCKEVENTS 66#ifndef CONFIG_GENERIC_CLOCKEVENTS
83/* 67/*
84 * Kernel system timer support. 68 * Kernel system timer support.
@@ -129,43 +113,8 @@ int __init register_persistent_clock(clock_access_fn read_boot,
129 return -EINVAL; 113 return -EINVAL;
130} 114}
131 115
132#if defined(CONFIG_PM) && !defined(CONFIG_GENERIC_CLOCKEVENTS)
133static int timer_suspend(void)
134{
135 if (system_timer->suspend)
136 system_timer->suspend();
137
138 return 0;
139}
140
141static void timer_resume(void)
142{
143 if (system_timer->resume)
144 system_timer->resume();
145}
146#else
147#define timer_suspend NULL
148#define timer_resume NULL
149#endif
150
151static struct syscore_ops timer_syscore_ops = {
152 .suspend = timer_suspend,
153 .resume = timer_resume,
154};
155
156static int __init timer_init_syscore_ops(void)
157{
158 register_syscore_ops(&timer_syscore_ops);
159
160 return 0;
161}
162
163device_initcall(timer_init_syscore_ops);
164
165void __init time_init(void) 116void __init time_init(void)
166{ 117{
167 system_timer = machine_desc->timer; 118 machine_desc->init_time();
168 system_timer->init();
169 sched_clock_postinit(); 119 sched_clock_postinit();
170} 120}
171
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index b0179b89a04c..1c089119b2d7 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -296,7 +296,7 @@ static void oops_end(unsigned long flags, struct pt_regs *regs, int signr)
296 296
297 bust_spinlocks(0); 297 bust_spinlocks(0);
298 die_owner = -1; 298 die_owner = -1;
299 add_taint(TAINT_DIE); 299 add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
300 die_nest_count--; 300 die_nest_count--;
301 if (!die_nest_count) 301 if (!die_nest_count)
302 /* Nest count reaches zero, release the lock. */ 302 /* Nest count reaches zero, release the lock. */
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index 11c1785bf63e..b571484e9f03 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -19,7 +19,11 @@
19 ALIGN_FUNCTION(); \ 19 ALIGN_FUNCTION(); \
20 VMLINUX_SYMBOL(__idmap_text_start) = .; \ 20 VMLINUX_SYMBOL(__idmap_text_start) = .; \
21 *(.idmap.text) \ 21 *(.idmap.text) \
22 VMLINUX_SYMBOL(__idmap_text_end) = .; 22 VMLINUX_SYMBOL(__idmap_text_end) = .; \
23 ALIGN_FUNCTION(); \
24 VMLINUX_SYMBOL(__hyp_idmap_text_start) = .; \
25 *(.hyp.idmap.text) \
26 VMLINUX_SYMBOL(__hyp_idmap_text_end) = .;
23 27
24#ifdef CONFIG_HOTPLUG_CPU 28#ifdef CONFIG_HOTPLUG_CPU
25#define ARM_CPU_DISCARD(x) 29#define ARM_CPU_DISCARD(x)
diff --git a/arch/arm/kvm/Kconfig b/arch/arm/kvm/Kconfig
new file mode 100644
index 000000000000..49dd64e579c2
--- /dev/null
+++ b/arch/arm/kvm/Kconfig
@@ -0,0 +1,72 @@
1#
2# KVM configuration
3#
4
5source "virt/kvm/Kconfig"
6
7menuconfig VIRTUALIZATION
8 bool "Virtualization"
9 ---help---
10 Say Y here to get to see options for using your Linux host to run
11 other operating systems inside virtual machines (guests).
12 This option alone does not add any kernel code.
13
14 If you say N, all options in this submenu will be skipped and
15 disabled.
16
17if VIRTUALIZATION
18
19config KVM
20 bool "Kernel-based Virtual Machine (KVM) support"
21 select PREEMPT_NOTIFIERS
22 select ANON_INODES
23 select KVM_MMIO
24 select KVM_ARM_HOST
25 depends on ARM_VIRT_EXT && ARM_LPAE
26 ---help---
27 Support hosting virtualized guest machines. You will also
28 need to select one or more of the processor modules below.
29
30 This module provides access to the hardware capabilities through
31 a character device node named /dev/kvm.
32
33 If unsure, say N.
34
35config KVM_ARM_HOST
36 bool "KVM host support for ARM cpus."
37 depends on KVM
38 depends on MMU
39 select MMU_NOTIFIER
40 ---help---
41 Provides host support for ARM processors.
42
43config KVM_ARM_MAX_VCPUS
44 int "Number maximum supported virtual CPUs per VM"
45 depends on KVM_ARM_HOST
46 default 4
47 help
48 Static number of max supported virtual CPUs per VM.
49
50 If you choose a high number, the vcpu structures will be quite
51 large, so only choose a reasonable number that you expect to
52 actually use.
53
54config KVM_ARM_VGIC
55 bool "KVM support for Virtual GIC"
56 depends on KVM_ARM_HOST && OF
57 select HAVE_KVM_IRQCHIP
58 default y
59 ---help---
60 Adds support for a hardware assisted, in-kernel GIC emulation.
61
62config KVM_ARM_TIMER
63 bool "KVM support for Architected Timers"
64 depends on KVM_ARM_VGIC && ARM_ARCH_TIMER
65 select HAVE_KVM_IRQCHIP
66 default y
67 ---help---
68 Adds support for the Architected Timers in virtual machines
69
70source drivers/virtio/Kconfig
71
72endif # VIRTUALIZATION
diff --git a/arch/arm/kvm/Makefile b/arch/arm/kvm/Makefile
new file mode 100644
index 000000000000..fc96ce6f2357
--- /dev/null
+++ b/arch/arm/kvm/Makefile
@@ -0,0 +1,23 @@
1#
2# Makefile for Kernel-based Virtual Machine module
3#
4
5plus_virt := $(call as-instr,.arch_extension virt,+virt)
6ifeq ($(plus_virt),+virt)
7 plus_virt_def := -DREQUIRES_VIRT=1
8endif
9
10ccflags-y += -Ivirt/kvm -Iarch/arm/kvm
11CFLAGS_arm.o := -I. $(plus_virt_def)
12CFLAGS_mmu.o := -I.
13
14AFLAGS_init.o := -Wa,-march=armv7-a$(plus_virt)
15AFLAGS_interrupts.o := -Wa,-march=armv7-a$(plus_virt)
16
17kvm-arm-y = $(addprefix ../../../virt/kvm/, kvm_main.o coalesced_mmio.o)
18
19obj-y += kvm-arm.o init.o interrupts.o
20obj-y += arm.o guest.o mmu.o emulate.o reset.o
21obj-y += coproc.o coproc_a15.o mmio.o psci.o
22obj-$(CONFIG_KVM_ARM_VGIC) += vgic.o
23obj-$(CONFIG_KVM_ARM_TIMER) += arch_timer.o
diff --git a/arch/arm/kvm/arch_timer.c b/arch/arm/kvm/arch_timer.c
new file mode 100644
index 000000000000..6ac938d46297
--- /dev/null
+++ b/arch/arm/kvm/arch_timer.c
@@ -0,0 +1,271 @@
1/*
2 * Copyright (C) 2012 ARM Ltd.
3 * Author: Marc Zyngier <marc.zyngier@arm.com>
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 * 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 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#include <linux/cpu.h>
20#include <linux/of_irq.h>
21#include <linux/kvm.h>
22#include <linux/kvm_host.h>
23#include <linux/interrupt.h>
24
25#include <asm/arch_timer.h>
26
27#include <asm/kvm_vgic.h>
28#include <asm/kvm_arch_timer.h>
29
30static struct timecounter *timecounter;
31static struct workqueue_struct *wqueue;
32static struct kvm_irq_level timer_irq = {
33 .level = 1,
34};
35
36static cycle_t kvm_phys_timer_read(void)
37{
38 return timecounter->cc->read(timecounter->cc);
39}
40
41static bool timer_is_armed(struct arch_timer_cpu *timer)
42{
43 return timer->armed;
44}
45
46/* timer_arm: as in "arm the timer", not as in ARM the company */
47static void timer_arm(struct arch_timer_cpu *timer, u64 ns)
48{
49 timer->armed = true;
50 hrtimer_start(&timer->timer, ktime_add_ns(ktime_get(), ns),
51 HRTIMER_MODE_ABS);
52}
53
54static void timer_disarm(struct arch_timer_cpu *timer)
55{
56 if (timer_is_armed(timer)) {
57 hrtimer_cancel(&timer->timer);
58 cancel_work_sync(&timer->expired);
59 timer->armed = false;
60 }
61}
62
63static void kvm_timer_inject_irq(struct kvm_vcpu *vcpu)
64{
65 struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu;
66
67 timer->cntv_ctl |= 1 << 1; /* Mask the interrupt in the guest */
68 kvm_vgic_inject_irq(vcpu->kvm, vcpu->vcpu_id,
69 vcpu->arch.timer_cpu.irq->irq,
70 vcpu->arch.timer_cpu.irq->level);
71}
72
73static irqreturn_t kvm_arch_timer_handler(int irq, void *dev_id)
74{
75 struct kvm_vcpu *vcpu = *(struct kvm_vcpu **)dev_id;
76
77 /*
78 * We disable the timer in the world switch and let it be
79 * handled by kvm_timer_sync_hwstate(). Getting a timer
80 * interrupt at this point is a sure sign of some major
81 * breakage.
82 */
83 pr_warn("Unexpected interrupt %d on vcpu %p\n", irq, vcpu);
84 return IRQ_HANDLED;
85}
86
87static void kvm_timer_inject_irq_work(struct work_struct *work)
88{
89 struct kvm_vcpu *vcpu;
90
91 vcpu = container_of(work, struct kvm_vcpu, arch.timer_cpu.expired);
92 vcpu->arch.timer_cpu.armed = false;
93 kvm_timer_inject_irq(vcpu);
94}
95
96static enum hrtimer_restart kvm_timer_expire(struct hrtimer *hrt)
97{
98 struct arch_timer_cpu *timer;
99 timer = container_of(hrt, struct arch_timer_cpu, timer);
100 queue_work(wqueue, &timer->expired);
101 return HRTIMER_NORESTART;
102}
103
104/**
105 * kvm_timer_flush_hwstate - prepare to move the virt timer to the cpu
106 * @vcpu: The vcpu pointer
107 *
108 * Disarm any pending soft timers, since the world-switch code will write the
109 * virtual timer state back to the physical CPU.
110 */
111void kvm_timer_flush_hwstate(struct kvm_vcpu *vcpu)
112{
113 struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu;
114
115 /*
116 * We're about to run this vcpu again, so there is no need to
117 * keep the background timer running, as we're about to
118 * populate the CPU timer again.
119 */
120 timer_disarm(timer);
121}
122
123/**
124 * kvm_timer_sync_hwstate - sync timer state from cpu
125 * @vcpu: The vcpu pointer
126 *
127 * Check if the virtual timer was armed and either schedule a corresponding
128 * soft timer or inject directly if already expired.
129 */
130void kvm_timer_sync_hwstate(struct kvm_vcpu *vcpu)
131{
132 struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu;
133 cycle_t cval, now;
134 u64 ns;
135
136 /* Check if the timer is enabled and unmasked first */
137 if ((timer->cntv_ctl & 3) != 1)
138 return;
139
140 cval = timer->cntv_cval;
141 now = kvm_phys_timer_read() - vcpu->kvm->arch.timer.cntvoff;
142
143 BUG_ON(timer_is_armed(timer));
144
145 if (cval <= now) {
146 /*
147 * Timer has already expired while we were not
148 * looking. Inject the interrupt and carry on.
149 */
150 kvm_timer_inject_irq(vcpu);
151 return;
152 }
153
154 ns = cyclecounter_cyc2ns(timecounter->cc, cval - now);
155 timer_arm(timer, ns);
156}
157
158void kvm_timer_vcpu_init(struct kvm_vcpu *vcpu)
159{
160 struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu;
161
162 INIT_WORK(&timer->expired, kvm_timer_inject_irq_work);
163 hrtimer_init(&timer->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
164 timer->timer.function = kvm_timer_expire;
165 timer->irq = &timer_irq;
166}
167
168static void kvm_timer_init_interrupt(void *info)
169{
170 enable_percpu_irq(timer_irq.irq, 0);
171}
172
173
174static int kvm_timer_cpu_notify(struct notifier_block *self,
175 unsigned long action, void *cpu)
176{
177 switch (action) {
178 case CPU_STARTING:
179 case CPU_STARTING_FROZEN:
180 kvm_timer_init_interrupt(NULL);
181 break;
182 case CPU_DYING:
183 case CPU_DYING_FROZEN:
184 disable_percpu_irq(timer_irq.irq);
185 break;
186 }
187
188 return NOTIFY_OK;
189}
190
191static struct notifier_block kvm_timer_cpu_nb = {
192 .notifier_call = kvm_timer_cpu_notify,
193};
194
195static const struct of_device_id arch_timer_of_match[] = {
196 { .compatible = "arm,armv7-timer", },
197 {},
198};
199
200int kvm_timer_hyp_init(void)
201{
202 struct device_node *np;
203 unsigned int ppi;
204 int err;
205
206 timecounter = arch_timer_get_timecounter();
207 if (!timecounter)
208 return -ENODEV;
209
210 np = of_find_matching_node(NULL, arch_timer_of_match);
211 if (!np) {
212 kvm_err("kvm_arch_timer: can't find DT node\n");
213 return -ENODEV;
214 }
215
216 ppi = irq_of_parse_and_map(np, 2);
217 if (!ppi) {
218 kvm_err("kvm_arch_timer: no virtual timer interrupt\n");
219 err = -EINVAL;
220 goto out;
221 }
222
223 err = request_percpu_irq(ppi, kvm_arch_timer_handler,
224 "kvm guest timer", kvm_get_running_vcpus());
225 if (err) {
226 kvm_err("kvm_arch_timer: can't request interrupt %d (%d)\n",
227 ppi, err);
228 goto out;
229 }
230
231 timer_irq.irq = ppi;
232
233 err = register_cpu_notifier(&kvm_timer_cpu_nb);
234 if (err) {
235 kvm_err("Cannot register timer CPU notifier\n");
236 goto out_free;
237 }
238
239 wqueue = create_singlethread_workqueue("kvm_arch_timer");
240 if (!wqueue) {
241 err = -ENOMEM;
242 goto out_free;
243 }
244
245 kvm_info("%s IRQ%d\n", np->name, ppi);
246 on_each_cpu(kvm_timer_init_interrupt, NULL, 1);
247
248 goto out;
249out_free:
250 free_percpu_irq(ppi, kvm_get_running_vcpus());
251out:
252 of_node_put(np);
253 return err;
254}
255
256void kvm_timer_vcpu_terminate(struct kvm_vcpu *vcpu)
257{
258 struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu;
259
260 timer_disarm(timer);
261}
262
263int kvm_timer_init(struct kvm *kvm)
264{
265 if (timecounter && wqueue) {
266 kvm->arch.timer.cntvoff = kvm_phys_timer_read();
267 kvm->arch.timer.enabled = 1;
268 }
269
270 return 0;
271}
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
new file mode 100644
index 000000000000..5a936988eb24
--- /dev/null
+++ b/arch/arm/kvm/arm.c
@@ -0,0 +1,1169 @@
1/*
2 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
3 * Author: Christoffer Dall <c.dall@virtualopensystems.com>
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 * 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 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#include <linux/errno.h>
20#include <linux/err.h>
21#include <linux/kvm_host.h>
22#include <linux/module.h>
23#include <linux/vmalloc.h>
24#include <linux/fs.h>
25#include <linux/mman.h>
26#include <linux/sched.h>
27#include <linux/kvm.h>
28#include <trace/events/kvm.h>
29
30#define CREATE_TRACE_POINTS
31#include "trace.h"
32
33#include <asm/unified.h>
34#include <asm/uaccess.h>
35#include <asm/ptrace.h>
36#include <asm/mman.h>
37#include <asm/cputype.h>
38#include <asm/tlbflush.h>
39#include <asm/cacheflush.h>
40#include <asm/virt.h>
41#include <asm/kvm_arm.h>
42#include <asm/kvm_asm.h>
43#include <asm/kvm_mmu.h>
44#include <asm/kvm_emulate.h>
45#include <asm/kvm_coproc.h>
46#include <asm/kvm_psci.h>
47#include <asm/opcodes.h>
48
49#ifdef REQUIRES_VIRT
50__asm__(".arch_extension virt");
51#endif
52
53static DEFINE_PER_CPU(unsigned long, kvm_arm_hyp_stack_page);
54static struct vfp_hard_struct __percpu *kvm_host_vfp_state;
55static unsigned long hyp_default_vectors;
56
57/* Per-CPU variable containing the currently running vcpu. */
58static DEFINE_PER_CPU(struct kvm_vcpu *, kvm_arm_running_vcpu);
59
60/* The VMID used in the VTTBR */
61static atomic64_t kvm_vmid_gen = ATOMIC64_INIT(1);
62static u8 kvm_next_vmid;
63static DEFINE_SPINLOCK(kvm_vmid_lock);
64
65static bool vgic_present;
66
67static void kvm_arm_set_running_vcpu(struct kvm_vcpu *vcpu)
68{
69 BUG_ON(preemptible());
70 __get_cpu_var(kvm_arm_running_vcpu) = vcpu;
71}
72
73/**
74 * kvm_arm_get_running_vcpu - get the vcpu running on the current CPU.
75 * Must be called from non-preemptible context
76 */
77struct kvm_vcpu *kvm_arm_get_running_vcpu(void)
78{
79 BUG_ON(preemptible());
80 return __get_cpu_var(kvm_arm_running_vcpu);
81}
82
83/**
84 * kvm_arm_get_running_vcpus - get the per-CPU array of currently running vcpus.
85 */
86struct kvm_vcpu __percpu **kvm_get_running_vcpus(void)
87{
88 return &kvm_arm_running_vcpu;
89}
90
91int kvm_arch_hardware_enable(void *garbage)
92{
93 return 0;
94}
95
96int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu)
97{
98 return kvm_vcpu_exiting_guest_mode(vcpu) == IN_GUEST_MODE;
99}
100
101void kvm_arch_hardware_disable(void *garbage)
102{
103}
104
105int kvm_arch_hardware_setup(void)
106{
107 return 0;
108}
109
110void kvm_arch_hardware_unsetup(void)
111{
112}
113
114void kvm_arch_check_processor_compat(void *rtn)
115{
116 *(int *)rtn = 0;
117}
118
119void kvm_arch_sync_events(struct kvm *kvm)
120{
121}
122
123/**
124 * kvm_arch_init_vm - initializes a VM data structure
125 * @kvm: pointer to the KVM struct
126 */
127int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
128{
129 int ret = 0;
130
131 if (type)
132 return -EINVAL;
133
134 ret = kvm_alloc_stage2_pgd(kvm);
135 if (ret)
136 goto out_fail_alloc;
137
138 ret = create_hyp_mappings(kvm, kvm + 1);
139 if (ret)
140 goto out_free_stage2_pgd;
141
142 /* Mark the initial VMID generation invalid */
143 kvm->arch.vmid_gen = 0;
144
145 return ret;
146out_free_stage2_pgd:
147 kvm_free_stage2_pgd(kvm);
148out_fail_alloc:
149 return ret;
150}
151
152int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf)
153{
154 return VM_FAULT_SIGBUS;
155}
156
157void kvm_arch_free_memslot(struct kvm_memory_slot *free,
158 struct kvm_memory_slot *dont)
159{
160}
161
162int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages)
163{
164 return 0;
165}
166
167/**
168 * kvm_arch_destroy_vm - destroy the VM data structure
169 * @kvm: pointer to the KVM struct
170 */
171void kvm_arch_destroy_vm(struct kvm *kvm)
172{
173 int i;
174
175 kvm_free_stage2_pgd(kvm);
176
177 for (i = 0; i < KVM_MAX_VCPUS; ++i) {
178 if (kvm->vcpus[i]) {
179 kvm_arch_vcpu_free(kvm->vcpus[i]);
180 kvm->vcpus[i] = NULL;
181 }
182 }
183}
184
185int kvm_dev_ioctl_check_extension(long ext)
186{
187 int r;
188 switch (ext) {
189 case KVM_CAP_IRQCHIP:
190 r = vgic_present;
191 break;
192 case KVM_CAP_USER_MEMORY:
193 case KVM_CAP_SYNC_MMU:
194 case KVM_CAP_DESTROY_MEMORY_REGION_WORKS:
195 case KVM_CAP_ONE_REG:
196 case KVM_CAP_ARM_PSCI:
197 r = 1;
198 break;
199 case KVM_CAP_COALESCED_MMIO:
200 r = KVM_COALESCED_MMIO_PAGE_OFFSET;
201 break;
202 case KVM_CAP_ARM_SET_DEVICE_ADDR:
203 r = 1;
204 case KVM_CAP_NR_VCPUS:
205 r = num_online_cpus();
206 break;
207 case KVM_CAP_MAX_VCPUS:
208 r = KVM_MAX_VCPUS;
209 break;
210 default:
211 r = 0;
212 break;
213 }
214 return r;
215}
216
217long kvm_arch_dev_ioctl(struct file *filp,
218 unsigned int ioctl, unsigned long arg)
219{
220 return -EINVAL;
221}
222
223int kvm_arch_set_memory_region(struct kvm *kvm,
224 struct kvm_userspace_memory_region *mem,
225 struct kvm_memory_slot old,
226 int user_alloc)
227{
228 return 0;
229}
230
231int kvm_arch_prepare_memory_region(struct kvm *kvm,
232 struct kvm_memory_slot *memslot,
233 struct kvm_memory_slot old,
234 struct kvm_userspace_memory_region *mem,
235 bool user_alloc)
236{
237 return 0;
238}
239
240void kvm_arch_commit_memory_region(struct kvm *kvm,
241 struct kvm_userspace_memory_region *mem,
242 struct kvm_memory_slot old,
243 bool user_alloc)
244{
245}
246
247void kvm_arch_flush_shadow_all(struct kvm *kvm)
248{
249}
250
251void kvm_arch_flush_shadow_memslot(struct kvm *kvm,
252 struct kvm_memory_slot *slot)
253{
254}
255
256struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id)
257{
258 int err;
259 struct kvm_vcpu *vcpu;
260
261 vcpu = kmem_cache_zalloc(kvm_vcpu_cache, GFP_KERNEL);
262 if (!vcpu) {
263 err = -ENOMEM;
264 goto out;
265 }
266
267 err = kvm_vcpu_init(vcpu, kvm, id);
268 if (err)
269 goto free_vcpu;
270
271 err = create_hyp_mappings(vcpu, vcpu + 1);
272 if (err)
273 goto vcpu_uninit;
274
275 return vcpu;
276vcpu_uninit:
277 kvm_vcpu_uninit(vcpu);
278free_vcpu:
279 kmem_cache_free(kvm_vcpu_cache, vcpu);
280out:
281 return ERR_PTR(err);
282}
283
284int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
285{
286 return 0;
287}
288
289void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu)
290{
291 kvm_mmu_free_memory_caches(vcpu);
292 kvm_timer_vcpu_terminate(vcpu);
293 kmem_cache_free(kvm_vcpu_cache, vcpu);
294}
295
296void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
297{
298 kvm_arch_vcpu_free(vcpu);
299}
300
301int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu)
302{
303 return 0;
304}
305
306int __attribute_const__ kvm_target_cpu(void)
307{
308 unsigned long implementor = read_cpuid_implementor();
309 unsigned long part_number = read_cpuid_part_number();
310
311 if (implementor != ARM_CPU_IMP_ARM)
312 return -EINVAL;
313
314 switch (part_number) {
315 case ARM_CPU_PART_CORTEX_A15:
316 return KVM_ARM_TARGET_CORTEX_A15;
317 default:
318 return -EINVAL;
319 }
320}
321
322int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
323{
324 int ret;
325
326 /* Force users to call KVM_ARM_VCPU_INIT */
327 vcpu->arch.target = -1;
328
329 /* Set up VGIC */
330 ret = kvm_vgic_vcpu_init(vcpu);
331 if (ret)
332 return ret;
333
334 /* Set up the timer */
335 kvm_timer_vcpu_init(vcpu);
336
337 return 0;
338}
339
340void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu)
341{
342}
343
344void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
345{
346 vcpu->cpu = cpu;
347 vcpu->arch.vfp_host = this_cpu_ptr(kvm_host_vfp_state);
348
349 /*
350 * Check whether this vcpu requires the cache to be flushed on
351 * this physical CPU. This is a consequence of doing dcache
352 * operations by set/way on this vcpu. We do it here to be in
353 * a non-preemptible section.
354 */
355 if (cpumask_test_and_clear_cpu(cpu, &vcpu->arch.require_dcache_flush))
356 flush_cache_all(); /* We'd really want v7_flush_dcache_all() */
357
358 kvm_arm_set_running_vcpu(vcpu);
359}
360
361void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
362{
363 kvm_arm_set_running_vcpu(NULL);
364}
365
366int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
367 struct kvm_guest_debug *dbg)
368{
369 return -EINVAL;
370}
371
372
373int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu,
374 struct kvm_mp_state *mp_state)
375{
376 return -EINVAL;
377}
378
379int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu,
380 struct kvm_mp_state *mp_state)
381{
382 return -EINVAL;
383}
384
385/**
386 * kvm_arch_vcpu_runnable - determine if the vcpu can be scheduled
387 * @v: The VCPU pointer
388 *
389 * If the guest CPU is not waiting for interrupts or an interrupt line is
390 * asserted, the CPU is by definition runnable.
391 */
392int kvm_arch_vcpu_runnable(struct kvm_vcpu *v)
393{
394 return !!v->arch.irq_lines || kvm_vgic_vcpu_pending_irq(v);
395}
396
397/* Just ensure a guest exit from a particular CPU */
398static void exit_vm_noop(void *info)
399{
400}
401
402void force_vm_exit(const cpumask_t *mask)
403{
404 smp_call_function_many(mask, exit_vm_noop, NULL, true);
405}
406
407/**
408 * need_new_vmid_gen - check that the VMID is still valid
409 * @kvm: The VM's VMID to checkt
410 *
411 * return true if there is a new generation of VMIDs being used
412 *
413 * The hardware supports only 256 values with the value zero reserved for the
414 * host, so we check if an assigned value belongs to a previous generation,
415 * which which requires us to assign a new value. If we're the first to use a
416 * VMID for the new generation, we must flush necessary caches and TLBs on all
417 * CPUs.
418 */
419static bool need_new_vmid_gen(struct kvm *kvm)
420{
421 return unlikely(kvm->arch.vmid_gen != atomic64_read(&kvm_vmid_gen));
422}
423
424/**
425 * update_vttbr - Update the VTTBR with a valid VMID before the guest runs
426 * @kvm The guest that we are about to run
427 *
428 * Called from kvm_arch_vcpu_ioctl_run before entering the guest to ensure the
429 * VM has a valid VMID, otherwise assigns a new one and flushes corresponding
430 * caches and TLBs.
431 */
432static void update_vttbr(struct kvm *kvm)
433{
434 phys_addr_t pgd_phys;
435 u64 vmid;
436
437 if (!need_new_vmid_gen(kvm))
438 return;
439
440 spin_lock(&kvm_vmid_lock);
441
442 /*
443 * We need to re-check the vmid_gen here to ensure that if another vcpu
444 * already allocated a valid vmid for this vm, then this vcpu should
445 * use the same vmid.
446 */
447 if (!need_new_vmid_gen(kvm)) {
448 spin_unlock(&kvm_vmid_lock);
449 return;
450 }
451
452 /* First user of a new VMID generation? */
453 if (unlikely(kvm_next_vmid == 0)) {
454 atomic64_inc(&kvm_vmid_gen);
455 kvm_next_vmid = 1;
456
457 /*
458 * On SMP we know no other CPUs can use this CPU's or each
459 * other's VMID after force_vm_exit returns since the
460 * kvm_vmid_lock blocks them from reentry to the guest.
461 */
462 force_vm_exit(cpu_all_mask);
463 /*
464 * Now broadcast TLB + ICACHE invalidation over the inner
465 * shareable domain to make sure all data structures are
466 * clean.
467 */
468 kvm_call_hyp(__kvm_flush_vm_context);
469 }
470
471 kvm->arch.vmid_gen = atomic64_read(&kvm_vmid_gen);
472 kvm->arch.vmid = kvm_next_vmid;
473 kvm_next_vmid++;
474
475 /* update vttbr to be used with the new vmid */
476 pgd_phys = virt_to_phys(kvm->arch.pgd);
477 vmid = ((u64)(kvm->arch.vmid) << VTTBR_VMID_SHIFT) & VTTBR_VMID_MASK;
478 kvm->arch.vttbr = pgd_phys & VTTBR_BADDR_MASK;
479 kvm->arch.vttbr |= vmid;
480
481 spin_unlock(&kvm_vmid_lock);
482}
483
484static int handle_svc_hyp(struct kvm_vcpu *vcpu, struct kvm_run *run)
485{
486 /* SVC called from Hyp mode should never get here */
487 kvm_debug("SVC called from Hyp mode shouldn't go here\n");
488 BUG();
489 return -EINVAL; /* Squash warning */
490}
491
492static int handle_hvc(struct kvm_vcpu *vcpu, struct kvm_run *run)
493{
494 trace_kvm_hvc(*vcpu_pc(vcpu), *vcpu_reg(vcpu, 0),
495 vcpu->arch.hsr & HSR_HVC_IMM_MASK);
496
497 if (kvm_psci_call(vcpu))
498 return 1;
499
500 kvm_inject_undefined(vcpu);
501 return 1;
502}
503
504static int handle_smc(struct kvm_vcpu *vcpu, struct kvm_run *run)
505{
506 if (kvm_psci_call(vcpu))
507 return 1;
508
509 kvm_inject_undefined(vcpu);
510 return 1;
511}
512
513static int handle_pabt_hyp(struct kvm_vcpu *vcpu, struct kvm_run *run)
514{
515 /* The hypervisor should never cause aborts */
516 kvm_err("Prefetch Abort taken from Hyp mode at %#08x (HSR: %#08x)\n",
517 vcpu->arch.hxfar, vcpu->arch.hsr);
518 return -EFAULT;
519}
520
521static int handle_dabt_hyp(struct kvm_vcpu *vcpu, struct kvm_run *run)
522{
523 /* This is either an error in the ws. code or an external abort */
524 kvm_err("Data Abort taken from Hyp mode at %#08x (HSR: %#08x)\n",
525 vcpu->arch.hxfar, vcpu->arch.hsr);
526 return -EFAULT;
527}
528
529typedef int (*exit_handle_fn)(struct kvm_vcpu *, struct kvm_run *);
530static exit_handle_fn arm_exit_handlers[] = {
531 [HSR_EC_WFI] = kvm_handle_wfi,
532 [HSR_EC_CP15_32] = kvm_handle_cp15_32,
533 [HSR_EC_CP15_64] = kvm_handle_cp15_64,
534 [HSR_EC_CP14_MR] = kvm_handle_cp14_access,
535 [HSR_EC_CP14_LS] = kvm_handle_cp14_load_store,
536 [HSR_EC_CP14_64] = kvm_handle_cp14_access,
537 [HSR_EC_CP_0_13] = kvm_handle_cp_0_13_access,
538 [HSR_EC_CP10_ID] = kvm_handle_cp10_id,
539 [HSR_EC_SVC_HYP] = handle_svc_hyp,
540 [HSR_EC_HVC] = handle_hvc,
541 [HSR_EC_SMC] = handle_smc,
542 [HSR_EC_IABT] = kvm_handle_guest_abort,
543 [HSR_EC_IABT_HYP] = handle_pabt_hyp,
544 [HSR_EC_DABT] = kvm_handle_guest_abort,
545 [HSR_EC_DABT_HYP] = handle_dabt_hyp,
546};
547
548/*
549 * A conditional instruction is allowed to trap, even though it
550 * wouldn't be executed. So let's re-implement the hardware, in
551 * software!
552 */
553static bool kvm_condition_valid(struct kvm_vcpu *vcpu)
554{
555 unsigned long cpsr, cond, insn;
556
557 /*
558 * Exception Code 0 can only happen if we set HCR.TGE to 1, to
559 * catch undefined instructions, and then we won't get past
560 * the arm_exit_handlers test anyway.
561 */
562 BUG_ON(((vcpu->arch.hsr & HSR_EC) >> HSR_EC_SHIFT) == 0);
563
564 /* Top two bits non-zero? Unconditional. */
565 if (vcpu->arch.hsr >> 30)
566 return true;
567
568 cpsr = *vcpu_cpsr(vcpu);
569
570 /* Is condition field valid? */
571 if ((vcpu->arch.hsr & HSR_CV) >> HSR_CV_SHIFT)
572 cond = (vcpu->arch.hsr & HSR_COND) >> HSR_COND_SHIFT;
573 else {
574 /* This can happen in Thumb mode: examine IT state. */
575 unsigned long it;
576
577 it = ((cpsr >> 8) & 0xFC) | ((cpsr >> 25) & 0x3);
578
579 /* it == 0 => unconditional. */
580 if (it == 0)
581 return true;
582
583 /* The cond for this insn works out as the top 4 bits. */
584 cond = (it >> 4);
585 }
586
587 /* Shift makes it look like an ARM-mode instruction */
588 insn = cond << 28;
589 return arm_check_condition(insn, cpsr) != ARM_OPCODE_CONDTEST_FAIL;
590}
591
592/*
593 * Return > 0 to return to guest, < 0 on error, 0 (and set exit_reason) on
594 * proper exit to QEMU.
595 */
596static int handle_exit(struct kvm_vcpu *vcpu, struct kvm_run *run,
597 int exception_index)
598{
599 unsigned long hsr_ec;
600
601 switch (exception_index) {
602 case ARM_EXCEPTION_IRQ:
603 return 1;
604 case ARM_EXCEPTION_UNDEFINED:
605 kvm_err("Undefined exception in Hyp mode at: %#08x\n",
606 vcpu->arch.hyp_pc);
607 BUG();
608 panic("KVM: Hypervisor undefined exception!\n");
609 case ARM_EXCEPTION_DATA_ABORT:
610 case ARM_EXCEPTION_PREF_ABORT:
611 case ARM_EXCEPTION_HVC:
612 hsr_ec = (vcpu->arch.hsr & HSR_EC) >> HSR_EC_SHIFT;
613
614 if (hsr_ec >= ARRAY_SIZE(arm_exit_handlers)
615 || !arm_exit_handlers[hsr_ec]) {
616 kvm_err("Unkown exception class: %#08lx, "
617 "hsr: %#08x\n", hsr_ec,
618 (unsigned int)vcpu->arch.hsr);
619 BUG();
620 }
621
622 /*
623 * See ARM ARM B1.14.1: "Hyp traps on instructions
624 * that fail their condition code check"
625 */
626 if (!kvm_condition_valid(vcpu)) {
627 bool is_wide = vcpu->arch.hsr & HSR_IL;
628 kvm_skip_instr(vcpu, is_wide);
629 return 1;
630 }
631
632 return arm_exit_handlers[hsr_ec](vcpu, run);
633 default:
634 kvm_pr_unimpl("Unsupported exception type: %d",
635 exception_index);
636 run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
637 return 0;
638 }
639}
640
641static int kvm_vcpu_first_run_init(struct kvm_vcpu *vcpu)
642{
643 if (likely(vcpu->arch.has_run_once))
644 return 0;
645
646 vcpu->arch.has_run_once = true;
647
648 /*
649 * Initialize the VGIC before running a vcpu the first time on
650 * this VM.
651 */
652 if (irqchip_in_kernel(vcpu->kvm) &&
653 unlikely(!vgic_initialized(vcpu->kvm))) {
654 int ret = kvm_vgic_init(vcpu->kvm);
655 if (ret)
656 return ret;
657 }
658
659 /*
660 * Handle the "start in power-off" case by calling into the
661 * PSCI code.
662 */
663 if (test_and_clear_bit(KVM_ARM_VCPU_POWER_OFF, vcpu->arch.features)) {
664 *vcpu_reg(vcpu, 0) = KVM_PSCI_FN_CPU_OFF;
665 kvm_psci_call(vcpu);
666 }
667
668 return 0;
669}
670
671static void vcpu_pause(struct kvm_vcpu *vcpu)
672{
673 wait_queue_head_t *wq = kvm_arch_vcpu_wq(vcpu);
674
675 wait_event_interruptible(*wq, !vcpu->arch.pause);
676}
677
678/**
679 * kvm_arch_vcpu_ioctl_run - the main VCPU run function to execute guest code
680 * @vcpu: The VCPU pointer
681 * @run: The kvm_run structure pointer used for userspace state exchange
682 *
683 * This function is called through the VCPU_RUN ioctl called from user space. It
684 * will execute VM code in a loop until the time slice for the process is used
685 * or some emulation is needed from user space in which case the function will
686 * return with return value 0 and with the kvm_run structure filled in with the
687 * required data for the requested emulation.
688 */
689int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
690{
691 int ret;
692 sigset_t sigsaved;
693
694 /* Make sure they initialize the vcpu with KVM_ARM_VCPU_INIT */
695 if (unlikely(vcpu->arch.target < 0))
696 return -ENOEXEC;
697
698 ret = kvm_vcpu_first_run_init(vcpu);
699 if (ret)
700 return ret;
701
702 if (run->exit_reason == KVM_EXIT_MMIO) {
703 ret = kvm_handle_mmio_return(vcpu, vcpu->run);
704 if (ret)
705 return ret;
706 }
707
708 if (vcpu->sigset_active)
709 sigprocmask(SIG_SETMASK, &vcpu->sigset, &sigsaved);
710
711 ret = 1;
712 run->exit_reason = KVM_EXIT_UNKNOWN;
713 while (ret > 0) {
714 /*
715 * Check conditions before entering the guest
716 */
717 cond_resched();
718
719 update_vttbr(vcpu->kvm);
720
721 if (vcpu->arch.pause)
722 vcpu_pause(vcpu);
723
724 kvm_vgic_flush_hwstate(vcpu);
725 kvm_timer_flush_hwstate(vcpu);
726
727 local_irq_disable();
728
729 /*
730 * Re-check atomic conditions
731 */
732 if (signal_pending(current)) {
733 ret = -EINTR;
734 run->exit_reason = KVM_EXIT_INTR;
735 }
736
737 if (ret <= 0 || need_new_vmid_gen(vcpu->kvm)) {
738 local_irq_enable();
739 kvm_timer_sync_hwstate(vcpu);
740 kvm_vgic_sync_hwstate(vcpu);
741 continue;
742 }
743
744 /**************************************************************
745 * Enter the guest
746 */
747 trace_kvm_entry(*vcpu_pc(vcpu));
748 kvm_guest_enter();
749 vcpu->mode = IN_GUEST_MODE;
750
751 ret = kvm_call_hyp(__kvm_vcpu_run, vcpu);
752
753 vcpu->mode = OUTSIDE_GUEST_MODE;
754 vcpu->arch.last_pcpu = smp_processor_id();
755 kvm_guest_exit();
756 trace_kvm_exit(*vcpu_pc(vcpu));
757 /*
758 * We may have taken a host interrupt in HYP mode (ie
759 * while executing the guest). This interrupt is still
760 * pending, as we haven't serviced it yet!
761 *
762 * We're now back in SVC mode, with interrupts
763 * disabled. Enabling the interrupts now will have
764 * the effect of taking the interrupt again, in SVC
765 * mode this time.
766 */
767 local_irq_enable();
768
769 /*
770 * Back from guest
771 *************************************************************/
772
773 kvm_timer_sync_hwstate(vcpu);
774 kvm_vgic_sync_hwstate(vcpu);
775
776 ret = handle_exit(vcpu, run, ret);
777 }
778
779 if (vcpu->sigset_active)
780 sigprocmask(SIG_SETMASK, &sigsaved, NULL);
781 return ret;
782}
783
784static int vcpu_interrupt_line(struct kvm_vcpu *vcpu, int number, bool level)
785{
786 int bit_index;
787 bool set;
788 unsigned long *ptr;
789
790 if (number == KVM_ARM_IRQ_CPU_IRQ)
791 bit_index = __ffs(HCR_VI);
792 else /* KVM_ARM_IRQ_CPU_FIQ */
793 bit_index = __ffs(HCR_VF);
794
795 ptr = (unsigned long *)&vcpu->arch.irq_lines;
796 if (level)
797 set = test_and_set_bit(bit_index, ptr);
798 else
799 set = test_and_clear_bit(bit_index, ptr);
800
801 /*
802 * If we didn't change anything, no need to wake up or kick other CPUs
803 */
804 if (set == level)
805 return 0;
806
807 /*
808 * The vcpu irq_lines field was updated, wake up sleeping VCPUs and
809 * trigger a world-switch round on the running physical CPU to set the
810 * virtual IRQ/FIQ fields in the HCR appropriately.
811 */
812 kvm_vcpu_kick(vcpu);
813
814 return 0;
815}
816
817int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level)
818{
819 u32 irq = irq_level->irq;
820 unsigned int irq_type, vcpu_idx, irq_num;
821 int nrcpus = atomic_read(&kvm->online_vcpus);
822 struct kvm_vcpu *vcpu = NULL;
823 bool level = irq_level->level;
824
825 irq_type = (irq >> KVM_ARM_IRQ_TYPE_SHIFT) & KVM_ARM_IRQ_TYPE_MASK;
826 vcpu_idx = (irq >> KVM_ARM_IRQ_VCPU_SHIFT) & KVM_ARM_IRQ_VCPU_MASK;
827 irq_num = (irq >> KVM_ARM_IRQ_NUM_SHIFT) & KVM_ARM_IRQ_NUM_MASK;
828
829 trace_kvm_irq_line(irq_type, vcpu_idx, irq_num, irq_level->level);
830
831 switch (irq_type) {
832 case KVM_ARM_IRQ_TYPE_CPU:
833 if (irqchip_in_kernel(kvm))
834 return -ENXIO;
835
836 if (vcpu_idx >= nrcpus)
837 return -EINVAL;
838
839 vcpu = kvm_get_vcpu(kvm, vcpu_idx);
840 if (!vcpu)
841 return -EINVAL;
842
843 if (irq_num > KVM_ARM_IRQ_CPU_FIQ)
844 return -EINVAL;
845
846 return vcpu_interrupt_line(vcpu, irq_num, level);
847 case KVM_ARM_IRQ_TYPE_PPI:
848 if (!irqchip_in_kernel(kvm))
849 return -ENXIO;
850
851 if (vcpu_idx >= nrcpus)
852 return -EINVAL;
853
854 vcpu = kvm_get_vcpu(kvm, vcpu_idx);
855 if (!vcpu)
856 return -EINVAL;
857
858 if (irq_num < VGIC_NR_SGIS || irq_num >= VGIC_NR_PRIVATE_IRQS)
859 return -EINVAL;
860
861 return kvm_vgic_inject_irq(kvm, vcpu->vcpu_id, irq_num, level);
862 case KVM_ARM_IRQ_TYPE_SPI:
863 if (!irqchip_in_kernel(kvm))
864 return -ENXIO;
865
866 if (irq_num < VGIC_NR_PRIVATE_IRQS ||
867 irq_num > KVM_ARM_IRQ_GIC_MAX)
868 return -EINVAL;
869
870 return kvm_vgic_inject_irq(kvm, 0, irq_num, level);
871 }
872
873 return -EINVAL;
874}
875
876long kvm_arch_vcpu_ioctl(struct file *filp,
877 unsigned int ioctl, unsigned long arg)
878{
879 struct kvm_vcpu *vcpu = filp->private_data;
880 void __user *argp = (void __user *)arg;
881
882 switch (ioctl) {
883 case KVM_ARM_VCPU_INIT: {
884 struct kvm_vcpu_init init;
885
886 if (copy_from_user(&init, argp, sizeof(init)))
887 return -EFAULT;
888
889 return kvm_vcpu_set_target(vcpu, &init);
890
891 }
892 case KVM_SET_ONE_REG:
893 case KVM_GET_ONE_REG: {
894 struct kvm_one_reg reg;
895 if (copy_from_user(&reg, argp, sizeof(reg)))
896 return -EFAULT;
897 if (ioctl == KVM_SET_ONE_REG)
898 return kvm_arm_set_reg(vcpu, &reg);
899 else
900 return kvm_arm_get_reg(vcpu, &reg);
901 }
902 case KVM_GET_REG_LIST: {
903 struct kvm_reg_list __user *user_list = argp;
904 struct kvm_reg_list reg_list;
905 unsigned n;
906
907 if (copy_from_user(&reg_list, user_list, sizeof(reg_list)))
908 return -EFAULT;
909 n = reg_list.n;
910 reg_list.n = kvm_arm_num_regs(vcpu);
911 if (copy_to_user(user_list, &reg_list, sizeof(reg_list)))
912 return -EFAULT;
913 if (n < reg_list.n)
914 return -E2BIG;
915 return kvm_arm_copy_reg_indices(vcpu, user_list->reg);
916 }
917 default:
918 return -EINVAL;
919 }
920}
921
922int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, struct kvm_dirty_log *log)
923{
924 return -EINVAL;
925}
926
927static int kvm_vm_ioctl_set_device_addr(struct kvm *kvm,
928 struct kvm_arm_device_addr *dev_addr)
929{
930 unsigned long dev_id, type;
931
932 dev_id = (dev_addr->id & KVM_ARM_DEVICE_ID_MASK) >>
933 KVM_ARM_DEVICE_ID_SHIFT;
934 type = (dev_addr->id & KVM_ARM_DEVICE_TYPE_MASK) >>
935 KVM_ARM_DEVICE_TYPE_SHIFT;
936
937 switch (dev_id) {
938 case KVM_ARM_DEVICE_VGIC_V2:
939 if (!vgic_present)
940 return -ENXIO;
941 return kvm_vgic_set_addr(kvm, type, dev_addr->addr);
942 default:
943 return -ENODEV;
944 }
945}
946
947long kvm_arch_vm_ioctl(struct file *filp,
948 unsigned int ioctl, unsigned long arg)
949{
950 struct kvm *kvm = filp->private_data;
951 void __user *argp = (void __user *)arg;
952
953 switch (ioctl) {
954 case KVM_CREATE_IRQCHIP: {
955 if (vgic_present)
956 return kvm_vgic_create(kvm);
957 else
958 return -ENXIO;
959 }
960 case KVM_ARM_SET_DEVICE_ADDR: {
961 struct kvm_arm_device_addr dev_addr;
962
963 if (copy_from_user(&dev_addr, argp, sizeof(dev_addr)))
964 return -EFAULT;
965 return kvm_vm_ioctl_set_device_addr(kvm, &dev_addr);
966 }
967 default:
968 return -EINVAL;
969 }
970}
971
972static void cpu_init_hyp_mode(void *vector)
973{
974 unsigned long long pgd_ptr;
975 unsigned long pgd_low, pgd_high;
976 unsigned long hyp_stack_ptr;
977 unsigned long stack_page;
978 unsigned long vector_ptr;
979
980 /* Switch from the HYP stub to our own HYP init vector */
981 __hyp_set_vectors((unsigned long)vector);
982
983 pgd_ptr = (unsigned long long)kvm_mmu_get_httbr();
984 pgd_low = (pgd_ptr & ((1ULL << 32) - 1));
985 pgd_high = (pgd_ptr >> 32ULL);
986 stack_page = __get_cpu_var(kvm_arm_hyp_stack_page);
987 hyp_stack_ptr = stack_page + PAGE_SIZE;
988 vector_ptr = (unsigned long)__kvm_hyp_vector;
989
990 /*
991 * Call initialization code, and switch to the full blown
992 * HYP code. The init code doesn't need to preserve these registers as
993 * r1-r3 and r12 are already callee save according to the AAPCS.
994 * Note that we slightly misuse the prototype by casing the pgd_low to
995 * a void *.
996 */
997 kvm_call_hyp((void *)pgd_low, pgd_high, hyp_stack_ptr, vector_ptr);
998}
999
1000/**
1001 * Inits Hyp-mode on all online CPUs
1002 */
1003static int init_hyp_mode(void)
1004{
1005 phys_addr_t init_phys_addr;
1006 int cpu;
1007 int err = 0;
1008
1009 /*
1010 * Allocate Hyp PGD and setup Hyp identity mapping
1011 */
1012 err = kvm_mmu_init();
1013 if (err)
1014 goto out_err;
1015
1016 /*
1017 * It is probably enough to obtain the default on one
1018 * CPU. It's unlikely to be different on the others.
1019 */
1020 hyp_default_vectors = __hyp_get_vectors();
1021
1022 /*
1023 * Allocate stack pages for Hypervisor-mode
1024 */
1025 for_each_possible_cpu(cpu) {
1026 unsigned long stack_page;
1027
1028 stack_page = __get_free_page(GFP_KERNEL);
1029 if (!stack_page) {
1030 err = -ENOMEM;
1031 goto out_free_stack_pages;
1032 }
1033
1034 per_cpu(kvm_arm_hyp_stack_page, cpu) = stack_page;
1035 }
1036
1037 /*
1038 * Execute the init code on each CPU.
1039 *
1040 * Note: The stack is not mapped yet, so don't do anything else than
1041 * initializing the hypervisor mode on each CPU using a local stack
1042 * space for temporary storage.
1043 */
1044 init_phys_addr = virt_to_phys(__kvm_hyp_init);
1045 for_each_online_cpu(cpu) {
1046 smp_call_function_single(cpu, cpu_init_hyp_mode,
1047 (void *)(long)init_phys_addr, 1);
1048 }
1049
1050 /*
1051 * Unmap the identity mapping
1052 */
1053 kvm_clear_hyp_idmap();
1054
1055 /*
1056 * Map the Hyp-code called directly from the host
1057 */
1058 err = create_hyp_mappings(__kvm_hyp_code_start, __kvm_hyp_code_end);
1059 if (err) {
1060 kvm_err("Cannot map world-switch code\n");
1061 goto out_free_mappings;
1062 }
1063
1064 /*
1065 * Map the Hyp stack pages
1066 */
1067 for_each_possible_cpu(cpu) {
1068 char *stack_page = (char *)per_cpu(kvm_arm_hyp_stack_page, cpu);
1069 err = create_hyp_mappings(stack_page, stack_page + PAGE_SIZE);
1070
1071 if (err) {
1072 kvm_err("Cannot map hyp stack\n");
1073 goto out_free_mappings;
1074 }
1075 }
1076
1077 /*
1078 * Map the host VFP structures
1079 */
1080 kvm_host_vfp_state = alloc_percpu(struct vfp_hard_struct);
1081 if (!kvm_host_vfp_state) {
1082 err = -ENOMEM;
1083 kvm_err("Cannot allocate host VFP state\n");
1084 goto out_free_mappings;
1085 }
1086
1087 for_each_possible_cpu(cpu) {
1088 struct vfp_hard_struct *vfp;
1089
1090 vfp = per_cpu_ptr(kvm_host_vfp_state, cpu);
1091 err = create_hyp_mappings(vfp, vfp + 1);
1092
1093 if (err) {
1094 kvm_err("Cannot map host VFP state: %d\n", err);
1095 goto out_free_vfp;
1096 }
1097 }
1098
1099 /*
1100 * Init HYP view of VGIC
1101 */
1102 err = kvm_vgic_hyp_init();
1103 if (err)
1104 goto out_free_vfp;
1105
1106#ifdef CONFIG_KVM_ARM_VGIC
1107 vgic_present = true;
1108#endif
1109
1110 /*
1111 * Init HYP architected timer support
1112 */
1113 err = kvm_timer_hyp_init();
1114 if (err)
1115 goto out_free_mappings;
1116
1117 kvm_info("Hyp mode initialized successfully\n");
1118 return 0;
1119out_free_vfp:
1120 free_percpu(kvm_host_vfp_state);
1121out_free_mappings:
1122 free_hyp_pmds();
1123out_free_stack_pages:
1124 for_each_possible_cpu(cpu)
1125 free_page(per_cpu(kvm_arm_hyp_stack_page, cpu));
1126out_err:
1127 kvm_err("error initializing Hyp mode: %d\n", err);
1128 return err;
1129}
1130
1131/**
1132 * Initialize Hyp-mode and memory mappings on all CPUs.
1133 */
1134int kvm_arch_init(void *opaque)
1135{
1136 int err;
1137
1138 if (!is_hyp_mode_available()) {
1139 kvm_err("HYP mode not available\n");
1140 return -ENODEV;
1141 }
1142
1143 if (kvm_target_cpu() < 0) {
1144 kvm_err("Target CPU not supported!\n");
1145 return -ENODEV;
1146 }
1147
1148 err = init_hyp_mode();
1149 if (err)
1150 goto out_err;
1151
1152 kvm_coproc_table_init();
1153 return 0;
1154out_err:
1155 return err;
1156}
1157
1158/* NOP: Compiling as a module not supported */
1159void kvm_arch_exit(void)
1160{
1161}
1162
1163static int arm_init(void)
1164{
1165 int rc = kvm_init(NULL, sizeof(struct kvm_vcpu), 0, THIS_MODULE);
1166 return rc;
1167}
1168
1169module_init(arm_init);
diff --git a/arch/arm/kvm/coproc.c b/arch/arm/kvm/coproc.c
new file mode 100644
index 000000000000..4ea9a982269c
--- /dev/null
+++ b/arch/arm/kvm/coproc.c
@@ -0,0 +1,1050 @@
1/*
2 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
3 * Authors: Rusty Russell <rusty@rustcorp.com.au>
4 * Christoffer Dall <c.dall@virtualopensystems.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 * 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19#include <linux/mm.h>
20#include <linux/kvm_host.h>
21#include <linux/uaccess.h>
22#include <asm/kvm_arm.h>
23#include <asm/kvm_host.h>
24#include <asm/kvm_emulate.h>
25#include <asm/kvm_coproc.h>
26#include <asm/cacheflush.h>
27#include <asm/cputype.h>
28#include <trace/events/kvm.h>
29#include <asm/vfp.h>
30#include "../vfp/vfpinstr.h"
31
32#include "trace.h"
33#include "coproc.h"
34
35
36/******************************************************************************
37 * Co-processor emulation
38 *****************************************************************************/
39
40/* 3 bits per cache level, as per CLIDR, but non-existent caches always 0 */
41static u32 cache_levels;
42
43/* CSSELR values; used to index KVM_REG_ARM_DEMUX_ID_CCSIDR */
44#define CSSELR_MAX 12
45
46int kvm_handle_cp10_id(struct kvm_vcpu *vcpu, struct kvm_run *run)
47{
48 kvm_inject_undefined(vcpu);
49 return 1;
50}
51
52int kvm_handle_cp_0_13_access(struct kvm_vcpu *vcpu, struct kvm_run *run)
53{
54 /*
55 * We can get here, if the host has been built without VFPv3 support,
56 * but the guest attempted a floating point operation.
57 */
58 kvm_inject_undefined(vcpu);
59 return 1;
60}
61
62int kvm_handle_cp14_load_store(struct kvm_vcpu *vcpu, struct kvm_run *run)
63{
64 kvm_inject_undefined(vcpu);
65 return 1;
66}
67
68int kvm_handle_cp14_access(struct kvm_vcpu *vcpu, struct kvm_run *run)
69{
70 kvm_inject_undefined(vcpu);
71 return 1;
72}
73
74/* See note at ARM ARM B1.14.4 */
75static bool access_dcsw(struct kvm_vcpu *vcpu,
76 const struct coproc_params *p,
77 const struct coproc_reg *r)
78{
79 u32 val;
80 int cpu;
81
82 cpu = get_cpu();
83
84 if (!p->is_write)
85 return read_from_write_only(vcpu, p);
86
87 cpumask_setall(&vcpu->arch.require_dcache_flush);
88 cpumask_clear_cpu(cpu, &vcpu->arch.require_dcache_flush);
89
90 /* If we were already preempted, take the long way around */
91 if (cpu != vcpu->arch.last_pcpu) {
92 flush_cache_all();
93 goto done;
94 }
95
96 val = *vcpu_reg(vcpu, p->Rt1);
97
98 switch (p->CRm) {
99 case 6: /* Upgrade DCISW to DCCISW, as per HCR.SWIO */
100 case 14: /* DCCISW */
101 asm volatile("mcr p15, 0, %0, c7, c14, 2" : : "r" (val));
102 break;
103
104 case 10: /* DCCSW */
105 asm volatile("mcr p15, 0, %0, c7, c10, 2" : : "r" (val));
106 break;
107 }
108
109done:
110 put_cpu();
111
112 return true;
113}
114
115/*
116 * We could trap ID_DFR0 and tell the guest we don't support performance
117 * monitoring. Unfortunately the patch to make the kernel check ID_DFR0 was
118 * NAKed, so it will read the PMCR anyway.
119 *
120 * Therefore we tell the guest we have 0 counters. Unfortunately, we
121 * must always support PMCCNTR (the cycle counter): we just RAZ/WI for
122 * all PM registers, which doesn't crash the guest kernel at least.
123 */
124static bool pm_fake(struct kvm_vcpu *vcpu,
125 const struct coproc_params *p,
126 const struct coproc_reg *r)
127{
128 if (p->is_write)
129 return ignore_write(vcpu, p);
130 else
131 return read_zero(vcpu, p);
132}
133
134#define access_pmcr pm_fake
135#define access_pmcntenset pm_fake
136#define access_pmcntenclr pm_fake
137#define access_pmovsr pm_fake
138#define access_pmselr pm_fake
139#define access_pmceid0 pm_fake
140#define access_pmceid1 pm_fake
141#define access_pmccntr pm_fake
142#define access_pmxevtyper pm_fake
143#define access_pmxevcntr pm_fake
144#define access_pmuserenr pm_fake
145#define access_pmintenset pm_fake
146#define access_pmintenclr pm_fake
147
148/* Architected CP15 registers.
149 * Important: Must be sorted ascending by CRn, CRM, Op1, Op2
150 */
151static const struct coproc_reg cp15_regs[] = {
152 /* CSSELR: swapped by interrupt.S. */
153 { CRn( 0), CRm( 0), Op1( 2), Op2( 0), is32,
154 NULL, reset_unknown, c0_CSSELR },
155
156 /* TTBR0/TTBR1: swapped by interrupt.S. */
157 { CRm( 2), Op1( 0), is64, NULL, reset_unknown64, c2_TTBR0 },
158 { CRm( 2), Op1( 1), is64, NULL, reset_unknown64, c2_TTBR1 },
159
160 /* TTBCR: swapped by interrupt.S. */
161 { CRn( 2), CRm( 0), Op1( 0), Op2( 2), is32,
162 NULL, reset_val, c2_TTBCR, 0x00000000 },
163
164 /* DACR: swapped by interrupt.S. */
165 { CRn( 3), CRm( 0), Op1( 0), Op2( 0), is32,
166 NULL, reset_unknown, c3_DACR },
167
168 /* DFSR/IFSR/ADFSR/AIFSR: swapped by interrupt.S. */
169 { CRn( 5), CRm( 0), Op1( 0), Op2( 0), is32,
170 NULL, reset_unknown, c5_DFSR },
171 { CRn( 5), CRm( 0), Op1( 0), Op2( 1), is32,
172 NULL, reset_unknown, c5_IFSR },
173 { CRn( 5), CRm( 1), Op1( 0), Op2( 0), is32,
174 NULL, reset_unknown, c5_ADFSR },
175 { CRn( 5), CRm( 1), Op1( 0), Op2( 1), is32,
176 NULL, reset_unknown, c5_AIFSR },
177
178 /* DFAR/IFAR: swapped by interrupt.S. */
179 { CRn( 6), CRm( 0), Op1( 0), Op2( 0), is32,
180 NULL, reset_unknown, c6_DFAR },
181 { CRn( 6), CRm( 0), Op1( 0), Op2( 2), is32,
182 NULL, reset_unknown, c6_IFAR },
183 /*
184 * DC{C,I,CI}SW operations:
185 */
186 { CRn( 7), CRm( 6), Op1( 0), Op2( 2), is32, access_dcsw},
187 { CRn( 7), CRm(10), Op1( 0), Op2( 2), is32, access_dcsw},
188 { CRn( 7), CRm(14), Op1( 0), Op2( 2), is32, access_dcsw},
189 /*
190 * Dummy performance monitor implementation.
191 */
192 { CRn( 9), CRm(12), Op1( 0), Op2( 0), is32, access_pmcr},
193 { CRn( 9), CRm(12), Op1( 0), Op2( 1), is32, access_pmcntenset},
194 { CRn( 9), CRm(12), Op1( 0), Op2( 2), is32, access_pmcntenclr},
195 { CRn( 9), CRm(12), Op1( 0), Op2( 3), is32, access_pmovsr},
196 { CRn( 9), CRm(12), Op1( 0), Op2( 5), is32, access_pmselr},
197 { CRn( 9), CRm(12), Op1( 0), Op2( 6), is32, access_pmceid0},
198 { CRn( 9), CRm(12), Op1( 0), Op2( 7), is32, access_pmceid1},
199 { CRn( 9), CRm(13), Op1( 0), Op2( 0), is32, access_pmccntr},
200 { CRn( 9), CRm(13), Op1( 0), Op2( 1), is32, access_pmxevtyper},
201 { CRn( 9), CRm(13), Op1( 0), Op2( 2), is32, access_pmxevcntr},
202 { CRn( 9), CRm(14), Op1( 0), Op2( 0), is32, access_pmuserenr},
203 { CRn( 9), CRm(14), Op1( 0), Op2( 1), is32, access_pmintenset},
204 { CRn( 9), CRm(14), Op1( 0), Op2( 2), is32, access_pmintenclr},
205
206 /* PRRR/NMRR (aka MAIR0/MAIR1): swapped by interrupt.S. */
207 { CRn(10), CRm( 2), Op1( 0), Op2( 0), is32,
208 NULL, reset_unknown, c10_PRRR},
209 { CRn(10), CRm( 2), Op1( 0), Op2( 1), is32,
210 NULL, reset_unknown, c10_NMRR},
211
212 /* VBAR: swapped by interrupt.S. */
213 { CRn(12), CRm( 0), Op1( 0), Op2( 0), is32,
214 NULL, reset_val, c12_VBAR, 0x00000000 },
215
216 /* CONTEXTIDR/TPIDRURW/TPIDRURO/TPIDRPRW: swapped by interrupt.S. */
217 { CRn(13), CRm( 0), Op1( 0), Op2( 1), is32,
218 NULL, reset_val, c13_CID, 0x00000000 },
219 { CRn(13), CRm( 0), Op1( 0), Op2( 2), is32,
220 NULL, reset_unknown, c13_TID_URW },
221 { CRn(13), CRm( 0), Op1( 0), Op2( 3), is32,
222 NULL, reset_unknown, c13_TID_URO },
223 { CRn(13), CRm( 0), Op1( 0), Op2( 4), is32,
224 NULL, reset_unknown, c13_TID_PRIV },
225
226 /* CNTKCTL: swapped by interrupt.S. */
227 { CRn(14), CRm( 1), Op1( 0), Op2( 0), is32,
228 NULL, reset_val, c14_CNTKCTL, 0x00000000 },
229};
230
231/* Target specific emulation tables */
232static struct kvm_coproc_target_table *target_tables[KVM_ARM_NUM_TARGETS];
233
234void kvm_register_target_coproc_table(struct kvm_coproc_target_table *table)
235{
236 target_tables[table->target] = table;
237}
238
239/* Get specific register table for this target. */
240static const struct coproc_reg *get_target_table(unsigned target, size_t *num)
241{
242 struct kvm_coproc_target_table *table;
243
244 table = target_tables[target];
245 *num = table->num;
246 return table->table;
247}
248
249static const struct coproc_reg *find_reg(const struct coproc_params *params,
250 const struct coproc_reg table[],
251 unsigned int num)
252{
253 unsigned int i;
254
255 for (i = 0; i < num; i++) {
256 const struct coproc_reg *r = &table[i];
257
258 if (params->is_64bit != r->is_64)
259 continue;
260 if (params->CRn != r->CRn)
261 continue;
262 if (params->CRm != r->CRm)
263 continue;
264 if (params->Op1 != r->Op1)
265 continue;
266 if (params->Op2 != r->Op2)
267 continue;
268
269 return r;
270 }
271 return NULL;
272}
273
274static int emulate_cp15(struct kvm_vcpu *vcpu,
275 const struct coproc_params *params)
276{
277 size_t num;
278 const struct coproc_reg *table, *r;
279
280 trace_kvm_emulate_cp15_imp(params->Op1, params->Rt1, params->CRn,
281 params->CRm, params->Op2, params->is_write);
282
283 table = get_target_table(vcpu->arch.target, &num);
284
285 /* Search target-specific then generic table. */
286 r = find_reg(params, table, num);
287 if (!r)
288 r = find_reg(params, cp15_regs, ARRAY_SIZE(cp15_regs));
289
290 if (likely(r)) {
291 /* If we don't have an accessor, we should never get here! */
292 BUG_ON(!r->access);
293
294 if (likely(r->access(vcpu, params, r))) {
295 /* Skip instruction, since it was emulated */
296 kvm_skip_instr(vcpu, (vcpu->arch.hsr >> 25) & 1);
297 return 1;
298 }
299 /* If access function fails, it should complain. */
300 } else {
301 kvm_err("Unsupported guest CP15 access at: %08x\n",
302 *vcpu_pc(vcpu));
303 print_cp_instr(params);
304 }
305 kvm_inject_undefined(vcpu);
306 return 1;
307}
308
309/**
310 * kvm_handle_cp15_64 -- handles a mrrc/mcrr trap on a guest CP15 access
311 * @vcpu: The VCPU pointer
312 * @run: The kvm_run struct
313 */
314int kvm_handle_cp15_64(struct kvm_vcpu *vcpu, struct kvm_run *run)
315{
316 struct coproc_params params;
317
318 params.CRm = (vcpu->arch.hsr >> 1) & 0xf;
319 params.Rt1 = (vcpu->arch.hsr >> 5) & 0xf;
320 params.is_write = ((vcpu->arch.hsr & 1) == 0);
321 params.is_64bit = true;
322
323 params.Op1 = (vcpu->arch.hsr >> 16) & 0xf;
324 params.Op2 = 0;
325 params.Rt2 = (vcpu->arch.hsr >> 10) & 0xf;
326 params.CRn = 0;
327
328 return emulate_cp15(vcpu, &params);
329}
330
331static void reset_coproc_regs(struct kvm_vcpu *vcpu,
332 const struct coproc_reg *table, size_t num)
333{
334 unsigned long i;
335
336 for (i = 0; i < num; i++)
337 if (table[i].reset)
338 table[i].reset(vcpu, &table[i]);
339}
340
341/**
342 * kvm_handle_cp15_32 -- handles a mrc/mcr trap on a guest CP15 access
343 * @vcpu: The VCPU pointer
344 * @run: The kvm_run struct
345 */
346int kvm_handle_cp15_32(struct kvm_vcpu *vcpu, struct kvm_run *run)
347{
348 struct coproc_params params;
349
350 params.CRm = (vcpu->arch.hsr >> 1) & 0xf;
351 params.Rt1 = (vcpu->arch.hsr >> 5) & 0xf;
352 params.is_write = ((vcpu->arch.hsr & 1) == 0);
353 params.is_64bit = false;
354
355 params.CRn = (vcpu->arch.hsr >> 10) & 0xf;
356 params.Op1 = (vcpu->arch.hsr >> 14) & 0x7;
357 params.Op2 = (vcpu->arch.hsr >> 17) & 0x7;
358 params.Rt2 = 0;
359
360 return emulate_cp15(vcpu, &params);
361}
362
363/******************************************************************************
364 * Userspace API
365 *****************************************************************************/
366
367static bool index_to_params(u64 id, struct coproc_params *params)
368{
369 switch (id & KVM_REG_SIZE_MASK) {
370 case KVM_REG_SIZE_U32:
371 /* Any unused index bits means it's not valid. */
372 if (id & ~(KVM_REG_ARCH_MASK | KVM_REG_SIZE_MASK
373 | KVM_REG_ARM_COPROC_MASK
374 | KVM_REG_ARM_32_CRN_MASK
375 | KVM_REG_ARM_CRM_MASK
376 | KVM_REG_ARM_OPC1_MASK
377 | KVM_REG_ARM_32_OPC2_MASK))
378 return false;
379
380 params->is_64bit = false;
381 params->CRn = ((id & KVM_REG_ARM_32_CRN_MASK)
382 >> KVM_REG_ARM_32_CRN_SHIFT);
383 params->CRm = ((id & KVM_REG_ARM_CRM_MASK)
384 >> KVM_REG_ARM_CRM_SHIFT);
385 params->Op1 = ((id & KVM_REG_ARM_OPC1_MASK)
386 >> KVM_REG_ARM_OPC1_SHIFT);
387 params->Op2 = ((id & KVM_REG_ARM_32_OPC2_MASK)
388 >> KVM_REG_ARM_32_OPC2_SHIFT);
389 return true;
390 case KVM_REG_SIZE_U64:
391 /* Any unused index bits means it's not valid. */
392 if (id & ~(KVM_REG_ARCH_MASK | KVM_REG_SIZE_MASK
393 | KVM_REG_ARM_COPROC_MASK
394 | KVM_REG_ARM_CRM_MASK
395 | KVM_REG_ARM_OPC1_MASK))
396 return false;
397 params->is_64bit = true;
398 params->CRm = ((id & KVM_REG_ARM_CRM_MASK)
399 >> KVM_REG_ARM_CRM_SHIFT);
400 params->Op1 = ((id & KVM_REG_ARM_OPC1_MASK)
401 >> KVM_REG_ARM_OPC1_SHIFT);
402 params->Op2 = 0;
403 params->CRn = 0;
404 return true;
405 default:
406 return false;
407 }
408}
409
410/* Decode an index value, and find the cp15 coproc_reg entry. */
411static const struct coproc_reg *index_to_coproc_reg(struct kvm_vcpu *vcpu,
412 u64 id)
413{
414 size_t num;
415 const struct coproc_reg *table, *r;
416 struct coproc_params params;
417
418 /* We only do cp15 for now. */
419 if ((id & KVM_REG_ARM_COPROC_MASK) >> KVM_REG_ARM_COPROC_SHIFT != 15)
420 return NULL;
421
422 if (!index_to_params(id, &params))
423 return NULL;
424
425 table = get_target_table(vcpu->arch.target, &num);
426 r = find_reg(&params, table, num);
427 if (!r)
428 r = find_reg(&params, cp15_regs, ARRAY_SIZE(cp15_regs));
429
430 /* Not saved in the cp15 array? */
431 if (r && !r->reg)
432 r = NULL;
433
434 return r;
435}
436
437/*
438 * These are the invariant cp15 registers: we let the guest see the host
439 * versions of these, so they're part of the guest state.
440 *
441 * A future CPU may provide a mechanism to present different values to
442 * the guest, or a future kvm may trap them.
443 */
444/* Unfortunately, there's no register-argument for mrc, so generate. */
445#define FUNCTION_FOR32(crn, crm, op1, op2, name) \
446 static void get_##name(struct kvm_vcpu *v, \
447 const struct coproc_reg *r) \
448 { \
449 u32 val; \
450 \
451 asm volatile("mrc p15, " __stringify(op1) \
452 ", %0, c" __stringify(crn) \
453 ", c" __stringify(crm) \
454 ", " __stringify(op2) "\n" : "=r" (val)); \
455 ((struct coproc_reg *)r)->val = val; \
456 }
457
458FUNCTION_FOR32(0, 0, 0, 0, MIDR)
459FUNCTION_FOR32(0, 0, 0, 1, CTR)
460FUNCTION_FOR32(0, 0, 0, 2, TCMTR)
461FUNCTION_FOR32(0, 0, 0, 3, TLBTR)
462FUNCTION_FOR32(0, 0, 0, 6, REVIDR)
463FUNCTION_FOR32(0, 1, 0, 0, ID_PFR0)
464FUNCTION_FOR32(0, 1, 0, 1, ID_PFR1)
465FUNCTION_FOR32(0, 1, 0, 2, ID_DFR0)
466FUNCTION_FOR32(0, 1, 0, 3, ID_AFR0)
467FUNCTION_FOR32(0, 1, 0, 4, ID_MMFR0)
468FUNCTION_FOR32(0, 1, 0, 5, ID_MMFR1)
469FUNCTION_FOR32(0, 1, 0, 6, ID_MMFR2)
470FUNCTION_FOR32(0, 1, 0, 7, ID_MMFR3)
471FUNCTION_FOR32(0, 2, 0, 0, ID_ISAR0)
472FUNCTION_FOR32(0, 2, 0, 1, ID_ISAR1)
473FUNCTION_FOR32(0, 2, 0, 2, ID_ISAR2)
474FUNCTION_FOR32(0, 2, 0, 3, ID_ISAR3)
475FUNCTION_FOR32(0, 2, 0, 4, ID_ISAR4)
476FUNCTION_FOR32(0, 2, 0, 5, ID_ISAR5)
477FUNCTION_FOR32(0, 0, 1, 1, CLIDR)
478FUNCTION_FOR32(0, 0, 1, 7, AIDR)
479
480/* ->val is filled in by kvm_invariant_coproc_table_init() */
481static struct coproc_reg invariant_cp15[] = {
482 { CRn( 0), CRm( 0), Op1( 0), Op2( 0), is32, NULL, get_MIDR },
483 { CRn( 0), CRm( 0), Op1( 0), Op2( 1), is32, NULL, get_CTR },
484 { CRn( 0), CRm( 0), Op1( 0), Op2( 2), is32, NULL, get_TCMTR },
485 { CRn( 0), CRm( 0), Op1( 0), Op2( 3), is32, NULL, get_TLBTR },
486 { CRn( 0), CRm( 0), Op1( 0), Op2( 6), is32, NULL, get_REVIDR },
487
488 { CRn( 0), CRm( 1), Op1( 0), Op2( 0), is32, NULL, get_ID_PFR0 },
489 { CRn( 0), CRm( 1), Op1( 0), Op2( 1), is32, NULL, get_ID_PFR1 },
490 { CRn( 0), CRm( 1), Op1( 0), Op2( 2), is32, NULL, get_ID_DFR0 },
491 { CRn( 0), CRm( 1), Op1( 0), Op2( 3), is32, NULL, get_ID_AFR0 },
492 { CRn( 0), CRm( 1), Op1( 0), Op2( 4), is32, NULL, get_ID_MMFR0 },
493 { CRn( 0), CRm( 1), Op1( 0), Op2( 5), is32, NULL, get_ID_MMFR1 },
494 { CRn( 0), CRm( 1), Op1( 0), Op2( 6), is32, NULL, get_ID_MMFR2 },
495 { CRn( 0), CRm( 1), Op1( 0), Op2( 7), is32, NULL, get_ID_MMFR3 },
496
497 { CRn( 0), CRm( 2), Op1( 0), Op2( 0), is32, NULL, get_ID_ISAR0 },
498 { CRn( 0), CRm( 2), Op1( 0), Op2( 1), is32, NULL, get_ID_ISAR1 },
499 { CRn( 0), CRm( 2), Op1( 0), Op2( 2), is32, NULL, get_ID_ISAR2 },
500 { CRn( 0), CRm( 2), Op1( 0), Op2( 3), is32, NULL, get_ID_ISAR3 },
501 { CRn( 0), CRm( 2), Op1( 0), Op2( 4), is32, NULL, get_ID_ISAR4 },
502 { CRn( 0), CRm( 2), Op1( 0), Op2( 5), is32, NULL, get_ID_ISAR5 },
503
504 { CRn( 0), CRm( 0), Op1( 1), Op2( 1), is32, NULL, get_CLIDR },
505 { CRn( 0), CRm( 0), Op1( 1), Op2( 7), is32, NULL, get_AIDR },
506};
507
508static int reg_from_user(void *val, const void __user *uaddr, u64 id)
509{
510 /* This Just Works because we are little endian. */
511 if (copy_from_user(val, uaddr, KVM_REG_SIZE(id)) != 0)
512 return -EFAULT;
513 return 0;
514}
515
516static int reg_to_user(void __user *uaddr, const void *val, u64 id)
517{
518 /* This Just Works because we are little endian. */
519 if (copy_to_user(uaddr, val, KVM_REG_SIZE(id)) != 0)
520 return -EFAULT;
521 return 0;
522}
523
524static int get_invariant_cp15(u64 id, void __user *uaddr)
525{
526 struct coproc_params params;
527 const struct coproc_reg *r;
528
529 if (!index_to_params(id, &params))
530 return -ENOENT;
531
532 r = find_reg(&params, invariant_cp15, ARRAY_SIZE(invariant_cp15));
533 if (!r)
534 return -ENOENT;
535
536 return reg_to_user(uaddr, &r->val, id);
537}
538
539static int set_invariant_cp15(u64 id, void __user *uaddr)
540{
541 struct coproc_params params;
542 const struct coproc_reg *r;
543 int err;
544 u64 val = 0; /* Make sure high bits are 0 for 32-bit regs */
545
546 if (!index_to_params(id, &params))
547 return -ENOENT;
548 r = find_reg(&params, invariant_cp15, ARRAY_SIZE(invariant_cp15));
549 if (!r)
550 return -ENOENT;
551
552 err = reg_from_user(&val, uaddr, id);
553 if (err)
554 return err;
555
556 /* This is what we mean by invariant: you can't change it. */
557 if (r->val != val)
558 return -EINVAL;
559
560 return 0;
561}
562
563static bool is_valid_cache(u32 val)
564{
565 u32 level, ctype;
566
567 if (val >= CSSELR_MAX)
568 return -ENOENT;
569
570 /* Bottom bit is Instruction or Data bit. Next 3 bits are level. */
571 level = (val >> 1);
572 ctype = (cache_levels >> (level * 3)) & 7;
573
574 switch (ctype) {
575 case 0: /* No cache */
576 return false;
577 case 1: /* Instruction cache only */
578 return (val & 1);
579 case 2: /* Data cache only */
580 case 4: /* Unified cache */
581 return !(val & 1);
582 case 3: /* Separate instruction and data caches */
583 return true;
584 default: /* Reserved: we can't know instruction or data. */
585 return false;
586 }
587}
588
589/* Which cache CCSIDR represents depends on CSSELR value. */
590static u32 get_ccsidr(u32 csselr)
591{
592 u32 ccsidr;
593
594 /* Make sure noone else changes CSSELR during this! */
595 local_irq_disable();
596 /* Put value into CSSELR */
597 asm volatile("mcr p15, 2, %0, c0, c0, 0" : : "r" (csselr));
598 isb();
599 /* Read result out of CCSIDR */
600 asm volatile("mrc p15, 1, %0, c0, c0, 0" : "=r" (ccsidr));
601 local_irq_enable();
602
603 return ccsidr;
604}
605
606static int demux_c15_get(u64 id, void __user *uaddr)
607{
608 u32 val;
609 u32 __user *uval = uaddr;
610
611 /* Fail if we have unknown bits set. */
612 if (id & ~(KVM_REG_ARCH_MASK|KVM_REG_SIZE_MASK|KVM_REG_ARM_COPROC_MASK
613 | ((1 << KVM_REG_ARM_COPROC_SHIFT)-1)))
614 return -ENOENT;
615
616 switch (id & KVM_REG_ARM_DEMUX_ID_MASK) {
617 case KVM_REG_ARM_DEMUX_ID_CCSIDR:
618 if (KVM_REG_SIZE(id) != 4)
619 return -ENOENT;
620 val = (id & KVM_REG_ARM_DEMUX_VAL_MASK)
621 >> KVM_REG_ARM_DEMUX_VAL_SHIFT;
622 if (!is_valid_cache(val))
623 return -ENOENT;
624
625 return put_user(get_ccsidr(val), uval);
626 default:
627 return -ENOENT;
628 }
629}
630
631static int demux_c15_set(u64 id, void __user *uaddr)
632{
633 u32 val, newval;
634 u32 __user *uval = uaddr;
635
636 /* Fail if we have unknown bits set. */
637 if (id & ~(KVM_REG_ARCH_MASK|KVM_REG_SIZE_MASK|KVM_REG_ARM_COPROC_MASK
638 | ((1 << KVM_REG_ARM_COPROC_SHIFT)-1)))
639 return -ENOENT;
640
641 switch (id & KVM_REG_ARM_DEMUX_ID_MASK) {
642 case KVM_REG_ARM_DEMUX_ID_CCSIDR:
643 if (KVM_REG_SIZE(id) != 4)
644 return -ENOENT;
645 val = (id & KVM_REG_ARM_DEMUX_VAL_MASK)
646 >> KVM_REG_ARM_DEMUX_VAL_SHIFT;
647 if (!is_valid_cache(val))
648 return -ENOENT;
649
650 if (get_user(newval, uval))
651 return -EFAULT;
652
653 /* This is also invariant: you can't change it. */
654 if (newval != get_ccsidr(val))
655 return -EINVAL;
656 return 0;
657 default:
658 return -ENOENT;
659 }
660}
661
662#ifdef CONFIG_VFPv3
663static const int vfp_sysregs[] = { KVM_REG_ARM_VFP_FPEXC,
664 KVM_REG_ARM_VFP_FPSCR,
665 KVM_REG_ARM_VFP_FPINST,
666 KVM_REG_ARM_VFP_FPINST2,
667 KVM_REG_ARM_VFP_MVFR0,
668 KVM_REG_ARM_VFP_MVFR1,
669 KVM_REG_ARM_VFP_FPSID };
670
671static unsigned int num_fp_regs(void)
672{
673 if (((fmrx(MVFR0) & MVFR0_A_SIMD_MASK) >> MVFR0_A_SIMD_BIT) == 2)
674 return 32;
675 else
676 return 16;
677}
678
679static unsigned int num_vfp_regs(void)
680{
681 /* Normal FP regs + control regs. */
682 return num_fp_regs() + ARRAY_SIZE(vfp_sysregs);
683}
684
685static int copy_vfp_regids(u64 __user *uindices)
686{
687 unsigned int i;
688 const u64 u32reg = KVM_REG_ARM | KVM_REG_SIZE_U32 | KVM_REG_ARM_VFP;
689 const u64 u64reg = KVM_REG_ARM | KVM_REG_SIZE_U64 | KVM_REG_ARM_VFP;
690
691 for (i = 0; i < num_fp_regs(); i++) {
692 if (put_user((u64reg | KVM_REG_ARM_VFP_BASE_REG) + i,
693 uindices))
694 return -EFAULT;
695 uindices++;
696 }
697
698 for (i = 0; i < ARRAY_SIZE(vfp_sysregs); i++) {
699 if (put_user(u32reg | vfp_sysregs[i], uindices))
700 return -EFAULT;
701 uindices++;
702 }
703
704 return num_vfp_regs();
705}
706
707static int vfp_get_reg(const struct kvm_vcpu *vcpu, u64 id, void __user *uaddr)
708{
709 u32 vfpid = (id & KVM_REG_ARM_VFP_MASK);
710 u32 val;
711
712 /* Fail if we have unknown bits set. */
713 if (id & ~(KVM_REG_ARCH_MASK|KVM_REG_SIZE_MASK|KVM_REG_ARM_COPROC_MASK
714 | ((1 << KVM_REG_ARM_COPROC_SHIFT)-1)))
715 return -ENOENT;
716
717 if (vfpid < num_fp_regs()) {
718 if (KVM_REG_SIZE(id) != 8)
719 return -ENOENT;
720 return reg_to_user(uaddr, &vcpu->arch.vfp_guest.fpregs[vfpid],
721 id);
722 }
723
724 /* FP control registers are all 32 bit. */
725 if (KVM_REG_SIZE(id) != 4)
726 return -ENOENT;
727
728 switch (vfpid) {
729 case KVM_REG_ARM_VFP_FPEXC:
730 return reg_to_user(uaddr, &vcpu->arch.vfp_guest.fpexc, id);
731 case KVM_REG_ARM_VFP_FPSCR:
732 return reg_to_user(uaddr, &vcpu->arch.vfp_guest.fpscr, id);
733 case KVM_REG_ARM_VFP_FPINST:
734 return reg_to_user(uaddr, &vcpu->arch.vfp_guest.fpinst, id);
735 case KVM_REG_ARM_VFP_FPINST2:
736 return reg_to_user(uaddr, &vcpu->arch.vfp_guest.fpinst2, id);
737 case KVM_REG_ARM_VFP_MVFR0:
738 val = fmrx(MVFR0);
739 return reg_to_user(uaddr, &val, id);
740 case KVM_REG_ARM_VFP_MVFR1:
741 val = fmrx(MVFR1);
742 return reg_to_user(uaddr, &val, id);
743 case KVM_REG_ARM_VFP_FPSID:
744 val = fmrx(FPSID);
745 return reg_to_user(uaddr, &val, id);
746 default:
747 return -ENOENT;
748 }
749}
750
751static int vfp_set_reg(struct kvm_vcpu *vcpu, u64 id, const void __user *uaddr)
752{
753 u32 vfpid = (id & KVM_REG_ARM_VFP_MASK);
754 u32 val;
755
756 /* Fail if we have unknown bits set. */
757 if (id & ~(KVM_REG_ARCH_MASK|KVM_REG_SIZE_MASK|KVM_REG_ARM_COPROC_MASK
758 | ((1 << KVM_REG_ARM_COPROC_SHIFT)-1)))
759 return -ENOENT;
760
761 if (vfpid < num_fp_regs()) {
762 if (KVM_REG_SIZE(id) != 8)
763 return -ENOENT;
764 return reg_from_user(&vcpu->arch.vfp_guest.fpregs[vfpid],
765 uaddr, id);
766 }
767
768 /* FP control registers are all 32 bit. */
769 if (KVM_REG_SIZE(id) != 4)
770 return -ENOENT;
771
772 switch (vfpid) {
773 case KVM_REG_ARM_VFP_FPEXC:
774 return reg_from_user(&vcpu->arch.vfp_guest.fpexc, uaddr, id);
775 case KVM_REG_ARM_VFP_FPSCR:
776 return reg_from_user(&vcpu->arch.vfp_guest.fpscr, uaddr, id);
777 case KVM_REG_ARM_VFP_FPINST:
778 return reg_from_user(&vcpu->arch.vfp_guest.fpinst, uaddr, id);
779 case KVM_REG_ARM_VFP_FPINST2:
780 return reg_from_user(&vcpu->arch.vfp_guest.fpinst2, uaddr, id);
781 /* These are invariant. */
782 case KVM_REG_ARM_VFP_MVFR0:
783 if (reg_from_user(&val, uaddr, id))
784 return -EFAULT;
785 if (val != fmrx(MVFR0))
786 return -EINVAL;
787 return 0;
788 case KVM_REG_ARM_VFP_MVFR1:
789 if (reg_from_user(&val, uaddr, id))
790 return -EFAULT;
791 if (val != fmrx(MVFR1))
792 return -EINVAL;
793 return 0;
794 case KVM_REG_ARM_VFP_FPSID:
795 if (reg_from_user(&val, uaddr, id))
796 return -EFAULT;
797 if (val != fmrx(FPSID))
798 return -EINVAL;
799 return 0;
800 default:
801 return -ENOENT;
802 }
803}
804#else /* !CONFIG_VFPv3 */
805static unsigned int num_vfp_regs(void)
806{
807 return 0;
808}
809
810static int copy_vfp_regids(u64 __user *uindices)
811{
812 return 0;
813}
814
815static int vfp_get_reg(const struct kvm_vcpu *vcpu, u64 id, void __user *uaddr)
816{
817 return -ENOENT;
818}
819
820static int vfp_set_reg(struct kvm_vcpu *vcpu, u64 id, const void __user *uaddr)
821{
822 return -ENOENT;
823}
824#endif /* !CONFIG_VFPv3 */
825
826int kvm_arm_coproc_get_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
827{
828 const struct coproc_reg *r;
829 void __user *uaddr = (void __user *)(long)reg->addr;
830
831 if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_DEMUX)
832 return demux_c15_get(reg->id, uaddr);
833
834 if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_VFP)
835 return vfp_get_reg(vcpu, reg->id, uaddr);
836
837 r = index_to_coproc_reg(vcpu, reg->id);
838 if (!r)
839 return get_invariant_cp15(reg->id, uaddr);
840
841 /* Note: copies two regs if size is 64 bit. */
842 return reg_to_user(uaddr, &vcpu->arch.cp15[r->reg], reg->id);
843}
844
845int kvm_arm_coproc_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
846{
847 const struct coproc_reg *r;
848 void __user *uaddr = (void __user *)(long)reg->addr;
849
850 if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_DEMUX)
851 return demux_c15_set(reg->id, uaddr);
852
853 if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_VFP)
854 return vfp_set_reg(vcpu, reg->id, uaddr);
855
856 r = index_to_coproc_reg(vcpu, reg->id);
857 if (!r)
858 return set_invariant_cp15(reg->id, uaddr);
859
860 /* Note: copies two regs if size is 64 bit */
861 return reg_from_user(&vcpu->arch.cp15[r->reg], uaddr, reg->id);
862}
863
864static unsigned int num_demux_regs(void)
865{
866 unsigned int i, count = 0;
867
868 for (i = 0; i < CSSELR_MAX; i++)
869 if (is_valid_cache(i))
870 count++;
871
872 return count;
873}
874
875static int write_demux_regids(u64 __user *uindices)
876{
877 u64 val = KVM_REG_ARM | KVM_REG_SIZE_U32 | KVM_REG_ARM_DEMUX;
878 unsigned int i;
879
880 val |= KVM_REG_ARM_DEMUX_ID_CCSIDR;
881 for (i = 0; i < CSSELR_MAX; i++) {
882 if (!is_valid_cache(i))
883 continue;
884 if (put_user(val | i, uindices))
885 return -EFAULT;
886 uindices++;
887 }
888 return 0;
889}
890
891static u64 cp15_to_index(const struct coproc_reg *reg)
892{
893 u64 val = KVM_REG_ARM | (15 << KVM_REG_ARM_COPROC_SHIFT);
894 if (reg->is_64) {
895 val |= KVM_REG_SIZE_U64;
896 val |= (reg->Op1 << KVM_REG_ARM_OPC1_SHIFT);
897 val |= (reg->CRm << KVM_REG_ARM_CRM_SHIFT);
898 } else {
899 val |= KVM_REG_SIZE_U32;
900 val |= (reg->Op1 << KVM_REG_ARM_OPC1_SHIFT);
901 val |= (reg->Op2 << KVM_REG_ARM_32_OPC2_SHIFT);
902 val |= (reg->CRm << KVM_REG_ARM_CRM_SHIFT);
903 val |= (reg->CRn << KVM_REG_ARM_32_CRN_SHIFT);
904 }
905 return val;
906}
907
908static bool copy_reg_to_user(const struct coproc_reg *reg, u64 __user **uind)
909{
910 if (!*uind)
911 return true;
912
913 if (put_user(cp15_to_index(reg), *uind))
914 return false;
915
916 (*uind)++;
917 return true;
918}
919
920/* Assumed ordered tables, see kvm_coproc_table_init. */
921static int walk_cp15(struct kvm_vcpu *vcpu, u64 __user *uind)
922{
923 const struct coproc_reg *i1, *i2, *end1, *end2;
924 unsigned int total = 0;
925 size_t num;
926
927 /* We check for duplicates here, to allow arch-specific overrides. */
928 i1 = get_target_table(vcpu->arch.target, &num);
929 end1 = i1 + num;
930 i2 = cp15_regs;
931 end2 = cp15_regs + ARRAY_SIZE(cp15_regs);
932
933 BUG_ON(i1 == end1 || i2 == end2);
934
935 /* Walk carefully, as both tables may refer to the same register. */
936 while (i1 || i2) {
937 int cmp = cmp_reg(i1, i2);
938 /* target-specific overrides generic entry. */
939 if (cmp <= 0) {
940 /* Ignore registers we trap but don't save. */
941 if (i1->reg) {
942 if (!copy_reg_to_user(i1, &uind))
943 return -EFAULT;
944 total++;
945 }
946 } else {
947 /* Ignore registers we trap but don't save. */
948 if (i2->reg) {
949 if (!copy_reg_to_user(i2, &uind))
950 return -EFAULT;
951 total++;
952 }
953 }
954
955 if (cmp <= 0 && ++i1 == end1)
956 i1 = NULL;
957 if (cmp >= 0 && ++i2 == end2)
958 i2 = NULL;
959 }
960 return total;
961}
962
963unsigned long kvm_arm_num_coproc_regs(struct kvm_vcpu *vcpu)
964{
965 return ARRAY_SIZE(invariant_cp15)
966 + num_demux_regs()
967 + num_vfp_regs()
968 + walk_cp15(vcpu, (u64 __user *)NULL);
969}
970
971int kvm_arm_copy_coproc_indices(struct kvm_vcpu *vcpu, u64 __user *uindices)
972{
973 unsigned int i;
974 int err;
975
976 /* Then give them all the invariant registers' indices. */
977 for (i = 0; i < ARRAY_SIZE(invariant_cp15); i++) {
978 if (put_user(cp15_to_index(&invariant_cp15[i]), uindices))
979 return -EFAULT;
980 uindices++;
981 }
982
983 err = walk_cp15(vcpu, uindices);
984 if (err < 0)
985 return err;
986 uindices += err;
987
988 err = copy_vfp_regids(uindices);
989 if (err < 0)
990 return err;
991 uindices += err;
992
993 return write_demux_regids(uindices);
994}
995
996void kvm_coproc_table_init(void)
997{
998 unsigned int i;
999
1000 /* Make sure tables are unique and in order. */
1001 for (i = 1; i < ARRAY_SIZE(cp15_regs); i++)
1002 BUG_ON(cmp_reg(&cp15_regs[i-1], &cp15_regs[i]) >= 0);
1003
1004 /* We abuse the reset function to overwrite the table itself. */
1005 for (i = 0; i < ARRAY_SIZE(invariant_cp15); i++)
1006 invariant_cp15[i].reset(NULL, &invariant_cp15[i]);
1007
1008 /*
1009 * CLIDR format is awkward, so clean it up. See ARM B4.1.20:
1010 *
1011 * If software reads the Cache Type fields from Ctype1
1012 * upwards, once it has seen a value of 0b000, no caches
1013 * exist at further-out levels of the hierarchy. So, for
1014 * example, if Ctype3 is the first Cache Type field with a
1015 * value of 0b000, the values of Ctype4 to Ctype7 must be
1016 * ignored.
1017 */
1018 asm volatile("mrc p15, 1, %0, c0, c0, 1" : "=r" (cache_levels));
1019 for (i = 0; i < 7; i++)
1020 if (((cache_levels >> (i*3)) & 7) == 0)
1021 break;
1022 /* Clear all higher bits. */
1023 cache_levels &= (1 << (i*3))-1;
1024}
1025
1026/**
1027 * kvm_reset_coprocs - sets cp15 registers to reset value
1028 * @vcpu: The VCPU pointer
1029 *
1030 * This function finds the right table above and sets the registers on the
1031 * virtual CPU struct to their architecturally defined reset values.
1032 */
1033void kvm_reset_coprocs(struct kvm_vcpu *vcpu)
1034{
1035 size_t num;
1036 const struct coproc_reg *table;
1037
1038 /* Catch someone adding a register without putting in reset entry. */
1039 memset(vcpu->arch.cp15, 0x42, sizeof(vcpu->arch.cp15));
1040
1041 /* Generic chip reset first (so target could override). */
1042 reset_coproc_regs(vcpu, cp15_regs, ARRAY_SIZE(cp15_regs));
1043
1044 table = get_target_table(vcpu->arch.target, &num);
1045 reset_coproc_regs(vcpu, table, num);
1046
1047 for (num = 1; num < NR_CP15_REGS; num++)
1048 if (vcpu->arch.cp15[num] == 0x42424242)
1049 panic("Didn't reset vcpu->arch.cp15[%zi]", num);
1050}
diff --git a/arch/arm/kvm/coproc.h b/arch/arm/kvm/coproc.h
new file mode 100644
index 000000000000..992adfafa2ff
--- /dev/null
+++ b/arch/arm/kvm/coproc.h
@@ -0,0 +1,153 @@
1/*
2 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
3 * Authors: Christoffer Dall <c.dall@virtualopensystems.com>
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 * 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 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#ifndef __ARM_KVM_COPROC_LOCAL_H__
20#define __ARM_KVM_COPROC_LOCAL_H__
21
22struct coproc_params {
23 unsigned long CRn;
24 unsigned long CRm;
25 unsigned long Op1;
26 unsigned long Op2;
27 unsigned long Rt1;
28 unsigned long Rt2;
29 bool is_64bit;
30 bool is_write;
31};
32
33struct coproc_reg {
34 /* MRC/MCR/MRRC/MCRR instruction which accesses it. */
35 unsigned long CRn;
36 unsigned long CRm;
37 unsigned long Op1;
38 unsigned long Op2;
39
40 bool is_64;
41
42 /* Trapped access from guest, if non-NULL. */
43 bool (*access)(struct kvm_vcpu *,
44 const struct coproc_params *,
45 const struct coproc_reg *);
46
47 /* Initialization for vcpu. */
48 void (*reset)(struct kvm_vcpu *, const struct coproc_reg *);
49
50 /* Index into vcpu->arch.cp15[], or 0 if we don't need to save it. */
51 unsigned long reg;
52
53 /* Value (usually reset value) */
54 u64 val;
55};
56
57static inline void print_cp_instr(const struct coproc_params *p)
58{
59 /* Look, we even formatted it for you to paste into the table! */
60 if (p->is_64bit) {
61 kvm_pr_unimpl(" { CRm(%2lu), Op1(%2lu), is64, func_%s },\n",
62 p->CRm, p->Op1, p->is_write ? "write" : "read");
63 } else {
64 kvm_pr_unimpl(" { CRn(%2lu), CRm(%2lu), Op1(%2lu), Op2(%2lu), is32,"
65 " func_%s },\n",
66 p->CRn, p->CRm, p->Op1, p->Op2,
67 p->is_write ? "write" : "read");
68 }
69}
70
71static inline bool ignore_write(struct kvm_vcpu *vcpu,
72 const struct coproc_params *p)
73{
74 return true;
75}
76
77static inline bool read_zero(struct kvm_vcpu *vcpu,
78 const struct coproc_params *p)
79{
80 *vcpu_reg(vcpu, p->Rt1) = 0;
81 return true;
82}
83
84static inline bool write_to_read_only(struct kvm_vcpu *vcpu,
85 const struct coproc_params *params)
86{
87 kvm_debug("CP15 write to read-only register at: %08x\n",
88 *vcpu_pc(vcpu));
89 print_cp_instr(params);
90 return false;
91}
92
93static inline bool read_from_write_only(struct kvm_vcpu *vcpu,
94 const struct coproc_params *params)
95{
96 kvm_debug("CP15 read to write-only register at: %08x\n",
97 *vcpu_pc(vcpu));
98 print_cp_instr(params);
99 return false;
100}
101
102/* Reset functions */
103static inline void reset_unknown(struct kvm_vcpu *vcpu,
104 const struct coproc_reg *r)
105{
106 BUG_ON(!r->reg);
107 BUG_ON(r->reg >= ARRAY_SIZE(vcpu->arch.cp15));
108 vcpu->arch.cp15[r->reg] = 0xdecafbad;
109}
110
111static inline void reset_val(struct kvm_vcpu *vcpu, const struct coproc_reg *r)
112{
113 BUG_ON(!r->reg);
114 BUG_ON(r->reg >= ARRAY_SIZE(vcpu->arch.cp15));
115 vcpu->arch.cp15[r->reg] = r->val;
116}
117
118static inline void reset_unknown64(struct kvm_vcpu *vcpu,
119 const struct coproc_reg *r)
120{
121 BUG_ON(!r->reg);
122 BUG_ON(r->reg + 1 >= ARRAY_SIZE(vcpu->arch.cp15));
123
124 vcpu->arch.cp15[r->reg] = 0xdecafbad;
125 vcpu->arch.cp15[r->reg+1] = 0xd0c0ffee;
126}
127
128static inline int cmp_reg(const struct coproc_reg *i1,
129 const struct coproc_reg *i2)
130{
131 BUG_ON(i1 == i2);
132 if (!i1)
133 return 1;
134 else if (!i2)
135 return -1;
136 if (i1->CRn != i2->CRn)
137 return i1->CRn - i2->CRn;
138 if (i1->CRm != i2->CRm)
139 return i1->CRm - i2->CRm;
140 if (i1->Op1 != i2->Op1)
141 return i1->Op1 - i2->Op1;
142 return i1->Op2 - i2->Op2;
143}
144
145
146#define CRn(_x) .CRn = _x
147#define CRm(_x) .CRm = _x
148#define Op1(_x) .Op1 = _x
149#define Op2(_x) .Op2 = _x
150#define is64 .is_64 = true
151#define is32 .is_64 = false
152
153#endif /* __ARM_KVM_COPROC_LOCAL_H__ */
diff --git a/arch/arm/kvm/coproc_a15.c b/arch/arm/kvm/coproc_a15.c
new file mode 100644
index 000000000000..685063a6d0cf
--- /dev/null
+++ b/arch/arm/kvm/coproc_a15.c
@@ -0,0 +1,162 @@
1/*
2 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
3 * Authors: Rusty Russell <rusty@rustcorp.au>
4 * Christoffer Dall <c.dall@virtualopensystems.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 * 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19#include <linux/kvm_host.h>
20#include <asm/cputype.h>
21#include <asm/kvm_arm.h>
22#include <asm/kvm_host.h>
23#include <asm/kvm_emulate.h>
24#include <asm/kvm_coproc.h>
25#include <linux/init.h>
26
27static void reset_mpidr(struct kvm_vcpu *vcpu, const struct coproc_reg *r)
28{
29 /*
30 * Compute guest MPIDR:
31 * (Even if we present only one VCPU to the guest on an SMP
32 * host we don't set the U bit in the MPIDR, or vice versa, as
33 * revealing the underlying hardware properties is likely to
34 * be the best choice).
35 */
36 vcpu->arch.cp15[c0_MPIDR] = (read_cpuid_mpidr() & ~MPIDR_LEVEL_MASK)
37 | (vcpu->vcpu_id & MPIDR_LEVEL_MASK);
38}
39
40#include "coproc.h"
41
42/* A15 TRM 4.3.28: RO WI */
43static bool access_actlr(struct kvm_vcpu *vcpu,
44 const struct coproc_params *p,
45 const struct coproc_reg *r)
46{
47 if (p->is_write)
48 return ignore_write(vcpu, p);
49
50 *vcpu_reg(vcpu, p->Rt1) = vcpu->arch.cp15[c1_ACTLR];
51 return true;
52}
53
54/* A15 TRM 4.3.60: R/O. */
55static bool access_cbar(struct kvm_vcpu *vcpu,
56 const struct coproc_params *p,
57 const struct coproc_reg *r)
58{
59 if (p->is_write)
60 return write_to_read_only(vcpu, p);
61 return read_zero(vcpu, p);
62}
63
64/* A15 TRM 4.3.48: R/O WI. */
65static bool access_l2ctlr(struct kvm_vcpu *vcpu,
66 const struct coproc_params *p,
67 const struct coproc_reg *r)
68{
69 if (p->is_write)
70 return ignore_write(vcpu, p);
71
72 *vcpu_reg(vcpu, p->Rt1) = vcpu->arch.cp15[c9_L2CTLR];
73 return true;
74}
75
76static void reset_l2ctlr(struct kvm_vcpu *vcpu, const struct coproc_reg *r)
77{
78 u32 l2ctlr, ncores;
79
80 asm volatile("mrc p15, 1, %0, c9, c0, 2\n" : "=r" (l2ctlr));
81 l2ctlr &= ~(3 << 24);
82 ncores = atomic_read(&vcpu->kvm->online_vcpus) - 1;
83 l2ctlr |= (ncores & 3) << 24;
84
85 vcpu->arch.cp15[c9_L2CTLR] = l2ctlr;
86}
87
88static void reset_actlr(struct kvm_vcpu *vcpu, const struct coproc_reg *r)
89{
90 u32 actlr;
91
92 /* ACTLR contains SMP bit: make sure you create all cpus first! */
93 asm volatile("mrc p15, 0, %0, c1, c0, 1\n" : "=r" (actlr));
94 /* Make the SMP bit consistent with the guest configuration */
95 if (atomic_read(&vcpu->kvm->online_vcpus) > 1)
96 actlr |= 1U << 6;
97 else
98 actlr &= ~(1U << 6);
99
100 vcpu->arch.cp15[c1_ACTLR] = actlr;
101}
102
103/* A15 TRM 4.3.49: R/O WI (even if NSACR.NS_L2ERR, a write of 1 is ignored). */
104static bool access_l2ectlr(struct kvm_vcpu *vcpu,
105 const struct coproc_params *p,
106 const struct coproc_reg *r)
107{
108 if (p->is_write)
109 return ignore_write(vcpu, p);
110
111 *vcpu_reg(vcpu, p->Rt1) = 0;
112 return true;
113}
114
115/*
116 * A15-specific CP15 registers.
117 * Important: Must be sorted ascending by CRn, CRM, Op1, Op2
118 */
119static const struct coproc_reg a15_regs[] = {
120 /* MPIDR: we use VMPIDR for guest access. */
121 { CRn( 0), CRm( 0), Op1( 0), Op2( 5), is32,
122 NULL, reset_mpidr, c0_MPIDR },
123
124 /* SCTLR: swapped by interrupt.S. */
125 { CRn( 1), CRm( 0), Op1( 0), Op2( 0), is32,
126 NULL, reset_val, c1_SCTLR, 0x00C50078 },
127 /* ACTLR: trapped by HCR.TAC bit. */
128 { CRn( 1), CRm( 0), Op1( 0), Op2( 1), is32,
129 access_actlr, reset_actlr, c1_ACTLR },
130 /* CPACR: swapped by interrupt.S. */
131 { CRn( 1), CRm( 0), Op1( 0), Op2( 2), is32,
132 NULL, reset_val, c1_CPACR, 0x00000000 },
133
134 /*
135 * L2CTLR access (guest wants to know #CPUs).
136 */
137 { CRn( 9), CRm( 0), Op1( 1), Op2( 2), is32,
138 access_l2ctlr, reset_l2ctlr, c9_L2CTLR },
139 { CRn( 9), CRm( 0), Op1( 1), Op2( 3), is32, access_l2ectlr},
140
141 /* The Configuration Base Address Register. */
142 { CRn(15), CRm( 0), Op1( 4), Op2( 0), is32, access_cbar},
143};
144
145static struct kvm_coproc_target_table a15_target_table = {
146 .target = KVM_ARM_TARGET_CORTEX_A15,
147 .table = a15_regs,
148 .num = ARRAY_SIZE(a15_regs),
149};
150
151static int __init coproc_a15_init(void)
152{
153 unsigned int i;
154
155 for (i = 1; i < ARRAY_SIZE(a15_regs); i++)
156 BUG_ON(cmp_reg(&a15_regs[i-1],
157 &a15_regs[i]) >= 0);
158
159 kvm_register_target_coproc_table(&a15_target_table);
160 return 0;
161}
162late_initcall(coproc_a15_init);
diff --git a/arch/arm/kvm/emulate.c b/arch/arm/kvm/emulate.c
new file mode 100644
index 000000000000..d61450ac6665
--- /dev/null
+++ b/arch/arm/kvm/emulate.c
@@ -0,0 +1,373 @@
1/*
2 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
3 * Author: Christoffer Dall <c.dall@virtualopensystems.com>
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 * 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 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#include <linux/mm.h>
20#include <linux/kvm_host.h>
21#include <asm/kvm_arm.h>
22#include <asm/kvm_emulate.h>
23#include <trace/events/kvm.h>
24
25#include "trace.h"
26
27#define VCPU_NR_MODES 6
28#define VCPU_REG_OFFSET_USR 0
29#define VCPU_REG_OFFSET_FIQ 1
30#define VCPU_REG_OFFSET_IRQ 2
31#define VCPU_REG_OFFSET_SVC 3
32#define VCPU_REG_OFFSET_ABT 4
33#define VCPU_REG_OFFSET_UND 5
34#define REG_OFFSET(_reg) \
35 (offsetof(struct kvm_regs, _reg) / sizeof(u32))
36
37#define USR_REG_OFFSET(_num) REG_OFFSET(usr_regs.uregs[_num])
38
39static const unsigned long vcpu_reg_offsets[VCPU_NR_MODES][15] = {
40 /* USR/SYS Registers */
41 [VCPU_REG_OFFSET_USR] = {
42 USR_REG_OFFSET(0), USR_REG_OFFSET(1), USR_REG_OFFSET(2),
43 USR_REG_OFFSET(3), USR_REG_OFFSET(4), USR_REG_OFFSET(5),
44 USR_REG_OFFSET(6), USR_REG_OFFSET(7), USR_REG_OFFSET(8),
45 USR_REG_OFFSET(9), USR_REG_OFFSET(10), USR_REG_OFFSET(11),
46 USR_REG_OFFSET(12), USR_REG_OFFSET(13), USR_REG_OFFSET(14),
47 },
48
49 /* FIQ Registers */
50 [VCPU_REG_OFFSET_FIQ] = {
51 USR_REG_OFFSET(0), USR_REG_OFFSET(1), USR_REG_OFFSET(2),
52 USR_REG_OFFSET(3), USR_REG_OFFSET(4), USR_REG_OFFSET(5),
53 USR_REG_OFFSET(6), USR_REG_OFFSET(7),
54 REG_OFFSET(fiq_regs[0]), /* r8 */
55 REG_OFFSET(fiq_regs[1]), /* r9 */
56 REG_OFFSET(fiq_regs[2]), /* r10 */
57 REG_OFFSET(fiq_regs[3]), /* r11 */
58 REG_OFFSET(fiq_regs[4]), /* r12 */
59 REG_OFFSET(fiq_regs[5]), /* r13 */
60 REG_OFFSET(fiq_regs[6]), /* r14 */
61 },
62
63 /* IRQ Registers */
64 [VCPU_REG_OFFSET_IRQ] = {
65 USR_REG_OFFSET(0), USR_REG_OFFSET(1), USR_REG_OFFSET(2),
66 USR_REG_OFFSET(3), USR_REG_OFFSET(4), USR_REG_OFFSET(5),
67 USR_REG_OFFSET(6), USR_REG_OFFSET(7), USR_REG_OFFSET(8),
68 USR_REG_OFFSET(9), USR_REG_OFFSET(10), USR_REG_OFFSET(11),
69 USR_REG_OFFSET(12),
70 REG_OFFSET(irq_regs[0]), /* r13 */
71 REG_OFFSET(irq_regs[1]), /* r14 */
72 },
73
74 /* SVC Registers */
75 [VCPU_REG_OFFSET_SVC] = {
76 USR_REG_OFFSET(0), USR_REG_OFFSET(1), USR_REG_OFFSET(2),
77 USR_REG_OFFSET(3), USR_REG_OFFSET(4), USR_REG_OFFSET(5),
78 USR_REG_OFFSET(6), USR_REG_OFFSET(7), USR_REG_OFFSET(8),
79 USR_REG_OFFSET(9), USR_REG_OFFSET(10), USR_REG_OFFSET(11),
80 USR_REG_OFFSET(12),
81 REG_OFFSET(svc_regs[0]), /* r13 */
82 REG_OFFSET(svc_regs[1]), /* r14 */
83 },
84
85 /* ABT Registers */
86 [VCPU_REG_OFFSET_ABT] = {
87 USR_REG_OFFSET(0), USR_REG_OFFSET(1), USR_REG_OFFSET(2),
88 USR_REG_OFFSET(3), USR_REG_OFFSET(4), USR_REG_OFFSET(5),
89 USR_REG_OFFSET(6), USR_REG_OFFSET(7), USR_REG_OFFSET(8),
90 USR_REG_OFFSET(9), USR_REG_OFFSET(10), USR_REG_OFFSET(11),
91 USR_REG_OFFSET(12),
92 REG_OFFSET(abt_regs[0]), /* r13 */
93 REG_OFFSET(abt_regs[1]), /* r14 */
94 },
95
96 /* UND Registers */
97 [VCPU_REG_OFFSET_UND] = {
98 USR_REG_OFFSET(0), USR_REG_OFFSET(1), USR_REG_OFFSET(2),
99 USR_REG_OFFSET(3), USR_REG_OFFSET(4), USR_REG_OFFSET(5),
100 USR_REG_OFFSET(6), USR_REG_OFFSET(7), USR_REG_OFFSET(8),
101 USR_REG_OFFSET(9), USR_REG_OFFSET(10), USR_REG_OFFSET(11),
102 USR_REG_OFFSET(12),
103 REG_OFFSET(und_regs[0]), /* r13 */
104 REG_OFFSET(und_regs[1]), /* r14 */
105 },
106};
107
108/*
109 * Return a pointer to the register number valid in the current mode of
110 * the virtual CPU.
111 */
112u32 *vcpu_reg(struct kvm_vcpu *vcpu, u8 reg_num)
113{
114 u32 *reg_array = (u32 *)&vcpu->arch.regs;
115 u32 mode = *vcpu_cpsr(vcpu) & MODE_MASK;
116
117 switch (mode) {
118 case USR_MODE...SVC_MODE:
119 mode &= ~MODE32_BIT; /* 0 ... 3 */
120 break;
121
122 case ABT_MODE:
123 mode = VCPU_REG_OFFSET_ABT;
124 break;
125
126 case UND_MODE:
127 mode = VCPU_REG_OFFSET_UND;
128 break;
129
130 case SYSTEM_MODE:
131 mode = VCPU_REG_OFFSET_USR;
132 break;
133
134 default:
135 BUG();
136 }
137
138 return reg_array + vcpu_reg_offsets[mode][reg_num];
139}
140
141/*
142 * Return the SPSR for the current mode of the virtual CPU.
143 */
144u32 *vcpu_spsr(struct kvm_vcpu *vcpu)
145{
146 u32 mode = *vcpu_cpsr(vcpu) & MODE_MASK;
147 switch (mode) {
148 case SVC_MODE:
149 return &vcpu->arch.regs.KVM_ARM_SVC_spsr;
150 case ABT_MODE:
151 return &vcpu->arch.regs.KVM_ARM_ABT_spsr;
152 case UND_MODE:
153 return &vcpu->arch.regs.KVM_ARM_UND_spsr;
154 case IRQ_MODE:
155 return &vcpu->arch.regs.KVM_ARM_IRQ_spsr;
156 case FIQ_MODE:
157 return &vcpu->arch.regs.KVM_ARM_FIQ_spsr;
158 default:
159 BUG();
160 }
161}
162
163/**
164 * kvm_handle_wfi - handle a wait-for-interrupts instruction executed by a guest
165 * @vcpu: the vcpu pointer
166 * @run: the kvm_run structure pointer
167 *
168 * Simply sets the wait_for_interrupts flag on the vcpu structure, which will
169 * halt execution of world-switches and schedule other host processes until
170 * there is an incoming IRQ or FIQ to the VM.
171 */
172int kvm_handle_wfi(struct kvm_vcpu *vcpu, struct kvm_run *run)
173{
174 trace_kvm_wfi(*vcpu_pc(vcpu));
175 kvm_vcpu_block(vcpu);
176 return 1;
177}
178
179/**
180 * adjust_itstate - adjust ITSTATE when emulating instructions in IT-block
181 * @vcpu: The VCPU pointer
182 *
183 * When exceptions occur while instructions are executed in Thumb IF-THEN
184 * blocks, the ITSTATE field of the CPSR is not advanved (updated), so we have
185 * to do this little bit of work manually. The fields map like this:
186 *
187 * IT[7:0] -> CPSR[26:25],CPSR[15:10]
188 */
189static void kvm_adjust_itstate(struct kvm_vcpu *vcpu)
190{
191 unsigned long itbits, cond;
192 unsigned long cpsr = *vcpu_cpsr(vcpu);
193 bool is_arm = !(cpsr & PSR_T_BIT);
194
195 BUG_ON(is_arm && (cpsr & PSR_IT_MASK));
196
197 if (!(cpsr & PSR_IT_MASK))
198 return;
199
200 cond = (cpsr & 0xe000) >> 13;
201 itbits = (cpsr & 0x1c00) >> (10 - 2);
202 itbits |= (cpsr & (0x3 << 25)) >> 25;
203
204 /* Perform ITAdvance (see page A-52 in ARM DDI 0406C) */
205 if ((itbits & 0x7) == 0)
206 itbits = cond = 0;
207 else
208 itbits = (itbits << 1) & 0x1f;
209
210 cpsr &= ~PSR_IT_MASK;
211 cpsr |= cond << 13;
212 cpsr |= (itbits & 0x1c) << (10 - 2);
213 cpsr |= (itbits & 0x3) << 25;
214 *vcpu_cpsr(vcpu) = cpsr;
215}
216
217/**
218 * kvm_skip_instr - skip a trapped instruction and proceed to the next
219 * @vcpu: The vcpu pointer
220 */
221void kvm_skip_instr(struct kvm_vcpu *vcpu, bool is_wide_instr)
222{
223 bool is_thumb;
224
225 is_thumb = !!(*vcpu_cpsr(vcpu) & PSR_T_BIT);
226 if (is_thumb && !is_wide_instr)
227 *vcpu_pc(vcpu) += 2;
228 else
229 *vcpu_pc(vcpu) += 4;
230 kvm_adjust_itstate(vcpu);
231}
232
233
234/******************************************************************************
235 * Inject exceptions into the guest
236 */
237
238static u32 exc_vector_base(struct kvm_vcpu *vcpu)
239{
240 u32 sctlr = vcpu->arch.cp15[c1_SCTLR];
241 u32 vbar = vcpu->arch.cp15[c12_VBAR];
242
243 if (sctlr & SCTLR_V)
244 return 0xffff0000;
245 else /* always have security exceptions */
246 return vbar;
247}
248
249/**
250 * kvm_inject_undefined - inject an undefined exception into the guest
251 * @vcpu: The VCPU to receive the undefined exception
252 *
253 * It is assumed that this code is called from the VCPU thread and that the
254 * VCPU therefore is not currently executing guest code.
255 *
256 * Modelled after TakeUndefInstrException() pseudocode.
257 */
258void kvm_inject_undefined(struct kvm_vcpu *vcpu)
259{
260 u32 new_lr_value;
261 u32 new_spsr_value;
262 u32 cpsr = *vcpu_cpsr(vcpu);
263 u32 sctlr = vcpu->arch.cp15[c1_SCTLR];
264 bool is_thumb = (cpsr & PSR_T_BIT);
265 u32 vect_offset = 4;
266 u32 return_offset = (is_thumb) ? 2 : 4;
267
268 new_spsr_value = cpsr;
269 new_lr_value = *vcpu_pc(vcpu) - return_offset;
270
271 *vcpu_cpsr(vcpu) = (cpsr & ~MODE_MASK) | UND_MODE;
272 *vcpu_cpsr(vcpu) |= PSR_I_BIT;
273 *vcpu_cpsr(vcpu) &= ~(PSR_IT_MASK | PSR_J_BIT | PSR_E_BIT | PSR_T_BIT);
274
275 if (sctlr & SCTLR_TE)
276 *vcpu_cpsr(vcpu) |= PSR_T_BIT;
277 if (sctlr & SCTLR_EE)
278 *vcpu_cpsr(vcpu) |= PSR_E_BIT;
279
280 /* Note: These now point to UND banked copies */
281 *vcpu_spsr(vcpu) = cpsr;
282 *vcpu_reg(vcpu, 14) = new_lr_value;
283
284 /* Branch to exception vector */
285 *vcpu_pc(vcpu) = exc_vector_base(vcpu) + vect_offset;
286}
287
288/*
289 * Modelled after TakeDataAbortException() and TakePrefetchAbortException
290 * pseudocode.
291 */
292static void inject_abt(struct kvm_vcpu *vcpu, bool is_pabt, unsigned long addr)
293{
294 u32 new_lr_value;
295 u32 new_spsr_value;
296 u32 cpsr = *vcpu_cpsr(vcpu);
297 u32 sctlr = vcpu->arch.cp15[c1_SCTLR];
298 bool is_thumb = (cpsr & PSR_T_BIT);
299 u32 vect_offset;
300 u32 return_offset = (is_thumb) ? 4 : 0;
301 bool is_lpae;
302
303 new_spsr_value = cpsr;
304 new_lr_value = *vcpu_pc(vcpu) + return_offset;
305
306 *vcpu_cpsr(vcpu) = (cpsr & ~MODE_MASK) | ABT_MODE;
307 *vcpu_cpsr(vcpu) |= PSR_I_BIT | PSR_A_BIT;
308 *vcpu_cpsr(vcpu) &= ~(PSR_IT_MASK | PSR_J_BIT | PSR_E_BIT | PSR_T_BIT);
309
310 if (sctlr & SCTLR_TE)
311 *vcpu_cpsr(vcpu) |= PSR_T_BIT;
312 if (sctlr & SCTLR_EE)
313 *vcpu_cpsr(vcpu) |= PSR_E_BIT;
314
315 /* Note: These now point to ABT banked copies */
316 *vcpu_spsr(vcpu) = cpsr;
317 *vcpu_reg(vcpu, 14) = new_lr_value;
318
319 if (is_pabt)
320 vect_offset = 12;
321 else
322 vect_offset = 16;
323
324 /* Branch to exception vector */
325 *vcpu_pc(vcpu) = exc_vector_base(vcpu) + vect_offset;
326
327 if (is_pabt) {
328 /* Set DFAR and DFSR */
329 vcpu->arch.cp15[c6_IFAR] = addr;
330 is_lpae = (vcpu->arch.cp15[c2_TTBCR] >> 31);
331 /* Always give debug fault for now - should give guest a clue */
332 if (is_lpae)
333 vcpu->arch.cp15[c5_IFSR] = 1 << 9 | 0x22;
334 else
335 vcpu->arch.cp15[c5_IFSR] = 2;
336 } else { /* !iabt */
337 /* Set DFAR and DFSR */
338 vcpu->arch.cp15[c6_DFAR] = addr;
339 is_lpae = (vcpu->arch.cp15[c2_TTBCR] >> 31);
340 /* Always give debug fault for now - should give guest a clue */
341 if (is_lpae)
342 vcpu->arch.cp15[c5_DFSR] = 1 << 9 | 0x22;
343 else
344 vcpu->arch.cp15[c5_DFSR] = 2;
345 }
346
347}
348
349/**
350 * kvm_inject_dabt - inject a data abort into the guest
351 * @vcpu: The VCPU to receive the undefined exception
352 * @addr: The address to report in the DFAR
353 *
354 * It is assumed that this code is called from the VCPU thread and that the
355 * VCPU therefore is not currently executing guest code.
356 */
357void kvm_inject_dabt(struct kvm_vcpu *vcpu, unsigned long addr)
358{
359 inject_abt(vcpu, false, addr);
360}
361
362/**
363 * kvm_inject_pabt - inject a prefetch abort into the guest
364 * @vcpu: The VCPU to receive the undefined exception
365 * @addr: The address to report in the DFAR
366 *
367 * It is assumed that this code is called from the VCPU thread and that the
368 * VCPU therefore is not currently executing guest code.
369 */
370void kvm_inject_pabt(struct kvm_vcpu *vcpu, unsigned long addr)
371{
372 inject_abt(vcpu, true, addr);
373}
diff --git a/arch/arm/kvm/guest.c b/arch/arm/kvm/guest.c
new file mode 100644
index 000000000000..2339d9609d36
--- /dev/null
+++ b/arch/arm/kvm/guest.c
@@ -0,0 +1,222 @@
1/*
2 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
3 * Author: Christoffer Dall <c.dall@virtualopensystems.com>
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 * 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 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#include <linux/errno.h>
20#include <linux/err.h>
21#include <linux/kvm_host.h>
22#include <linux/module.h>
23#include <linux/vmalloc.h>
24#include <linux/fs.h>
25#include <asm/uaccess.h>
26#include <asm/kvm.h>
27#include <asm/kvm_asm.h>
28#include <asm/kvm_emulate.h>
29#include <asm/kvm_coproc.h>
30
31#define VM_STAT(x) { #x, offsetof(struct kvm, stat.x), KVM_STAT_VM }
32#define VCPU_STAT(x) { #x, offsetof(struct kvm_vcpu, stat.x), KVM_STAT_VCPU }
33
34struct kvm_stats_debugfs_item debugfs_entries[] = {
35 { NULL }
36};
37
38int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
39{
40 return 0;
41}
42
43static u64 core_reg_offset_from_id(u64 id)
44{
45 return id & ~(KVM_REG_ARCH_MASK | KVM_REG_SIZE_MASK | KVM_REG_ARM_CORE);
46}
47
48static int get_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
49{
50 u32 __user *uaddr = (u32 __user *)(long)reg->addr;
51 struct kvm_regs *regs = &vcpu->arch.regs;
52 u64 off;
53
54 if (KVM_REG_SIZE(reg->id) != 4)
55 return -ENOENT;
56
57 /* Our ID is an index into the kvm_regs struct. */
58 off = core_reg_offset_from_id(reg->id);
59 if (off >= sizeof(*regs) / KVM_REG_SIZE(reg->id))
60 return -ENOENT;
61
62 return put_user(((u32 *)regs)[off], uaddr);
63}
64
65static int set_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
66{
67 u32 __user *uaddr = (u32 __user *)(long)reg->addr;
68 struct kvm_regs *regs = &vcpu->arch.regs;
69 u64 off, val;
70
71 if (KVM_REG_SIZE(reg->id) != 4)
72 return -ENOENT;
73
74 /* Our ID is an index into the kvm_regs struct. */
75 off = core_reg_offset_from_id(reg->id);
76 if (off >= sizeof(*regs) / KVM_REG_SIZE(reg->id))
77 return -ENOENT;
78
79 if (get_user(val, uaddr) != 0)
80 return -EFAULT;
81
82 if (off == KVM_REG_ARM_CORE_REG(usr_regs.ARM_cpsr)) {
83 unsigned long mode = val & MODE_MASK;
84 switch (mode) {
85 case USR_MODE:
86 case FIQ_MODE:
87 case IRQ_MODE:
88 case SVC_MODE:
89 case ABT_MODE:
90 case UND_MODE:
91 break;
92 default:
93 return -EINVAL;
94 }
95 }
96
97 ((u32 *)regs)[off] = val;
98 return 0;
99}
100
101int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
102{
103 return -EINVAL;
104}
105
106int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
107{
108 return -EINVAL;
109}
110
111static unsigned long num_core_regs(void)
112{
113 return sizeof(struct kvm_regs) / sizeof(u32);
114}
115
116/**
117 * kvm_arm_num_regs - how many registers do we present via KVM_GET_ONE_REG
118 *
119 * This is for all registers.
120 */
121unsigned long kvm_arm_num_regs(struct kvm_vcpu *vcpu)
122{
123 return num_core_regs() + kvm_arm_num_coproc_regs(vcpu);
124}
125
126/**
127 * kvm_arm_copy_reg_indices - get indices of all registers.
128 *
129 * We do core registers right here, then we apppend coproc regs.
130 */
131int kvm_arm_copy_reg_indices(struct kvm_vcpu *vcpu, u64 __user *uindices)
132{
133 unsigned int i;
134 const u64 core_reg = KVM_REG_ARM | KVM_REG_SIZE_U32 | KVM_REG_ARM_CORE;
135
136 for (i = 0; i < sizeof(struct kvm_regs)/sizeof(u32); i++) {
137 if (put_user(core_reg | i, uindices))
138 return -EFAULT;
139 uindices++;
140 }
141
142 return kvm_arm_copy_coproc_indices(vcpu, uindices);
143}
144
145int kvm_arm_get_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
146{
147 /* We currently use nothing arch-specific in upper 32 bits */
148 if ((reg->id & ~KVM_REG_SIZE_MASK) >> 32 != KVM_REG_ARM >> 32)
149 return -EINVAL;
150
151 /* Register group 16 means we want a core register. */
152 if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_CORE)
153 return get_core_reg(vcpu, reg);
154
155 return kvm_arm_coproc_get_reg(vcpu, reg);
156}
157
158int kvm_arm_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
159{
160 /* We currently use nothing arch-specific in upper 32 bits */
161 if ((reg->id & ~KVM_REG_SIZE_MASK) >> 32 != KVM_REG_ARM >> 32)
162 return -EINVAL;
163
164 /* Register group 16 means we set a core register. */
165 if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_CORE)
166 return set_core_reg(vcpu, reg);
167
168 return kvm_arm_coproc_set_reg(vcpu, reg);
169}
170
171int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
172 struct kvm_sregs *sregs)
173{
174 return -EINVAL;
175}
176
177int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
178 struct kvm_sregs *sregs)
179{
180 return -EINVAL;
181}
182
183int kvm_vcpu_set_target(struct kvm_vcpu *vcpu,
184 const struct kvm_vcpu_init *init)
185{
186 unsigned int i;
187
188 /* We can only do a cortex A15 for now. */
189 if (init->target != kvm_target_cpu())
190 return -EINVAL;
191
192 vcpu->arch.target = init->target;
193 bitmap_zero(vcpu->arch.features, KVM_VCPU_MAX_FEATURES);
194
195 /* -ENOENT for unknown features, -EINVAL for invalid combinations. */
196 for (i = 0; i < sizeof(init->features) * 8; i++) {
197 if (test_bit(i, (void *)init->features)) {
198 if (i >= KVM_VCPU_MAX_FEATURES)
199 return -ENOENT;
200 set_bit(i, vcpu->arch.features);
201 }
202 }
203
204 /* Now we know what it is, we can reset it. */
205 return kvm_reset_vcpu(vcpu);
206}
207
208int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
209{
210 return -EINVAL;
211}
212
213int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
214{
215 return -EINVAL;
216}
217
218int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu,
219 struct kvm_translation *tr)
220{
221 return -EINVAL;
222}
diff --git a/arch/arm/kvm/init.S b/arch/arm/kvm/init.S
new file mode 100644
index 000000000000..9f37a79b880b
--- /dev/null
+++ b/arch/arm/kvm/init.S
@@ -0,0 +1,114 @@
1/*
2 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
3 * Author: Christoffer Dall <c.dall@virtualopensystems.com>
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 * 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 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#include <linux/linkage.h>
20#include <asm/unified.h>
21#include <asm/asm-offsets.h>
22#include <asm/kvm_asm.h>
23#include <asm/kvm_arm.h>
24
25/********************************************************************
26 * Hypervisor initialization
27 * - should be called with:
28 * r0,r1 = Hypervisor pgd pointer
29 * r2 = top of Hyp stack (kernel VA)
30 * r3 = pointer to hyp vectors
31 */
32
33 .text
34 .pushsection .hyp.idmap.text,"ax"
35 .align 5
36__kvm_hyp_init:
37 .globl __kvm_hyp_init
38
39 @ Hyp-mode exception vector
40 W(b) .
41 W(b) .
42 W(b) .
43 W(b) .
44 W(b) .
45 W(b) __do_hyp_init
46 W(b) .
47 W(b) .
48
49__do_hyp_init:
50 @ Set the HTTBR to point to the hypervisor PGD pointer passed
51 mcrr p15, 4, r0, r1, c2
52
53 @ Set the HTCR and VTCR to the same shareability and cacheability
54 @ settings as the non-secure TTBCR and with T0SZ == 0.
55 mrc p15, 4, r0, c2, c0, 2 @ HTCR
56 ldr r12, =HTCR_MASK
57 bic r0, r0, r12
58 mrc p15, 0, r1, c2, c0, 2 @ TTBCR
59 and r1, r1, #(HTCR_MASK & ~TTBCR_T0SZ)
60 orr r0, r0, r1
61 mcr p15, 4, r0, c2, c0, 2 @ HTCR
62
63 mrc p15, 4, r1, c2, c1, 2 @ VTCR
64 ldr r12, =VTCR_MASK
65 bic r1, r1, r12
66 bic r0, r0, #(~VTCR_HTCR_SH) @ clear non-reusable HTCR bits
67 orr r1, r0, r1
68 orr r1, r1, #(KVM_VTCR_SL0 | KVM_VTCR_T0SZ | KVM_VTCR_S)
69 mcr p15, 4, r1, c2, c1, 2 @ VTCR
70
71 @ Use the same memory attributes for hyp. accesses as the kernel
72 @ (copy MAIRx ro HMAIRx).
73 mrc p15, 0, r0, c10, c2, 0
74 mcr p15, 4, r0, c10, c2, 0
75 mrc p15, 0, r0, c10, c2, 1
76 mcr p15, 4, r0, c10, c2, 1
77
78 @ Set the HSCTLR to:
79 @ - ARM/THUMB exceptions: Kernel config (Thumb-2 kernel)
80 @ - Endianness: Kernel config
81 @ - Fast Interrupt Features: Kernel config
82 @ - Write permission implies XN: disabled
83 @ - Instruction cache: enabled
84 @ - Data/Unified cache: enabled
85 @ - Memory alignment checks: enabled
86 @ - MMU: enabled (this code must be run from an identity mapping)
87 mrc p15, 4, r0, c1, c0, 0 @ HSCR
88 ldr r12, =HSCTLR_MASK
89 bic r0, r0, r12
90 mrc p15, 0, r1, c1, c0, 0 @ SCTLR
91 ldr r12, =(HSCTLR_EE | HSCTLR_FI | HSCTLR_I | HSCTLR_C)
92 and r1, r1, r12
93 ARM( ldr r12, =(HSCTLR_M | HSCTLR_A) )
94 THUMB( ldr r12, =(HSCTLR_M | HSCTLR_A | HSCTLR_TE) )
95 orr r1, r1, r12
96 orr r0, r0, r1
97 isb
98 mcr p15, 4, r0, c1, c0, 0 @ HSCR
99 isb
100
101 @ Set stack pointer and return to the kernel
102 mov sp, r2
103
104 @ Set HVBAR to point to the HYP vectors
105 mcr p15, 4, r3, c12, c0, 0 @ HVBAR
106
107 eret
108
109 .ltorg
110
111 .globl __kvm_hyp_init_end
112__kvm_hyp_init_end:
113
114 .popsection
diff --git a/arch/arm/kvm/interrupts.S b/arch/arm/kvm/interrupts.S
new file mode 100644
index 000000000000..8ca87ab0919d
--- /dev/null
+++ b/arch/arm/kvm/interrupts.S
@@ -0,0 +1,484 @@
1/*
2 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
3 * Author: Christoffer Dall <c.dall@virtualopensystems.com>
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 * 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 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#include <linux/linkage.h>
20#include <linux/const.h>
21#include <asm/unified.h>
22#include <asm/page.h>
23#include <asm/ptrace.h>
24#include <asm/asm-offsets.h>
25#include <asm/kvm_asm.h>
26#include <asm/kvm_arm.h>
27#include <asm/vfpmacros.h>
28#include "interrupts_head.S"
29
30 .text
31
32__kvm_hyp_code_start:
33 .globl __kvm_hyp_code_start
34
35/********************************************************************
36 * Flush per-VMID TLBs
37 *
38 * void __kvm_tlb_flush_vmid(struct kvm *kvm);
39 *
40 * We rely on the hardware to broadcast the TLB invalidation to all CPUs
41 * inside the inner-shareable domain (which is the case for all v7
42 * implementations). If we come across a non-IS SMP implementation, we'll
43 * have to use an IPI based mechanism. Until then, we stick to the simple
44 * hardware assisted version.
45 */
46ENTRY(__kvm_tlb_flush_vmid)
47 push {r2, r3}
48
49 add r0, r0, #KVM_VTTBR
50 ldrd r2, r3, [r0]
51 mcrr p15, 6, r2, r3, c2 @ Write VTTBR
52 isb
53 mcr p15, 0, r0, c8, c3, 0 @ TLBIALLIS (rt ignored)
54 dsb
55 isb
56 mov r2, #0
57 mov r3, #0
58 mcrr p15, 6, r2, r3, c2 @ Back to VMID #0
59 isb @ Not necessary if followed by eret
60
61 pop {r2, r3}
62 bx lr
63ENDPROC(__kvm_tlb_flush_vmid)
64
65/********************************************************************
66 * Flush TLBs and instruction caches of all CPUs inside the inner-shareable
67 * domain, for all VMIDs
68 *
69 * void __kvm_flush_vm_context(void);
70 */
71ENTRY(__kvm_flush_vm_context)
72 mov r0, #0 @ rn parameter for c15 flushes is SBZ
73
74 /* Invalidate NS Non-Hyp TLB Inner Shareable (TLBIALLNSNHIS) */
75 mcr p15, 4, r0, c8, c3, 4
76 /* Invalidate instruction caches Inner Shareable (ICIALLUIS) */
77 mcr p15, 0, r0, c7, c1, 0
78 dsb
79 isb @ Not necessary if followed by eret
80
81 bx lr
82ENDPROC(__kvm_flush_vm_context)
83
84
85/********************************************************************
86 * Hypervisor world-switch code
87 *
88 *
89 * int __kvm_vcpu_run(struct kvm_vcpu *vcpu)
90 */
91ENTRY(__kvm_vcpu_run)
92 @ Save the vcpu pointer
93 mcr p15, 4, vcpu, c13, c0, 2 @ HTPIDR
94
95 save_host_regs
96
97 restore_vgic_state
98 restore_timer_state
99
100 @ Store hardware CP15 state and load guest state
101 read_cp15_state store_to_vcpu = 0
102 write_cp15_state read_from_vcpu = 1
103
104 @ If the host kernel has not been configured with VFPv3 support,
105 @ then it is safer if we deny guests from using it as well.
106#ifdef CONFIG_VFPv3
107 @ Set FPEXC_EN so the guest doesn't trap floating point instructions
108 VFPFMRX r2, FPEXC @ VMRS
109 push {r2}
110 orr r2, r2, #FPEXC_EN
111 VFPFMXR FPEXC, r2 @ VMSR
112#endif
113
114 @ Configure Hyp-role
115 configure_hyp_role vmentry
116
117 @ Trap coprocessor CRx accesses
118 set_hstr vmentry
119 set_hcptr vmentry, (HCPTR_TTA | HCPTR_TCP(10) | HCPTR_TCP(11))
120 set_hdcr vmentry
121
122 @ Write configured ID register into MIDR alias
123 ldr r1, [vcpu, #VCPU_MIDR]
124 mcr p15, 4, r1, c0, c0, 0
125
126 @ Write guest view of MPIDR into VMPIDR
127 ldr r1, [vcpu, #CP15_OFFSET(c0_MPIDR)]
128 mcr p15, 4, r1, c0, c0, 5
129
130 @ Set up guest memory translation
131 ldr r1, [vcpu, #VCPU_KVM]
132 add r1, r1, #KVM_VTTBR
133 ldrd r2, r3, [r1]
134 mcrr p15, 6, r2, r3, c2 @ Write VTTBR
135
136 @ We're all done, just restore the GPRs and go to the guest
137 restore_guest_regs
138 clrex @ Clear exclusive monitor
139 eret
140
141__kvm_vcpu_return:
142 /*
143 * return convention:
144 * guest r0, r1, r2 saved on the stack
145 * r0: vcpu pointer
146 * r1: exception code
147 */
148 save_guest_regs
149
150 @ Set VMID == 0
151 mov r2, #0
152 mov r3, #0
153 mcrr p15, 6, r2, r3, c2 @ Write VTTBR
154
155 @ Don't trap coprocessor accesses for host kernel
156 set_hstr vmexit
157 set_hdcr vmexit
158 set_hcptr vmexit, (HCPTR_TTA | HCPTR_TCP(10) | HCPTR_TCP(11))
159
160#ifdef CONFIG_VFPv3
161 @ Save floating point registers we if let guest use them.
162 tst r2, #(HCPTR_TCP(10) | HCPTR_TCP(11))
163 bne after_vfp_restore
164
165 @ Switch VFP/NEON hardware state to the host's
166 add r7, vcpu, #VCPU_VFP_GUEST
167 store_vfp_state r7
168 add r7, vcpu, #VCPU_VFP_HOST
169 ldr r7, [r7]
170 restore_vfp_state r7
171
172after_vfp_restore:
173 @ Restore FPEXC_EN which we clobbered on entry
174 pop {r2}
175 VFPFMXR FPEXC, r2
176#endif
177
178 @ Reset Hyp-role
179 configure_hyp_role vmexit
180
181 @ Let host read hardware MIDR
182 mrc p15, 0, r2, c0, c0, 0
183 mcr p15, 4, r2, c0, c0, 0
184
185 @ Back to hardware MPIDR
186 mrc p15, 0, r2, c0, c0, 5
187 mcr p15, 4, r2, c0, c0, 5
188
189 @ Store guest CP15 state and restore host state
190 read_cp15_state store_to_vcpu = 1
191 write_cp15_state read_from_vcpu = 0
192
193 save_timer_state
194 save_vgic_state
195
196 restore_host_regs
197 clrex @ Clear exclusive monitor
198 mov r0, r1 @ Return the return code
199 mov r1, #0 @ Clear upper bits in return value
200 bx lr @ return to IOCTL
201
202/********************************************************************
203 * Call function in Hyp mode
204 *
205 *
206 * u64 kvm_call_hyp(void *hypfn, ...);
207 *
208 * This is not really a variadic function in the classic C-way and care must
209 * be taken when calling this to ensure parameters are passed in registers
210 * only, since the stack will change between the caller and the callee.
211 *
212 * Call the function with the first argument containing a pointer to the
213 * function you wish to call in Hyp mode, and subsequent arguments will be
214 * passed as r0, r1, and r2 (a maximum of 3 arguments in addition to the
215 * function pointer can be passed). The function being called must be mapped
216 * in Hyp mode (see init_hyp_mode in arch/arm/kvm/arm.c). Return values are
217 * passed in r0 and r1.
218 *
219 * The calling convention follows the standard AAPCS:
220 * r0 - r3: caller save
221 * r12: caller save
222 * rest: callee save
223 */
224ENTRY(kvm_call_hyp)
225 hvc #0
226 bx lr
227
228/********************************************************************
229 * Hypervisor exception vector and handlers
230 *
231 *
232 * The KVM/ARM Hypervisor ABI is defined as follows:
233 *
234 * Entry to Hyp mode from the host kernel will happen _only_ when an HVC
235 * instruction is issued since all traps are disabled when running the host
236 * kernel as per the Hyp-mode initialization at boot time.
237 *
238 * HVC instructions cause a trap to the vector page + offset 0x18 (see hyp_hvc
239 * below) when the HVC instruction is called from SVC mode (i.e. a guest or the
240 * host kernel) and they cause a trap to the vector page + offset 0xc when HVC
241 * instructions are called from within Hyp-mode.
242 *
243 * Hyp-ABI: Calling HYP-mode functions from host (in SVC mode):
244 * Switching to Hyp mode is done through a simple HVC #0 instruction. The
245 * exception vector code will check that the HVC comes from VMID==0 and if
246 * so will push the necessary state (SPSR, lr_usr) on the Hyp stack.
247 * - r0 contains a pointer to a HYP function
248 * - r1, r2, and r3 contain arguments to the above function.
249 * - The HYP function will be called with its arguments in r0, r1 and r2.
250 * On HYP function return, we return directly to SVC.
251 *
252 * Note that the above is used to execute code in Hyp-mode from a host-kernel
253 * point of view, and is a different concept from performing a world-switch and
254 * executing guest code SVC mode (with a VMID != 0).
255 */
256
257/* Handle undef, svc, pabt, or dabt by crashing with a user notice */
258.macro bad_exception exception_code, panic_str
259 push {r0-r2}
260 mrrc p15, 6, r0, r1, c2 @ Read VTTBR
261 lsr r1, r1, #16
262 ands r1, r1, #0xff
263 beq 99f
264
265 load_vcpu @ Load VCPU pointer
266 .if \exception_code == ARM_EXCEPTION_DATA_ABORT
267 mrc p15, 4, r2, c5, c2, 0 @ HSR
268 mrc p15, 4, r1, c6, c0, 0 @ HDFAR
269 str r2, [vcpu, #VCPU_HSR]
270 str r1, [vcpu, #VCPU_HxFAR]
271 .endif
272 .if \exception_code == ARM_EXCEPTION_PREF_ABORT
273 mrc p15, 4, r2, c5, c2, 0 @ HSR
274 mrc p15, 4, r1, c6, c0, 2 @ HIFAR
275 str r2, [vcpu, #VCPU_HSR]
276 str r1, [vcpu, #VCPU_HxFAR]
277 .endif
278 mov r1, #\exception_code
279 b __kvm_vcpu_return
280
281 @ We were in the host already. Let's craft a panic-ing return to SVC.
28299: mrs r2, cpsr
283 bic r2, r2, #MODE_MASK
284 orr r2, r2, #SVC_MODE
285THUMB( orr r2, r2, #PSR_T_BIT )
286 msr spsr_cxsf, r2
287 mrs r1, ELR_hyp
288 ldr r2, =BSYM(panic)
289 msr ELR_hyp, r2
290 ldr r0, =\panic_str
291 eret
292.endm
293
294 .text
295
296 .align 5
297__kvm_hyp_vector:
298 .globl __kvm_hyp_vector
299
300 @ Hyp-mode exception vector
301 W(b) hyp_reset
302 W(b) hyp_undef
303 W(b) hyp_svc
304 W(b) hyp_pabt
305 W(b) hyp_dabt
306 W(b) hyp_hvc
307 W(b) hyp_irq
308 W(b) hyp_fiq
309
310 .align
311hyp_reset:
312 b hyp_reset
313
314 .align
315hyp_undef:
316 bad_exception ARM_EXCEPTION_UNDEFINED, und_die_str
317
318 .align
319hyp_svc:
320 bad_exception ARM_EXCEPTION_HVC, svc_die_str
321
322 .align
323hyp_pabt:
324 bad_exception ARM_EXCEPTION_PREF_ABORT, pabt_die_str
325
326 .align
327hyp_dabt:
328 bad_exception ARM_EXCEPTION_DATA_ABORT, dabt_die_str
329
330 .align
331hyp_hvc:
332 /*
333 * Getting here is either becuase of a trap from a guest or from calling
334 * HVC from the host kernel, which means "switch to Hyp mode".
335 */
336 push {r0, r1, r2}
337
338 @ Check syndrome register
339 mrc p15, 4, r1, c5, c2, 0 @ HSR
340 lsr r0, r1, #HSR_EC_SHIFT
341#ifdef CONFIG_VFPv3
342 cmp r0, #HSR_EC_CP_0_13
343 beq switch_to_guest_vfp
344#endif
345 cmp r0, #HSR_EC_HVC
346 bne guest_trap @ Not HVC instr.
347
348 /*
349 * Let's check if the HVC came from VMID 0 and allow simple
350 * switch to Hyp mode
351 */
352 mrrc p15, 6, r0, r2, c2
353 lsr r2, r2, #16
354 and r2, r2, #0xff
355 cmp r2, #0
356 bne guest_trap @ Guest called HVC
357
358host_switch_to_hyp:
359 pop {r0, r1, r2}
360
361 push {lr}
362 mrs lr, SPSR
363 push {lr}
364
365 mov lr, r0
366 mov r0, r1
367 mov r1, r2
368 mov r2, r3
369
370THUMB( orr lr, #1)
371 blx lr @ Call the HYP function
372
373 pop {lr}
374 msr SPSR_csxf, lr
375 pop {lr}
376 eret
377
378guest_trap:
379 load_vcpu @ Load VCPU pointer to r0
380 str r1, [vcpu, #VCPU_HSR]
381
382 @ Check if we need the fault information
383 lsr r1, r1, #HSR_EC_SHIFT
384 cmp r1, #HSR_EC_IABT
385 mrceq p15, 4, r2, c6, c0, 2 @ HIFAR
386 beq 2f
387 cmp r1, #HSR_EC_DABT
388 bne 1f
389 mrc p15, 4, r2, c6, c0, 0 @ HDFAR
390
3912: str r2, [vcpu, #VCPU_HxFAR]
392
393 /*
394 * B3.13.5 Reporting exceptions taken to the Non-secure PL2 mode:
395 *
396 * Abort on the stage 2 translation for a memory access from a
397 * Non-secure PL1 or PL0 mode:
398 *
399 * For any Access flag fault or Translation fault, and also for any
400 * Permission fault on the stage 2 translation of a memory access
401 * made as part of a translation table walk for a stage 1 translation,
402 * the HPFAR holds the IPA that caused the fault. Otherwise, the HPFAR
403 * is UNKNOWN.
404 */
405
406 /* Check for permission fault, and S1PTW */
407 mrc p15, 4, r1, c5, c2, 0 @ HSR
408 and r0, r1, #HSR_FSC_TYPE
409 cmp r0, #FSC_PERM
410 tsteq r1, #(1 << 7) @ S1PTW
411 mrcne p15, 4, r2, c6, c0, 4 @ HPFAR
412 bne 3f
413
414 /* Resolve IPA using the xFAR */
415 mcr p15, 0, r2, c7, c8, 0 @ ATS1CPR
416 isb
417 mrrc p15, 0, r0, r1, c7 @ PAR
418 tst r0, #1
419 bne 4f @ Failed translation
420 ubfx r2, r0, #12, #20
421 lsl r2, r2, #4
422 orr r2, r2, r1, lsl #24
423
4243: load_vcpu @ Load VCPU pointer to r0
425 str r2, [r0, #VCPU_HPFAR]
426
4271: mov r1, #ARM_EXCEPTION_HVC
428 b __kvm_vcpu_return
429
4304: pop {r0, r1, r2} @ Failed translation, return to guest
431 eret
432
433/*
434 * If VFPv3 support is not available, then we will not switch the VFP
435 * registers; however cp10 and cp11 accesses will still trap and fallback
436 * to the regular coprocessor emulation code, which currently will
437 * inject an undefined exception to the guest.
438 */
439#ifdef CONFIG_VFPv3
440switch_to_guest_vfp:
441 load_vcpu @ Load VCPU pointer to r0
442 push {r3-r7}
443
444 @ NEON/VFP used. Turn on VFP access.
445 set_hcptr vmexit, (HCPTR_TCP(10) | HCPTR_TCP(11))
446
447 @ Switch VFP/NEON hardware state to the guest's
448 add r7, r0, #VCPU_VFP_HOST
449 ldr r7, [r7]
450 store_vfp_state r7
451 add r7, r0, #VCPU_VFP_GUEST
452 restore_vfp_state r7
453
454 pop {r3-r7}
455 pop {r0-r2}
456 eret
457#endif
458
459 .align
460hyp_irq:
461 push {r0, r1, r2}
462 mov r1, #ARM_EXCEPTION_IRQ
463 load_vcpu @ Load VCPU pointer to r0
464 b __kvm_vcpu_return
465
466 .align
467hyp_fiq:
468 b hyp_fiq
469
470 .ltorg
471
472__kvm_hyp_code_end:
473 .globl __kvm_hyp_code_end
474
475 .section ".rodata"
476
477und_die_str:
478 .ascii "unexpected undefined exception in Hyp mode at: %#08x"
479pabt_die_str:
480 .ascii "unexpected prefetch abort in Hyp mode at: %#08x"
481dabt_die_str:
482 .ascii "unexpected data abort in Hyp mode at: %#08x"
483svc_die_str:
484 .ascii "unexpected HVC/SVC trap in Hyp mode at: %#08x"
diff --git a/arch/arm/kvm/interrupts_head.S b/arch/arm/kvm/interrupts_head.S
new file mode 100644
index 000000000000..3c8f2f0b4c5e
--- /dev/null
+++ b/arch/arm/kvm/interrupts_head.S
@@ -0,0 +1,605 @@
1#include <linux/irqchip/arm-gic.h>
2
3#define VCPU_USR_REG(_reg_nr) (VCPU_USR_REGS + (_reg_nr * 4))
4#define VCPU_USR_SP (VCPU_USR_REG(13))
5#define VCPU_USR_LR (VCPU_USR_REG(14))
6#define CP15_OFFSET(_cp15_reg_idx) (VCPU_CP15 + (_cp15_reg_idx * 4))
7
8/*
9 * Many of these macros need to access the VCPU structure, which is always
10 * held in r0. These macros should never clobber r1, as it is used to hold the
11 * exception code on the return path (except of course the macro that switches
12 * all the registers before the final jump to the VM).
13 */
14vcpu .req r0 @ vcpu pointer always in r0
15
16/* Clobbers {r2-r6} */
17.macro store_vfp_state vfp_base
18 @ The VFPFMRX and VFPFMXR macros are the VMRS and VMSR instructions
19 VFPFMRX r2, FPEXC
20 @ Make sure VFP is enabled so we can touch the registers.
21 orr r6, r2, #FPEXC_EN
22 VFPFMXR FPEXC, r6
23
24 VFPFMRX r3, FPSCR
25 tst r2, #FPEXC_EX @ Check for VFP Subarchitecture
26 beq 1f
27 @ If FPEXC_EX is 0, then FPINST/FPINST2 reads are upredictable, so
28 @ we only need to save them if FPEXC_EX is set.
29 VFPFMRX r4, FPINST
30 tst r2, #FPEXC_FP2V
31 VFPFMRX r5, FPINST2, ne @ vmrsne
32 bic r6, r2, #FPEXC_EX @ FPEXC_EX disable
33 VFPFMXR FPEXC, r6
341:
35 VFPFSTMIA \vfp_base, r6 @ Save VFP registers
36 stm \vfp_base, {r2-r5} @ Save FPEXC, FPSCR, FPINST, FPINST2
37.endm
38
39/* Assume FPEXC_EN is on and FPEXC_EX is off, clobbers {r2-r6} */
40.macro restore_vfp_state vfp_base
41 VFPFLDMIA \vfp_base, r6 @ Load VFP registers
42 ldm \vfp_base, {r2-r5} @ Load FPEXC, FPSCR, FPINST, FPINST2
43
44 VFPFMXR FPSCR, r3
45 tst r2, #FPEXC_EX @ Check for VFP Subarchitecture
46 beq 1f
47 VFPFMXR FPINST, r4
48 tst r2, #FPEXC_FP2V
49 VFPFMXR FPINST2, r5, ne
501:
51 VFPFMXR FPEXC, r2 @ FPEXC (last, in case !EN)
52.endm
53
54/* These are simply for the macros to work - value don't have meaning */
55.equ usr, 0
56.equ svc, 1
57.equ abt, 2
58.equ und, 3
59.equ irq, 4
60.equ fiq, 5
61
62.macro push_host_regs_mode mode
63 mrs r2, SP_\mode
64 mrs r3, LR_\mode
65 mrs r4, SPSR_\mode
66 push {r2, r3, r4}
67.endm
68
69/*
70 * Store all host persistent registers on the stack.
71 * Clobbers all registers, in all modes, except r0 and r1.
72 */
73.macro save_host_regs
74 /* Hyp regs. Only ELR_hyp (SPSR_hyp already saved) */
75 mrs r2, ELR_hyp
76 push {r2}
77
78 /* usr regs */
79 push {r4-r12} @ r0-r3 are always clobbered
80 mrs r2, SP_usr
81 mov r3, lr
82 push {r2, r3}
83
84 push_host_regs_mode svc
85 push_host_regs_mode abt
86 push_host_regs_mode und
87 push_host_regs_mode irq
88
89 /* fiq regs */
90 mrs r2, r8_fiq
91 mrs r3, r9_fiq
92 mrs r4, r10_fiq
93 mrs r5, r11_fiq
94 mrs r6, r12_fiq
95 mrs r7, SP_fiq
96 mrs r8, LR_fiq
97 mrs r9, SPSR_fiq
98 push {r2-r9}
99.endm
100
101.macro pop_host_regs_mode mode
102 pop {r2, r3, r4}
103 msr SP_\mode, r2
104 msr LR_\mode, r3
105 msr SPSR_\mode, r4
106.endm
107
108/*
109 * Restore all host registers from the stack.
110 * Clobbers all registers, in all modes, except r0 and r1.
111 */
112.macro restore_host_regs
113 pop {r2-r9}
114 msr r8_fiq, r2
115 msr r9_fiq, r3
116 msr r10_fiq, r4
117 msr r11_fiq, r5
118 msr r12_fiq, r6
119 msr SP_fiq, r7
120 msr LR_fiq, r8
121 msr SPSR_fiq, r9
122
123 pop_host_regs_mode irq
124 pop_host_regs_mode und
125 pop_host_regs_mode abt
126 pop_host_regs_mode svc
127
128 pop {r2, r3}
129 msr SP_usr, r2
130 mov lr, r3
131 pop {r4-r12}
132
133 pop {r2}
134 msr ELR_hyp, r2
135.endm
136
137/*
138 * Restore SP, LR and SPSR for a given mode. offset is the offset of
139 * this mode's registers from the VCPU base.
140 *
141 * Assumes vcpu pointer in vcpu reg
142 *
143 * Clobbers r1, r2, r3, r4.
144 */
145.macro restore_guest_regs_mode mode, offset
146 add r1, vcpu, \offset
147 ldm r1, {r2, r3, r4}
148 msr SP_\mode, r2
149 msr LR_\mode, r3
150 msr SPSR_\mode, r4
151.endm
152
153/*
154 * Restore all guest registers from the vcpu struct.
155 *
156 * Assumes vcpu pointer in vcpu reg
157 *
158 * Clobbers *all* registers.
159 */
160.macro restore_guest_regs
161 restore_guest_regs_mode svc, #VCPU_SVC_REGS
162 restore_guest_regs_mode abt, #VCPU_ABT_REGS
163 restore_guest_regs_mode und, #VCPU_UND_REGS
164 restore_guest_regs_mode irq, #VCPU_IRQ_REGS
165
166 add r1, vcpu, #VCPU_FIQ_REGS
167 ldm r1, {r2-r9}
168 msr r8_fiq, r2
169 msr r9_fiq, r3
170 msr r10_fiq, r4
171 msr r11_fiq, r5
172 msr r12_fiq, r6
173 msr SP_fiq, r7
174 msr LR_fiq, r8
175 msr SPSR_fiq, r9
176
177 @ Load return state
178 ldr r2, [vcpu, #VCPU_PC]
179 ldr r3, [vcpu, #VCPU_CPSR]
180 msr ELR_hyp, r2
181 msr SPSR_cxsf, r3
182
183 @ Load user registers
184 ldr r2, [vcpu, #VCPU_USR_SP]
185 ldr r3, [vcpu, #VCPU_USR_LR]
186 msr SP_usr, r2
187 mov lr, r3
188 add vcpu, vcpu, #(VCPU_USR_REGS)
189 ldm vcpu, {r0-r12}
190.endm
191
192/*
193 * Save SP, LR and SPSR for a given mode. offset is the offset of
194 * this mode's registers from the VCPU base.
195 *
196 * Assumes vcpu pointer in vcpu reg
197 *
198 * Clobbers r2, r3, r4, r5.
199 */
200.macro save_guest_regs_mode mode, offset
201 add r2, vcpu, \offset
202 mrs r3, SP_\mode
203 mrs r4, LR_\mode
204 mrs r5, SPSR_\mode
205 stm r2, {r3, r4, r5}
206.endm
207
208/*
209 * Save all guest registers to the vcpu struct
210 * Expects guest's r0, r1, r2 on the stack.
211 *
212 * Assumes vcpu pointer in vcpu reg
213 *
214 * Clobbers r2, r3, r4, r5.
215 */
216.macro save_guest_regs
217 @ Store usr registers
218 add r2, vcpu, #VCPU_USR_REG(3)
219 stm r2, {r3-r12}
220 add r2, vcpu, #VCPU_USR_REG(0)
221 pop {r3, r4, r5} @ r0, r1, r2
222 stm r2, {r3, r4, r5}
223 mrs r2, SP_usr
224 mov r3, lr
225 str r2, [vcpu, #VCPU_USR_SP]
226 str r3, [vcpu, #VCPU_USR_LR]
227
228 @ Store return state
229 mrs r2, ELR_hyp
230 mrs r3, spsr
231 str r2, [vcpu, #VCPU_PC]
232 str r3, [vcpu, #VCPU_CPSR]
233
234 @ Store other guest registers
235 save_guest_regs_mode svc, #VCPU_SVC_REGS
236 save_guest_regs_mode abt, #VCPU_ABT_REGS
237 save_guest_regs_mode und, #VCPU_UND_REGS
238 save_guest_regs_mode irq, #VCPU_IRQ_REGS
239.endm
240
241/* Reads cp15 registers from hardware and stores them in memory
242 * @store_to_vcpu: If 0, registers are written in-order to the stack,
243 * otherwise to the VCPU struct pointed to by vcpup
244 *
245 * Assumes vcpu pointer in vcpu reg
246 *
247 * Clobbers r2 - r12
248 */
249.macro read_cp15_state store_to_vcpu
250 mrc p15, 0, r2, c1, c0, 0 @ SCTLR
251 mrc p15, 0, r3, c1, c0, 2 @ CPACR
252 mrc p15, 0, r4, c2, c0, 2 @ TTBCR
253 mrc p15, 0, r5, c3, c0, 0 @ DACR
254 mrrc p15, 0, r6, r7, c2 @ TTBR 0
255 mrrc p15, 1, r8, r9, c2 @ TTBR 1
256 mrc p15, 0, r10, c10, c2, 0 @ PRRR
257 mrc p15, 0, r11, c10, c2, 1 @ NMRR
258 mrc p15, 2, r12, c0, c0, 0 @ CSSELR
259
260 .if \store_to_vcpu == 0
261 push {r2-r12} @ Push CP15 registers
262 .else
263 str r2, [vcpu, #CP15_OFFSET(c1_SCTLR)]
264 str r3, [vcpu, #CP15_OFFSET(c1_CPACR)]
265 str r4, [vcpu, #CP15_OFFSET(c2_TTBCR)]
266 str r5, [vcpu, #CP15_OFFSET(c3_DACR)]
267 add r2, vcpu, #CP15_OFFSET(c2_TTBR0)
268 strd r6, r7, [r2]
269 add r2, vcpu, #CP15_OFFSET(c2_TTBR1)
270 strd r8, r9, [r2]
271 str r10, [vcpu, #CP15_OFFSET(c10_PRRR)]
272 str r11, [vcpu, #CP15_OFFSET(c10_NMRR)]
273 str r12, [vcpu, #CP15_OFFSET(c0_CSSELR)]
274 .endif
275
276 mrc p15, 0, r2, c13, c0, 1 @ CID
277 mrc p15, 0, r3, c13, c0, 2 @ TID_URW
278 mrc p15, 0, r4, c13, c0, 3 @ TID_URO
279 mrc p15, 0, r5, c13, c0, 4 @ TID_PRIV
280 mrc p15, 0, r6, c5, c0, 0 @ DFSR
281 mrc p15, 0, r7, c5, c0, 1 @ IFSR
282 mrc p15, 0, r8, c5, c1, 0 @ ADFSR
283 mrc p15, 0, r9, c5, c1, 1 @ AIFSR
284 mrc p15, 0, r10, c6, c0, 0 @ DFAR
285 mrc p15, 0, r11, c6, c0, 2 @ IFAR
286 mrc p15, 0, r12, c12, c0, 0 @ VBAR
287
288 .if \store_to_vcpu == 0
289 push {r2-r12} @ Push CP15 registers
290 .else
291 str r2, [vcpu, #CP15_OFFSET(c13_CID)]
292 str r3, [vcpu, #CP15_OFFSET(c13_TID_URW)]
293 str r4, [vcpu, #CP15_OFFSET(c13_TID_URO)]
294 str r5, [vcpu, #CP15_OFFSET(c13_TID_PRIV)]
295 str r6, [vcpu, #CP15_OFFSET(c5_DFSR)]
296 str r7, [vcpu, #CP15_OFFSET(c5_IFSR)]
297 str r8, [vcpu, #CP15_OFFSET(c5_ADFSR)]
298 str r9, [vcpu, #CP15_OFFSET(c5_AIFSR)]
299 str r10, [vcpu, #CP15_OFFSET(c6_DFAR)]
300 str r11, [vcpu, #CP15_OFFSET(c6_IFAR)]
301 str r12, [vcpu, #CP15_OFFSET(c12_VBAR)]
302 .endif
303
304 mrc p15, 0, r2, c14, c1, 0 @ CNTKCTL
305
306 .if \store_to_vcpu == 0
307 push {r2}
308 .else
309 str r2, [vcpu, #CP15_OFFSET(c14_CNTKCTL)]
310 .endif
311.endm
312
313/*
314 * Reads cp15 registers from memory and writes them to hardware
315 * @read_from_vcpu: If 0, registers are read in-order from the stack,
316 * otherwise from the VCPU struct pointed to by vcpup
317 *
318 * Assumes vcpu pointer in vcpu reg
319 */
320.macro write_cp15_state read_from_vcpu
321 .if \read_from_vcpu == 0
322 pop {r2}
323 .else
324 ldr r2, [vcpu, #CP15_OFFSET(c14_CNTKCTL)]
325 .endif
326
327 mcr p15, 0, r2, c14, c1, 0 @ CNTKCTL
328
329 .if \read_from_vcpu == 0
330 pop {r2-r12}
331 .else
332 ldr r2, [vcpu, #CP15_OFFSET(c13_CID)]
333 ldr r3, [vcpu, #CP15_OFFSET(c13_TID_URW)]
334 ldr r4, [vcpu, #CP15_OFFSET(c13_TID_URO)]
335 ldr r5, [vcpu, #CP15_OFFSET(c13_TID_PRIV)]
336 ldr r6, [vcpu, #CP15_OFFSET(c5_DFSR)]
337 ldr r7, [vcpu, #CP15_OFFSET(c5_IFSR)]
338 ldr r8, [vcpu, #CP15_OFFSET(c5_ADFSR)]
339 ldr r9, [vcpu, #CP15_OFFSET(c5_AIFSR)]
340 ldr r10, [vcpu, #CP15_OFFSET(c6_DFAR)]
341 ldr r11, [vcpu, #CP15_OFFSET(c6_IFAR)]
342 ldr r12, [vcpu, #CP15_OFFSET(c12_VBAR)]
343 .endif
344
345 mcr p15, 0, r2, c13, c0, 1 @ CID
346 mcr p15, 0, r3, c13, c0, 2 @ TID_URW
347 mcr p15, 0, r4, c13, c0, 3 @ TID_URO
348 mcr p15, 0, r5, c13, c0, 4 @ TID_PRIV
349 mcr p15, 0, r6, c5, c0, 0 @ DFSR
350 mcr p15, 0, r7, c5, c0, 1 @ IFSR
351 mcr p15, 0, r8, c5, c1, 0 @ ADFSR
352 mcr p15, 0, r9, c5, c1, 1 @ AIFSR
353 mcr p15, 0, r10, c6, c0, 0 @ DFAR
354 mcr p15, 0, r11, c6, c0, 2 @ IFAR
355 mcr p15, 0, r12, c12, c0, 0 @ VBAR
356
357 .if \read_from_vcpu == 0
358 pop {r2-r12}
359 .else
360 ldr r2, [vcpu, #CP15_OFFSET(c1_SCTLR)]
361 ldr r3, [vcpu, #CP15_OFFSET(c1_CPACR)]
362 ldr r4, [vcpu, #CP15_OFFSET(c2_TTBCR)]
363 ldr r5, [vcpu, #CP15_OFFSET(c3_DACR)]
364 add r12, vcpu, #CP15_OFFSET(c2_TTBR0)
365 ldrd r6, r7, [r12]
366 add r12, vcpu, #CP15_OFFSET(c2_TTBR1)
367 ldrd r8, r9, [r12]
368 ldr r10, [vcpu, #CP15_OFFSET(c10_PRRR)]
369 ldr r11, [vcpu, #CP15_OFFSET(c10_NMRR)]
370 ldr r12, [vcpu, #CP15_OFFSET(c0_CSSELR)]
371 .endif
372
373 mcr p15, 0, r2, c1, c0, 0 @ SCTLR
374 mcr p15, 0, r3, c1, c0, 2 @ CPACR
375 mcr p15, 0, r4, c2, c0, 2 @ TTBCR
376 mcr p15, 0, r5, c3, c0, 0 @ DACR
377 mcrr p15, 0, r6, r7, c2 @ TTBR 0
378 mcrr p15, 1, r8, r9, c2 @ TTBR 1
379 mcr p15, 0, r10, c10, c2, 0 @ PRRR
380 mcr p15, 0, r11, c10, c2, 1 @ NMRR
381 mcr p15, 2, r12, c0, c0, 0 @ CSSELR
382.endm
383
384/*
385 * Save the VGIC CPU state into memory
386 *
387 * Assumes vcpu pointer in vcpu reg
388 */
389.macro save_vgic_state
390#ifdef CONFIG_KVM_ARM_VGIC
391 /* Get VGIC VCTRL base into r2 */
392 ldr r2, [vcpu, #VCPU_KVM]
393 ldr r2, [r2, #KVM_VGIC_VCTRL]
394 cmp r2, #0
395 beq 2f
396
397 /* Compute the address of struct vgic_cpu */
398 add r11, vcpu, #VCPU_VGIC_CPU
399
400 /* Save all interesting registers */
401 ldr r3, [r2, #GICH_HCR]
402 ldr r4, [r2, #GICH_VMCR]
403 ldr r5, [r2, #GICH_MISR]
404 ldr r6, [r2, #GICH_EISR0]
405 ldr r7, [r2, #GICH_EISR1]
406 ldr r8, [r2, #GICH_ELRSR0]
407 ldr r9, [r2, #GICH_ELRSR1]
408 ldr r10, [r2, #GICH_APR]
409
410 str r3, [r11, #VGIC_CPU_HCR]
411 str r4, [r11, #VGIC_CPU_VMCR]
412 str r5, [r11, #VGIC_CPU_MISR]
413 str r6, [r11, #VGIC_CPU_EISR]
414 str r7, [r11, #(VGIC_CPU_EISR + 4)]
415 str r8, [r11, #VGIC_CPU_ELRSR]
416 str r9, [r11, #(VGIC_CPU_ELRSR + 4)]
417 str r10, [r11, #VGIC_CPU_APR]
418
419 /* Clear GICH_HCR */
420 mov r5, #0
421 str r5, [r2, #GICH_HCR]
422
423 /* Save list registers */
424 add r2, r2, #GICH_LR0
425 add r3, r11, #VGIC_CPU_LR
426 ldr r4, [r11, #VGIC_CPU_NR_LR]
4271: ldr r6, [r2], #4
428 str r6, [r3], #4
429 subs r4, r4, #1
430 bne 1b
4312:
432#endif
433.endm
434
435/*
436 * Restore the VGIC CPU state from memory
437 *
438 * Assumes vcpu pointer in vcpu reg
439 */
440.macro restore_vgic_state
441#ifdef CONFIG_KVM_ARM_VGIC
442 /* Get VGIC VCTRL base into r2 */
443 ldr r2, [vcpu, #VCPU_KVM]
444 ldr r2, [r2, #KVM_VGIC_VCTRL]
445 cmp r2, #0
446 beq 2f
447
448 /* Compute the address of struct vgic_cpu */
449 add r11, vcpu, #VCPU_VGIC_CPU
450
451 /* We only restore a minimal set of registers */
452 ldr r3, [r11, #VGIC_CPU_HCR]
453 ldr r4, [r11, #VGIC_CPU_VMCR]
454 ldr r8, [r11, #VGIC_CPU_APR]
455
456 str r3, [r2, #GICH_HCR]
457 str r4, [r2, #GICH_VMCR]
458 str r8, [r2, #GICH_APR]
459
460 /* Restore list registers */
461 add r2, r2, #GICH_LR0
462 add r3, r11, #VGIC_CPU_LR
463 ldr r4, [r11, #VGIC_CPU_NR_LR]
4641: ldr r6, [r3], #4
465 str r6, [r2], #4
466 subs r4, r4, #1
467 bne 1b
4682:
469#endif
470.endm
471
472#define CNTHCTL_PL1PCTEN (1 << 0)
473#define CNTHCTL_PL1PCEN (1 << 1)
474
475/*
476 * Save the timer state onto the VCPU and allow physical timer/counter access
477 * for the host.
478 *
479 * Assumes vcpu pointer in vcpu reg
480 * Clobbers r2-r5
481 */
482.macro save_timer_state
483#ifdef CONFIG_KVM_ARM_TIMER
484 ldr r4, [vcpu, #VCPU_KVM]
485 ldr r2, [r4, #KVM_TIMER_ENABLED]
486 cmp r2, #0
487 beq 1f
488
489 mrc p15, 0, r2, c14, c3, 1 @ CNTV_CTL
490 str r2, [vcpu, #VCPU_TIMER_CNTV_CTL]
491 bic r2, #1 @ Clear ENABLE
492 mcr p15, 0, r2, c14, c3, 1 @ CNTV_CTL
493 isb
494
495 mrrc p15, 3, r2, r3, c14 @ CNTV_CVAL
496 ldr r4, =VCPU_TIMER_CNTV_CVAL
497 add r5, vcpu, r4
498 strd r2, r3, [r5]
499
5001:
501#endif
502 @ Allow physical timer/counter access for the host
503 mrc p15, 4, r2, c14, c1, 0 @ CNTHCTL
504 orr r2, r2, #(CNTHCTL_PL1PCEN | CNTHCTL_PL1PCTEN)
505 mcr p15, 4, r2, c14, c1, 0 @ CNTHCTL
506.endm
507
508/*
509 * Load the timer state from the VCPU and deny physical timer/counter access
510 * for the host.
511 *
512 * Assumes vcpu pointer in vcpu reg
513 * Clobbers r2-r5
514 */
515.macro restore_timer_state
516 @ Disallow physical timer access for the guest
517 @ Physical counter access is allowed
518 mrc p15, 4, r2, c14, c1, 0 @ CNTHCTL
519 orr r2, r2, #CNTHCTL_PL1PCTEN
520 bic r2, r2, #CNTHCTL_PL1PCEN
521 mcr p15, 4, r2, c14, c1, 0 @ CNTHCTL
522
523#ifdef CONFIG_KVM_ARM_TIMER
524 ldr r4, [vcpu, #VCPU_KVM]
525 ldr r2, [r4, #KVM_TIMER_ENABLED]
526 cmp r2, #0
527 beq 1f
528
529 ldr r2, [r4, #KVM_TIMER_CNTVOFF]
530 ldr r3, [r4, #(KVM_TIMER_CNTVOFF + 4)]
531 mcrr p15, 4, r2, r3, c14 @ CNTVOFF
532
533 ldr r4, =VCPU_TIMER_CNTV_CVAL
534 add r5, vcpu, r4
535 ldrd r2, r3, [r5]
536 mcrr p15, 3, r2, r3, c14 @ CNTV_CVAL
537 isb
538
539 ldr r2, [vcpu, #VCPU_TIMER_CNTV_CTL]
540 and r2, r2, #3
541 mcr p15, 0, r2, c14, c3, 1 @ CNTV_CTL
5421:
543#endif
544.endm
545
546.equ vmentry, 0
547.equ vmexit, 1
548
549/* Configures the HSTR (Hyp System Trap Register) on entry/return
550 * (hardware reset value is 0) */
551.macro set_hstr operation
552 mrc p15, 4, r2, c1, c1, 3
553 ldr r3, =HSTR_T(15)
554 .if \operation == vmentry
555 orr r2, r2, r3 @ Trap CR{15}
556 .else
557 bic r2, r2, r3 @ Don't trap any CRx accesses
558 .endif
559 mcr p15, 4, r2, c1, c1, 3
560.endm
561
562/* Configures the HCPTR (Hyp Coprocessor Trap Register) on entry/return
563 * (hardware reset value is 0). Keep previous value in r2. */
564.macro set_hcptr operation, mask
565 mrc p15, 4, r2, c1, c1, 2
566 ldr r3, =\mask
567 .if \operation == vmentry
568 orr r3, r2, r3 @ Trap coproc-accesses defined in mask
569 .else
570 bic r3, r2, r3 @ Don't trap defined coproc-accesses
571 .endif
572 mcr p15, 4, r3, c1, c1, 2
573.endm
574
575/* Configures the HDCR (Hyp Debug Configuration Register) on entry/return
576 * (hardware reset value is 0) */
577.macro set_hdcr operation
578 mrc p15, 4, r2, c1, c1, 1
579 ldr r3, =(HDCR_TPM|HDCR_TPMCR)
580 .if \operation == vmentry
581 orr r2, r2, r3 @ Trap some perfmon accesses
582 .else
583 bic r2, r2, r3 @ Don't trap any perfmon accesses
584 .endif
585 mcr p15, 4, r2, c1, c1, 1
586.endm
587
588/* Enable/Disable: stage-2 trans., trap interrupts, trap wfi, trap smc */
589.macro configure_hyp_role operation
590 mrc p15, 4, r2, c1, c1, 0 @ HCR
591 bic r2, r2, #HCR_VIRT_EXCP_MASK
592 ldr r3, =HCR_GUEST_MASK
593 .if \operation == vmentry
594 orr r2, r2, r3
595 ldr r3, [vcpu, #VCPU_IRQ_LINES]
596 orr r2, r2, r3
597 .else
598 bic r2, r2, r3
599 .endif
600 mcr p15, 4, r2, c1, c1, 0
601.endm
602
603.macro load_vcpu
604 mrc p15, 4, vcpu, c13, c0, 2 @ HTPIDR
605.endm
diff --git a/arch/arm/kvm/mmio.c b/arch/arm/kvm/mmio.c
new file mode 100644
index 000000000000..98a870ff1a5c
--- /dev/null
+++ b/arch/arm/kvm/mmio.c
@@ -0,0 +1,156 @@
1/*
2 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
3 * Author: Christoffer Dall <c.dall@virtualopensystems.com>
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 * 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 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#include <linux/kvm_host.h>
20#include <asm/kvm_mmio.h>
21#include <asm/kvm_emulate.h>
22#include <trace/events/kvm.h>
23
24#include "trace.h"
25
26/**
27 * kvm_handle_mmio_return -- Handle MMIO loads after user space emulation
28 * @vcpu: The VCPU pointer
29 * @run: The VCPU run struct containing the mmio data
30 *
31 * This should only be called after returning from userspace for MMIO load
32 * emulation.
33 */
34int kvm_handle_mmio_return(struct kvm_vcpu *vcpu, struct kvm_run *run)
35{
36 __u32 *dest;
37 unsigned int len;
38 int mask;
39
40 if (!run->mmio.is_write) {
41 dest = vcpu_reg(vcpu, vcpu->arch.mmio_decode.rt);
42 memset(dest, 0, sizeof(int));
43
44 len = run->mmio.len;
45 if (len > 4)
46 return -EINVAL;
47
48 memcpy(dest, run->mmio.data, len);
49
50 trace_kvm_mmio(KVM_TRACE_MMIO_READ, len, run->mmio.phys_addr,
51 *((u64 *)run->mmio.data));
52
53 if (vcpu->arch.mmio_decode.sign_extend && len < 4) {
54 mask = 1U << ((len * 8) - 1);
55 *dest = (*dest ^ mask) - mask;
56 }
57 }
58
59 return 0;
60}
61
62static int decode_hsr(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
63 struct kvm_exit_mmio *mmio)
64{
65 unsigned long rt, len;
66 bool is_write, sign_extend;
67
68 if ((vcpu->arch.hsr >> 8) & 1) {
69 /* cache operation on I/O addr, tell guest unsupported */
70 kvm_inject_dabt(vcpu, vcpu->arch.hxfar);
71 return 1;
72 }
73
74 if ((vcpu->arch.hsr >> 7) & 1) {
75 /* page table accesses IO mem: tell guest to fix its TTBR */
76 kvm_inject_dabt(vcpu, vcpu->arch.hxfar);
77 return 1;
78 }
79
80 switch ((vcpu->arch.hsr >> 22) & 0x3) {
81 case 0:
82 len = 1;
83 break;
84 case 1:
85 len = 2;
86 break;
87 case 2:
88 len = 4;
89 break;
90 default:
91 kvm_err("Hardware is weird: SAS 0b11 is reserved\n");
92 return -EFAULT;
93 }
94
95 is_write = vcpu->arch.hsr & HSR_WNR;
96 sign_extend = vcpu->arch.hsr & HSR_SSE;
97 rt = (vcpu->arch.hsr & HSR_SRT_MASK) >> HSR_SRT_SHIFT;
98
99 if (kvm_vcpu_reg_is_pc(vcpu, rt)) {
100 /* IO memory trying to read/write pc */
101 kvm_inject_pabt(vcpu, vcpu->arch.hxfar);
102 return 1;
103 }
104
105 mmio->is_write = is_write;
106 mmio->phys_addr = fault_ipa;
107 mmio->len = len;
108 vcpu->arch.mmio_decode.sign_extend = sign_extend;
109 vcpu->arch.mmio_decode.rt = rt;
110
111 /*
112 * The MMIO instruction is emulated and should not be re-executed
113 * in the guest.
114 */
115 kvm_skip_instr(vcpu, (vcpu->arch.hsr >> 25) & 1);
116 return 0;
117}
118
119int io_mem_abort(struct kvm_vcpu *vcpu, struct kvm_run *run,
120 phys_addr_t fault_ipa)
121{
122 struct kvm_exit_mmio mmio;
123 unsigned long rt;
124 int ret;
125
126 /*
127 * Prepare MMIO operation. First stash it in a private
128 * structure that we can use for in-kernel emulation. If the
129 * kernel can't handle it, copy it into run->mmio and let user
130 * space do its magic.
131 */
132
133 if (vcpu->arch.hsr & HSR_ISV) {
134 ret = decode_hsr(vcpu, fault_ipa, &mmio);
135 if (ret)
136 return ret;
137 } else {
138 kvm_err("load/store instruction decoding not implemented\n");
139 return -ENOSYS;
140 }
141
142 rt = vcpu->arch.mmio_decode.rt;
143 trace_kvm_mmio((mmio.is_write) ? KVM_TRACE_MMIO_WRITE :
144 KVM_TRACE_MMIO_READ_UNSATISFIED,
145 mmio.len, fault_ipa,
146 (mmio.is_write) ? *vcpu_reg(vcpu, rt) : 0);
147
148 if (mmio.is_write)
149 memcpy(mmio.data, vcpu_reg(vcpu, rt), mmio.len);
150
151 if (vgic_handle_mmio(vcpu, run, &mmio))
152 return 1;
153
154 kvm_prepare_mmio(run, &mmio);
155 return 0;
156}
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
new file mode 100644
index 000000000000..99e07c7dd745
--- /dev/null
+++ b/arch/arm/kvm/mmu.c
@@ -0,0 +1,782 @@
1/*
2 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
3 * Author: Christoffer Dall <c.dall@virtualopensystems.com>
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 * 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 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#include <linux/mman.h>
20#include <linux/kvm_host.h>
21#include <linux/io.h>
22#include <trace/events/kvm.h>
23#include <asm/idmap.h>
24#include <asm/pgalloc.h>
25#include <asm/cacheflush.h>
26#include <asm/kvm_arm.h>
27#include <asm/kvm_mmu.h>
28#include <asm/kvm_mmio.h>
29#include <asm/kvm_asm.h>
30#include <asm/kvm_emulate.h>
31#include <asm/mach/map.h>
32#include <trace/events/kvm.h>
33
34#include "trace.h"
35
36extern char __hyp_idmap_text_start[], __hyp_idmap_text_end[];
37
38static DEFINE_MUTEX(kvm_hyp_pgd_mutex);
39
40static void kvm_tlb_flush_vmid(struct kvm *kvm)
41{
42 kvm_call_hyp(__kvm_tlb_flush_vmid, kvm);
43}
44
45static void kvm_set_pte(pte_t *pte, pte_t new_pte)
46{
47 pte_val(*pte) = new_pte;
48 /*
49 * flush_pmd_entry just takes a void pointer and cleans the necessary
50 * cache entries, so we can reuse the function for ptes.
51 */
52 flush_pmd_entry(pte);
53}
54
55static int mmu_topup_memory_cache(struct kvm_mmu_memory_cache *cache,
56 int min, int max)
57{
58 void *page;
59
60 BUG_ON(max > KVM_NR_MEM_OBJS);
61 if (cache->nobjs >= min)
62 return 0;
63 while (cache->nobjs < max) {
64 page = (void *)__get_free_page(PGALLOC_GFP);
65 if (!page)
66 return -ENOMEM;
67 cache->objects[cache->nobjs++] = page;
68 }
69 return 0;
70}
71
72static void mmu_free_memory_cache(struct kvm_mmu_memory_cache *mc)
73{
74 while (mc->nobjs)
75 free_page((unsigned long)mc->objects[--mc->nobjs]);
76}
77
78static void *mmu_memory_cache_alloc(struct kvm_mmu_memory_cache *mc)
79{
80 void *p;
81
82 BUG_ON(!mc || !mc->nobjs);
83 p = mc->objects[--mc->nobjs];
84 return p;
85}
86
87static void free_ptes(pmd_t *pmd, unsigned long addr)
88{
89 pte_t *pte;
90 unsigned int i;
91
92 for (i = 0; i < PTRS_PER_PMD; i++, addr += PMD_SIZE) {
93 if (!pmd_none(*pmd) && pmd_table(*pmd)) {
94 pte = pte_offset_kernel(pmd, addr);
95 pte_free_kernel(NULL, pte);
96 }
97 pmd++;
98 }
99}
100
101/**
102 * free_hyp_pmds - free a Hyp-mode level-2 tables and child level-3 tables
103 *
104 * Assumes this is a page table used strictly in Hyp-mode and therefore contains
105 * only mappings in the kernel memory area, which is above PAGE_OFFSET.
106 */
107void free_hyp_pmds(void)
108{
109 pgd_t *pgd;
110 pud_t *pud;
111 pmd_t *pmd;
112 unsigned long addr;
113
114 mutex_lock(&kvm_hyp_pgd_mutex);
115 for (addr = PAGE_OFFSET; addr != 0; addr += PGDIR_SIZE) {
116 pgd = hyp_pgd + pgd_index(addr);
117 pud = pud_offset(pgd, addr);
118
119 if (pud_none(*pud))
120 continue;
121 BUG_ON(pud_bad(*pud));
122
123 pmd = pmd_offset(pud, addr);
124 free_ptes(pmd, addr);
125 pmd_free(NULL, pmd);
126 pud_clear(pud);
127 }
128 mutex_unlock(&kvm_hyp_pgd_mutex);
129}
130
131static void create_hyp_pte_mappings(pmd_t *pmd, unsigned long start,
132 unsigned long end)
133{
134 pte_t *pte;
135 unsigned long addr;
136 struct page *page;
137
138 for (addr = start & PAGE_MASK; addr < end; addr += PAGE_SIZE) {
139 pte = pte_offset_kernel(pmd, addr);
140 BUG_ON(!virt_addr_valid(addr));
141 page = virt_to_page(addr);
142 kvm_set_pte(pte, mk_pte(page, PAGE_HYP));
143 }
144}
145
146static void create_hyp_io_pte_mappings(pmd_t *pmd, unsigned long start,
147 unsigned long end,
148 unsigned long *pfn_base)
149{
150 pte_t *pte;
151 unsigned long addr;
152
153 for (addr = start & PAGE_MASK; addr < end; addr += PAGE_SIZE) {
154 pte = pte_offset_kernel(pmd, addr);
155 BUG_ON(pfn_valid(*pfn_base));
156 kvm_set_pte(pte, pfn_pte(*pfn_base, PAGE_HYP_DEVICE));
157 (*pfn_base)++;
158 }
159}
160
161static int create_hyp_pmd_mappings(pud_t *pud, unsigned long start,
162 unsigned long end, unsigned long *pfn_base)
163{
164 pmd_t *pmd;
165 pte_t *pte;
166 unsigned long addr, next;
167
168 for (addr = start; addr < end; addr = next) {
169 pmd = pmd_offset(pud, addr);
170
171 BUG_ON(pmd_sect(*pmd));
172
173 if (pmd_none(*pmd)) {
174 pte = pte_alloc_one_kernel(NULL, addr);
175 if (!pte) {
176 kvm_err("Cannot allocate Hyp pte\n");
177 return -ENOMEM;
178 }
179 pmd_populate_kernel(NULL, pmd, pte);
180 }
181
182 next = pmd_addr_end(addr, end);
183
184 /*
185 * If pfn_base is NULL, we map kernel pages into HYP with the
186 * virtual address. Otherwise, this is considered an I/O
187 * mapping and we map the physical region starting at
188 * *pfn_base to [start, end[.
189 */
190 if (!pfn_base)
191 create_hyp_pte_mappings(pmd, addr, next);
192 else
193 create_hyp_io_pte_mappings(pmd, addr, next, pfn_base);
194 }
195
196 return 0;
197}
198
199static int __create_hyp_mappings(void *from, void *to, unsigned long *pfn_base)
200{
201 unsigned long start = (unsigned long)from;
202 unsigned long end = (unsigned long)to;
203 pgd_t *pgd;
204 pud_t *pud;
205 pmd_t *pmd;
206 unsigned long addr, next;
207 int err = 0;
208
209 BUG_ON(start > end);
210 if (start < PAGE_OFFSET)
211 return -EINVAL;
212
213 mutex_lock(&kvm_hyp_pgd_mutex);
214 for (addr = start; addr < end; addr = next) {
215 pgd = hyp_pgd + pgd_index(addr);
216 pud = pud_offset(pgd, addr);
217
218 if (pud_none_or_clear_bad(pud)) {
219 pmd = pmd_alloc_one(NULL, addr);
220 if (!pmd) {
221 kvm_err("Cannot allocate Hyp pmd\n");
222 err = -ENOMEM;
223 goto out;
224 }
225 pud_populate(NULL, pud, pmd);
226 }
227
228 next = pgd_addr_end(addr, end);
229 err = create_hyp_pmd_mappings(pud, addr, next, pfn_base);
230 if (err)
231 goto out;
232 }
233out:
234 mutex_unlock(&kvm_hyp_pgd_mutex);
235 return err;
236}
237
238/**
239 * create_hyp_mappings - map a kernel virtual address range in Hyp mode
240 * @from: The virtual kernel start address of the range
241 * @to: The virtual kernel end address of the range (exclusive)
242 *
243 * The same virtual address as the kernel virtual address is also used in
244 * Hyp-mode mapping to the same underlying physical pages.
245 *
246 * Note: Wrapping around zero in the "to" address is not supported.
247 */
248int create_hyp_mappings(void *from, void *to)
249{
250 return __create_hyp_mappings(from, to, NULL);
251}
252
253/**
254 * create_hyp_io_mappings - map a physical IO range in Hyp mode
255 * @from: The virtual HYP start address of the range
256 * @to: The virtual HYP end address of the range (exclusive)
257 * @addr: The physical start address which gets mapped
258 */
259int create_hyp_io_mappings(void *from, void *to, phys_addr_t addr)
260{
261 unsigned long pfn = __phys_to_pfn(addr);
262 return __create_hyp_mappings(from, to, &pfn);
263}
264
265/**
266 * kvm_alloc_stage2_pgd - allocate level-1 table for stage-2 translation.
267 * @kvm: The KVM struct pointer for the VM.
268 *
269 * Allocates the 1st level table only of size defined by S2_PGD_ORDER (can
270 * support either full 40-bit input addresses or limited to 32-bit input
271 * addresses). Clears the allocated pages.
272 *
273 * Note we don't need locking here as this is only called when the VM is
274 * created, which can only be done once.
275 */
276int kvm_alloc_stage2_pgd(struct kvm *kvm)
277{
278 pgd_t *pgd;
279
280 if (kvm->arch.pgd != NULL) {
281 kvm_err("kvm_arch already initialized?\n");
282 return -EINVAL;
283 }
284
285 pgd = (pgd_t *)__get_free_pages(GFP_KERNEL, S2_PGD_ORDER);
286 if (!pgd)
287 return -ENOMEM;
288
289 /* stage-2 pgd must be aligned to its size */
290 VM_BUG_ON((unsigned long)pgd & (S2_PGD_SIZE - 1));
291
292 memset(pgd, 0, PTRS_PER_S2_PGD * sizeof(pgd_t));
293 clean_dcache_area(pgd, PTRS_PER_S2_PGD * sizeof(pgd_t));
294 kvm->arch.pgd = pgd;
295
296 return 0;
297}
298
299static void clear_pud_entry(pud_t *pud)
300{
301 pmd_t *pmd_table = pmd_offset(pud, 0);
302 pud_clear(pud);
303 pmd_free(NULL, pmd_table);
304 put_page(virt_to_page(pud));
305}
306
307static void clear_pmd_entry(pmd_t *pmd)
308{
309 pte_t *pte_table = pte_offset_kernel(pmd, 0);
310 pmd_clear(pmd);
311 pte_free_kernel(NULL, pte_table);
312 put_page(virt_to_page(pmd));
313}
314
315static bool pmd_empty(pmd_t *pmd)
316{
317 struct page *pmd_page = virt_to_page(pmd);
318 return page_count(pmd_page) == 1;
319}
320
321static void clear_pte_entry(pte_t *pte)
322{
323 if (pte_present(*pte)) {
324 kvm_set_pte(pte, __pte(0));
325 put_page(virt_to_page(pte));
326 }
327}
328
329static bool pte_empty(pte_t *pte)
330{
331 struct page *pte_page = virt_to_page(pte);
332 return page_count(pte_page) == 1;
333}
334
335/**
336 * unmap_stage2_range -- Clear stage2 page table entries to unmap a range
337 * @kvm: The VM pointer
338 * @start: The intermediate physical base address of the range to unmap
339 * @size: The size of the area to unmap
340 *
341 * Clear a range of stage-2 mappings, lowering the various ref-counts. Must
342 * be called while holding mmu_lock (unless for freeing the stage2 pgd before
343 * destroying the VM), otherwise another faulting VCPU may come in and mess
344 * with things behind our backs.
345 */
346static void unmap_stage2_range(struct kvm *kvm, phys_addr_t start, u64 size)
347{
348 pgd_t *pgd;
349 pud_t *pud;
350 pmd_t *pmd;
351 pte_t *pte;
352 phys_addr_t addr = start, end = start + size;
353 u64 range;
354
355 while (addr < end) {
356 pgd = kvm->arch.pgd + pgd_index(addr);
357 pud = pud_offset(pgd, addr);
358 if (pud_none(*pud)) {
359 addr += PUD_SIZE;
360 continue;
361 }
362
363 pmd = pmd_offset(pud, addr);
364 if (pmd_none(*pmd)) {
365 addr += PMD_SIZE;
366 continue;
367 }
368
369 pte = pte_offset_kernel(pmd, addr);
370 clear_pte_entry(pte);
371 range = PAGE_SIZE;
372
373 /* If we emptied the pte, walk back up the ladder */
374 if (pte_empty(pte)) {
375 clear_pmd_entry(pmd);
376 range = PMD_SIZE;
377 if (pmd_empty(pmd)) {
378 clear_pud_entry(pud);
379 range = PUD_SIZE;
380 }
381 }
382
383 addr += range;
384 }
385}
386
387/**
388 * kvm_free_stage2_pgd - free all stage-2 tables
389 * @kvm: The KVM struct pointer for the VM.
390 *
391 * Walks the level-1 page table pointed to by kvm->arch.pgd and frees all
392 * underlying level-2 and level-3 tables before freeing the actual level-1 table
393 * and setting the struct pointer to NULL.
394 *
395 * Note we don't need locking here as this is only called when the VM is
396 * destroyed, which can only be done once.
397 */
398void kvm_free_stage2_pgd(struct kvm *kvm)
399{
400 if (kvm->arch.pgd == NULL)
401 return;
402
403 unmap_stage2_range(kvm, 0, KVM_PHYS_SIZE);
404 free_pages((unsigned long)kvm->arch.pgd, S2_PGD_ORDER);
405 kvm->arch.pgd = NULL;
406}
407
408
409static int stage2_set_pte(struct kvm *kvm, struct kvm_mmu_memory_cache *cache,
410 phys_addr_t addr, const pte_t *new_pte, bool iomap)
411{
412 pgd_t *pgd;
413 pud_t *pud;
414 pmd_t *pmd;
415 pte_t *pte, old_pte;
416
417 /* Create 2nd stage page table mapping - Level 1 */
418 pgd = kvm->arch.pgd + pgd_index(addr);
419 pud = pud_offset(pgd, addr);
420 if (pud_none(*pud)) {
421 if (!cache)
422 return 0; /* ignore calls from kvm_set_spte_hva */
423 pmd = mmu_memory_cache_alloc(cache);
424 pud_populate(NULL, pud, pmd);
425 pmd += pmd_index(addr);
426 get_page(virt_to_page(pud));
427 } else
428 pmd = pmd_offset(pud, addr);
429
430 /* Create 2nd stage page table mapping - Level 2 */
431 if (pmd_none(*pmd)) {
432 if (!cache)
433 return 0; /* ignore calls from kvm_set_spte_hva */
434 pte = mmu_memory_cache_alloc(cache);
435 clean_pte_table(pte);
436 pmd_populate_kernel(NULL, pmd, pte);
437 pte += pte_index(addr);
438 get_page(virt_to_page(pmd));
439 } else
440 pte = pte_offset_kernel(pmd, addr);
441
442 if (iomap && pte_present(*pte))
443 return -EFAULT;
444
445 /* Create 2nd stage page table mapping - Level 3 */
446 old_pte = *pte;
447 kvm_set_pte(pte, *new_pte);
448 if (pte_present(old_pte))
449 kvm_tlb_flush_vmid(kvm);
450 else
451 get_page(virt_to_page(pte));
452
453 return 0;
454}
455
456/**
457 * kvm_phys_addr_ioremap - map a device range to guest IPA
458 *
459 * @kvm: The KVM pointer
460 * @guest_ipa: The IPA at which to insert the mapping
461 * @pa: The physical address of the device
462 * @size: The size of the mapping
463 */
464int kvm_phys_addr_ioremap(struct kvm *kvm, phys_addr_t guest_ipa,
465 phys_addr_t pa, unsigned long size)
466{
467 phys_addr_t addr, end;
468 int ret = 0;
469 unsigned long pfn;
470 struct kvm_mmu_memory_cache cache = { 0, };
471
472 end = (guest_ipa + size + PAGE_SIZE - 1) & PAGE_MASK;
473 pfn = __phys_to_pfn(pa);
474
475 for (addr = guest_ipa; addr < end; addr += PAGE_SIZE) {
476 pte_t pte = pfn_pte(pfn, PAGE_S2_DEVICE | L_PTE_S2_RDWR);
477
478 ret = mmu_topup_memory_cache(&cache, 2, 2);
479 if (ret)
480 goto out;
481 spin_lock(&kvm->mmu_lock);
482 ret = stage2_set_pte(kvm, &cache, addr, &pte, true);
483 spin_unlock(&kvm->mmu_lock);
484 if (ret)
485 goto out;
486
487 pfn++;
488 }
489
490out:
491 mmu_free_memory_cache(&cache);
492 return ret;
493}
494
495static void coherent_icache_guest_page(struct kvm *kvm, gfn_t gfn)
496{
497 /*
498 * If we are going to insert an instruction page and the icache is
499 * either VIPT or PIPT, there is a potential problem where the host
500 * (or another VM) may have used the same page as this guest, and we
501 * read incorrect data from the icache. If we're using a PIPT cache,
502 * we can invalidate just that page, but if we are using a VIPT cache
503 * we need to invalidate the entire icache - damn shame - as written
504 * in the ARM ARM (DDI 0406C.b - Page B3-1393).
505 *
506 * VIVT caches are tagged using both the ASID and the VMID and doesn't
507 * need any kind of flushing (DDI 0406C.b - Page B3-1392).
508 */
509 if (icache_is_pipt()) {
510 unsigned long hva = gfn_to_hva(kvm, gfn);
511 __cpuc_coherent_user_range(hva, hva + PAGE_SIZE);
512 } else if (!icache_is_vivt_asid_tagged()) {
513 /* any kind of VIPT cache */
514 __flush_icache_all();
515 }
516}
517
518static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
519 gfn_t gfn, struct kvm_memory_slot *memslot,
520 unsigned long fault_status)
521{
522 pte_t new_pte;
523 pfn_t pfn;
524 int ret;
525 bool write_fault, writable;
526 unsigned long mmu_seq;
527 struct kvm_mmu_memory_cache *memcache = &vcpu->arch.mmu_page_cache;
528
529 write_fault = kvm_is_write_fault(vcpu->arch.hsr);
530 if (fault_status == FSC_PERM && !write_fault) {
531 kvm_err("Unexpected L2 read permission error\n");
532 return -EFAULT;
533 }
534
535 /* We need minimum second+third level pages */
536 ret = mmu_topup_memory_cache(memcache, 2, KVM_NR_MEM_OBJS);
537 if (ret)
538 return ret;
539
540 mmu_seq = vcpu->kvm->mmu_notifier_seq;
541 /*
542 * Ensure the read of mmu_notifier_seq happens before we call
543 * gfn_to_pfn_prot (which calls get_user_pages), so that we don't risk
544 * the page we just got a reference to gets unmapped before we have a
545 * chance to grab the mmu_lock, which ensure that if the page gets
546 * unmapped afterwards, the call to kvm_unmap_hva will take it away
547 * from us again properly. This smp_rmb() interacts with the smp_wmb()
548 * in kvm_mmu_notifier_invalidate_<page|range_end>.
549 */
550 smp_rmb();
551
552 pfn = gfn_to_pfn_prot(vcpu->kvm, gfn, write_fault, &writable);
553 if (is_error_pfn(pfn))
554 return -EFAULT;
555
556 new_pte = pfn_pte(pfn, PAGE_S2);
557 coherent_icache_guest_page(vcpu->kvm, gfn);
558
559 spin_lock(&vcpu->kvm->mmu_lock);
560 if (mmu_notifier_retry(vcpu->kvm, mmu_seq))
561 goto out_unlock;
562 if (writable) {
563 pte_val(new_pte) |= L_PTE_S2_RDWR;
564 kvm_set_pfn_dirty(pfn);
565 }
566 stage2_set_pte(vcpu->kvm, memcache, fault_ipa, &new_pte, false);
567
568out_unlock:
569 spin_unlock(&vcpu->kvm->mmu_lock);
570 kvm_release_pfn_clean(pfn);
571 return 0;
572}
573
574/**
575 * kvm_handle_guest_abort - handles all 2nd stage aborts
576 * @vcpu: the VCPU pointer
577 * @run: the kvm_run structure
578 *
579 * Any abort that gets to the host is almost guaranteed to be caused by a
580 * missing second stage translation table entry, which can mean that either the
581 * guest simply needs more memory and we must allocate an appropriate page or it
582 * can mean that the guest tried to access I/O memory, which is emulated by user
583 * space. The distinction is based on the IPA causing the fault and whether this
584 * memory region has been registered as standard RAM by user space.
585 */
586int kvm_handle_guest_abort(struct kvm_vcpu *vcpu, struct kvm_run *run)
587{
588 unsigned long hsr_ec;
589 unsigned long fault_status;
590 phys_addr_t fault_ipa;
591 struct kvm_memory_slot *memslot;
592 bool is_iabt;
593 gfn_t gfn;
594 int ret, idx;
595
596 hsr_ec = vcpu->arch.hsr >> HSR_EC_SHIFT;
597 is_iabt = (hsr_ec == HSR_EC_IABT);
598 fault_ipa = ((phys_addr_t)vcpu->arch.hpfar & HPFAR_MASK) << 8;
599
600 trace_kvm_guest_fault(*vcpu_pc(vcpu), vcpu->arch.hsr,
601 vcpu->arch.hxfar, fault_ipa);
602
603 /* Check the stage-2 fault is trans. fault or write fault */
604 fault_status = (vcpu->arch.hsr & HSR_FSC_TYPE);
605 if (fault_status != FSC_FAULT && fault_status != FSC_PERM) {
606 kvm_err("Unsupported fault status: EC=%#lx DFCS=%#lx\n",
607 hsr_ec, fault_status);
608 return -EFAULT;
609 }
610
611 idx = srcu_read_lock(&vcpu->kvm->srcu);
612
613 gfn = fault_ipa >> PAGE_SHIFT;
614 if (!kvm_is_visible_gfn(vcpu->kvm, gfn)) {
615 if (is_iabt) {
616 /* Prefetch Abort on I/O address */
617 kvm_inject_pabt(vcpu, vcpu->arch.hxfar);
618 ret = 1;
619 goto out_unlock;
620 }
621
622 if (fault_status != FSC_FAULT) {
623 kvm_err("Unsupported fault status on io memory: %#lx\n",
624 fault_status);
625 ret = -EFAULT;
626 goto out_unlock;
627 }
628
629 /* Adjust page offset */
630 fault_ipa |= vcpu->arch.hxfar & ~PAGE_MASK;
631 ret = io_mem_abort(vcpu, run, fault_ipa);
632 goto out_unlock;
633 }
634
635 memslot = gfn_to_memslot(vcpu->kvm, gfn);
636
637 ret = user_mem_abort(vcpu, fault_ipa, gfn, memslot, fault_status);
638 if (ret == 0)
639 ret = 1;
640out_unlock:
641 srcu_read_unlock(&vcpu->kvm->srcu, idx);
642 return ret;
643}
644
645static void handle_hva_to_gpa(struct kvm *kvm,
646 unsigned long start,
647 unsigned long end,
648 void (*handler)(struct kvm *kvm,
649 gpa_t gpa, void *data),
650 void *data)
651{
652 struct kvm_memslots *slots;
653 struct kvm_memory_slot *memslot;
654
655 slots = kvm_memslots(kvm);
656
657 /* we only care about the pages that the guest sees */
658 kvm_for_each_memslot(memslot, slots) {
659 unsigned long hva_start, hva_end;
660 gfn_t gfn, gfn_end;
661
662 hva_start = max(start, memslot->userspace_addr);
663 hva_end = min(end, memslot->userspace_addr +
664 (memslot->npages << PAGE_SHIFT));
665 if (hva_start >= hva_end)
666 continue;
667
668 /*
669 * {gfn(page) | page intersects with [hva_start, hva_end)} =
670 * {gfn_start, gfn_start+1, ..., gfn_end-1}.
671 */
672 gfn = hva_to_gfn_memslot(hva_start, memslot);
673 gfn_end = hva_to_gfn_memslot(hva_end + PAGE_SIZE - 1, memslot);
674
675 for (; gfn < gfn_end; ++gfn) {
676 gpa_t gpa = gfn << PAGE_SHIFT;
677 handler(kvm, gpa, data);
678 }
679 }
680}
681
682static void kvm_unmap_hva_handler(struct kvm *kvm, gpa_t gpa, void *data)
683{
684 unmap_stage2_range(kvm, gpa, PAGE_SIZE);
685 kvm_tlb_flush_vmid(kvm);
686}
687
688int kvm_unmap_hva(struct kvm *kvm, unsigned long hva)
689{
690 unsigned long end = hva + PAGE_SIZE;
691
692 if (!kvm->arch.pgd)
693 return 0;
694
695 trace_kvm_unmap_hva(hva);
696 handle_hva_to_gpa(kvm, hva, end, &kvm_unmap_hva_handler, NULL);
697 return 0;
698}
699
700int kvm_unmap_hva_range(struct kvm *kvm,
701 unsigned long start, unsigned long end)
702{
703 if (!kvm->arch.pgd)
704 return 0;
705
706 trace_kvm_unmap_hva_range(start, end);
707 handle_hva_to_gpa(kvm, start, end, &kvm_unmap_hva_handler, NULL);
708 return 0;
709}
710
711static void kvm_set_spte_handler(struct kvm *kvm, gpa_t gpa, void *data)
712{
713 pte_t *pte = (pte_t *)data;
714
715 stage2_set_pte(kvm, NULL, gpa, pte, false);
716}
717
718
719void kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte)
720{
721 unsigned long end = hva + PAGE_SIZE;
722 pte_t stage2_pte;
723
724 if (!kvm->arch.pgd)
725 return;
726
727 trace_kvm_set_spte_hva(hva);
728 stage2_pte = pfn_pte(pte_pfn(pte), PAGE_S2);
729 handle_hva_to_gpa(kvm, hva, end, &kvm_set_spte_handler, &stage2_pte);
730}
731
732void kvm_mmu_free_memory_caches(struct kvm_vcpu *vcpu)
733{
734 mmu_free_memory_cache(&vcpu->arch.mmu_page_cache);
735}
736
737phys_addr_t kvm_mmu_get_httbr(void)
738{
739 VM_BUG_ON(!virt_addr_valid(hyp_pgd));
740 return virt_to_phys(hyp_pgd);
741}
742
743int kvm_mmu_init(void)
744{
745 if (!hyp_pgd) {
746 kvm_err("Hyp mode PGD not allocated\n");
747 return -ENOMEM;
748 }
749
750 return 0;
751}
752
753/**
754 * kvm_clear_idmap - remove all idmaps from the hyp pgd
755 *
756 * Free the underlying pmds for all pgds in range and clear the pgds (but
757 * don't free them) afterwards.
758 */
759void kvm_clear_hyp_idmap(void)
760{
761 unsigned long addr, end;
762 unsigned long next;
763 pgd_t *pgd = hyp_pgd;
764 pud_t *pud;
765 pmd_t *pmd;
766
767 addr = virt_to_phys(__hyp_idmap_text_start);
768 end = virt_to_phys(__hyp_idmap_text_end);
769
770 pgd += pgd_index(addr);
771 do {
772 next = pgd_addr_end(addr, end);
773 if (pgd_none_or_clear_bad(pgd))
774 continue;
775 pud = pud_offset(pgd, addr);
776 pmd = pmd_offset(pud, addr);
777
778 pud_clear(pud);
779 clean_pmd_entry(pmd);
780 pmd_free(NULL, (pmd_t *)((unsigned long)pmd & PAGE_MASK));
781 } while (pgd++, addr = next, addr < end);
782}
diff --git a/arch/arm/kvm/psci.c b/arch/arm/kvm/psci.c
new file mode 100644
index 000000000000..7ee5bb7a3667
--- /dev/null
+++ b/arch/arm/kvm/psci.c
@@ -0,0 +1,108 @@
1/*
2 * Copyright (C) 2012 - ARM Ltd
3 * Author: Marc Zyngier <marc.zyngier@arm.com>
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 * 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 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include <linux/kvm_host.h>
19#include <linux/wait.h>
20
21#include <asm/kvm_emulate.h>
22#include <asm/kvm_psci.h>
23
24/*
25 * This is an implementation of the Power State Coordination Interface
26 * as described in ARM document number ARM DEN 0022A.
27 */
28
29static void kvm_psci_vcpu_off(struct kvm_vcpu *vcpu)
30{
31 vcpu->arch.pause = true;
32}
33
34static unsigned long kvm_psci_vcpu_on(struct kvm_vcpu *source_vcpu)
35{
36 struct kvm *kvm = source_vcpu->kvm;
37 struct kvm_vcpu *vcpu;
38 wait_queue_head_t *wq;
39 unsigned long cpu_id;
40 phys_addr_t target_pc;
41
42 cpu_id = *vcpu_reg(source_vcpu, 1);
43 if (vcpu_mode_is_32bit(source_vcpu))
44 cpu_id &= ~((u32) 0);
45
46 if (cpu_id >= atomic_read(&kvm->online_vcpus))
47 return KVM_PSCI_RET_INVAL;
48
49 target_pc = *vcpu_reg(source_vcpu, 2);
50
51 vcpu = kvm_get_vcpu(kvm, cpu_id);
52
53 wq = kvm_arch_vcpu_wq(vcpu);
54 if (!waitqueue_active(wq))
55 return KVM_PSCI_RET_INVAL;
56
57 kvm_reset_vcpu(vcpu);
58
59 /* Gracefully handle Thumb2 entry point */
60 if (vcpu_mode_is_32bit(vcpu) && (target_pc & 1)) {
61 target_pc &= ~((phys_addr_t) 1);
62 vcpu_set_thumb(vcpu);
63 }
64
65 *vcpu_pc(vcpu) = target_pc;
66 vcpu->arch.pause = false;
67 smp_mb(); /* Make sure the above is visible */
68
69 wake_up_interruptible(wq);
70
71 return KVM_PSCI_RET_SUCCESS;
72}
73
74/**
75 * kvm_psci_call - handle PSCI call if r0 value is in range
76 * @vcpu: Pointer to the VCPU struct
77 *
78 * Handle PSCI calls from guests through traps from HVC or SMC instructions.
79 * The calling convention is similar to SMC calls to the secure world where
80 * the function number is placed in r0 and this function returns true if the
81 * function number specified in r0 is withing the PSCI range, and false
82 * otherwise.
83 */
84bool kvm_psci_call(struct kvm_vcpu *vcpu)
85{
86 unsigned long psci_fn = *vcpu_reg(vcpu, 0) & ~((u32) 0);
87 unsigned long val;
88
89 switch (psci_fn) {
90 case KVM_PSCI_FN_CPU_OFF:
91 kvm_psci_vcpu_off(vcpu);
92 val = KVM_PSCI_RET_SUCCESS;
93 break;
94 case KVM_PSCI_FN_CPU_ON:
95 val = kvm_psci_vcpu_on(vcpu);
96 break;
97 case KVM_PSCI_FN_CPU_SUSPEND:
98 case KVM_PSCI_FN_MIGRATE:
99 val = KVM_PSCI_RET_NI;
100 break;
101
102 default:
103 return false;
104 }
105
106 *vcpu_reg(vcpu, 0) = val;
107 return true;
108}
diff --git a/arch/arm/kvm/reset.c b/arch/arm/kvm/reset.c
new file mode 100644
index 000000000000..b80256b554cd
--- /dev/null
+++ b/arch/arm/kvm/reset.c
@@ -0,0 +1,74 @@
1/*
2 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
3 * Author: Christoffer Dall <c.dall@virtualopensystems.com>
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 * 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 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18#include <linux/compiler.h>
19#include <linux/errno.h>
20#include <linux/sched.h>
21#include <linux/kvm_host.h>
22#include <linux/kvm.h>
23
24#include <asm/unified.h>
25#include <asm/ptrace.h>
26#include <asm/cputype.h>
27#include <asm/kvm_arm.h>
28#include <asm/kvm_coproc.h>
29
30/******************************************************************************
31 * Cortex-A15 Reset Values
32 */
33
34static const int a15_max_cpu_idx = 3;
35
36static struct kvm_regs a15_regs_reset = {
37 .usr_regs.ARM_cpsr = SVC_MODE | PSR_A_BIT | PSR_I_BIT | PSR_F_BIT,
38};
39
40
41/*******************************************************************************
42 * Exported reset function
43 */
44
45/**
46 * kvm_reset_vcpu - sets core registers and cp15 registers to reset value
47 * @vcpu: The VCPU pointer
48 *
49 * This function finds the right table above and sets the registers on the
50 * virtual CPU struct to their architectually defined reset values.
51 */
52int kvm_reset_vcpu(struct kvm_vcpu *vcpu)
53{
54 struct kvm_regs *cpu_reset;
55
56 switch (vcpu->arch.target) {
57 case KVM_ARM_TARGET_CORTEX_A15:
58 if (vcpu->vcpu_id > a15_max_cpu_idx)
59 return -EINVAL;
60 cpu_reset = &a15_regs_reset;
61 vcpu->arch.midr = read_cpuid_id();
62 break;
63 default:
64 return -ENODEV;
65 }
66
67 /* Reset core registers */
68 memcpy(&vcpu->arch.regs, cpu_reset, sizeof(vcpu->arch.regs));
69
70 /* Reset CP15 registers */
71 kvm_reset_coprocs(vcpu);
72
73 return 0;
74}
diff --git a/arch/arm/kvm/trace.h b/arch/arm/kvm/trace.h
new file mode 100644
index 000000000000..a8e73ed5ad5b
--- /dev/null
+++ b/arch/arm/kvm/trace.h
@@ -0,0 +1,235 @@
1#if !defined(_TRACE_KVM_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_KVM_H
3
4#include <linux/tracepoint.h>
5
6#undef TRACE_SYSTEM
7#define TRACE_SYSTEM kvm
8
9/*
10 * Tracepoints for entry/exit to guest
11 */
12TRACE_EVENT(kvm_entry,
13 TP_PROTO(unsigned long vcpu_pc),
14 TP_ARGS(vcpu_pc),
15
16 TP_STRUCT__entry(
17 __field( unsigned long, vcpu_pc )
18 ),
19
20 TP_fast_assign(
21 __entry->vcpu_pc = vcpu_pc;
22 ),
23
24 TP_printk("PC: 0x%08lx", __entry->vcpu_pc)
25);
26
27TRACE_EVENT(kvm_exit,
28 TP_PROTO(unsigned long vcpu_pc),
29 TP_ARGS(vcpu_pc),
30
31 TP_STRUCT__entry(
32 __field( unsigned long, vcpu_pc )
33 ),
34
35 TP_fast_assign(
36 __entry->vcpu_pc = vcpu_pc;
37 ),
38
39 TP_printk("PC: 0x%08lx", __entry->vcpu_pc)
40);
41
42TRACE_EVENT(kvm_guest_fault,
43 TP_PROTO(unsigned long vcpu_pc, unsigned long hsr,
44 unsigned long hxfar,
45 unsigned long long ipa),
46 TP_ARGS(vcpu_pc, hsr, hxfar, ipa),
47
48 TP_STRUCT__entry(
49 __field( unsigned long, vcpu_pc )
50 __field( unsigned long, hsr )
51 __field( unsigned long, hxfar )
52 __field( unsigned long long, ipa )
53 ),
54
55 TP_fast_assign(
56 __entry->vcpu_pc = vcpu_pc;
57 __entry->hsr = hsr;
58 __entry->hxfar = hxfar;
59 __entry->ipa = ipa;
60 ),
61
62 TP_printk("guest fault at PC %#08lx (hxfar %#08lx, "
63 "ipa %#16llx, hsr %#08lx",
64 __entry->vcpu_pc, __entry->hxfar,
65 __entry->ipa, __entry->hsr)
66);
67
68TRACE_EVENT(kvm_irq_line,
69 TP_PROTO(unsigned int type, int vcpu_idx, int irq_num, int level),
70 TP_ARGS(type, vcpu_idx, irq_num, level),
71
72 TP_STRUCT__entry(
73 __field( unsigned int, type )
74 __field( int, vcpu_idx )
75 __field( int, irq_num )
76 __field( int, level )
77 ),
78
79 TP_fast_assign(
80 __entry->type = type;
81 __entry->vcpu_idx = vcpu_idx;
82 __entry->irq_num = irq_num;
83 __entry->level = level;
84 ),
85
86 TP_printk("Inject %s interrupt (%d), vcpu->idx: %d, num: %d, level: %d",
87 (__entry->type == KVM_ARM_IRQ_TYPE_CPU) ? "CPU" :
88 (__entry->type == KVM_ARM_IRQ_TYPE_PPI) ? "VGIC PPI" :
89 (__entry->type == KVM_ARM_IRQ_TYPE_SPI) ? "VGIC SPI" : "UNKNOWN",
90 __entry->type, __entry->vcpu_idx, __entry->irq_num, __entry->level)
91);
92
93TRACE_EVENT(kvm_mmio_emulate,
94 TP_PROTO(unsigned long vcpu_pc, unsigned long instr,
95 unsigned long cpsr),
96 TP_ARGS(vcpu_pc, instr, cpsr),
97
98 TP_STRUCT__entry(
99 __field( unsigned long, vcpu_pc )
100 __field( unsigned long, instr )
101 __field( unsigned long, cpsr )
102 ),
103
104 TP_fast_assign(
105 __entry->vcpu_pc = vcpu_pc;
106 __entry->instr = instr;
107 __entry->cpsr = cpsr;
108 ),
109
110 TP_printk("Emulate MMIO at: 0x%08lx (instr: %08lx, cpsr: %08lx)",
111 __entry->vcpu_pc, __entry->instr, __entry->cpsr)
112);
113
114/* Architecturally implementation defined CP15 register access */
115TRACE_EVENT(kvm_emulate_cp15_imp,
116 TP_PROTO(unsigned long Op1, unsigned long Rt1, unsigned long CRn,
117 unsigned long CRm, unsigned long Op2, bool is_write),
118 TP_ARGS(Op1, Rt1, CRn, CRm, Op2, is_write),
119
120 TP_STRUCT__entry(
121 __field( unsigned int, Op1 )
122 __field( unsigned int, Rt1 )
123 __field( unsigned int, CRn )
124 __field( unsigned int, CRm )
125 __field( unsigned int, Op2 )
126 __field( bool, is_write )
127 ),
128
129 TP_fast_assign(
130 __entry->is_write = is_write;
131 __entry->Op1 = Op1;
132 __entry->Rt1 = Rt1;
133 __entry->CRn = CRn;
134 __entry->CRm = CRm;
135 __entry->Op2 = Op2;
136 ),
137
138 TP_printk("Implementation defined CP15: %s\tp15, %u, r%u, c%u, c%u, %u",
139 (__entry->is_write) ? "mcr" : "mrc",
140 __entry->Op1, __entry->Rt1, __entry->CRn,
141 __entry->CRm, __entry->Op2)
142);
143
144TRACE_EVENT(kvm_wfi,
145 TP_PROTO(unsigned long vcpu_pc),
146 TP_ARGS(vcpu_pc),
147
148 TP_STRUCT__entry(
149 __field( unsigned long, vcpu_pc )
150 ),
151
152 TP_fast_assign(
153 __entry->vcpu_pc = vcpu_pc;
154 ),
155
156 TP_printk("guest executed wfi at: 0x%08lx", __entry->vcpu_pc)
157);
158
159TRACE_EVENT(kvm_unmap_hva,
160 TP_PROTO(unsigned long hva),
161 TP_ARGS(hva),
162
163 TP_STRUCT__entry(
164 __field( unsigned long, hva )
165 ),
166
167 TP_fast_assign(
168 __entry->hva = hva;
169 ),
170
171 TP_printk("mmu notifier unmap hva: %#08lx", __entry->hva)
172);
173
174TRACE_EVENT(kvm_unmap_hva_range,
175 TP_PROTO(unsigned long start, unsigned long end),
176 TP_ARGS(start, end),
177
178 TP_STRUCT__entry(
179 __field( unsigned long, start )
180 __field( unsigned long, end )
181 ),
182
183 TP_fast_assign(
184 __entry->start = start;
185 __entry->end = end;
186 ),
187
188 TP_printk("mmu notifier unmap range: %#08lx -- %#08lx",
189 __entry->start, __entry->end)
190);
191
192TRACE_EVENT(kvm_set_spte_hva,
193 TP_PROTO(unsigned long hva),
194 TP_ARGS(hva),
195
196 TP_STRUCT__entry(
197 __field( unsigned long, hva )
198 ),
199
200 TP_fast_assign(
201 __entry->hva = hva;
202 ),
203
204 TP_printk("mmu notifier set pte hva: %#08lx", __entry->hva)
205);
206
207TRACE_EVENT(kvm_hvc,
208 TP_PROTO(unsigned long vcpu_pc, unsigned long r0, unsigned long imm),
209 TP_ARGS(vcpu_pc, r0, imm),
210
211 TP_STRUCT__entry(
212 __field( unsigned long, vcpu_pc )
213 __field( unsigned long, r0 )
214 __field( unsigned long, imm )
215 ),
216
217 TP_fast_assign(
218 __entry->vcpu_pc = vcpu_pc;
219 __entry->r0 = r0;
220 __entry->imm = imm;
221 ),
222
223 TP_printk("HVC at 0x%08lx (r0: 0x%08lx, imm: 0x%lx",
224 __entry->vcpu_pc, __entry->r0, __entry->imm)
225);
226
227#endif /* _TRACE_KVM_H */
228
229#undef TRACE_INCLUDE_PATH
230#define TRACE_INCLUDE_PATH arch/arm/kvm
231#undef TRACE_INCLUDE_FILE
232#define TRACE_INCLUDE_FILE trace
233
234/* This part must be outside protection */
235#include <trace/define_trace.h>
diff --git a/arch/arm/kvm/vgic.c b/arch/arm/kvm/vgic.c
new file mode 100644
index 000000000000..c9a17316e9fe
--- /dev/null
+++ b/arch/arm/kvm/vgic.c
@@ -0,0 +1,1506 @@
1/*
2 * Copyright (C) 2012 ARM Ltd.
3 * Author: Marc Zyngier <marc.zyngier@arm.com>
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 * 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 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#include <linux/cpu.h>
20#include <linux/kvm.h>
21#include <linux/kvm_host.h>
22#include <linux/interrupt.h>
23#include <linux/io.h>
24#include <linux/of.h>
25#include <linux/of_address.h>
26#include <linux/of_irq.h>
27
28#include <linux/irqchip/arm-gic.h>
29
30#include <asm/kvm_emulate.h>
31#include <asm/kvm_arm.h>
32#include <asm/kvm_mmu.h>
33
34/*
35 * How the whole thing works (courtesy of Christoffer Dall):
36 *
37 * - At any time, the dist->irq_pending_on_cpu is the oracle that knows if
38 * something is pending
39 * - VGIC pending interrupts are stored on the vgic.irq_state vgic
40 * bitmap (this bitmap is updated by both user land ioctls and guest
41 * mmio ops, and other in-kernel peripherals such as the
42 * arch. timers) and indicate the 'wire' state.
43 * - Every time the bitmap changes, the irq_pending_on_cpu oracle is
44 * recalculated
45 * - To calculate the oracle, we need info for each cpu from
46 * compute_pending_for_cpu, which considers:
47 * - PPI: dist->irq_state & dist->irq_enable
48 * - SPI: dist->irq_state & dist->irq_enable & dist->irq_spi_target
49 * - irq_spi_target is a 'formatted' version of the GICD_ICFGR
50 * registers, stored on each vcpu. We only keep one bit of
51 * information per interrupt, making sure that only one vcpu can
52 * accept the interrupt.
53 * - The same is true when injecting an interrupt, except that we only
54 * consider a single interrupt at a time. The irq_spi_cpu array
55 * contains the target CPU for each SPI.
56 *
57 * The handling of level interrupts adds some extra complexity. We
58 * need to track when the interrupt has been EOIed, so we can sample
59 * the 'line' again. This is achieved as such:
60 *
61 * - When a level interrupt is moved onto a vcpu, the corresponding
62 * bit in irq_active is set. As long as this bit is set, the line
63 * will be ignored for further interrupts. The interrupt is injected
64 * into the vcpu with the GICH_LR_EOI bit set (generate a
65 * maintenance interrupt on EOI).
66 * - When the interrupt is EOIed, the maintenance interrupt fires,
67 * and clears the corresponding bit in irq_active. This allow the
68 * interrupt line to be sampled again.
69 */
70
71#define VGIC_ADDR_UNDEF (-1)
72#define IS_VGIC_ADDR_UNDEF(_x) ((_x) == VGIC_ADDR_UNDEF)
73
74/* Physical address of vgic virtual cpu interface */
75static phys_addr_t vgic_vcpu_base;
76
77/* Virtual control interface base address */
78static void __iomem *vgic_vctrl_base;
79
80static struct device_node *vgic_node;
81
82#define ACCESS_READ_VALUE (1 << 0)
83#define ACCESS_READ_RAZ (0 << 0)
84#define ACCESS_READ_MASK(x) ((x) & (1 << 0))
85#define ACCESS_WRITE_IGNORED (0 << 1)
86#define ACCESS_WRITE_SETBIT (1 << 1)
87#define ACCESS_WRITE_CLEARBIT (2 << 1)
88#define ACCESS_WRITE_VALUE (3 << 1)
89#define ACCESS_WRITE_MASK(x) ((x) & (3 << 1))
90
91static void vgic_retire_disabled_irqs(struct kvm_vcpu *vcpu);
92static void vgic_update_state(struct kvm *kvm);
93static void vgic_kick_vcpus(struct kvm *kvm);
94static void vgic_dispatch_sgi(struct kvm_vcpu *vcpu, u32 reg);
95static u32 vgic_nr_lr;
96
97static unsigned int vgic_maint_irq;
98
99static u32 *vgic_bitmap_get_reg(struct vgic_bitmap *x,
100 int cpuid, u32 offset)
101{
102 offset >>= 2;
103 if (!offset)
104 return x->percpu[cpuid].reg;
105 else
106 return x->shared.reg + offset - 1;
107}
108
109static int vgic_bitmap_get_irq_val(struct vgic_bitmap *x,
110 int cpuid, int irq)
111{
112 if (irq < VGIC_NR_PRIVATE_IRQS)
113 return test_bit(irq, x->percpu[cpuid].reg_ul);
114
115 return test_bit(irq - VGIC_NR_PRIVATE_IRQS, x->shared.reg_ul);
116}
117
118static void vgic_bitmap_set_irq_val(struct vgic_bitmap *x, int cpuid,
119 int irq, int val)
120{
121 unsigned long *reg;
122
123 if (irq < VGIC_NR_PRIVATE_IRQS) {
124 reg = x->percpu[cpuid].reg_ul;
125 } else {
126 reg = x->shared.reg_ul;
127 irq -= VGIC_NR_PRIVATE_IRQS;
128 }
129
130 if (val)
131 set_bit(irq, reg);
132 else
133 clear_bit(irq, reg);
134}
135
136static unsigned long *vgic_bitmap_get_cpu_map(struct vgic_bitmap *x, int cpuid)
137{
138 if (unlikely(cpuid >= VGIC_MAX_CPUS))
139 return NULL;
140 return x->percpu[cpuid].reg_ul;
141}
142
143static unsigned long *vgic_bitmap_get_shared_map(struct vgic_bitmap *x)
144{
145 return x->shared.reg_ul;
146}
147
148static u32 *vgic_bytemap_get_reg(struct vgic_bytemap *x, int cpuid, u32 offset)
149{
150 offset >>= 2;
151 BUG_ON(offset > (VGIC_NR_IRQS / 4));
152 if (offset < 4)
153 return x->percpu[cpuid] + offset;
154 else
155 return x->shared + offset - 8;
156}
157
158#define VGIC_CFG_LEVEL 0
159#define VGIC_CFG_EDGE 1
160
161static bool vgic_irq_is_edge(struct kvm_vcpu *vcpu, int irq)
162{
163 struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
164 int irq_val;
165
166 irq_val = vgic_bitmap_get_irq_val(&dist->irq_cfg, vcpu->vcpu_id, irq);
167 return irq_val == VGIC_CFG_EDGE;
168}
169
170static int vgic_irq_is_enabled(struct kvm_vcpu *vcpu, int irq)
171{
172 struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
173
174 return vgic_bitmap_get_irq_val(&dist->irq_enabled, vcpu->vcpu_id, irq);
175}
176
177static int vgic_irq_is_active(struct kvm_vcpu *vcpu, int irq)
178{
179 struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
180
181 return vgic_bitmap_get_irq_val(&dist->irq_active, vcpu->vcpu_id, irq);
182}
183
184static void vgic_irq_set_active(struct kvm_vcpu *vcpu, int irq)
185{
186 struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
187
188 vgic_bitmap_set_irq_val(&dist->irq_active, vcpu->vcpu_id, irq, 1);
189}
190
191static void vgic_irq_clear_active(struct kvm_vcpu *vcpu, int irq)
192{
193 struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
194
195 vgic_bitmap_set_irq_val(&dist->irq_active, vcpu->vcpu_id, irq, 0);
196}
197
198static int vgic_dist_irq_is_pending(struct kvm_vcpu *vcpu, int irq)
199{
200 struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
201
202 return vgic_bitmap_get_irq_val(&dist->irq_state, vcpu->vcpu_id, irq);
203}
204
205static void vgic_dist_irq_set(struct kvm_vcpu *vcpu, int irq)
206{
207 struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
208
209 vgic_bitmap_set_irq_val(&dist->irq_state, vcpu->vcpu_id, irq, 1);
210}
211
212static void vgic_dist_irq_clear(struct kvm_vcpu *vcpu, int irq)
213{
214 struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
215
216 vgic_bitmap_set_irq_val(&dist->irq_state, vcpu->vcpu_id, irq, 0);
217}
218
219static void vgic_cpu_irq_set(struct kvm_vcpu *vcpu, int irq)
220{
221 if (irq < VGIC_NR_PRIVATE_IRQS)
222 set_bit(irq, vcpu->arch.vgic_cpu.pending_percpu);
223 else
224 set_bit(irq - VGIC_NR_PRIVATE_IRQS,
225 vcpu->arch.vgic_cpu.pending_shared);
226}
227
228static void vgic_cpu_irq_clear(struct kvm_vcpu *vcpu, int irq)
229{
230 if (irq < VGIC_NR_PRIVATE_IRQS)
231 clear_bit(irq, vcpu->arch.vgic_cpu.pending_percpu);
232 else
233 clear_bit(irq - VGIC_NR_PRIVATE_IRQS,
234 vcpu->arch.vgic_cpu.pending_shared);
235}
236
237static u32 mmio_data_read(struct kvm_exit_mmio *mmio, u32 mask)
238{
239 return *((u32 *)mmio->data) & mask;
240}
241
242static void mmio_data_write(struct kvm_exit_mmio *mmio, u32 mask, u32 value)
243{
244 *((u32 *)mmio->data) = value & mask;
245}
246
247/**
248 * vgic_reg_access - access vgic register
249 * @mmio: pointer to the data describing the mmio access
250 * @reg: pointer to the virtual backing of vgic distributor data
251 * @offset: least significant 2 bits used for word offset
252 * @mode: ACCESS_ mode (see defines above)
253 *
254 * Helper to make vgic register access easier using one of the access
255 * modes defined for vgic register access
256 * (read,raz,write-ignored,setbit,clearbit,write)
257 */
258static void vgic_reg_access(struct kvm_exit_mmio *mmio, u32 *reg,
259 phys_addr_t offset, int mode)
260{
261 int word_offset = (offset & 3) * 8;
262 u32 mask = (1UL << (mmio->len * 8)) - 1;
263 u32 regval;
264
265 /*
266 * Any alignment fault should have been delivered to the guest
267 * directly (ARM ARM B3.12.7 "Prioritization of aborts").
268 */
269
270 if (reg) {
271 regval = *reg;
272 } else {
273 BUG_ON(mode != (ACCESS_READ_RAZ | ACCESS_WRITE_IGNORED));
274 regval = 0;
275 }
276
277 if (mmio->is_write) {
278 u32 data = mmio_data_read(mmio, mask) << word_offset;
279 switch (ACCESS_WRITE_MASK(mode)) {
280 case ACCESS_WRITE_IGNORED:
281 return;
282
283 case ACCESS_WRITE_SETBIT:
284 regval |= data;
285 break;
286
287 case ACCESS_WRITE_CLEARBIT:
288 regval &= ~data;
289 break;
290
291 case ACCESS_WRITE_VALUE:
292 regval = (regval & ~(mask << word_offset)) | data;
293 break;
294 }
295 *reg = regval;
296 } else {
297 switch (ACCESS_READ_MASK(mode)) {
298 case ACCESS_READ_RAZ:
299 regval = 0;
300 /* fall through */
301
302 case ACCESS_READ_VALUE:
303 mmio_data_write(mmio, mask, regval >> word_offset);
304 }
305 }
306}
307
308static bool handle_mmio_misc(struct kvm_vcpu *vcpu,
309 struct kvm_exit_mmio *mmio, phys_addr_t offset)
310{
311 u32 reg;
312 u32 word_offset = offset & 3;
313
314 switch (offset & ~3) {
315 case 0: /* CTLR */
316 reg = vcpu->kvm->arch.vgic.enabled;
317 vgic_reg_access(mmio, &reg, word_offset,
318 ACCESS_READ_VALUE | ACCESS_WRITE_VALUE);
319 if (mmio->is_write) {
320 vcpu->kvm->arch.vgic.enabled = reg & 1;
321 vgic_update_state(vcpu->kvm);
322 return true;
323 }
324 break;
325
326 case 4: /* TYPER */
327 reg = (atomic_read(&vcpu->kvm->online_vcpus) - 1) << 5;
328 reg |= (VGIC_NR_IRQS >> 5) - 1;
329 vgic_reg_access(mmio, &reg, word_offset,
330 ACCESS_READ_VALUE | ACCESS_WRITE_IGNORED);
331 break;
332
333 case 8: /* IIDR */
334 reg = 0x4B00043B;
335 vgic_reg_access(mmio, &reg, word_offset,
336 ACCESS_READ_VALUE | ACCESS_WRITE_IGNORED);
337 break;
338 }
339
340 return false;
341}
342
343static bool handle_mmio_raz_wi(struct kvm_vcpu *vcpu,
344 struct kvm_exit_mmio *mmio, phys_addr_t offset)
345{
346 vgic_reg_access(mmio, NULL, offset,
347 ACCESS_READ_RAZ | ACCESS_WRITE_IGNORED);
348 return false;
349}
350
351static bool handle_mmio_set_enable_reg(struct kvm_vcpu *vcpu,
352 struct kvm_exit_mmio *mmio,
353 phys_addr_t offset)
354{
355 u32 *reg = vgic_bitmap_get_reg(&vcpu->kvm->arch.vgic.irq_enabled,
356 vcpu->vcpu_id, offset);
357 vgic_reg_access(mmio, reg, offset,
358 ACCESS_READ_VALUE | ACCESS_WRITE_SETBIT);
359 if (mmio->is_write) {
360 vgic_update_state(vcpu->kvm);
361 return true;
362 }
363
364 return false;
365}
366
367static bool handle_mmio_clear_enable_reg(struct kvm_vcpu *vcpu,
368 struct kvm_exit_mmio *mmio,
369 phys_addr_t offset)
370{
371 u32 *reg = vgic_bitmap_get_reg(&vcpu->kvm->arch.vgic.irq_enabled,
372 vcpu->vcpu_id, offset);
373 vgic_reg_access(mmio, reg, offset,
374 ACCESS_READ_VALUE | ACCESS_WRITE_CLEARBIT);
375 if (mmio->is_write) {
376 if (offset < 4) /* Force SGI enabled */
377 *reg |= 0xffff;
378 vgic_retire_disabled_irqs(vcpu);
379 vgic_update_state(vcpu->kvm);
380 return true;
381 }
382
383 return false;
384}
385
386static bool handle_mmio_set_pending_reg(struct kvm_vcpu *vcpu,
387 struct kvm_exit_mmio *mmio,
388 phys_addr_t offset)
389{
390 u32 *reg = vgic_bitmap_get_reg(&vcpu->kvm->arch.vgic.irq_state,
391 vcpu->vcpu_id, offset);
392 vgic_reg_access(mmio, reg, offset,
393 ACCESS_READ_VALUE | ACCESS_WRITE_SETBIT);
394 if (mmio->is_write) {
395 vgic_update_state(vcpu->kvm);
396 return true;
397 }
398
399 return false;
400}
401
402static bool handle_mmio_clear_pending_reg(struct kvm_vcpu *vcpu,
403 struct kvm_exit_mmio *mmio,
404 phys_addr_t offset)
405{
406 u32 *reg = vgic_bitmap_get_reg(&vcpu->kvm->arch.vgic.irq_state,
407 vcpu->vcpu_id, offset);
408 vgic_reg_access(mmio, reg, offset,
409 ACCESS_READ_VALUE | ACCESS_WRITE_CLEARBIT);
410 if (mmio->is_write) {
411 vgic_update_state(vcpu->kvm);
412 return true;
413 }
414
415 return false;
416}
417
418static bool handle_mmio_priority_reg(struct kvm_vcpu *vcpu,
419 struct kvm_exit_mmio *mmio,
420 phys_addr_t offset)
421{
422 u32 *reg = vgic_bytemap_get_reg(&vcpu->kvm->arch.vgic.irq_priority,
423 vcpu->vcpu_id, offset);
424 vgic_reg_access(mmio, reg, offset,
425 ACCESS_READ_VALUE | ACCESS_WRITE_VALUE);
426 return false;
427}
428
429#define GICD_ITARGETSR_SIZE 32
430#define GICD_CPUTARGETS_BITS 8
431#define GICD_IRQS_PER_ITARGETSR (GICD_ITARGETSR_SIZE / GICD_CPUTARGETS_BITS)
432static u32 vgic_get_target_reg(struct kvm *kvm, int irq)
433{
434 struct vgic_dist *dist = &kvm->arch.vgic;
435 struct kvm_vcpu *vcpu;
436 int i, c;
437 unsigned long *bmap;
438 u32 val = 0;
439
440 irq -= VGIC_NR_PRIVATE_IRQS;
441
442 kvm_for_each_vcpu(c, vcpu, kvm) {
443 bmap = vgic_bitmap_get_shared_map(&dist->irq_spi_target[c]);
444 for (i = 0; i < GICD_IRQS_PER_ITARGETSR; i++)
445 if (test_bit(irq + i, bmap))
446 val |= 1 << (c + i * 8);
447 }
448
449 return val;
450}
451
452static void vgic_set_target_reg(struct kvm *kvm, u32 val, int irq)
453{
454 struct vgic_dist *dist = &kvm->arch.vgic;
455 struct kvm_vcpu *vcpu;
456 int i, c;
457 unsigned long *bmap;
458 u32 target;
459
460 irq -= VGIC_NR_PRIVATE_IRQS;
461
462 /*
463 * Pick the LSB in each byte. This ensures we target exactly
464 * one vcpu per IRQ. If the byte is null, assume we target
465 * CPU0.
466 */
467 for (i = 0; i < GICD_IRQS_PER_ITARGETSR; i++) {
468 int shift = i * GICD_CPUTARGETS_BITS;
469 target = ffs((val >> shift) & 0xffU);
470 target = target ? (target - 1) : 0;
471 dist->irq_spi_cpu[irq + i] = target;
472 kvm_for_each_vcpu(c, vcpu, kvm) {
473 bmap = vgic_bitmap_get_shared_map(&dist->irq_spi_target[c]);
474 if (c == target)
475 set_bit(irq + i, bmap);
476 else
477 clear_bit(irq + i, bmap);
478 }
479 }
480}
481
482static bool handle_mmio_target_reg(struct kvm_vcpu *vcpu,
483 struct kvm_exit_mmio *mmio,
484 phys_addr_t offset)
485{
486 u32 reg;
487
488 /* We treat the banked interrupts targets as read-only */
489 if (offset < 32) {
490 u32 roreg = 1 << vcpu->vcpu_id;
491 roreg |= roreg << 8;
492 roreg |= roreg << 16;
493
494 vgic_reg_access(mmio, &roreg, offset,
495 ACCESS_READ_VALUE | ACCESS_WRITE_IGNORED);
496 return false;
497 }
498
499 reg = vgic_get_target_reg(vcpu->kvm, offset & ~3U);
500 vgic_reg_access(mmio, &reg, offset,
501 ACCESS_READ_VALUE | ACCESS_WRITE_VALUE);
502 if (mmio->is_write) {
503 vgic_set_target_reg(vcpu->kvm, reg, offset & ~3U);
504 vgic_update_state(vcpu->kvm);
505 return true;
506 }
507
508 return false;
509}
510
511static u32 vgic_cfg_expand(u16 val)
512{
513 u32 res = 0;
514 int i;
515
516 /*
517 * Turn a 16bit value like abcd...mnop into a 32bit word
518 * a0b0c0d0...m0n0o0p0, which is what the HW cfg register is.
519 */
520 for (i = 0; i < 16; i++)
521 res |= ((val >> i) & VGIC_CFG_EDGE) << (2 * i + 1);
522
523 return res;
524}
525
526static u16 vgic_cfg_compress(u32 val)
527{
528 u16 res = 0;
529 int i;
530
531 /*
532 * Turn a 32bit word a0b0c0d0...m0n0o0p0 into 16bit value like
533 * abcd...mnop which is what we really care about.
534 */
535 for (i = 0; i < 16; i++)
536 res |= ((val >> (i * 2 + 1)) & VGIC_CFG_EDGE) << i;
537
538 return res;
539}
540
541/*
542 * The distributor uses 2 bits per IRQ for the CFG register, but the
543 * LSB is always 0. As such, we only keep the upper bit, and use the
544 * two above functions to compress/expand the bits
545 */
546static bool handle_mmio_cfg_reg(struct kvm_vcpu *vcpu,
547 struct kvm_exit_mmio *mmio, phys_addr_t offset)
548{
549 u32 val;
550 u32 *reg = vgic_bitmap_get_reg(&vcpu->kvm->arch.vgic.irq_cfg,
551 vcpu->vcpu_id, offset >> 1);
552 if (offset & 2)
553 val = *reg >> 16;
554 else
555 val = *reg & 0xffff;
556
557 val = vgic_cfg_expand(val);
558 vgic_reg_access(mmio, &val, offset,
559 ACCESS_READ_VALUE | ACCESS_WRITE_VALUE);
560 if (mmio->is_write) {
561 if (offset < 4) {
562 *reg = ~0U; /* Force PPIs/SGIs to 1 */
563 return false;
564 }
565
566 val = vgic_cfg_compress(val);
567 if (offset & 2) {
568 *reg &= 0xffff;
569 *reg |= val << 16;
570 } else {
571 *reg &= 0xffff << 16;
572 *reg |= val;
573 }
574 }
575
576 return false;
577}
578
579static bool handle_mmio_sgi_reg(struct kvm_vcpu *vcpu,
580 struct kvm_exit_mmio *mmio, phys_addr_t offset)
581{
582 u32 reg;
583 vgic_reg_access(mmio, &reg, offset,
584 ACCESS_READ_RAZ | ACCESS_WRITE_VALUE);
585 if (mmio->is_write) {
586 vgic_dispatch_sgi(vcpu, reg);
587 vgic_update_state(vcpu->kvm);
588 return true;
589 }
590
591 return false;
592}
593
594/*
595 * I would have liked to use the kvm_bus_io_*() API instead, but it
596 * cannot cope with banked registers (only the VM pointer is passed
597 * around, and we need the vcpu). One of these days, someone please
598 * fix it!
599 */
600struct mmio_range {
601 phys_addr_t base;
602 unsigned long len;
603 bool (*handle_mmio)(struct kvm_vcpu *vcpu, struct kvm_exit_mmio *mmio,
604 phys_addr_t offset);
605};
606
607static const struct mmio_range vgic_ranges[] = {
608 {
609 .base = GIC_DIST_CTRL,
610 .len = 12,
611 .handle_mmio = handle_mmio_misc,
612 },
613 {
614 .base = GIC_DIST_IGROUP,
615 .len = VGIC_NR_IRQS / 8,
616 .handle_mmio = handle_mmio_raz_wi,
617 },
618 {
619 .base = GIC_DIST_ENABLE_SET,
620 .len = VGIC_NR_IRQS / 8,
621 .handle_mmio = handle_mmio_set_enable_reg,
622 },
623 {
624 .base = GIC_DIST_ENABLE_CLEAR,
625 .len = VGIC_NR_IRQS / 8,
626 .handle_mmio = handle_mmio_clear_enable_reg,
627 },
628 {
629 .base = GIC_DIST_PENDING_SET,
630 .len = VGIC_NR_IRQS / 8,
631 .handle_mmio = handle_mmio_set_pending_reg,
632 },
633 {
634 .base = GIC_DIST_PENDING_CLEAR,
635 .len = VGIC_NR_IRQS / 8,
636 .handle_mmio = handle_mmio_clear_pending_reg,
637 },
638 {
639 .base = GIC_DIST_ACTIVE_SET,
640 .len = VGIC_NR_IRQS / 8,
641 .handle_mmio = handle_mmio_raz_wi,
642 },
643 {
644 .base = GIC_DIST_ACTIVE_CLEAR,
645 .len = VGIC_NR_IRQS / 8,
646 .handle_mmio = handle_mmio_raz_wi,
647 },
648 {
649 .base = GIC_DIST_PRI,
650 .len = VGIC_NR_IRQS,
651 .handle_mmio = handle_mmio_priority_reg,
652 },
653 {
654 .base = GIC_DIST_TARGET,
655 .len = VGIC_NR_IRQS,
656 .handle_mmio = handle_mmio_target_reg,
657 },
658 {
659 .base = GIC_DIST_CONFIG,
660 .len = VGIC_NR_IRQS / 4,
661 .handle_mmio = handle_mmio_cfg_reg,
662 },
663 {
664 .base = GIC_DIST_SOFTINT,
665 .len = 4,
666 .handle_mmio = handle_mmio_sgi_reg,
667 },
668 {}
669};
670
671static const
672struct mmio_range *find_matching_range(const struct mmio_range *ranges,
673 struct kvm_exit_mmio *mmio,
674 phys_addr_t base)
675{
676 const struct mmio_range *r = ranges;
677 phys_addr_t addr = mmio->phys_addr - base;
678
679 while (r->len) {
680 if (addr >= r->base &&
681 (addr + mmio->len) <= (r->base + r->len))
682 return r;
683 r++;
684 }
685
686 return NULL;
687}
688
689/**
690 * vgic_handle_mmio - handle an in-kernel MMIO access
691 * @vcpu: pointer to the vcpu performing the access
692 * @run: pointer to the kvm_run structure
693 * @mmio: pointer to the data describing the access
694 *
695 * returns true if the MMIO access has been performed in kernel space,
696 * and false if it needs to be emulated in user space.
697 */
698bool vgic_handle_mmio(struct kvm_vcpu *vcpu, struct kvm_run *run,
699 struct kvm_exit_mmio *mmio)
700{
701 const struct mmio_range *range;
702 struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
703 unsigned long base = dist->vgic_dist_base;
704 bool updated_state;
705 unsigned long offset;
706
707 if (!irqchip_in_kernel(vcpu->kvm) ||
708 mmio->phys_addr < base ||
709 (mmio->phys_addr + mmio->len) > (base + KVM_VGIC_V2_DIST_SIZE))
710 return false;
711
712 /* We don't support ldrd / strd or ldm / stm to the emulated vgic */
713 if (mmio->len > 4) {
714 kvm_inject_dabt(vcpu, mmio->phys_addr);
715 return true;
716 }
717
718 range = find_matching_range(vgic_ranges, mmio, base);
719 if (unlikely(!range || !range->handle_mmio)) {
720 pr_warn("Unhandled access %d %08llx %d\n",
721 mmio->is_write, mmio->phys_addr, mmio->len);
722 return false;
723 }
724
725 spin_lock(&vcpu->kvm->arch.vgic.lock);
726 offset = mmio->phys_addr - range->base - base;
727 updated_state = range->handle_mmio(vcpu, mmio, offset);
728 spin_unlock(&vcpu->kvm->arch.vgic.lock);
729 kvm_prepare_mmio(run, mmio);
730 kvm_handle_mmio_return(vcpu, run);
731
732 if (updated_state)
733 vgic_kick_vcpus(vcpu->kvm);
734
735 return true;
736}
737
738static void vgic_dispatch_sgi(struct kvm_vcpu *vcpu, u32 reg)
739{
740 struct kvm *kvm = vcpu->kvm;
741 struct vgic_dist *dist = &kvm->arch.vgic;
742 int nrcpus = atomic_read(&kvm->online_vcpus);
743 u8 target_cpus;
744 int sgi, mode, c, vcpu_id;
745
746 vcpu_id = vcpu->vcpu_id;
747
748 sgi = reg & 0xf;
749 target_cpus = (reg >> 16) & 0xff;
750 mode = (reg >> 24) & 3;
751
752 switch (mode) {
753 case 0:
754 if (!target_cpus)
755 return;
756
757 case 1:
758 target_cpus = ((1 << nrcpus) - 1) & ~(1 << vcpu_id) & 0xff;
759 break;
760
761 case 2:
762 target_cpus = 1 << vcpu_id;
763 break;
764 }
765
766 kvm_for_each_vcpu(c, vcpu, kvm) {
767 if (target_cpus & 1) {
768 /* Flag the SGI as pending */
769 vgic_dist_irq_set(vcpu, sgi);
770 dist->irq_sgi_sources[c][sgi] |= 1 << vcpu_id;
771 kvm_debug("SGI%d from CPU%d to CPU%d\n", sgi, vcpu_id, c);
772 }
773
774 target_cpus >>= 1;
775 }
776}
777
778static int compute_pending_for_cpu(struct kvm_vcpu *vcpu)
779{
780 struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
781 unsigned long *pending, *enabled, *pend_percpu, *pend_shared;
782 unsigned long pending_private, pending_shared;
783 int vcpu_id;
784
785 vcpu_id = vcpu->vcpu_id;
786 pend_percpu = vcpu->arch.vgic_cpu.pending_percpu;
787 pend_shared = vcpu->arch.vgic_cpu.pending_shared;
788
789 pending = vgic_bitmap_get_cpu_map(&dist->irq_state, vcpu_id);
790 enabled = vgic_bitmap_get_cpu_map(&dist->irq_enabled, vcpu_id);
791 bitmap_and(pend_percpu, pending, enabled, VGIC_NR_PRIVATE_IRQS);
792
793 pending = vgic_bitmap_get_shared_map(&dist->irq_state);
794 enabled = vgic_bitmap_get_shared_map(&dist->irq_enabled);
795 bitmap_and(pend_shared, pending, enabled, VGIC_NR_SHARED_IRQS);
796 bitmap_and(pend_shared, pend_shared,
797 vgic_bitmap_get_shared_map(&dist->irq_spi_target[vcpu_id]),
798 VGIC_NR_SHARED_IRQS);
799
800 pending_private = find_first_bit(pend_percpu, VGIC_NR_PRIVATE_IRQS);
801 pending_shared = find_first_bit(pend_shared, VGIC_NR_SHARED_IRQS);
802 return (pending_private < VGIC_NR_PRIVATE_IRQS ||
803 pending_shared < VGIC_NR_SHARED_IRQS);
804}
805
806/*
807 * Update the interrupt state and determine which CPUs have pending
808 * interrupts. Must be called with distributor lock held.
809 */
810static void vgic_update_state(struct kvm *kvm)
811{
812 struct vgic_dist *dist = &kvm->arch.vgic;
813 struct kvm_vcpu *vcpu;
814 int c;
815
816 if (!dist->enabled) {
817 set_bit(0, &dist->irq_pending_on_cpu);
818 return;
819 }
820
821 kvm_for_each_vcpu(c, vcpu, kvm) {
822 if (compute_pending_for_cpu(vcpu)) {
823 pr_debug("CPU%d has pending interrupts\n", c);
824 set_bit(c, &dist->irq_pending_on_cpu);
825 }
826 }
827}
828
829#define LR_CPUID(lr) \
830 (((lr) & GICH_LR_PHYSID_CPUID) >> GICH_LR_PHYSID_CPUID_SHIFT)
831#define MK_LR_PEND(src, irq) \
832 (GICH_LR_PENDING_BIT | ((src) << GICH_LR_PHYSID_CPUID_SHIFT) | (irq))
833
834/*
835 * An interrupt may have been disabled after being made pending on the
836 * CPU interface (the classic case is a timer running while we're
837 * rebooting the guest - the interrupt would kick as soon as the CPU
838 * interface gets enabled, with deadly consequences).
839 *
840 * The solution is to examine already active LRs, and check the
841 * interrupt is still enabled. If not, just retire it.
842 */
843static void vgic_retire_disabled_irqs(struct kvm_vcpu *vcpu)
844{
845 struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;
846 int lr;
847
848 for_each_set_bit(lr, vgic_cpu->lr_used, vgic_cpu->nr_lr) {
849 int irq = vgic_cpu->vgic_lr[lr] & GICH_LR_VIRTUALID;
850
851 if (!vgic_irq_is_enabled(vcpu, irq)) {
852 vgic_cpu->vgic_irq_lr_map[irq] = LR_EMPTY;
853 clear_bit(lr, vgic_cpu->lr_used);
854 vgic_cpu->vgic_lr[lr] &= ~GICH_LR_STATE;
855 if (vgic_irq_is_active(vcpu, irq))
856 vgic_irq_clear_active(vcpu, irq);
857 }
858 }
859}
860
861/*
862 * Queue an interrupt to a CPU virtual interface. Return true on success,
863 * or false if it wasn't possible to queue it.
864 */
865static bool vgic_queue_irq(struct kvm_vcpu *vcpu, u8 sgi_source_id, int irq)
866{
867 struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;
868 int lr;
869
870 /* Sanitize the input... */
871 BUG_ON(sgi_source_id & ~7);
872 BUG_ON(sgi_source_id && irq >= VGIC_NR_SGIS);
873 BUG_ON(irq >= VGIC_NR_IRQS);
874
875 kvm_debug("Queue IRQ%d\n", irq);
876
877 lr = vgic_cpu->vgic_irq_lr_map[irq];
878
879 /* Do we have an active interrupt for the same CPUID? */
880 if (lr != LR_EMPTY &&
881 (LR_CPUID(vgic_cpu->vgic_lr[lr]) == sgi_source_id)) {
882 kvm_debug("LR%d piggyback for IRQ%d %x\n",
883 lr, irq, vgic_cpu->vgic_lr[lr]);
884 BUG_ON(!test_bit(lr, vgic_cpu->lr_used));
885 vgic_cpu->vgic_lr[lr] |= GICH_LR_PENDING_BIT;
886
887 goto out;
888 }
889
890 /* Try to use another LR for this interrupt */
891 lr = find_first_zero_bit((unsigned long *)vgic_cpu->lr_used,
892 vgic_cpu->nr_lr);
893 if (lr >= vgic_cpu->nr_lr)
894 return false;
895
896 kvm_debug("LR%d allocated for IRQ%d %x\n", lr, irq, sgi_source_id);
897 vgic_cpu->vgic_lr[lr] = MK_LR_PEND(sgi_source_id, irq);
898 vgic_cpu->vgic_irq_lr_map[irq] = lr;
899 set_bit(lr, vgic_cpu->lr_used);
900
901out:
902 if (!vgic_irq_is_edge(vcpu, irq))
903 vgic_cpu->vgic_lr[lr] |= GICH_LR_EOI;
904
905 return true;
906}
907
908static bool vgic_queue_sgi(struct kvm_vcpu *vcpu, int irq)
909{
910 struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
911 unsigned long sources;
912 int vcpu_id = vcpu->vcpu_id;
913 int c;
914
915 sources = dist->irq_sgi_sources[vcpu_id][irq];
916
917 for_each_set_bit(c, &sources, VGIC_MAX_CPUS) {
918 if (vgic_queue_irq(vcpu, c, irq))
919 clear_bit(c, &sources);
920 }
921
922 dist->irq_sgi_sources[vcpu_id][irq] = sources;
923
924 /*
925 * If the sources bitmap has been cleared it means that we
926 * could queue all the SGIs onto link registers (see the
927 * clear_bit above), and therefore we are done with them in
928 * our emulated gic and can get rid of them.
929 */
930 if (!sources) {
931 vgic_dist_irq_clear(vcpu, irq);
932 vgic_cpu_irq_clear(vcpu, irq);
933 return true;
934 }
935
936 return false;
937}
938
939static bool vgic_queue_hwirq(struct kvm_vcpu *vcpu, int irq)
940{
941 if (vgic_irq_is_active(vcpu, irq))
942 return true; /* level interrupt, already queued */
943
944 if (vgic_queue_irq(vcpu, 0, irq)) {
945 if (vgic_irq_is_edge(vcpu, irq)) {
946 vgic_dist_irq_clear(vcpu, irq);
947 vgic_cpu_irq_clear(vcpu, irq);
948 } else {
949 vgic_irq_set_active(vcpu, irq);
950 }
951
952 return true;
953 }
954
955 return false;
956}
957
958/*
959 * Fill the list registers with pending interrupts before running the
960 * guest.
961 */
962static void __kvm_vgic_flush_hwstate(struct kvm_vcpu *vcpu)
963{
964 struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;
965 struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
966 int i, vcpu_id;
967 int overflow = 0;
968
969 vcpu_id = vcpu->vcpu_id;
970
971 /*
972 * We may not have any pending interrupt, or the interrupts
973 * may have been serviced from another vcpu. In all cases,
974 * move along.
975 */
976 if (!kvm_vgic_vcpu_pending_irq(vcpu)) {
977 pr_debug("CPU%d has no pending interrupt\n", vcpu_id);
978 goto epilog;
979 }
980
981 /* SGIs */
982 for_each_set_bit(i, vgic_cpu->pending_percpu, VGIC_NR_SGIS) {
983 if (!vgic_queue_sgi(vcpu, i))
984 overflow = 1;
985 }
986
987 /* PPIs */
988 for_each_set_bit_from(i, vgic_cpu->pending_percpu, VGIC_NR_PRIVATE_IRQS) {
989 if (!vgic_queue_hwirq(vcpu, i))
990 overflow = 1;
991 }
992
993 /* SPIs */
994 for_each_set_bit(i, vgic_cpu->pending_shared, VGIC_NR_SHARED_IRQS) {
995 if (!vgic_queue_hwirq(vcpu, i + VGIC_NR_PRIVATE_IRQS))
996 overflow = 1;
997 }
998
999epilog:
1000 if (overflow) {
1001 vgic_cpu->vgic_hcr |= GICH_HCR_UIE;
1002 } else {
1003 vgic_cpu->vgic_hcr &= ~GICH_HCR_UIE;
1004 /*
1005 * We're about to run this VCPU, and we've consumed
1006 * everything the distributor had in store for
1007 * us. Claim we don't have anything pending. We'll
1008 * adjust that if needed while exiting.
1009 */
1010 clear_bit(vcpu_id, &dist->irq_pending_on_cpu);
1011 }
1012}
1013
1014static bool vgic_process_maintenance(struct kvm_vcpu *vcpu)
1015{
1016 struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;
1017 bool level_pending = false;
1018
1019 kvm_debug("MISR = %08x\n", vgic_cpu->vgic_misr);
1020
1021 /*
1022 * We do not need to take the distributor lock here, since the only
1023 * action we perform is clearing the irq_active_bit for an EOIed
1024 * level interrupt. There is a potential race with
1025 * the queuing of an interrupt in __kvm_vgic_flush_hwstate(), where we
1026 * check if the interrupt is already active. Two possibilities:
1027 *
1028 * - The queuing is occurring on the same vcpu: cannot happen,
1029 * as we're already in the context of this vcpu, and
1030 * executing the handler
1031 * - The interrupt has been migrated to another vcpu, and we
1032 * ignore this interrupt for this run. Big deal. It is still
1033 * pending though, and will get considered when this vcpu
1034 * exits.
1035 */
1036 if (vgic_cpu->vgic_misr & GICH_MISR_EOI) {
1037 /*
1038 * Some level interrupts have been EOIed. Clear their
1039 * active bit.
1040 */
1041 int lr, irq;
1042
1043 for_each_set_bit(lr, (unsigned long *)vgic_cpu->vgic_eisr,
1044 vgic_cpu->nr_lr) {
1045 irq = vgic_cpu->vgic_lr[lr] & GICH_LR_VIRTUALID;
1046
1047 vgic_irq_clear_active(vcpu, irq);
1048 vgic_cpu->vgic_lr[lr] &= ~GICH_LR_EOI;
1049
1050 /* Any additional pending interrupt? */
1051 if (vgic_dist_irq_is_pending(vcpu, irq)) {
1052 vgic_cpu_irq_set(vcpu, irq);
1053 level_pending = true;
1054 } else {
1055 vgic_cpu_irq_clear(vcpu, irq);
1056 }
1057 }
1058 }
1059
1060 if (vgic_cpu->vgic_misr & GICH_MISR_U)
1061 vgic_cpu->vgic_hcr &= ~GICH_HCR_UIE;
1062
1063 return level_pending;
1064}
1065
1066/*
1067 * Sync back the VGIC state after a guest run. We do not really touch
1068 * the distributor here (the irq_pending_on_cpu bit is safe to set),
1069 * so there is no need for taking its lock.
1070 */
1071static void __kvm_vgic_sync_hwstate(struct kvm_vcpu *vcpu)
1072{
1073 struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;
1074 struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
1075 int lr, pending;
1076 bool level_pending;
1077
1078 level_pending = vgic_process_maintenance(vcpu);
1079
1080 /* Clear mappings for empty LRs */
1081 for_each_set_bit(lr, (unsigned long *)vgic_cpu->vgic_elrsr,
1082 vgic_cpu->nr_lr) {
1083 int irq;
1084
1085 if (!test_and_clear_bit(lr, vgic_cpu->lr_used))
1086 continue;
1087
1088 irq = vgic_cpu->vgic_lr[lr] & GICH_LR_VIRTUALID;
1089
1090 BUG_ON(irq >= VGIC_NR_IRQS);
1091 vgic_cpu->vgic_irq_lr_map[irq] = LR_EMPTY;
1092 }
1093
1094 /* Check if we still have something up our sleeve... */
1095 pending = find_first_zero_bit((unsigned long *)vgic_cpu->vgic_elrsr,
1096 vgic_cpu->nr_lr);
1097 if (level_pending || pending < vgic_cpu->nr_lr)
1098 set_bit(vcpu->vcpu_id, &dist->irq_pending_on_cpu);
1099}
1100
1101void kvm_vgic_flush_hwstate(struct kvm_vcpu *vcpu)
1102{
1103 struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
1104
1105 if (!irqchip_in_kernel(vcpu->kvm))
1106 return;
1107
1108 spin_lock(&dist->lock);
1109 __kvm_vgic_flush_hwstate(vcpu);
1110 spin_unlock(&dist->lock);
1111}
1112
1113void kvm_vgic_sync_hwstate(struct kvm_vcpu *vcpu)
1114{
1115 if (!irqchip_in_kernel(vcpu->kvm))
1116 return;
1117
1118 __kvm_vgic_sync_hwstate(vcpu);
1119}
1120
1121int kvm_vgic_vcpu_pending_irq(struct kvm_vcpu *vcpu)
1122{
1123 struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
1124
1125 if (!irqchip_in_kernel(vcpu->kvm))
1126 return 0;
1127
1128 return test_bit(vcpu->vcpu_id, &dist->irq_pending_on_cpu);
1129}
1130
1131static void vgic_kick_vcpus(struct kvm *kvm)
1132{
1133 struct kvm_vcpu *vcpu;
1134 int c;
1135
1136 /*
1137 * We've injected an interrupt, time to find out who deserves
1138 * a good kick...
1139 */
1140 kvm_for_each_vcpu(c, vcpu, kvm) {
1141 if (kvm_vgic_vcpu_pending_irq(vcpu))
1142 kvm_vcpu_kick(vcpu);
1143 }
1144}
1145
1146static int vgic_validate_injection(struct kvm_vcpu *vcpu, int irq, int level)
1147{
1148 int is_edge = vgic_irq_is_edge(vcpu, irq);
1149 int state = vgic_dist_irq_is_pending(vcpu, irq);
1150
1151 /*
1152 * Only inject an interrupt if:
1153 * - edge triggered and we have a rising edge
1154 * - level triggered and we change level
1155 */
1156 if (is_edge)
1157 return level > state;
1158 else
1159 return level != state;
1160}
1161
1162static bool vgic_update_irq_state(struct kvm *kvm, int cpuid,
1163 unsigned int irq_num, bool level)
1164{
1165 struct vgic_dist *dist = &kvm->arch.vgic;
1166 struct kvm_vcpu *vcpu;
1167 int is_edge, is_level;
1168 int enabled;
1169 bool ret = true;
1170
1171 spin_lock(&dist->lock);
1172
1173 vcpu = kvm_get_vcpu(kvm, cpuid);
1174 is_edge = vgic_irq_is_edge(vcpu, irq_num);
1175 is_level = !is_edge;
1176
1177 if (!vgic_validate_injection(vcpu, irq_num, level)) {
1178 ret = false;
1179 goto out;
1180 }
1181
1182 if (irq_num >= VGIC_NR_PRIVATE_IRQS) {
1183 cpuid = dist->irq_spi_cpu[irq_num - VGIC_NR_PRIVATE_IRQS];
1184 vcpu = kvm_get_vcpu(kvm, cpuid);
1185 }
1186
1187 kvm_debug("Inject IRQ%d level %d CPU%d\n", irq_num, level, cpuid);
1188
1189 if (level)
1190 vgic_dist_irq_set(vcpu, irq_num);
1191 else
1192 vgic_dist_irq_clear(vcpu, irq_num);
1193
1194 enabled = vgic_irq_is_enabled(vcpu, irq_num);
1195
1196 if (!enabled) {
1197 ret = false;
1198 goto out;
1199 }
1200
1201 if (is_level && vgic_irq_is_active(vcpu, irq_num)) {
1202 /*
1203 * Level interrupt in progress, will be picked up
1204 * when EOId.
1205 */
1206 ret = false;
1207 goto out;
1208 }
1209
1210 if (level) {
1211 vgic_cpu_irq_set(vcpu, irq_num);
1212 set_bit(cpuid, &dist->irq_pending_on_cpu);
1213 }
1214
1215out:
1216 spin_unlock(&dist->lock);
1217
1218 return ret;
1219}
1220
1221/**
1222 * kvm_vgic_inject_irq - Inject an IRQ from a device to the vgic
1223 * @kvm: The VM structure pointer
1224 * @cpuid: The CPU for PPIs
1225 * @irq_num: The IRQ number that is assigned to the device
1226 * @level: Edge-triggered: true: to trigger the interrupt
1227 * false: to ignore the call
1228 * Level-sensitive true: activates an interrupt
1229 * false: deactivates an interrupt
1230 *
1231 * The GIC is not concerned with devices being active-LOW or active-HIGH for
1232 * level-sensitive interrupts. You can think of the level parameter as 1
1233 * being HIGH and 0 being LOW and all devices being active-HIGH.
1234 */
1235int kvm_vgic_inject_irq(struct kvm *kvm, int cpuid, unsigned int irq_num,
1236 bool level)
1237{
1238 if (vgic_update_irq_state(kvm, cpuid, irq_num, level))
1239 vgic_kick_vcpus(kvm);
1240
1241 return 0;
1242}
1243
1244static irqreturn_t vgic_maintenance_handler(int irq, void *data)
1245{
1246 /*
1247 * We cannot rely on the vgic maintenance interrupt to be
1248 * delivered synchronously. This means we can only use it to
1249 * exit the VM, and we perform the handling of EOIed
1250 * interrupts on the exit path (see vgic_process_maintenance).
1251 */
1252 return IRQ_HANDLED;
1253}
1254
1255int kvm_vgic_vcpu_init(struct kvm_vcpu *vcpu)
1256{
1257 struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;
1258 struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
1259 int i;
1260
1261 if (!irqchip_in_kernel(vcpu->kvm))
1262 return 0;
1263
1264 if (vcpu->vcpu_id >= VGIC_MAX_CPUS)
1265 return -EBUSY;
1266
1267 for (i = 0; i < VGIC_NR_IRQS; i++) {
1268 if (i < VGIC_NR_PPIS)
1269 vgic_bitmap_set_irq_val(&dist->irq_enabled,
1270 vcpu->vcpu_id, i, 1);
1271 if (i < VGIC_NR_PRIVATE_IRQS)
1272 vgic_bitmap_set_irq_val(&dist->irq_cfg,
1273 vcpu->vcpu_id, i, VGIC_CFG_EDGE);
1274
1275 vgic_cpu->vgic_irq_lr_map[i] = LR_EMPTY;
1276 }
1277
1278 /*
1279 * By forcing VMCR to zero, the GIC will restore the binary
1280 * points to their reset values. Anything else resets to zero
1281 * anyway.
1282 */
1283 vgic_cpu->vgic_vmcr = 0;
1284
1285 vgic_cpu->nr_lr = vgic_nr_lr;
1286 vgic_cpu->vgic_hcr = GICH_HCR_EN; /* Get the show on the road... */
1287
1288 return 0;
1289}
1290
1291static void vgic_init_maintenance_interrupt(void *info)
1292{
1293 enable_percpu_irq(vgic_maint_irq, 0);
1294}
1295
1296static int vgic_cpu_notify(struct notifier_block *self,
1297 unsigned long action, void *cpu)
1298{
1299 switch (action) {
1300 case CPU_STARTING:
1301 case CPU_STARTING_FROZEN:
1302 vgic_init_maintenance_interrupt(NULL);
1303 break;
1304 case CPU_DYING:
1305 case CPU_DYING_FROZEN:
1306 disable_percpu_irq(vgic_maint_irq);
1307 break;
1308 }
1309
1310 return NOTIFY_OK;
1311}
1312
1313static struct notifier_block vgic_cpu_nb = {
1314 .notifier_call = vgic_cpu_notify,
1315};
1316
1317int kvm_vgic_hyp_init(void)
1318{
1319 int ret;
1320 struct resource vctrl_res;
1321 struct resource vcpu_res;
1322
1323 vgic_node = of_find_compatible_node(NULL, NULL, "arm,cortex-a15-gic");
1324 if (!vgic_node) {
1325 kvm_err("error: no compatible vgic node in DT\n");
1326 return -ENODEV;
1327 }
1328
1329 vgic_maint_irq = irq_of_parse_and_map(vgic_node, 0);
1330 if (!vgic_maint_irq) {
1331 kvm_err("error getting vgic maintenance irq from DT\n");
1332 ret = -ENXIO;
1333 goto out;
1334 }
1335
1336 ret = request_percpu_irq(vgic_maint_irq, vgic_maintenance_handler,
1337 "vgic", kvm_get_running_vcpus());
1338 if (ret) {
1339 kvm_err("Cannot register interrupt %d\n", vgic_maint_irq);
1340 goto out;
1341 }
1342
1343 ret = register_cpu_notifier(&vgic_cpu_nb);
1344 if (ret) {
1345 kvm_err("Cannot register vgic CPU notifier\n");
1346 goto out_free_irq;
1347 }
1348
1349 ret = of_address_to_resource(vgic_node, 2, &vctrl_res);
1350 if (ret) {
1351 kvm_err("Cannot obtain VCTRL resource\n");
1352 goto out_free_irq;
1353 }
1354
1355 vgic_vctrl_base = of_iomap(vgic_node, 2);
1356 if (!vgic_vctrl_base) {
1357 kvm_err("Cannot ioremap VCTRL\n");
1358 ret = -ENOMEM;
1359 goto out_free_irq;
1360 }
1361
1362 vgic_nr_lr = readl_relaxed(vgic_vctrl_base + GICH_VTR);
1363 vgic_nr_lr = (vgic_nr_lr & 0x3f) + 1;
1364
1365 ret = create_hyp_io_mappings(vgic_vctrl_base,
1366 vgic_vctrl_base + resource_size(&vctrl_res),
1367 vctrl_res.start);
1368 if (ret) {
1369 kvm_err("Cannot map VCTRL into hyp\n");
1370 goto out_unmap;
1371 }
1372
1373 kvm_info("%s@%llx IRQ%d\n", vgic_node->name,
1374 vctrl_res.start, vgic_maint_irq);
1375 on_each_cpu(vgic_init_maintenance_interrupt, NULL, 1);
1376
1377 if (of_address_to_resource(vgic_node, 3, &vcpu_res)) {
1378 kvm_err("Cannot obtain VCPU resource\n");
1379 ret = -ENXIO;
1380 goto out_unmap;
1381 }
1382 vgic_vcpu_base = vcpu_res.start;
1383
1384 goto out;
1385
1386out_unmap:
1387 iounmap(vgic_vctrl_base);
1388out_free_irq:
1389 free_percpu_irq(vgic_maint_irq, kvm_get_running_vcpus());
1390out:
1391 of_node_put(vgic_node);
1392 return ret;
1393}
1394
1395int kvm_vgic_init(struct kvm *kvm)
1396{
1397 int ret = 0, i;
1398
1399 mutex_lock(&kvm->lock);
1400
1401 if (vgic_initialized(kvm))
1402 goto out;
1403
1404 if (IS_VGIC_ADDR_UNDEF(kvm->arch.vgic.vgic_dist_base) ||
1405 IS_VGIC_ADDR_UNDEF(kvm->arch.vgic.vgic_cpu_base)) {
1406 kvm_err("Need to set vgic cpu and dist addresses first\n");
1407 ret = -ENXIO;
1408 goto out;
1409 }
1410
1411 ret = kvm_phys_addr_ioremap(kvm, kvm->arch.vgic.vgic_cpu_base,
1412 vgic_vcpu_base, KVM_VGIC_V2_CPU_SIZE);
1413 if (ret) {
1414 kvm_err("Unable to remap VGIC CPU to VCPU\n");
1415 goto out;
1416 }
1417
1418 for (i = VGIC_NR_PRIVATE_IRQS; i < VGIC_NR_IRQS; i += 4)
1419 vgic_set_target_reg(kvm, 0, i);
1420
1421 kvm_timer_init(kvm);
1422 kvm->arch.vgic.ready = true;
1423out:
1424 mutex_unlock(&kvm->lock);
1425 return ret;
1426}
1427
1428int kvm_vgic_create(struct kvm *kvm)
1429{
1430 int ret = 0;
1431
1432 mutex_lock(&kvm->lock);
1433
1434 if (atomic_read(&kvm->online_vcpus) || kvm->arch.vgic.vctrl_base) {
1435 ret = -EEXIST;
1436 goto out;
1437 }
1438
1439 spin_lock_init(&kvm->arch.vgic.lock);
1440 kvm->arch.vgic.vctrl_base = vgic_vctrl_base;
1441 kvm->arch.vgic.vgic_dist_base = VGIC_ADDR_UNDEF;
1442 kvm->arch.vgic.vgic_cpu_base = VGIC_ADDR_UNDEF;
1443
1444out:
1445 mutex_unlock(&kvm->lock);
1446 return ret;
1447}
1448
1449static bool vgic_ioaddr_overlap(struct kvm *kvm)
1450{
1451 phys_addr_t dist = kvm->arch.vgic.vgic_dist_base;
1452 phys_addr_t cpu = kvm->arch.vgic.vgic_cpu_base;
1453
1454 if (IS_VGIC_ADDR_UNDEF(dist) || IS_VGIC_ADDR_UNDEF(cpu))
1455 return 0;
1456 if ((dist <= cpu && dist + KVM_VGIC_V2_DIST_SIZE > cpu) ||
1457 (cpu <= dist && cpu + KVM_VGIC_V2_CPU_SIZE > dist))
1458 return -EBUSY;
1459 return 0;
1460}
1461
1462static int vgic_ioaddr_assign(struct kvm *kvm, phys_addr_t *ioaddr,
1463 phys_addr_t addr, phys_addr_t size)
1464{
1465 int ret;
1466
1467 if (!IS_VGIC_ADDR_UNDEF(*ioaddr))
1468 return -EEXIST;
1469 if (addr + size < addr)
1470 return -EINVAL;
1471
1472 ret = vgic_ioaddr_overlap(kvm);
1473 if (ret)
1474 return ret;
1475 *ioaddr = addr;
1476 return ret;
1477}
1478
1479int kvm_vgic_set_addr(struct kvm *kvm, unsigned long type, u64 addr)
1480{
1481 int r = 0;
1482 struct vgic_dist *vgic = &kvm->arch.vgic;
1483
1484 if (addr & ~KVM_PHYS_MASK)
1485 return -E2BIG;
1486
1487 if (addr & ~PAGE_MASK)
1488 return -EINVAL;
1489
1490 mutex_lock(&kvm->lock);
1491 switch (type) {
1492 case KVM_VGIC_V2_ADDR_TYPE_DIST:
1493 r = vgic_ioaddr_assign(kvm, &vgic->vgic_dist_base,
1494 addr, KVM_VGIC_V2_DIST_SIZE);
1495 break;
1496 case KVM_VGIC_V2_ADDR_TYPE_CPU:
1497 r = vgic_ioaddr_assign(kvm, &vgic->vgic_cpu_base,
1498 addr, KVM_VGIC_V2_CPU_SIZE);
1499 break;
1500 default:
1501 r = -ENODEV;
1502 }
1503
1504 mutex_unlock(&kvm->lock);
1505 return r;
1506}
diff --git a/arch/arm/lib/delay.c b/arch/arm/lib/delay.c
index 0dc53854a5d8..6b93f6a1a3c7 100644
--- a/arch/arm/lib/delay.c
+++ b/arch/arm/lib/delay.c
@@ -77,6 +77,7 @@ void __init register_current_timer_delay(const struct delay_timer *timer)
77 arm_delay_ops.delay = __timer_delay; 77 arm_delay_ops.delay = __timer_delay;
78 arm_delay_ops.const_udelay = __timer_const_udelay; 78 arm_delay_ops.const_udelay = __timer_const_udelay;
79 arm_delay_ops.udelay = __timer_udelay; 79 arm_delay_ops.udelay = __timer_udelay;
80 arm_delay_ops.const_clock = true;
80 delay_calibrated = true; 81 delay_calibrated = true;
81 } else { 82 } else {
82 pr_info("Ignoring duplicate/late registration of read_current_timer delay\n"); 83 pr_info("Ignoring duplicate/late registration of read_current_timer delay\n");
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 958358c91afd..6071f4c3d654 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -352,12 +352,6 @@ config MACH_USB_A9263
352 Select this if you are using a Calao Systems USB-A9263. 352 Select this if you are using a Calao Systems USB-A9263.
353 <http://www.calao-systems.com> 353 <http://www.calao-systems.com>
354 354
355config MACH_NEOCORE926
356 bool "Adeneo NEOCORE926"
357 select HAVE_AT91_DATAFLASH_CARD
358 help
359 Select this if you are using the Adeneo Neocore 926 board.
360
361endif 355endif
362 356
363# ---------------------------------------------------------- 357# ----------------------------------------------------------
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index b38a1dcb79b8..39218ca6d8e8 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -66,7 +66,6 @@ obj-$(CONFIG_MACH_AT91SAM9G10EK) += board-sam9261ek.o
66# AT91SAM9263 board-specific support 66# AT91SAM9263 board-specific support
67obj-$(CONFIG_MACH_AT91SAM9263EK) += board-sam9263ek.o 67obj-$(CONFIG_MACH_AT91SAM9263EK) += board-sam9263ek.o
68obj-$(CONFIG_MACH_USB_A9263) += board-usb-a926x.o 68obj-$(CONFIG_MACH_USB_A9263) += board-usb-a926x.o
69obj-$(CONFIG_MACH_NEOCORE926) += board-neocore926.o
70 69
71# AT91SAM9RL board-specific support 70# AT91SAM9RL board-specific support
72obj-$(CONFIG_MACH_AT91SAM9RLEK) += board-sam9rlek.o 71obj-$(CONFIG_MACH_AT91SAM9RLEK) += board-sam9rlek.o
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 7aeb473ee539..9706c000f294 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -210,6 +210,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
210 CLKDEV_CON_DEV_ID("t0_clk", "fffa4000.timer", &tc3_clk), 210 CLKDEV_CON_DEV_ID("t0_clk", "fffa4000.timer", &tc3_clk),
211 CLKDEV_CON_DEV_ID("t1_clk", "fffa4000.timer", &tc4_clk), 211 CLKDEV_CON_DEV_ID("t1_clk", "fffa4000.timer", &tc4_clk),
212 CLKDEV_CON_DEV_ID("t2_clk", "fffa4000.timer", &tc5_clk), 212 CLKDEV_CON_DEV_ID("t2_clk", "fffa4000.timer", &tc5_clk),
213 CLKDEV_CON_DEV_ID("mci_clk", "fffb4000.mmc", &mmc_clk),
214 CLKDEV_CON_DEV_ID("emac_clk", "fffbc000.ethernet", &ether_clk),
213 CLKDEV_CON_DEV_ID("hclk", "300000.ohci", &ohci_clk), 215 CLKDEV_CON_DEV_ID("hclk", "300000.ohci", &ohci_clk),
214 CLKDEV_CON_DEV_ID(NULL, "fffff400.gpio", &pioA_clk), 216 CLKDEV_CON_DEV_ID(NULL, "fffff400.gpio", &pioA_clk),
215 CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioB_clk), 217 CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioB_clk),
diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
index cafe98836c8a..2acdff4c1dfe 100644
--- a/arch/arm/mach-at91/at91rm9200_time.c
+++ b/arch/arm/mach-at91/at91rm9200_time.c
@@ -174,7 +174,6 @@ clkevt32k_next_event(unsigned long delta, struct clock_event_device *dev)
174static struct clock_event_device clkevt = { 174static struct clock_event_device clkevt = {
175 .name = "at91_tick", 175 .name = "at91_tick",
176 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 176 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
177 .shift = 32,
178 .rating = 150, 177 .rating = 150,
179 .set_next_event = clkevt32k_next_event, 178 .set_next_event = clkevt32k_next_event,
180 .set_mode = clkevt32k_mode, 179 .set_mode = clkevt32k_mode,
@@ -265,17 +264,10 @@ void __init at91rm9200_timer_init(void)
265 at91_st_write(AT91_ST_RTMR, 1); 264 at91_st_write(AT91_ST_RTMR, 1);
266 265
267 /* Setup timer clockevent, with minimum of two ticks (important!!) */ 266 /* Setup timer clockevent, with minimum of two ticks (important!!) */
268 clkevt.mult = div_sc(AT91_SLOW_CLOCK, NSEC_PER_SEC, clkevt.shift);
269 clkevt.max_delta_ns = clockevent_delta2ns(AT91_ST_ALMV, &clkevt);
270 clkevt.min_delta_ns = clockevent_delta2ns(2, &clkevt) + 1;
271 clkevt.cpumask = cpumask_of(0); 267 clkevt.cpumask = cpumask_of(0);
272 clockevents_register_device(&clkevt); 268 clockevents_config_and_register(&clkevt, AT91_SLOW_CLOCK,
269 2, AT91_ST_ALMV);
273 270
274 /* register clocksource */ 271 /* register clocksource */
275 clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK); 272 clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK);
276} 273}
277
278struct sys_timer at91rm9200_timer = {
279 .init = at91rm9200_timer_init,
280};
281
diff --git a/arch/arm/mach-at91/at91sam926x_time.c b/arch/arm/mach-at91/at91sam926x_time.c
index 358412f1f5f8..3a4bc2e1a65e 100644
--- a/arch/arm/mach-at91/at91sam926x_time.c
+++ b/arch/arm/mach-at91/at91sam926x_time.c
@@ -104,12 +104,38 @@ pit_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev)
104 } 104 }
105} 105}
106 106
107static void at91sam926x_pit_suspend(struct clock_event_device *cedev)
108{
109 /* Disable timer */
110 pit_write(AT91_PIT_MR, 0);
111}
112
113static void at91sam926x_pit_reset(void)
114{
115 /* Disable timer and irqs */
116 pit_write(AT91_PIT_MR, 0);
117
118 /* Clear any pending interrupts, wait for PIT to stop counting */
119 while (PIT_CPIV(pit_read(AT91_PIT_PIVR)) != 0)
120 cpu_relax();
121
122 /* Start PIT but don't enable IRQ */
123 pit_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN);
124}
125
126static void at91sam926x_pit_resume(struct clock_event_device *cedev)
127{
128 at91sam926x_pit_reset();
129}
130
107static struct clock_event_device pit_clkevt = { 131static struct clock_event_device pit_clkevt = {
108 .name = "pit", 132 .name = "pit",
109 .features = CLOCK_EVT_FEAT_PERIODIC, 133 .features = CLOCK_EVT_FEAT_PERIODIC,
110 .shift = 32, 134 .shift = 32,
111 .rating = 100, 135 .rating = 100,
112 .set_mode = pit_clkevt_mode, 136 .set_mode = pit_clkevt_mode,
137 .suspend = at91sam926x_pit_suspend,
138 .resume = at91sam926x_pit_resume,
113}; 139};
114 140
115 141
@@ -150,19 +176,6 @@ static struct irqaction at91sam926x_pit_irq = {
150 .irq = NR_IRQS_LEGACY + AT91_ID_SYS, 176 .irq = NR_IRQS_LEGACY + AT91_ID_SYS,
151}; 177};
152 178
153static void at91sam926x_pit_reset(void)
154{
155 /* Disable timer and irqs */
156 pit_write(AT91_PIT_MR, 0);
157
158 /* Clear any pending interrupts, wait for PIT to stop counting */
159 while (PIT_CPIV(pit_read(AT91_PIT_PIVR)) != 0)
160 cpu_relax();
161
162 /* Start PIT but don't enable IRQ */
163 pit_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN);
164}
165
166#ifdef CONFIG_OF 179#ifdef CONFIG_OF
167static struct of_device_id pit_timer_ids[] = { 180static struct of_device_id pit_timer_ids[] = {
168 { .compatible = "atmel,at91sam9260-pit" }, 181 { .compatible = "atmel,at91sam9260-pit" },
@@ -211,7 +224,7 @@ static int __init of_at91sam926x_pit_init(void)
211/* 224/*
212 * Set up both clocksource and clockevent support. 225 * Set up both clocksource and clockevent support.
213 */ 226 */
214static void __init at91sam926x_pit_init(void) 227void __init at91sam926x_pit_init(void)
215{ 228{
216 unsigned long pit_rate; 229 unsigned long pit_rate;
217 unsigned bits; 230 unsigned bits;
@@ -250,12 +263,6 @@ static void __init at91sam926x_pit_init(void)
250 clockevents_register_device(&pit_clkevt); 263 clockevents_register_device(&pit_clkevt);
251} 264}
252 265
253static void at91sam926x_pit_suspend(void)
254{
255 /* Disable timer */
256 pit_write(AT91_PIT_MR, 0);
257}
258
259void __init at91sam926x_ioremap_pit(u32 addr) 266void __init at91sam926x_ioremap_pit(u32 addr)
260{ 267{
261#if defined(CONFIG_OF) 268#if defined(CONFIG_OF)
@@ -272,9 +279,3 @@ void __init at91sam926x_ioremap_pit(u32 addr)
272 if (!pit_base_addr) 279 if (!pit_base_addr)
273 panic("Impossible to ioremap PIT\n"); 280 panic("Impossible to ioremap PIT\n");
274} 281}
275
276struct sys_timer at91sam926x_timer = {
277 .init = at91sam926x_pit_init,
278 .suspend = at91sam926x_pit_suspend,
279 .resume = at91sam926x_pit_reset,
280};
diff --git a/arch/arm/mach-at91/at91x40_time.c b/arch/arm/mach-at91/at91x40_time.c
index 0e57e440c061..0c07a4459cb2 100644
--- a/arch/arm/mach-at91/at91x40_time.c
+++ b/arch/arm/mach-at91/at91x40_time.c
@@ -42,9 +42,10 @@
42#define AT91_TC_CLK1BASE 0x40 42#define AT91_TC_CLK1BASE 0x40
43#define AT91_TC_CLK2BASE 0x80 43#define AT91_TC_CLK2BASE 0x80
44 44
45static unsigned long at91x40_gettimeoffset(void) 45static u32 at91x40_gettimeoffset(void)
46{ 46{
47 return (at91_tc_read(AT91_TC_CLK1BASE + AT91_TC_CV) * 1000000 / (AT91X40_MASTER_CLOCK / 128)); 47 return (at91_tc_read(AT91_TC_CLK1BASE + AT91_TC_CV) * 1000000 /
48 (AT91X40_MASTER_CLOCK / 128)) * 1000;
48} 49}
49 50
50static irqreturn_t at91x40_timer_interrupt(int irq, void *dev_id) 51static irqreturn_t at91x40_timer_interrupt(int irq, void *dev_id)
@@ -64,6 +65,8 @@ void __init at91x40_timer_init(void)
64{ 65{
65 unsigned int v; 66 unsigned int v;
66 67
68 arch_gettimeoffset = at91x40_gettimeoffset;
69
67 at91_tc_write(AT91_TC_BCR, 0); 70 at91_tc_write(AT91_TC_BCR, 0);
68 v = at91_tc_read(AT91_TC_BMR); 71 v = at91_tc_read(AT91_TC_BMR);
69 v = (v & ~AT91_TC_TC1XC1S) | AT91_TC_TC1XC1S_NONE; 72 v = (v & ~AT91_TC_TC1XC1S) | AT91_TC_TC1XC1S_NONE;
@@ -79,9 +82,3 @@ void __init at91x40_timer_init(void)
79 82
80 at91_tc_write(AT91_TC_CLK1BASE + AT91_TC_CCR, (AT91_TC_SWTRG | AT91_TC_CLKEN)); 83 at91_tc_write(AT91_TC_CLK1BASE + AT91_TC_CCR, (AT91_TC_SWTRG | AT91_TC_CLKEN));
81} 84}
82
83struct sys_timer at91x40_timer = {
84 .init = at91x40_timer_init,
85 .offset = at91x40_gettimeoffset,
86};
87
diff --git a/arch/arm/mach-at91/board-1arm.c b/arch/arm/mach-at91/board-1arm.c
index b99b5752cc10..35ab632bbf68 100644
--- a/arch/arm/mach-at91/board-1arm.c
+++ b/arch/arm/mach-at91/board-1arm.c
@@ -90,7 +90,7 @@ static void __init onearm_board_init(void)
90 90
91MACHINE_START(ONEARM, "Ajeco 1ARM single board computer") 91MACHINE_START(ONEARM, "Ajeco 1ARM single board computer")
92 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */ 92 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
93 .timer = &at91rm9200_timer, 93 .init_time = at91rm9200_timer_init,
94 .map_io = at91_map_io, 94 .map_io = at91_map_io,
95 .handle_irq = at91_aic_handle_irq, 95 .handle_irq = at91_aic_handle_irq,
96 .init_early = onearm_init_early, 96 .init_early = onearm_init_early,
diff --git a/arch/arm/mach-at91/board-afeb-9260v1.c b/arch/arm/mach-at91/board-afeb-9260v1.c
index 854b97974287..f95e31cda4b3 100644
--- a/arch/arm/mach-at91/board-afeb-9260v1.c
+++ b/arch/arm/mach-at91/board-afeb-9260v1.c
@@ -210,7 +210,7 @@ static void __init afeb9260_board_init(void)
210 210
211MACHINE_START(AFEB9260, "Custom afeb9260 board") 211MACHINE_START(AFEB9260, "Custom afeb9260 board")
212 /* Maintainer: Sergey Lapin <slapin@ossfans.org> */ 212 /* Maintainer: Sergey Lapin <slapin@ossfans.org> */
213 .timer = &at91sam926x_timer, 213 .init_time = at91sam926x_pit_init,
214 .map_io = at91_map_io, 214 .map_io = at91_map_io,
215 .handle_irq = at91_aic_handle_irq, 215 .handle_irq = at91_aic_handle_irq,
216 .init_early = afeb9260_init_early, 216 .init_early = afeb9260_init_early,
diff --git a/arch/arm/mach-at91/board-cam60.c b/arch/arm/mach-at91/board-cam60.c
index 28a18ce6d914..ade948b82662 100644
--- a/arch/arm/mach-at91/board-cam60.c
+++ b/arch/arm/mach-at91/board-cam60.c
@@ -187,7 +187,7 @@ static void __init cam60_board_init(void)
187 187
188MACHINE_START(CAM60, "KwikByte CAM60") 188MACHINE_START(CAM60, "KwikByte CAM60")
189 /* Maintainer: KwikByte */ 189 /* Maintainer: KwikByte */
190 .timer = &at91sam926x_timer, 190 .init_time = at91sam926x_pit_init,
191 .map_io = at91_map_io, 191 .map_io = at91_map_io,
192 .handle_irq = at91_aic_handle_irq, 192 .handle_irq = at91_aic_handle_irq,
193 .init_early = cam60_init_early, 193 .init_early = cam60_init_early,
diff --git a/arch/arm/mach-at91/board-carmeva.c b/arch/arm/mach-at91/board-carmeva.c
index c17bb533a949..92983050a9bd 100644
--- a/arch/arm/mach-at91/board-carmeva.c
+++ b/arch/arm/mach-at91/board-carmeva.c
@@ -157,7 +157,7 @@ static void __init carmeva_board_init(void)
157 157
158MACHINE_START(CARMEVA, "Carmeva") 158MACHINE_START(CARMEVA, "Carmeva")
159 /* Maintainer: Conitec Datasystems */ 159 /* Maintainer: Conitec Datasystems */
160 .timer = &at91rm9200_timer, 160 .init_time = at91rm9200_timer_init,
161 .map_io = at91_map_io, 161 .map_io = at91_map_io,
162 .handle_irq = at91_aic_handle_irq, 162 .handle_irq = at91_aic_handle_irq,
163 .init_early = carmeva_init_early, 163 .init_early = carmeva_init_early,
diff --git a/arch/arm/mach-at91/board-cpu9krea.c b/arch/arm/mach-at91/board-cpu9krea.c
index 847432441ecc..008527efdbcf 100644
--- a/arch/arm/mach-at91/board-cpu9krea.c
+++ b/arch/arm/mach-at91/board-cpu9krea.c
@@ -374,7 +374,7 @@ MACHINE_START(CPUAT9260, "Eukrea CPU9260")
374MACHINE_START(CPUAT9G20, "Eukrea CPU9G20") 374MACHINE_START(CPUAT9G20, "Eukrea CPU9G20")
375#endif 375#endif
376 /* Maintainer: Eric Benard - EUKREA Electromatique */ 376 /* Maintainer: Eric Benard - EUKREA Electromatique */
377 .timer = &at91sam926x_timer, 377 .init_time = at91sam926x_pit_init,
378 .map_io = at91_map_io, 378 .map_io = at91_map_io,
379 .handle_irq = at91_aic_handle_irq, 379 .handle_irq = at91_aic_handle_irq,
380 .init_early = cpu9krea_init_early, 380 .init_early = cpu9krea_init_early,
diff --git a/arch/arm/mach-at91/board-cpuat91.c b/arch/arm/mach-at91/board-cpuat91.c
index 2a7af7868747..42f1353a4baf 100644
--- a/arch/arm/mach-at91/board-cpuat91.c
+++ b/arch/arm/mach-at91/board-cpuat91.c
@@ -178,7 +178,7 @@ static void __init cpuat91_board_init(void)
178 178
179MACHINE_START(CPUAT91, "Eukrea") 179MACHINE_START(CPUAT91, "Eukrea")
180 /* Maintainer: Eric Benard - EUKREA Electromatique */ 180 /* Maintainer: Eric Benard - EUKREA Electromatique */
181 .timer = &at91rm9200_timer, 181 .init_time = at91rm9200_timer_init,
182 .map_io = at91_map_io, 182 .map_io = at91_map_io,
183 .handle_irq = at91_aic_handle_irq, 183 .handle_irq = at91_aic_handle_irq,
184 .init_early = cpuat91_init_early, 184 .init_early = cpuat91_init_early,
diff --git a/arch/arm/mach-at91/board-csb337.c b/arch/arm/mach-at91/board-csb337.c
index 48a531e05be3..e5fde215225b 100644
--- a/arch/arm/mach-at91/board-csb337.c
+++ b/arch/arm/mach-at91/board-csb337.c
@@ -251,7 +251,7 @@ static void __init csb337_board_init(void)
251 251
252MACHINE_START(CSB337, "Cogent CSB337") 252MACHINE_START(CSB337, "Cogent CSB337")
253 /* Maintainer: Bill Gatliff */ 253 /* Maintainer: Bill Gatliff */
254 .timer = &at91rm9200_timer, 254 .init_time = at91rm9200_timer_init,
255 .map_io = at91_map_io, 255 .map_io = at91_map_io,
256 .handle_irq = at91_aic_handle_irq, 256 .handle_irq = at91_aic_handle_irq,
257 .init_early = csb337_init_early, 257 .init_early = csb337_init_early,
diff --git a/arch/arm/mach-at91/board-csb637.c b/arch/arm/mach-at91/board-csb637.c
index ec0f3abd504b..fdf11061c577 100644
--- a/arch/arm/mach-at91/board-csb637.c
+++ b/arch/arm/mach-at91/board-csb637.c
@@ -132,7 +132,7 @@ static void __init csb637_board_init(void)
132 132
133MACHINE_START(CSB637, "Cogent CSB637") 133MACHINE_START(CSB637, "Cogent CSB637")
134 /* Maintainer: Bill Gatliff */ 134 /* Maintainer: Bill Gatliff */
135 .timer = &at91rm9200_timer, 135 .init_time = at91rm9200_timer_init,
136 .map_io = at91_map_io, 136 .map_io = at91_map_io,
137 .handle_irq = at91_aic_handle_irq, 137 .handle_irq = at91_aic_handle_irq,
138 .init_early = csb637_init_early, 138 .init_early = csb637_init_early,
diff --git a/arch/arm/mach-at91/board-dt.c b/arch/arm/mach-at91/board-dt.c
index 881170ce61dd..8db30132abed 100644
--- a/arch/arm/mach-at91/board-dt.c
+++ b/arch/arm/mach-at91/board-dt.c
@@ -49,7 +49,7 @@ static const char *at91_dt_board_compat[] __initdata = {
49 49
50DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)") 50DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)")
51 /* Maintainer: Atmel */ 51 /* Maintainer: Atmel */
52 .timer = &at91sam926x_timer, 52 .init_time = at91sam926x_pit_init,
53 .map_io = at91_map_io, 53 .map_io = at91_map_io,
54 .handle_irq = at91_aic_handle_irq, 54 .handle_irq = at91_aic_handle_irq,
55 .init_early = at91_dt_initialize, 55 .init_early = at91_dt_initialize,
diff --git a/arch/arm/mach-at91/board-eb01.c b/arch/arm/mach-at91/board-eb01.c
index b489388a6f84..becf0a6a289e 100644
--- a/arch/arm/mach-at91/board-eb01.c
+++ b/arch/arm/mach-at91/board-eb01.c
@@ -44,7 +44,7 @@ static void __init at91eb01_init_early(void)
44 44
45MACHINE_START(AT91EB01, "Atmel AT91 EB01") 45MACHINE_START(AT91EB01, "Atmel AT91 EB01")
46 /* Maintainer: Greg Ungerer <gerg@snapgear.com> */ 46 /* Maintainer: Greg Ungerer <gerg@snapgear.com> */
47 .timer = &at91x40_timer, 47 .init_time = at91x40_timer_init,
48 .handle_irq = at91_aic_handle_irq, 48 .handle_irq = at91_aic_handle_irq,
49 .init_early = at91eb01_init_early, 49 .init_early = at91eb01_init_early,
50 .init_irq = at91eb01_init_irq, 50 .init_irq = at91eb01_init_irq,
diff --git a/arch/arm/mach-at91/board-eb9200.c b/arch/arm/mach-at91/board-eb9200.c
index 9f5e71c95f05..f9be8161bbfa 100644
--- a/arch/arm/mach-at91/board-eb9200.c
+++ b/arch/arm/mach-at91/board-eb9200.c
@@ -116,7 +116,7 @@ static void __init eb9200_board_init(void)
116} 116}
117 117
118MACHINE_START(ATEB9200, "Embest ATEB9200") 118MACHINE_START(ATEB9200, "Embest ATEB9200")
119 .timer = &at91rm9200_timer, 119 .init_time = at91rm9200_timer_init,
120 .map_io = at91_map_io, 120 .map_io = at91_map_io,
121 .handle_irq = at91_aic_handle_irq, 121 .handle_irq = at91_aic_handle_irq,
122 .init_early = eb9200_init_early, 122 .init_early = eb9200_init_early,
diff --git a/arch/arm/mach-at91/board-ecbat91.c b/arch/arm/mach-at91/board-ecbat91.c
index ef69e0ebe949..b2fcd71262ba 100644
--- a/arch/arm/mach-at91/board-ecbat91.c
+++ b/arch/arm/mach-at91/board-ecbat91.c
@@ -181,7 +181,7 @@ static void __init ecb_at91board_init(void)
181 181
182MACHINE_START(ECBAT91, "emQbit's ECB_AT91") 182MACHINE_START(ECBAT91, "emQbit's ECB_AT91")
183 /* Maintainer: emQbit.com */ 183 /* Maintainer: emQbit.com */
184 .timer = &at91rm9200_timer, 184 .init_time = at91rm9200_timer_init,
185 .map_io = at91_map_io, 185 .map_io = at91_map_io,
186 .handle_irq = at91_aic_handle_irq, 186 .handle_irq = at91_aic_handle_irq,
187 .init_early = ecb_at91init_early, 187 .init_early = ecb_at91init_early,
diff --git a/arch/arm/mach-at91/board-eco920.c b/arch/arm/mach-at91/board-eco920.c
index 50f3d3795c05..77de410efc90 100644
--- a/arch/arm/mach-at91/board-eco920.c
+++ b/arch/arm/mach-at91/board-eco920.c
@@ -149,7 +149,7 @@ static void __init eco920_board_init(void)
149 149
150MACHINE_START(ECO920, "eco920") 150MACHINE_START(ECO920, "eco920")
151 /* Maintainer: Sascha Hauer */ 151 /* Maintainer: Sascha Hauer */
152 .timer = &at91rm9200_timer, 152 .init_time = at91rm9200_timer_init,
153 .map_io = at91_map_io, 153 .map_io = at91_map_io,
154 .handle_irq = at91_aic_handle_irq, 154 .handle_irq = at91_aic_handle_irq,
155 .init_early = eco920_init_early, 155 .init_early = eco920_init_early,
diff --git a/arch/arm/mach-at91/board-flexibity.c b/arch/arm/mach-at91/board-flexibity.c
index 5d44eba0f20f..737c08563628 100644
--- a/arch/arm/mach-at91/board-flexibity.c
+++ b/arch/arm/mach-at91/board-flexibity.c
@@ -159,7 +159,7 @@ static void __init flexibity_board_init(void)
159 159
160MACHINE_START(FLEXIBITY, "Flexibity Connect") 160MACHINE_START(FLEXIBITY, "Flexibity Connect")
161 /* Maintainer: Maxim Osipov */ 161 /* Maintainer: Maxim Osipov */
162 .timer = &at91sam926x_timer, 162 .init_time = at91sam926x_pit_init,
163 .map_io = at91_map_io, 163 .map_io = at91_map_io,
164 .handle_irq = at91_aic_handle_irq, 164 .handle_irq = at91_aic_handle_irq,
165 .init_early = flexibity_init_early, 165 .init_early = flexibity_init_early,
diff --git a/arch/arm/mach-at91/board-foxg20.c b/arch/arm/mach-at91/board-foxg20.c
index 191d37c16bab..2ea7059b840b 100644
--- a/arch/arm/mach-at91/board-foxg20.c
+++ b/arch/arm/mach-at91/board-foxg20.c
@@ -261,7 +261,7 @@ static void __init foxg20_board_init(void)
261 261
262MACHINE_START(ACMENETUSFOXG20, "Acme Systems srl FOX Board G20") 262MACHINE_START(ACMENETUSFOXG20, "Acme Systems srl FOX Board G20")
263 /* Maintainer: Sergio Tanzilli */ 263 /* Maintainer: Sergio Tanzilli */
264 .timer = &at91sam926x_timer, 264 .init_time = at91sam926x_pit_init,
265 .map_io = at91_map_io, 265 .map_io = at91_map_io,
266 .handle_irq = at91_aic_handle_irq, 266 .handle_irq = at91_aic_handle_irq,
267 .init_early = foxg20_init_early, 267 .init_early = foxg20_init_early,
diff --git a/arch/arm/mach-at91/board-gsia18s.c b/arch/arm/mach-at91/board-gsia18s.c
index 23a2fa17ab29..c1d61d247790 100644
--- a/arch/arm/mach-at91/board-gsia18s.c
+++ b/arch/arm/mach-at91/board-gsia18s.c
@@ -574,7 +574,7 @@ static void __init gsia18s_board_init(void)
574} 574}
575 575
576MACHINE_START(GSIA18S, "GS_IA18_S") 576MACHINE_START(GSIA18S, "GS_IA18_S")
577 .timer = &at91sam926x_timer, 577 .init_time = at91sam926x_pit_init,
578 .map_io = at91_map_io, 578 .map_io = at91_map_io,
579 .handle_irq = at91_aic_handle_irq, 579 .handle_irq = at91_aic_handle_irq,
580 .init_early = gsia18s_init_early, 580 .init_early = gsia18s_init_early,
diff --git a/arch/arm/mach-at91/board-kafa.c b/arch/arm/mach-at91/board-kafa.c
index 9a43d1e1a037..88e2f5d2d16d 100644
--- a/arch/arm/mach-at91/board-kafa.c
+++ b/arch/arm/mach-at91/board-kafa.c
@@ -103,7 +103,7 @@ static void __init kafa_board_init(void)
103 103
104MACHINE_START(KAFA, "Sperry-Sun KAFA") 104MACHINE_START(KAFA, "Sperry-Sun KAFA")
105 /* Maintainer: Sergei Sharonov */ 105 /* Maintainer: Sergei Sharonov */
106 .timer = &at91rm9200_timer, 106 .init_time = at91rm9200_timer_init,
107 .map_io = at91_map_io, 107 .map_io = at91_map_io,
108 .handle_irq = at91_aic_handle_irq, 108 .handle_irq = at91_aic_handle_irq,
109 .init_early = kafa_init_early, 109 .init_early = kafa_init_early,
diff --git a/arch/arm/mach-at91/board-kb9202.c b/arch/arm/mach-at91/board-kb9202.c
index f168bec2369f..0c519d9ebffc 100644
--- a/arch/arm/mach-at91/board-kb9202.c
+++ b/arch/arm/mach-at91/board-kb9202.c
@@ -149,7 +149,7 @@ static void __init kb9202_board_init(void)
149 149
150MACHINE_START(KB9200, "KB920x") 150MACHINE_START(KB9200, "KB920x")
151 /* Maintainer: KwikByte, Inc. */ 151 /* Maintainer: KwikByte, Inc. */
152 .timer = &at91rm9200_timer, 152 .init_time = at91rm9200_timer_init,
153 .map_io = at91_map_io, 153 .map_io = at91_map_io,
154 .handle_irq = at91_aic_handle_irq, 154 .handle_irq = at91_aic_handle_irq,
155 .init_early = kb9202_init_early, 155 .init_early = kb9202_init_early,
diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c
deleted file mode 100644
index bc7a1c4a1f6a..000000000000
--- a/arch/arm/mach-at91/board-neocore926.c
+++ /dev/null
@@ -1,387 +0,0 @@
1/*
2 * linux/arch/arm/mach-at91/board-neocore926.c
3 *
4 * Copyright (C) 2005 SAN People
5 * Copyright (C) 2007 Atmel Corporation
6 * Copyright (C) 2008 ADENEO.
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 USA
21 */
22
23#include <linux/types.h>
24#include <linux/gpio.h>
25#include <linux/init.h>
26#include <linux/mm.h>
27#include <linux/module.h>
28#include <linux/platform_device.h>
29#include <linux/spi/spi.h>
30#include <linux/spi/ads7846.h>
31#include <linux/fb.h>
32#include <linux/gpio_keys.h>
33#include <linux/input.h>
34
35#include <video/atmel_lcdc.h>
36
37#include <asm/setup.h>
38#include <asm/mach-types.h>
39#include <asm/irq.h>
40#include <asm/sizes.h>
41
42#include <asm/mach/arch.h>
43#include <asm/mach/map.h>
44#include <asm/mach/irq.h>
45
46#include <mach/hardware.h>
47#include <mach/at91sam9_smc.h>
48
49#include "at91_aic.h"
50#include "board.h"
51#include "sam9_smc.h"
52#include "generic.h"
53
54
55static void __init neocore926_init_early(void)
56{
57 /* Initialize processor: 20 MHz crystal */
58 at91_initialize(20000000);
59}
60
61/*
62 * USB Host port
63 */
64static struct at91_usbh_data __initdata neocore926_usbh_data = {
65 .ports = 2,
66 .vbus_pin = { AT91_PIN_PA24, AT91_PIN_PA21 },
67 .overcurrent_pin= {-EINVAL, -EINVAL},
68};
69
70/*
71 * USB Device port
72 */
73static struct at91_udc_data __initdata neocore926_udc_data = {
74 .vbus_pin = AT91_PIN_PA25,
75 .pullup_pin = -EINVAL, /* pull-up driven by UDC */
76};
77
78
79/*
80 * ADS7846 Touchscreen
81 */
82#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
83static int ads7843_pendown_state(void)
84{
85 return !at91_get_gpio_value(AT91_PIN_PA15); /* Touchscreen PENIRQ */
86}
87
88static struct ads7846_platform_data ads_info = {
89 .model = 7843,
90 .x_min = 150,
91 .x_max = 3830,
92 .y_min = 190,
93 .y_max = 3830,
94 .vref_delay_usecs = 100,
95 .x_plate_ohms = 450,
96 .y_plate_ohms = 250,
97 .pressure_max = 15000,
98 .debounce_max = 1,
99 .debounce_rep = 0,
100 .debounce_tol = (~0),
101 .get_pendown_state = ads7843_pendown_state,
102};
103
104static void __init neocore926_add_device_ts(void)
105{
106 at91_set_B_periph(AT91_PIN_PA15, 1); /* External IRQ1, with pullup */
107 at91_set_gpio_input(AT91_PIN_PC13, 1); /* Touchscreen BUSY signal */
108}
109#else
110static void __init neocore926_add_device_ts(void) {}
111#endif
112
113/*
114 * SPI devices.
115 */
116static struct spi_board_info neocore926_spi_devices[] = {
117#if defined(CONFIG_MTD_AT91_DATAFLASH_CARD)
118 { /* DataFlash card */
119 .modalias = "mtd_dataflash",
120 .chip_select = 0,
121 .max_speed_hz = 15 * 1000 * 1000,
122 .bus_num = 0,
123 },
124#endif
125#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
126 {
127 .modalias = "ads7846",
128 .chip_select = 1,
129 .max_speed_hz = 125000 * 16,
130 .bus_num = 0,
131 .platform_data = &ads_info,
132 .irq = NR_IRQS_LEGACY + AT91SAM9263_ID_IRQ1,
133 },
134#endif
135};
136
137
138/*
139 * MCI (SD/MMC)
140 */
141static struct mci_platform_data __initdata neocore926_mci0_data = {
142 .slot[0] = {
143 .bus_width = 4,
144 .detect_pin = AT91_PIN_PE18,
145 .wp_pin = AT91_PIN_PE19,
146 },
147};
148
149
150/*
151 * MACB Ethernet device
152 */
153static struct macb_platform_data __initdata neocore926_macb_data = {
154 .phy_irq_pin = AT91_PIN_PE31,
155 .is_rmii = 1,
156};
157
158
159/*
160 * NAND flash
161 */
162static struct mtd_partition __initdata neocore926_nand_partition[] = {
163 {
164 .name = "Linux Kernel", /* "Partition 1", */
165 .offset = 0,
166 .size = SZ_8M,
167 },
168 {
169 .name = "Filesystem", /* "Partition 2", */
170 .offset = MTDPART_OFS_NXTBLK,
171 .size = SZ_32M,
172 },
173 {
174 .name = "Free", /* "Partition 3", */
175 .offset = MTDPART_OFS_NXTBLK,
176 .size = MTDPART_SIZ_FULL,
177 },
178};
179
180static struct atmel_nand_data __initdata neocore926_nand_data = {
181 .ale = 21,
182 .cle = 22,
183 .rdy_pin = AT91_PIN_PB19,
184 .rdy_pin_active_low = 1,
185 .enable_pin = AT91_PIN_PD15,
186 .ecc_mode = NAND_ECC_SOFT,
187 .parts = neocore926_nand_partition,
188 .num_parts = ARRAY_SIZE(neocore926_nand_partition),
189 .det_pin = -EINVAL,
190};
191
192static struct sam9_smc_config __initdata neocore926_nand_smc_config = {
193 .ncs_read_setup = 0,
194 .nrd_setup = 1,
195 .ncs_write_setup = 0,
196 .nwe_setup = 1,
197
198 .ncs_read_pulse = 4,
199 .nrd_pulse = 4,
200 .ncs_write_pulse = 4,
201 .nwe_pulse = 4,
202
203 .read_cycle = 6,
204 .write_cycle = 6,
205
206 .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_8,
207 .tdf_cycles = 2,
208};
209
210static void __init neocore926_add_device_nand(void)
211{
212 /* configure chip-select 3 (NAND) */
213 sam9_smc_configure(0, 3, &neocore926_nand_smc_config);
214
215 at91_add_device_nand(&neocore926_nand_data);
216}
217
218
219/*
220 * LCD Controller
221 */
222#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
223static struct fb_videomode at91_tft_vga_modes[] = {
224 {
225 .name = "TX09D50VM1CCA @ 60",
226 .refresh = 60,
227 .xres = 240, .yres = 320,
228 .pixclock = KHZ2PICOS(5000),
229
230 .left_margin = 1, .right_margin = 33,
231 .upper_margin = 1, .lower_margin = 0,
232 .hsync_len = 5, .vsync_len = 1,
233
234 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
235 .vmode = FB_VMODE_NONINTERLACED,
236 },
237};
238
239static struct fb_monspecs at91fb_default_monspecs = {
240 .manufacturer = "HIT",
241 .monitor = "TX09D70VM1CCA",
242
243 .modedb = at91_tft_vga_modes,
244 .modedb_len = ARRAY_SIZE(at91_tft_vga_modes),
245 .hfmin = 15000,
246 .hfmax = 64000,
247 .vfmin = 50,
248 .vfmax = 150,
249};
250
251#define AT91SAM9263_DEFAULT_LCDCON2 (ATMEL_LCDC_MEMOR_LITTLE \
252 | ATMEL_LCDC_DISTYPE_TFT \
253 | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE)
254
255static void at91_lcdc_power_control(int on)
256{
257 at91_set_gpio_value(AT91_PIN_PA30, on);
258}
259
260/* Driver datas */
261static struct atmel_lcdfb_info __initdata neocore926_lcdc_data = {
262 .lcdcon_is_backlight = true,
263 .default_bpp = 16,
264 .default_dmacon = ATMEL_LCDC_DMAEN,
265 .default_lcdcon2 = AT91SAM9263_DEFAULT_LCDCON2,
266 .default_monspecs = &at91fb_default_monspecs,
267 .atmel_lcdfb_power_control = at91_lcdc_power_control,
268 .guard_time = 1,
269 .lcd_wiring_mode = ATMEL_LCDC_WIRING_RGB555,
270};
271
272#else
273static struct atmel_lcdfb_info __initdata neocore926_lcdc_data;
274#endif
275
276
277/*
278 * GPIO Buttons
279 */
280#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
281static struct gpio_keys_button neocore926_buttons[] = {
282 { /* BP1, "leftclic" */
283 .code = BTN_LEFT,
284 .gpio = AT91_PIN_PC5,
285 .active_low = 1,
286 .desc = "left_click",
287 .wakeup = 1,
288 },
289 { /* BP2, "rightclic" */
290 .code = BTN_RIGHT,
291 .gpio = AT91_PIN_PC4,
292 .active_low = 1,
293 .desc = "right_click",
294 .wakeup = 1,
295 },
296};
297
298static struct gpio_keys_platform_data neocore926_button_data = {
299 .buttons = neocore926_buttons,
300 .nbuttons = ARRAY_SIZE(neocore926_buttons),
301};
302
303static struct platform_device neocore926_button_device = {
304 .name = "gpio-keys",
305 .id = -1,
306 .num_resources = 0,
307 .dev = {
308 .platform_data = &neocore926_button_data,
309 }
310};
311
312static void __init neocore926_add_device_buttons(void)
313{
314 at91_set_GPIO_periph(AT91_PIN_PC5, 0); /* left button */
315 at91_set_deglitch(AT91_PIN_PC5, 1);
316 at91_set_GPIO_periph(AT91_PIN_PC4, 0); /* right button */
317 at91_set_deglitch(AT91_PIN_PC4, 1);
318
319 platform_device_register(&neocore926_button_device);
320}
321#else
322static void __init neocore926_add_device_buttons(void) {}
323#endif
324
325
326/*
327 * AC97
328 */
329static struct ac97c_platform_data neocore926_ac97_data = {
330 .reset_pin = AT91_PIN_PA13,
331};
332
333
334static void __init neocore926_board_init(void)
335{
336 /* Serial */
337 /* DBGU on ttyS0. (Rx & Tx only) */
338 at91_register_uart(0, 0, 0);
339
340 /* USART0 on ttyS1. (Rx, Tx, RTS, CTS) */
341 at91_register_uart(AT91SAM9263_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS);
342 at91_add_device_serial();
343
344 /* USB Host */
345 at91_add_device_usbh(&neocore926_usbh_data);
346
347 /* USB Device */
348 at91_add_device_udc(&neocore926_udc_data);
349
350 /* SPI */
351 at91_set_gpio_output(AT91_PIN_PE20, 1); /* select spi0 clock */
352 at91_add_device_spi(neocore926_spi_devices, ARRAY_SIZE(neocore926_spi_devices));
353
354 /* Touchscreen */
355 neocore926_add_device_ts();
356
357 /* MMC */
358 at91_add_device_mci(0, &neocore926_mci0_data);
359
360 /* Ethernet */
361 at91_add_device_eth(&neocore926_macb_data);
362
363 /* NAND */
364 neocore926_add_device_nand();
365
366 /* I2C */
367 at91_add_device_i2c(NULL, 0);
368
369 /* LCD Controller */
370 at91_add_device_lcdc(&neocore926_lcdc_data);
371
372 /* Push Buttons */
373 neocore926_add_device_buttons();
374
375 /* AC97 */
376 at91_add_device_ac97(&neocore926_ac97_data);
377}
378
379MACHINE_START(NEOCORE926, "ADENEO NEOCORE 926")
380 /* Maintainer: ADENEO */
381 .timer = &at91sam926x_timer,
382 .map_io = at91_map_io,
383 .handle_irq = at91_aic_handle_irq,
384 .init_early = neocore926_init_early,
385 .init_irq = at91_init_irq_default,
386 .init_machine = neocore926_board_init,
387MACHINE_END
diff --git a/arch/arm/mach-at91/board-pcontrol-g20.c b/arch/arm/mach-at91/board-pcontrol-g20.c
index 0299554495dd..65c0d6b5ecba 100644
--- a/arch/arm/mach-at91/board-pcontrol-g20.c
+++ b/arch/arm/mach-at91/board-pcontrol-g20.c
@@ -217,7 +217,7 @@ static void __init pcontrol_g20_board_init(void)
217 217
218MACHINE_START(PCONTROL_G20, "PControl G20") 218MACHINE_START(PCONTROL_G20, "PControl G20")
219 /* Maintainer: pgsellmann@portner-elektronik.at */ 219 /* Maintainer: pgsellmann@portner-elektronik.at */
220 .timer = &at91sam926x_timer, 220 .init_time = at91sam926x_pit_init,
221 .map_io = at91_map_io, 221 .map_io = at91_map_io,
222 .handle_irq = at91_aic_handle_irq, 222 .handle_irq = at91_aic_handle_irq,
223 .init_early = pcontrol_g20_init_early, 223 .init_early = pcontrol_g20_init_early,
diff --git a/arch/arm/mach-at91/board-picotux200.c b/arch/arm/mach-at91/board-picotux200.c
index 4938f1cd5e13..ab2b2ec36c14 100644
--- a/arch/arm/mach-at91/board-picotux200.c
+++ b/arch/arm/mach-at91/board-picotux200.c
@@ -119,7 +119,7 @@ static void __init picotux200_board_init(void)
119 119
120MACHINE_START(PICOTUX2XX, "picotux 200") 120MACHINE_START(PICOTUX2XX, "picotux 200")
121 /* Maintainer: Kleinhenz Elektronik GmbH */ 121 /* Maintainer: Kleinhenz Elektronik GmbH */
122 .timer = &at91rm9200_timer, 122 .init_time = at91rm9200_timer_init,
123 .map_io = at91_map_io, 123 .map_io = at91_map_io,
124 .handle_irq = at91_aic_handle_irq, 124 .handle_irq = at91_aic_handle_irq,
125 .init_early = picotux200_init_early, 125 .init_early = picotux200_init_early,
diff --git a/arch/arm/mach-at91/board-qil-a9260.c b/arch/arm/mach-at91/board-qil-a9260.c
index 33b1628467ea..aa3bc9b0f150 100644
--- a/arch/arm/mach-at91/board-qil-a9260.c
+++ b/arch/arm/mach-at91/board-qil-a9260.c
@@ -257,7 +257,7 @@ static void __init ek_board_init(void)
257 257
258MACHINE_START(QIL_A9260, "CALAO QIL_A9260") 258MACHINE_START(QIL_A9260, "CALAO QIL_A9260")
259 /* Maintainer: calao-systems */ 259 /* Maintainer: calao-systems */
260 .timer = &at91sam926x_timer, 260 .init_time = at91sam926x_pit_init,
261 .map_io = at91_map_io, 261 .map_io = at91_map_io,
262 .handle_irq = at91_aic_handle_irq, 262 .handle_irq = at91_aic_handle_irq,
263 .init_early = ek_init_early, 263 .init_early = ek_init_early,
diff --git a/arch/arm/mach-at91/board-rm9200-dt.c b/arch/arm/mach-at91/board-rm9200-dt.c
index 5f9ce3da3fde..3fcb6623a33e 100644
--- a/arch/arm/mach-at91/board-rm9200-dt.c
+++ b/arch/arm/mach-at91/board-rm9200-dt.c
@@ -47,7 +47,7 @@ static const char *at91rm9200_dt_board_compat[] __initdata = {
47}; 47};
48 48
49DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)") 49DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)")
50 .timer = &at91rm9200_timer, 50 .init_time = at91rm9200_timer_init,
51 .map_io = at91_map_io, 51 .map_io = at91_map_io,
52 .handle_irq = at91_aic_handle_irq, 52 .handle_irq = at91_aic_handle_irq,
53 .init_early = at91rm9200_dt_initialize, 53 .init_early = at91rm9200_dt_initialize,
diff --git a/arch/arm/mach-at91/board-rm9200dk.c b/arch/arm/mach-at91/board-rm9200dk.c
index 9e5061bef0d0..690541b18cbc 100644
--- a/arch/arm/mach-at91/board-rm9200dk.c
+++ b/arch/arm/mach-at91/board-rm9200dk.c
@@ -219,7 +219,7 @@ static void __init dk_board_init(void)
219 219
220MACHINE_START(AT91RM9200DK, "Atmel AT91RM9200-DK") 220MACHINE_START(AT91RM9200DK, "Atmel AT91RM9200-DK")
221 /* Maintainer: SAN People/Atmel */ 221 /* Maintainer: SAN People/Atmel */
222 .timer = &at91rm9200_timer, 222 .init_time = at91rm9200_timer_init,
223 .map_io = at91_map_io, 223 .map_io = at91_map_io,
224 .handle_irq = at91_aic_handle_irq, 224 .handle_irq = at91_aic_handle_irq,
225 .init_early = dk_init_early, 225 .init_early = dk_init_early,
diff --git a/arch/arm/mach-at91/board-rm9200ek.c b/arch/arm/mach-at91/board-rm9200ek.c
index 58277dbc718f..8b17dadc1aba 100644
--- a/arch/arm/mach-at91/board-rm9200ek.c
+++ b/arch/arm/mach-at91/board-rm9200ek.c
@@ -186,7 +186,7 @@ static void __init ek_board_init(void)
186 186
187MACHINE_START(AT91RM9200EK, "Atmel AT91RM9200-EK") 187MACHINE_START(AT91RM9200EK, "Atmel AT91RM9200-EK")
188 /* Maintainer: SAN People/Atmel */ 188 /* Maintainer: SAN People/Atmel */
189 .timer = &at91rm9200_timer, 189 .init_time = at91rm9200_timer_init,
190 .map_io = at91_map_io, 190 .map_io = at91_map_io,
191 .handle_irq = at91_aic_handle_irq, 191 .handle_irq = at91_aic_handle_irq,
192 .init_early = ek_init_early, 192 .init_early = ek_init_early,
diff --git a/arch/arm/mach-at91/board-rsi-ews.c b/arch/arm/mach-at91/board-rsi-ews.c
index 2e8b8339a206..f6d7f1958c7e 100644
--- a/arch/arm/mach-at91/board-rsi-ews.c
+++ b/arch/arm/mach-at91/board-rsi-ews.c
@@ -222,7 +222,7 @@ static void __init rsi_ews_board_init(void)
222 222
223MACHINE_START(RSI_EWS, "RSI EWS") 223MACHINE_START(RSI_EWS, "RSI EWS")
224 /* Maintainer: Josef Holzmayr <holzmayr@rsi-elektrotechnik.de> */ 224 /* Maintainer: Josef Holzmayr <holzmayr@rsi-elektrotechnik.de> */
225 .timer = &at91rm9200_timer, 225 .init_time = at91rm9200_timer_init,
226 .map_io = at91_map_io, 226 .map_io = at91_map_io,
227 .handle_irq = at91_aic_handle_irq, 227 .handle_irq = at91_aic_handle_irq,
228 .init_early = rsi_ews_init_early, 228 .init_early = rsi_ews_init_early,
diff --git a/arch/arm/mach-at91/board-sam9-l9260.c b/arch/arm/mach-at91/board-sam9-l9260.c
index b75fbf6003a1..43ee4dc43b50 100644
--- a/arch/arm/mach-at91/board-sam9-l9260.c
+++ b/arch/arm/mach-at91/board-sam9-l9260.c
@@ -218,7 +218,7 @@ static void __init ek_board_init(void)
218 218
219MACHINE_START(SAM9_L9260, "Olimex SAM9-L9260") 219MACHINE_START(SAM9_L9260, "Olimex SAM9-L9260")
220 /* Maintainer: Olimex */ 220 /* Maintainer: Olimex */
221 .timer = &at91sam926x_timer, 221 .init_time = at91sam926x_pit_init,
222 .map_io = at91_map_io, 222 .map_io = at91_map_io,
223 .handle_irq = at91_aic_handle_irq, 223 .handle_irq = at91_aic_handle_irq,
224 .init_early = ek_init_early, 224 .init_early = ek_init_early,
diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c
index f0135cd1d858..0b153c87521d 100644
--- a/arch/arm/mach-at91/board-sam9260ek.c
+++ b/arch/arm/mach-at91/board-sam9260ek.c
@@ -343,7 +343,7 @@ static void __init ek_board_init(void)
343 343
344MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK") 344MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK")
345 /* Maintainer: Atmel */ 345 /* Maintainer: Atmel */
346 .timer = &at91sam926x_timer, 346 .init_time = at91sam926x_pit_init,
347 .map_io = at91_map_io, 347 .map_io = at91_map_io,
348 .handle_irq = at91_aic_handle_irq, 348 .handle_irq = at91_aic_handle_irq,
349 .init_early = ek_init_early, 349 .init_early = ek_init_early,
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
index 13ebaa8e4100..b446645c7727 100644
--- a/arch/arm/mach-at91/board-sam9261ek.c
+++ b/arch/arm/mach-at91/board-sam9261ek.c
@@ -612,7 +612,7 @@ MACHINE_START(AT91SAM9261EK, "Atmel AT91SAM9261-EK")
612MACHINE_START(AT91SAM9G10EK, "Atmel AT91SAM9G10-EK") 612MACHINE_START(AT91SAM9G10EK, "Atmel AT91SAM9G10-EK")
613#endif 613#endif
614 /* Maintainer: Atmel */ 614 /* Maintainer: Atmel */
615 .timer = &at91sam926x_timer, 615 .init_time = at91sam926x_pit_init,
616 .map_io = at91_map_io, 616 .map_io = at91_map_io,
617 .handle_irq = at91_aic_handle_irq, 617 .handle_irq = at91_aic_handle_irq,
618 .init_early = ek_init_early, 618 .init_early = ek_init_early,
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
index 89b9608742a7..3284df05df14 100644
--- a/arch/arm/mach-at91/board-sam9263ek.c
+++ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -443,7 +443,7 @@ static void __init ek_board_init(void)
443 443
444MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK") 444MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK")
445 /* Maintainer: Atmel */ 445 /* Maintainer: Atmel */
446 .timer = &at91sam926x_timer, 446 .init_time = at91sam926x_pit_init,
447 .map_io = at91_map_io, 447 .map_io = at91_map_io,
448 .handle_irq = at91_aic_handle_irq, 448 .handle_irq = at91_aic_handle_irq,
449 .init_early = ek_init_early, 449 .init_early = ek_init_early,
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c
index 1b7dd9f688d3..f9cd1f2c7146 100644
--- a/arch/arm/mach-at91/board-sam9g20ek.c
+++ b/arch/arm/mach-at91/board-sam9g20ek.c
@@ -409,7 +409,7 @@ static void __init ek_board_init(void)
409 409
410MACHINE_START(AT91SAM9G20EK, "Atmel AT91SAM9G20-EK") 410MACHINE_START(AT91SAM9G20EK, "Atmel AT91SAM9G20-EK")
411 /* Maintainer: Atmel */ 411 /* Maintainer: Atmel */
412 .timer = &at91sam926x_timer, 412 .init_time = at91sam926x_pit_init,
413 .map_io = at91_map_io, 413 .map_io = at91_map_io,
414 .handle_irq = at91_aic_handle_irq, 414 .handle_irq = at91_aic_handle_irq,
415 .init_early = ek_init_early, 415 .init_early = ek_init_early,
@@ -419,7 +419,7 @@ MACHINE_END
419 419
420MACHINE_START(AT91SAM9G20EK_2MMC, "Atmel AT91SAM9G20-EK 2 MMC Slot Mod") 420MACHINE_START(AT91SAM9G20EK_2MMC, "Atmel AT91SAM9G20-EK 2 MMC Slot Mod")
421 /* Maintainer: Atmel */ 421 /* Maintainer: Atmel */
422 .timer = &at91sam926x_timer, 422 .init_time = at91sam926x_pit_init,
423 .map_io = at91_map_io, 423 .map_io = at91_map_io,
424 .handle_irq = at91_aic_handle_irq, 424 .handle_irq = at91_aic_handle_irq,
425 .init_early = ek_init_early, 425 .init_early = ek_init_early,
diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c
index e4cc375e3a32..2a94896a1375 100644
--- a/arch/arm/mach-at91/board-sam9m10g45ek.c
+++ b/arch/arm/mach-at91/board-sam9m10g45ek.c
@@ -502,7 +502,7 @@ static void __init ek_board_init(void)
502 502
503MACHINE_START(AT91SAM9M10G45EK, "Atmel AT91SAM9M10G45-EK") 503MACHINE_START(AT91SAM9M10G45EK, "Atmel AT91SAM9M10G45-EK")
504 /* Maintainer: Atmel */ 504 /* Maintainer: Atmel */
505 .timer = &at91sam926x_timer, 505 .init_time = at91sam926x_pit_init,
506 .map_io = at91_map_io, 506 .map_io = at91_map_io,
507 .handle_irq = at91_aic_handle_irq, 507 .handle_irq = at91_aic_handle_irq,
508 .init_early = ek_init_early, 508 .init_early = ek_init_early,
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c
index 377a1097afa7..aa265dcf2128 100644
--- a/arch/arm/mach-at91/board-sam9rlek.c
+++ b/arch/arm/mach-at91/board-sam9rlek.c
@@ -320,7 +320,7 @@ static void __init ek_board_init(void)
320 320
321MACHINE_START(AT91SAM9RLEK, "Atmel AT91SAM9RL-EK") 321MACHINE_START(AT91SAM9RLEK, "Atmel AT91SAM9RL-EK")
322 /* Maintainer: Atmel */ 322 /* Maintainer: Atmel */
323 .timer = &at91sam926x_timer, 323 .init_time = at91sam926x_pit_init,
324 .map_io = at91_map_io, 324 .map_io = at91_map_io,
325 .handle_irq = at91_aic_handle_irq, 325 .handle_irq = at91_aic_handle_irq,
326 .init_early = ek_init_early, 326 .init_early = ek_init_early,
diff --git a/arch/arm/mach-at91/board-snapper9260.c b/arch/arm/mach-at91/board-snapper9260.c
index 98771500ddb9..3aaa9784cf0e 100644
--- a/arch/arm/mach-at91/board-snapper9260.c
+++ b/arch/arm/mach-at91/board-snapper9260.c
@@ -177,7 +177,7 @@ static void __init snapper9260_board_init(void)
177} 177}
178 178
179MACHINE_START(SNAPPER_9260, "Bluewater Systems Snapper 9260/9G20 module") 179MACHINE_START(SNAPPER_9260, "Bluewater Systems Snapper 9260/9G20 module")
180 .timer = &at91sam926x_timer, 180 .init_time = at91sam926x_pit_init,
181 .map_io = at91_map_io, 181 .map_io = at91_map_io,
182 .handle_irq = at91_aic_handle_irq, 182 .handle_irq = at91_aic_handle_irq,
183 .init_early = snapper9260_init_early, 183 .init_early = snapper9260_init_early,
diff --git a/arch/arm/mach-at91/board-stamp9g20.c b/arch/arm/mach-at91/board-stamp9g20.c
index 48a962b61fa3..a033b8df9fb2 100644
--- a/arch/arm/mach-at91/board-stamp9g20.c
+++ b/arch/arm/mach-at91/board-stamp9g20.c
@@ -272,7 +272,7 @@ static void __init stamp9g20evb_board_init(void)
272 272
273MACHINE_START(PORTUXG20, "taskit PortuxG20") 273MACHINE_START(PORTUXG20, "taskit PortuxG20")
274 /* Maintainer: taskit GmbH */ 274 /* Maintainer: taskit GmbH */
275 .timer = &at91sam926x_timer, 275 .init_time = at91sam926x_pit_init,
276 .map_io = at91_map_io, 276 .map_io = at91_map_io,
277 .handle_irq = at91_aic_handle_irq, 277 .handle_irq = at91_aic_handle_irq,
278 .init_early = stamp9g20_init_early, 278 .init_early = stamp9g20_init_early,
@@ -282,7 +282,7 @@ MACHINE_END
282 282
283MACHINE_START(STAMP9G20, "taskit Stamp9G20") 283MACHINE_START(STAMP9G20, "taskit Stamp9G20")
284 /* Maintainer: taskit GmbH */ 284 /* Maintainer: taskit GmbH */
285 .timer = &at91sam926x_timer, 285 .init_time = at91sam926x_pit_init,
286 .map_io = at91_map_io, 286 .map_io = at91_map_io,
287 .handle_irq = at91_aic_handle_irq, 287 .handle_irq = at91_aic_handle_irq,
288 .init_early = stamp9g20_init_early, 288 .init_early = stamp9g20_init_early,
diff --git a/arch/arm/mach-at91/board-usb-a926x.c b/arch/arm/mach-at91/board-usb-a926x.c
index c1060f96e589..2487d944a1bc 100644
--- a/arch/arm/mach-at91/board-usb-a926x.c
+++ b/arch/arm/mach-at91/board-usb-a926x.c
@@ -355,7 +355,7 @@ static void __init ek_board_init(void)
355 355
356MACHINE_START(USB_A9263, "CALAO USB_A9263") 356MACHINE_START(USB_A9263, "CALAO USB_A9263")
357 /* Maintainer: calao-systems */ 357 /* Maintainer: calao-systems */
358 .timer = &at91sam926x_timer, 358 .init_time = at91sam926x_pit_init,
359 .map_io = at91_map_io, 359 .map_io = at91_map_io,
360 .handle_irq = at91_aic_handle_irq, 360 .handle_irq = at91_aic_handle_irq,
361 .init_early = ek_init_early, 361 .init_early = ek_init_early,
@@ -365,7 +365,7 @@ MACHINE_END
365 365
366MACHINE_START(USB_A9260, "CALAO USB_A9260") 366MACHINE_START(USB_A9260, "CALAO USB_A9260")
367 /* Maintainer: calao-systems */ 367 /* Maintainer: calao-systems */
368 .timer = &at91sam926x_timer, 368 .init_time = at91sam926x_pit_init,
369 .map_io = at91_map_io, 369 .map_io = at91_map_io,
370 .handle_irq = at91_aic_handle_irq, 370 .handle_irq = at91_aic_handle_irq,
371 .init_early = ek_init_early, 371 .init_early = ek_init_early,
@@ -375,7 +375,7 @@ MACHINE_END
375 375
376MACHINE_START(USB_A9G20, "CALAO USB_A92G0") 376MACHINE_START(USB_A9G20, "CALAO USB_A92G0")
377 /* Maintainer: Jean-Christophe PLAGNIOL-VILLARD */ 377 /* Maintainer: Jean-Christophe PLAGNIOL-VILLARD */
378 .timer = &at91sam926x_timer, 378 .init_time = at91sam926x_pit_init,
379 .map_io = at91_map_io, 379 .map_io = at91_map_io,
380 .handle_irq = at91_aic_handle_irq, 380 .handle_irq = at91_aic_handle_irq,
381 .init_early = ek_init_early, 381 .init_early = ek_init_early,
diff --git a/arch/arm/mach-at91/board-yl-9200.c b/arch/arm/mach-at91/board-yl-9200.c
index 8673aebcb85d..be083771df2e 100644
--- a/arch/arm/mach-at91/board-yl-9200.c
+++ b/arch/arm/mach-at91/board-yl-9200.c
@@ -587,7 +587,7 @@ static void __init yl9200_board_init(void)
587 587
588MACHINE_START(YL9200, "uCdragon YL-9200") 588MACHINE_START(YL9200, "uCdragon YL-9200")
589 /* Maintainer: S.Birtles */ 589 /* Maintainer: S.Birtles */
590 .timer = &at91rm9200_timer, 590 .init_time = at91rm9200_timer_init,
591 .map_io = at91_map_io, 591 .map_io = at91_map_io,
592 .handle_irq = at91_aic_handle_irq, 592 .handle_irq = at91_aic_handle_irq,
593 .init_early = yl9200_init_early, 593 .init_early = yl9200_init_early,
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index fc593d615e7d..78ab06548658 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -36,12 +36,11 @@ extern int __init at91_aic5_of_init(struct device_node *node,
36 36
37 37
38 /* Timer */ 38 /* Timer */
39struct sys_timer;
40extern void at91rm9200_ioremap_st(u32 addr); 39extern void at91rm9200_ioremap_st(u32 addr);
41extern struct sys_timer at91rm9200_timer; 40extern void at91rm9200_timer_init(void);
42extern void at91sam926x_ioremap_pit(u32 addr); 41extern void at91sam926x_ioremap_pit(u32 addr);
43extern struct sys_timer at91sam926x_timer; 42extern void at91sam926x_pit_init(void);
44extern struct sys_timer at91x40_timer; 43extern void at91x40_timer_init(void);
45 44
46 /* Clocks */ 45 /* Clocks */
47#ifdef CONFIG_AT91_PMC_UNIT 46#ifdef CONFIG_AT91_PMC_UNIT
diff --git a/arch/arm/mach-at91/include/mach/uncompress.h b/arch/arm/mach-at91/include/mach/uncompress.h
index 97ad68a826f8..5659f7c72120 100644
--- a/arch/arm/mach-at91/include/mach/uncompress.h
+++ b/arch/arm/mach-at91/include/mach/uncompress.h
@@ -196,6 +196,4 @@ static inline void flush(void)
196 barrier(); 196 barrier();
197} 197}
198 198
199#define arch_decomp_wdog()
200
201#endif 199#endif
diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig
index 48705c10a0fe..bf02471d7e7c 100644
--- a/arch/arm/mach-bcm/Kconfig
+++ b/arch/arm/mach-bcm/Kconfig
@@ -7,7 +7,6 @@ config ARCH_BCM
7 select ARM_GIC 7 select ARM_GIC
8 select CPU_V7 8 select CPU_V7
9 select GENERIC_CLOCKEVENTS 9 select GENERIC_CLOCKEVENTS
10 select GENERIC_GPIO
11 select GENERIC_TIME 10 select GENERIC_TIME
12 select GPIO_BCM 11 select GPIO_BCM
13 select SPARSE_IRQ 12 select SPARSE_IRQ
diff --git a/arch/arm/mach-bcm/board_bcm.c b/arch/arm/mach-bcm/board_bcm.c
index 3a62f1b1cabc..f0f9abafad29 100644
--- a/arch/arm/mach-bcm/board_bcm.c
+++ b/arch/arm/mach-bcm/board_bcm.c
@@ -11,34 +11,19 @@
11 * GNU General Public License for more details. 11 * GNU General Public License for more details.
12 */ 12 */
13 13
14#include <linux/of_irq.h>
15#include <linux/of_platform.h> 14#include <linux/of_platform.h>
16#include <linux/init.h> 15#include <linux/init.h>
17#include <linux/device.h> 16#include <linux/device.h>
18#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/irqchip.h>
19 19
20#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
21#include <asm/hardware/gic.h>
22
23#include <asm/mach/time.h> 21#include <asm/mach/time.h>
24 22
25static const struct of_device_id irq_match[] = {
26 {.compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
27 {}
28};
29
30static void timer_init(void) 23static void timer_init(void)
31{ 24{
32} 25}
33 26
34static struct sys_timer timer = {
35 .init = timer_init,
36};
37
38static void __init init_irq(void)
39{
40 of_irq_init(irq_match);
41}
42 27
43static void __init board_init(void) 28static void __init board_init(void)
44{ 29{
@@ -49,9 +34,8 @@ static void __init board_init(void)
49static const char * const bcm11351_dt_compat[] = { "bcm,bcm11351", NULL, }; 34static const char * const bcm11351_dt_compat[] = { "bcm,bcm11351", NULL, };
50 35
51DT_MACHINE_START(BCM11351_DT, "Broadcom Application Processor") 36DT_MACHINE_START(BCM11351_DT, "Broadcom Application Processor")
52 .init_irq = init_irq, 37 .init_irq = irqchip_init,
53 .timer = &timer, 38 .init_time = timer_init,
54 .init_machine = board_init, 39 .init_machine = board_init,
55 .dt_compat = bcm11351_dt_compat, 40 .dt_compat = bcm11351_dt_compat,
56 .handle_irq = gic_handle_irq,
57MACHINE_END 41MACHINE_END
diff --git a/arch/arm/mach-bcm2835/bcm2835.c b/arch/arm/mach-bcm2835/bcm2835.c
index f0d739f4b7a3..6f5785985dd1 100644
--- a/arch/arm/mach-bcm2835/bcm2835.c
+++ b/arch/arm/mach-bcm2835/bcm2835.c
@@ -17,8 +17,8 @@
17#include <linux/irqchip/bcm2835.h> 17#include <linux/irqchip/bcm2835.h>
18#include <linux/of_address.h> 18#include <linux/of_address.h>
19#include <linux/of_platform.h> 19#include <linux/of_platform.h>
20#include <linux/bcm2835_timer.h>
21#include <linux/clk/bcm2835.h> 20#include <linux/clk/bcm2835.h>
21#include <linux/clocksource.h>
22 22
23#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
24#include <asm/mach/map.h> 24#include <asm/mach/map.h>
@@ -26,11 +26,13 @@
26#include <mach/bcm2835_soc.h> 26#include <mach/bcm2835_soc.h>
27 27
28#define PM_RSTC 0x1c 28#define PM_RSTC 0x1c
29#define PM_RSTS 0x20
29#define PM_WDOG 0x24 30#define PM_WDOG 0x24
30 31
31#define PM_PASSWORD 0x5a000000 32#define PM_PASSWORD 0x5a000000
32#define PM_RSTC_WRCFG_MASK 0x00000030 33#define PM_RSTC_WRCFG_MASK 0x00000030
33#define PM_RSTC_WRCFG_FULL_RESET 0x00000020 34#define PM_RSTC_WRCFG_FULL_RESET 0x00000020
35#define PM_RSTS_HADWRH_SET 0x00000040
34 36
35static void __iomem *wdt_regs; 37static void __iomem *wdt_regs;
36 38
@@ -67,6 +69,29 @@ static void bcm2835_restart(char mode, const char *cmd)
67 mdelay(1); 69 mdelay(1);
68} 70}
69 71
72/*
73 * We can't really power off, but if we do the normal reset scheme, and
74 * indicate to bootcode.bin not to reboot, then most of the chip will be
75 * powered off.
76 */
77static void bcm2835_power_off(void)
78{
79 u32 val;
80
81 /*
82 * We set the watchdog hard reset bit here to distinguish this reset
83 * from the normal (full) reset. bootcode.bin will not reboot after a
84 * hard reset.
85 */
86 val = readl_relaxed(wdt_regs + PM_RSTS);
87 val &= ~PM_RSTC_WRCFG_MASK;
88 val |= PM_PASSWORD | PM_RSTS_HADWRH_SET;
89 writel_relaxed(val, wdt_regs + PM_RSTS);
90
91 /* Continue with normal reset mechanism */
92 bcm2835_restart(0, "");
93}
94
70static struct map_desc io_map __initdata = { 95static struct map_desc io_map __initdata = {
71 .virtual = BCM2835_PERIPH_VIRT, 96 .virtual = BCM2835_PERIPH_VIRT,
72 .pfn = __phys_to_pfn(BCM2835_PERIPH_PHYS), 97 .pfn = __phys_to_pfn(BCM2835_PERIPH_PHYS),
@@ -84,6 +109,9 @@ static void __init bcm2835_init(void)
84 int ret; 109 int ret;
85 110
86 bcm2835_setup_restart(); 111 bcm2835_setup_restart();
112 if (wdt_regs)
113 pm_power_off = bcm2835_power_off;
114
87 bcm2835_init_clocks(); 115 bcm2835_init_clocks();
88 116
89 ret = of_platform_populate(NULL, of_default_bus_match_table, NULL, 117 ret = of_platform_populate(NULL, of_default_bus_match_table, NULL,
@@ -104,7 +132,7 @@ DT_MACHINE_START(BCM2835, "BCM2835")
104 .init_irq = bcm2835_init_irq, 132 .init_irq = bcm2835_init_irq,
105 .handle_irq = bcm2835_handle_irq, 133 .handle_irq = bcm2835_handle_irq,
106 .init_machine = bcm2835_init, 134 .init_machine = bcm2835_init,
107 .timer = &bcm2835_timer, 135 .init_time = clocksource_of_init,
108 .restart = bcm2835_restart, 136 .restart = bcm2835_restart,
109 .dt_compat = bcm2835_compat 137 .dt_compat = bcm2835_compat
110MACHINE_END 138MACHINE_END
diff --git a/arch/arm/mach-bcm2835/include/mach/uncompress.h b/arch/arm/mach-bcm2835/include/mach/uncompress.h
index cc46dcc72377..bf86dca3bf71 100644
--- a/arch/arm/mach-bcm2835/include/mach/uncompress.h
+++ b/arch/arm/mach-bcm2835/include/mach/uncompress.h
@@ -42,4 +42,3 @@ static inline void flush(void)
42} 42}
43 43
44#define arch_decomp_setup() 44#define arch_decomp_setup()
45#define arch_decomp_wdog()
diff --git a/arch/arm/mach-clps711x/board-autcpu12.c b/arch/arm/mach-clps711x/board-autcpu12.c
index 3fbf43f72589..f38584709df7 100644
--- a/arch/arm/mach-clps711x/board-autcpu12.c
+++ b/arch/arm/mach-clps711x/board-autcpu12.c
@@ -170,7 +170,7 @@ MACHINE_START(AUTCPU12, "autronix autcpu12")
170 .nr_irqs = CLPS711X_NR_IRQS, 170 .nr_irqs = CLPS711X_NR_IRQS,
171 .map_io = clps711x_map_io, 171 .map_io = clps711x_map_io,
172 .init_irq = clps711x_init_irq, 172 .init_irq = clps711x_init_irq,
173 .timer = &clps711x_timer, 173 .init_time = clps711x_timer_init,
174 .init_machine = autcpu12_init, 174 .init_machine = autcpu12_init,
175 .init_late = autcpu12_init_late, 175 .init_late = autcpu12_init_late,
176 .handle_irq = clps711x_handle_irq, 176 .handle_irq = clps711x_handle_irq,
diff --git a/arch/arm/mach-clps711x/board-cdb89712.c b/arch/arm/mach-clps711x/board-cdb89712.c
index 60900ddf97c9..baab7da33c9b 100644
--- a/arch/arm/mach-clps711x/board-cdb89712.c
+++ b/arch/arm/mach-clps711x/board-cdb89712.c
@@ -140,7 +140,7 @@ MACHINE_START(CDB89712, "Cirrus-CDB89712")
140 .nr_irqs = CLPS711X_NR_IRQS, 140 .nr_irqs = CLPS711X_NR_IRQS,
141 .map_io = clps711x_map_io, 141 .map_io = clps711x_map_io,
142 .init_irq = clps711x_init_irq, 142 .init_irq = clps711x_init_irq,
143 .timer = &clps711x_timer, 143 .init_time = clps711x_timer_init,
144 .init_machine = cdb89712_init, 144 .init_machine = cdb89712_init,
145 .handle_irq = clps711x_handle_irq, 145 .handle_irq = clps711x_handle_irq,
146 .restart = clps711x_restart, 146 .restart = clps711x_restart,
diff --git a/arch/arm/mach-clps711x/board-clep7312.c b/arch/arm/mach-clps711x/board-clep7312.c
index 0b32a487183b..014aa3c19a03 100644
--- a/arch/arm/mach-clps711x/board-clep7312.c
+++ b/arch/arm/mach-clps711x/board-clep7312.c
@@ -40,7 +40,7 @@ MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312")
40 .fixup = fixup_clep7312, 40 .fixup = fixup_clep7312,
41 .map_io = clps711x_map_io, 41 .map_io = clps711x_map_io,
42 .init_irq = clps711x_init_irq, 42 .init_irq = clps711x_init_irq,
43 .timer = &clps711x_timer, 43 .init_time = clps711x_timer_init,
44 .handle_irq = clps711x_handle_irq, 44 .handle_irq = clps711x_handle_irq,
45 .restart = clps711x_restart, 45 .restart = clps711x_restart,
46MACHINE_END 46MACHINE_END
diff --git a/arch/arm/mach-clps711x/board-edb7211.c b/arch/arm/mach-clps711x/board-edb7211.c
index 71aa5cf2c0d3..5f928e9ed2ef 100644
--- a/arch/arm/mach-clps711x/board-edb7211.c
+++ b/arch/arm/mach-clps711x/board-edb7211.c
@@ -173,7 +173,7 @@ MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)")
173 .reserve = edb7211_reserve, 173 .reserve = edb7211_reserve,
174 .map_io = edb7211_map_io, 174 .map_io = edb7211_map_io,
175 .init_irq = clps711x_init_irq, 175 .init_irq = clps711x_init_irq,
176 .timer = &clps711x_timer, 176 .init_time = clps711x_timer_init,
177 .init_machine = edb7211_init, 177 .init_machine = edb7211_init,
178 .handle_irq = clps711x_handle_irq, 178 .handle_irq = clps711x_handle_irq,
179 .restart = clps711x_restart, 179 .restart = clps711x_restart,
diff --git a/arch/arm/mach-clps711x/board-fortunet.c b/arch/arm/mach-clps711x/board-fortunet.c
index 7d0125580366..c5675efc8c6a 100644
--- a/arch/arm/mach-clps711x/board-fortunet.c
+++ b/arch/arm/mach-clps711x/board-fortunet.c
@@ -78,7 +78,7 @@ MACHINE_START(FORTUNET, "ARM-FortuNet")
78 .fixup = fortunet_fixup, 78 .fixup = fortunet_fixup,
79 .map_io = clps711x_map_io, 79 .map_io = clps711x_map_io,
80 .init_irq = clps711x_init_irq, 80 .init_irq = clps711x_init_irq,
81 .timer = &clps711x_timer, 81 .init_time = clps711x_timer_init,
82 .handle_irq = clps711x_handle_irq, 82 .handle_irq = clps711x_handle_irq,
83 .restart = clps711x_restart, 83 .restart = clps711x_restart,
84MACHINE_END 84MACHINE_END
diff --git a/arch/arm/mach-clps711x/board-p720t.c b/arch/arm/mach-clps711x/board-p720t.c
index 1518fc83babd..8d3ee6771135 100644
--- a/arch/arm/mach-clps711x/board-p720t.c
+++ b/arch/arm/mach-clps711x/board-p720t.c
@@ -224,7 +224,7 @@ MACHINE_START(P720T, "ARM-Prospector720T")
224 .map_io = p720t_map_io, 224 .map_io = p720t_map_io,
225 .init_early = p720t_init_early, 225 .init_early = p720t_init_early,
226 .init_irq = clps711x_init_irq, 226 .init_irq = clps711x_init_irq,
227 .timer = &clps711x_timer, 227 .init_time = clps711x_timer_init,
228 .init_machine = p720t_init, 228 .init_machine = p720t_init,
229 .init_late = p720t_init_late, 229 .init_late = p720t_init_late,
230 .handle_irq = clps711x_handle_irq, 230 .handle_irq = clps711x_handle_irq,
diff --git a/arch/arm/mach-clps711x/common.c b/arch/arm/mach-clps711x/common.c
index e046439573ee..20ff50f3ccf0 100644
--- a/arch/arm/mach-clps711x/common.c
+++ b/arch/arm/mach-clps711x/common.c
@@ -282,7 +282,7 @@ static void add_fixed_clk(struct clk *clk, const char *name, int rate)
282 clk_register_clkdev(clk, name, NULL); 282 clk_register_clkdev(clk, name, NULL);
283} 283}
284 284
285static void __init clps711x_timer_init(void) 285void __init clps711x_timer_init(void)
286{ 286{
287 int osc, ext, pll, cpu, bus, timl, timh, uart, spi; 287 int osc, ext, pll, cpu, bus, timl, timh, uart, spi;
288 u32 tmp; 288 u32 tmp;
@@ -345,10 +345,6 @@ static void __init clps711x_timer_init(void)
345 setup_irq(IRQ_TC2OI, &clps711x_timer_irq); 345 setup_irq(IRQ_TC2OI, &clps711x_timer_irq);
346} 346}
347 347
348struct sys_timer clps711x_timer = {
349 .init = clps711x_timer_init,
350};
351
352void clps711x_restart(char mode, const char *cmd) 348void clps711x_restart(char mode, const char *cmd)
353{ 349{
354 soft_restart(0); 350 soft_restart(0);
diff --git a/arch/arm/mach-clps711x/common.h b/arch/arm/mach-clps711x/common.h
index b7c0c75c90c0..f84a7292c70e 100644
--- a/arch/arm/mach-clps711x/common.h
+++ b/arch/arm/mach-clps711x/common.h
@@ -8,10 +8,8 @@
8#define CLPS711X_NR_GPIO (4 * 8 + 3) 8#define CLPS711X_NR_GPIO (4 * 8 + 3)
9#define CLPS711X_GPIO(prt, bit) ((prt) * 8 + (bit)) 9#define CLPS711X_GPIO(prt, bit) ((prt) * 8 + (bit))
10 10
11struct sys_timer;
12
13extern void clps711x_map_io(void); 11extern void clps711x_map_io(void);
14extern void clps711x_init_irq(void); 12extern void clps711x_init_irq(void);
13extern void clps711x_timer_init(void);
15extern void clps711x_handle_irq(struct pt_regs *regs); 14extern void clps711x_handle_irq(struct pt_regs *regs);
16extern void clps711x_restart(char mode, const char *cmd); 15extern void clps711x_restart(char mode, const char *cmd);
17extern struct sys_timer clps711x_timer;
diff --git a/arch/arm/mach-clps711x/include/mach/uncompress.h b/arch/arm/mach-clps711x/include/mach/uncompress.h
index 7b28d6a47690..5f02d06dc655 100644
--- a/arch/arm/mach-clps711x/include/mach/uncompress.h
+++ b/arch/arm/mach-clps711x/include/mach/uncompress.h
@@ -53,5 +53,3 @@ static inline void flush(void)
53 * nothing to do 53 * nothing to do
54 */ 54 */
55#define arch_decomp_setup() 55#define arch_decomp_setup()
56
57#define arch_decomp_wdog()
diff --git a/arch/arm/mach-cns3xxx/cns3420vb.c b/arch/arm/mach-cns3xxx/cns3420vb.c
index ae305397003c..a71867e1d8d6 100644
--- a/arch/arm/mach-cns3xxx/cns3420vb.c
+++ b/arch/arm/mach-cns3xxx/cns3420vb.c
@@ -28,7 +28,6 @@
28#include <linux/usb/ohci_pdriver.h> 28#include <linux/usb/ohci_pdriver.h>
29#include <asm/setup.h> 29#include <asm/setup.h>
30#include <asm/mach-types.h> 30#include <asm/mach-types.h>
31#include <asm/hardware/gic.h>
32#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
33#include <asm/mach/map.h> 32#include <asm/mach/map.h>
34#include <asm/mach/time.h> 33#include <asm/mach/time.h>
@@ -250,8 +249,7 @@ MACHINE_START(CNS3420VB, "Cavium Networks CNS3420 Validation Board")
250 .atag_offset = 0x100, 249 .atag_offset = 0x100,
251 .map_io = cns3420_map_io, 250 .map_io = cns3420_map_io,
252 .init_irq = cns3xxx_init_irq, 251 .init_irq = cns3xxx_init_irq,
253 .timer = &cns3xxx_timer, 252 .init_time = cns3xxx_timer_init,
254 .handle_irq = gic_handle_irq,
255 .init_machine = cns3420_init, 253 .init_machine = cns3420_init,
256 .restart = cns3xxx_restart, 254 .restart = cns3xxx_restart,
257MACHINE_END 255MACHINE_END
diff --git a/arch/arm/mach-cns3xxx/core.c b/arch/arm/mach-cns3xxx/core.c
index 031805b1428d..e698f26cc0cb 100644
--- a/arch/arm/mach-cns3xxx/core.c
+++ b/arch/arm/mach-cns3xxx/core.c
@@ -12,10 +12,10 @@
12#include <linux/interrupt.h> 12#include <linux/interrupt.h>
13#include <linux/clockchips.h> 13#include <linux/clockchips.h>
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/irqchip/arm-gic.h>
15#include <asm/mach/map.h> 16#include <asm/mach/map.h>
16#include <asm/mach/time.h> 17#include <asm/mach/time.h>
17#include <asm/mach/irq.h> 18#include <asm/mach/irq.h>
18#include <asm/hardware/gic.h>
19#include <asm/hardware/cache-l2x0.h> 19#include <asm/hardware/cache-l2x0.h>
20#include <mach/cns3xxx.h> 20#include <mach/cns3xxx.h>
21#include "core.h" 21#include "core.h"
@@ -134,7 +134,6 @@ static int cns3xxx_timer_set_next_event(unsigned long evt,
134 134
135static struct clock_event_device cns3xxx_tmr1_clockevent = { 135static struct clock_event_device cns3xxx_tmr1_clockevent = {
136 .name = "cns3xxx timer1", 136 .name = "cns3xxx timer1",
137 .shift = 8,
138 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 137 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
139 .set_mode = cns3xxx_timer_set_mode, 138 .set_mode = cns3xxx_timer_set_mode,
140 .set_next_event = cns3xxx_timer_set_next_event, 139 .set_next_event = cns3xxx_timer_set_next_event,
@@ -145,15 +144,9 @@ static struct clock_event_device cns3xxx_tmr1_clockevent = {
145static void __init cns3xxx_clockevents_init(unsigned int timer_irq) 144static void __init cns3xxx_clockevents_init(unsigned int timer_irq)
146{ 145{
147 cns3xxx_tmr1_clockevent.irq = timer_irq; 146 cns3xxx_tmr1_clockevent.irq = timer_irq;
148 cns3xxx_tmr1_clockevent.mult = 147 clockevents_config_and_register(&cns3xxx_tmr1_clockevent,
149 div_sc((cns3xxx_cpu_clock() >> 3) * 1000000, NSEC_PER_SEC, 148 (cns3xxx_cpu_clock() >> 3) * 1000000,
150 cns3xxx_tmr1_clockevent.shift); 149 0xf, 0xffffffff);
151 cns3xxx_tmr1_clockevent.max_delta_ns =
152 clockevent_delta2ns(0xffffffff, &cns3xxx_tmr1_clockevent);
153 cns3xxx_tmr1_clockevent.min_delta_ns =
154 clockevent_delta2ns(0xf, &cns3xxx_tmr1_clockevent);
155
156 clockevents_register_device(&cns3xxx_tmr1_clockevent);
157} 150}
158 151
159/* 152/*
@@ -235,17 +228,13 @@ static void __init __cns3xxx_timer_init(unsigned int timer_irq)
235 cns3xxx_clockevents_init(timer_irq); 228 cns3xxx_clockevents_init(timer_irq);
236} 229}
237 230
238static void __init cns3xxx_timer_init(void) 231void __init cns3xxx_timer_init(void)
239{ 232{
240 cns3xxx_tmr1 = IOMEM(CNS3XXX_TIMER1_2_3_BASE_VIRT); 233 cns3xxx_tmr1 = IOMEM(CNS3XXX_TIMER1_2_3_BASE_VIRT);
241 234
242 __cns3xxx_timer_init(IRQ_CNS3XXX_TIMER0); 235 __cns3xxx_timer_init(IRQ_CNS3XXX_TIMER0);
243} 236}
244 237
245struct sys_timer cns3xxx_timer = {
246 .init = cns3xxx_timer_init,
247};
248
249#ifdef CONFIG_CACHE_L2X0 238#ifdef CONFIG_CACHE_L2X0
250 239
251void __init cns3xxx_l2x0_init(void) 240void __init cns3xxx_l2x0_init(void)
diff --git a/arch/arm/mach-cns3xxx/core.h b/arch/arm/mach-cns3xxx/core.h
index 4894b8c17151..b23b17b4da10 100644
--- a/arch/arm/mach-cns3xxx/core.h
+++ b/arch/arm/mach-cns3xxx/core.h
@@ -11,7 +11,7 @@
11#ifndef __CNS3XXX_CORE_H 11#ifndef __CNS3XXX_CORE_H
12#define __CNS3XXX_CORE_H 12#define __CNS3XXX_CORE_H
13 13
14extern struct sys_timer cns3xxx_timer; 14extern void cns3xxx_timer_init(void);
15 15
16#ifdef CONFIG_CACHE_L2X0 16#ifdef CONFIG_CACHE_L2X0
17void __init cns3xxx_l2x0_init(void); 17void __init cns3xxx_l2x0_init(void);
diff --git a/arch/arm/mach-cns3xxx/include/mach/uncompress.h b/arch/arm/mach-cns3xxx/include/mach/uncompress.h
index a91b6058ab4f..7a030b99df84 100644
--- a/arch/arm/mach-cns3xxx/include/mach/uncompress.h
+++ b/arch/arm/mach-cns3xxx/include/mach/uncompress.h
@@ -51,4 +51,3 @@ static inline void flush(void)
51 * nothing to do 51 * nothing to do
52 */ 52 */
53#define arch_decomp_setup() 53#define arch_decomp_setup()
54#define arch_decomp_wdog()
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index 0153950f6068..a075b3e0c5c7 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -62,6 +62,7 @@ config MACH_DA8XX_DT
62 bool "Support DA8XX platforms using device tree" 62 bool "Support DA8XX platforms using device tree"
63 default y 63 default y
64 depends on ARCH_DAVINCI_DA8XX 64 depends on ARCH_DAVINCI_DA8XX
65 select PINCTRL
65 help 66 help
66 Say y here to include support for TI DaVinci DA850 based using 67 Say y here to include support for TI DaVinci DA850 based using
67 Flattened Device Tree. More information at Documentation/devicetree 68 Flattened Device Tree. More information at Documentation/devicetree
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c
index 95b5e102ceb1..6da25eebf911 100644
--- a/arch/arm/mach-davinci/board-da830-evm.c
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -652,8 +652,13 @@ static __init void da830_evm_init(void)
652 if (ret) 652 if (ret)
653 pr_warning("da830_evm_init: rtc setup failed: %d\n", ret); 653 pr_warning("da830_evm_init: rtc setup failed: %d\n", ret);
654 654
655 ret = da8xx_register_spi(0, da830evm_spi_info, 655 ret = spi_register_board_info(da830evm_spi_info,
656 ARRAY_SIZE(da830evm_spi_info)); 656 ARRAY_SIZE(da830evm_spi_info));
657 if (ret)
658 pr_warn("%s: spi info registration failed: %d\n", __func__,
659 ret);
660
661 ret = da8xx_register_spi_bus(0, ARRAY_SIZE(da830evm_spi_info));
657 if (ret) 662 if (ret)
658 pr_warning("da830_evm_init: spi 0 registration failed: %d\n", 663 pr_warning("da830_evm_init: spi 0 registration failed: %d\n",
659 ret); 664 ret);
@@ -679,7 +684,7 @@ MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP-L137/AM17x EVM")
679 .atag_offset = 0x100, 684 .atag_offset = 0x100,
680 .map_io = da830_evm_map_io, 685 .map_io = da830_evm_map_io,
681 .init_irq = cp_intc_init, 686 .init_irq = cp_intc_init,
682 .timer = &davinci_timer, 687 .init_time = davinci_timer_init,
683 .init_machine = da830_evm_init, 688 .init_machine = da830_evm_init,
684 .init_late = davinci_init_late, 689 .init_late = davinci_init_late,
685 .dma_zone_size = SZ_128M, 690 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 0299915575a8..c2dfe06563df 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -349,13 +349,13 @@ static inline void da850_evm_setup_nor_nand(void)
349 if (!HAS_MMC) { 349 if (!HAS_MMC) {
350 ret = davinci_cfg_reg_list(da850_evm_nand_pins); 350 ret = davinci_cfg_reg_list(da850_evm_nand_pins);
351 if (ret) 351 if (ret)
352 pr_warning("da850_evm_init: nand mux setup failed: " 352 pr_warn("%s: NAND mux setup failed: %d\n",
353 "%d\n", ret); 353 __func__, ret);
354 354
355 ret = davinci_cfg_reg_list(da850_evm_nor_pins); 355 ret = davinci_cfg_reg_list(da850_evm_nor_pins);
356 if (ret) 356 if (ret)
357 pr_warning("da850_evm_init: nor mux setup failed: %d\n", 357 pr_warn("%s: NOR mux setup failed: %d\n",
358 ret); 358 __func__, ret);
359 359
360 da850_evm_init_nor(); 360 da850_evm_init_nor();
361 361
@@ -477,19 +477,19 @@ static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio,
477 477
478 ret = gpio_request(sel_a, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_A]); 478 ret = gpio_request(sel_a, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_A]);
479 if (ret) { 479 if (ret) {
480 pr_warning("Cannot open UI expander pin %d\n", sel_a); 480 pr_warn("Cannot open UI expander pin %d\n", sel_a);
481 goto exp_setup_sela_fail; 481 goto exp_setup_sela_fail;
482 } 482 }
483 483
484 ret = gpio_request(sel_b, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_B]); 484 ret = gpio_request(sel_b, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_B]);
485 if (ret) { 485 if (ret) {
486 pr_warning("Cannot open UI expander pin %d\n", sel_b); 486 pr_warn("Cannot open UI expander pin %d\n", sel_b);
487 goto exp_setup_selb_fail; 487 goto exp_setup_selb_fail;
488 } 488 }
489 489
490 ret = gpio_request(sel_c, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_C]); 490 ret = gpio_request(sel_c, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_C]);
491 if (ret) { 491 if (ret) {
492 pr_warning("Cannot open UI expander pin %d\n", sel_c); 492 pr_warn("Cannot open UI expander pin %d\n", sel_c);
493 goto exp_setup_selc_fail; 493 goto exp_setup_selc_fail;
494 } 494 }
495 495
@@ -501,7 +501,7 @@ static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio,
501 da850_evm_ui_keys_init(gpio); 501 da850_evm_ui_keys_init(gpio);
502 ret = platform_device_register(&da850_evm_ui_keys_device); 502 ret = platform_device_register(&da850_evm_ui_keys_device);
503 if (ret) { 503 if (ret) {
504 pr_warning("Could not register UI GPIO expander push-buttons"); 504 pr_warn("Could not register UI GPIO expander push-buttons");
505 goto exp_setup_keys_fail; 505 goto exp_setup_keys_fail;
506 } 506 }
507 507
@@ -690,14 +690,14 @@ static int da850_evm_bb_expander_setup(struct i2c_client *client,
690 da850_evm_bb_keys_init(gpio); 690 da850_evm_bb_keys_init(gpio);
691 ret = platform_device_register(&da850_evm_bb_keys_device); 691 ret = platform_device_register(&da850_evm_bb_keys_device);
692 if (ret) { 692 if (ret) {
693 pr_warning("Could not register baseboard GPIO expander keys"); 693 pr_warn("Could not register baseboard GPIO expander keys");
694 goto io_exp_setup_sw_fail; 694 goto io_exp_setup_sw_fail;
695 } 695 }
696 696
697 da850_evm_bb_leds_init(gpio); 697 da850_evm_bb_leds_init(gpio);
698 ret = platform_device_register(&da850_evm_bb_leds_device); 698 ret = platform_device_register(&da850_evm_bb_leds_device);
699 if (ret) { 699 if (ret) {
700 pr_warning("Could not register baseboard GPIO expander LEDS"); 700 pr_warn("Could not register baseboard GPIO expander LEDs");
701 goto io_exp_setup_leds_fail; 701 goto io_exp_setup_leds_fail;
702 } 702 }
703 703
@@ -1065,21 +1065,19 @@ static int __init da850_evm_config_emac(void)
1065 } 1065 }
1066 1066
1067 if (ret) 1067 if (ret)
1068 pr_warning("da850_evm_init: cpgmac/rmii mux setup failed: %d\n", 1068 pr_warn("%s: CPGMAC/RMII mux setup failed: %d\n",
1069 ret); 1069 __func__, ret);
1070 1070
1071 /* configure the CFGCHIP3 register for RMII or MII */ 1071 /* configure the CFGCHIP3 register for RMII or MII */
1072 __raw_writel(val, cfg_chip3_base); 1072 __raw_writel(val, cfg_chip3_base);
1073 1073
1074 ret = davinci_cfg_reg(DA850_GPIO2_6); 1074 ret = davinci_cfg_reg(DA850_GPIO2_6);
1075 if (ret) 1075 if (ret)
1076 pr_warning("da850_evm_init:GPIO(2,6) mux setup " 1076 pr_warn("%s:GPIO(2,6) mux setup failed\n", __func__);
1077 "failed\n");
1078 1077
1079 ret = gpio_request(DA850_MII_MDIO_CLKEN_PIN, "mdio_clk_en"); 1078 ret = gpio_request(DA850_MII_MDIO_CLKEN_PIN, "mdio_clk_en");
1080 if (ret) { 1079 if (ret) {
1081 pr_warning("Cannot open GPIO %d\n", 1080 pr_warn("Cannot open GPIO %d\n", DA850_MII_MDIO_CLKEN_PIN);
1082 DA850_MII_MDIO_CLKEN_PIN);
1083 return ret; 1081 return ret;
1084 } 1082 }
1085 1083
@@ -1090,8 +1088,7 @@ static int __init da850_evm_config_emac(void)
1090 1088
1091 ret = da8xx_register_emac(); 1089 ret = da8xx_register_emac();
1092 if (ret) 1090 if (ret)
1093 pr_warning("da850_evm_init: emac registration failed: %d\n", 1091 pr_warn("%s: EMAC registration failed: %d\n", __func__, ret);
1094 ret);
1095 1092
1096 return 0; 1093 return 0;
1097} 1094}
@@ -1256,11 +1253,24 @@ static struct vpif_capture_config da850_vpif_capture_config = {
1256}; 1253};
1257 1254
1258/* VPIF display configuration */ 1255/* VPIF display configuration */
1256
1257static struct adv7343_platform_data adv7343_pdata = {
1258 .mode_config = {
1259 .dac_3 = 1,
1260 .dac_2 = 1,
1261 .dac_1 = 1,
1262 },
1263 .sd_config = {
1264 .sd_dac_out1 = 1,
1265 },
1266};
1267
1259static struct vpif_subdev_info da850_vpif_subdev[] = { 1268static struct vpif_subdev_info da850_vpif_subdev[] = {
1260 { 1269 {
1261 .name = "adv7343", 1270 .name = "adv7343",
1262 .board_info = { 1271 .board_info = {
1263 I2C_BOARD_INFO("adv7343", 0x2a), 1272 I2C_BOARD_INFO("adv7343", 0x2a),
1273 .platform_data = &adv7343_pdata,
1264 }, 1274 },
1265 }, 1275 },
1266}; 1276};
@@ -1443,57 +1453,53 @@ static __init void da850_evm_init(void)
1443 1453
1444 ret = pmic_tps65070_init(); 1454 ret = pmic_tps65070_init();
1445 if (ret) 1455 if (ret)
1446 pr_warning("da850_evm_init: TPS65070 PMIC init failed: %d\n", 1456 pr_warn("%s: TPS65070 PMIC init failed: %d\n", __func__, ret);
1447 ret);
1448 1457
1449 ret = da850_register_edma(da850_edma_rsv); 1458 ret = da850_register_edma(da850_edma_rsv);
1450 if (ret) 1459 if (ret)
1451 pr_warning("da850_evm_init: edma registration failed: %d\n", 1460 pr_warn("%s: EDMA registration failed: %d\n", __func__, ret);
1452 ret);
1453 1461
1454 ret = davinci_cfg_reg_list(da850_i2c0_pins); 1462 ret = davinci_cfg_reg_list(da850_i2c0_pins);
1455 if (ret) 1463 if (ret)
1456 pr_warning("da850_evm_init: i2c0 mux setup failed: %d\n", 1464 pr_warn("%s: I2C0 mux setup failed: %d\n", __func__, ret);
1457 ret);
1458 1465
1459 ret = da8xx_register_i2c(0, &da850_evm_i2c_0_pdata); 1466 ret = da8xx_register_i2c(0, &da850_evm_i2c_0_pdata);
1460 if (ret) 1467 if (ret)
1461 pr_warning("da850_evm_init: i2c0 registration failed: %d\n", 1468 pr_warn("%s: I2C0 registration failed: %d\n", __func__, ret);
1462 ret);
1463 1469
1464 1470
1465 ret = da8xx_register_watchdog(); 1471 ret = da8xx_register_watchdog();
1466 if (ret) 1472 if (ret)
1467 pr_warning("da830_evm_init: watchdog registration failed: %d\n", 1473 pr_warn("%s: watchdog registration failed: %d\n",
1468 ret); 1474 __func__, ret);
1469 1475
1470 if (HAS_MMC) { 1476 if (HAS_MMC) {
1471 ret = davinci_cfg_reg_list(da850_evm_mmcsd0_pins); 1477 ret = davinci_cfg_reg_list(da850_evm_mmcsd0_pins);
1472 if (ret) 1478 if (ret)
1473 pr_warning("da850_evm_init: mmcsd0 mux setup failed:" 1479 pr_warn("%s: MMCSD0 mux setup failed: %d\n",
1474 " %d\n", ret); 1480 __func__, ret);
1475 1481
1476 ret = gpio_request(DA850_MMCSD_CD_PIN, "MMC CD\n"); 1482 ret = gpio_request(DA850_MMCSD_CD_PIN, "MMC CD\n");
1477 if (ret) 1483 if (ret)
1478 pr_warning("da850_evm_init: can not open GPIO %d\n", 1484 pr_warn("%s: can not open GPIO %d\n",
1479 DA850_MMCSD_CD_PIN); 1485 __func__, DA850_MMCSD_CD_PIN);
1480 gpio_direction_input(DA850_MMCSD_CD_PIN); 1486 gpio_direction_input(DA850_MMCSD_CD_PIN);
1481 1487
1482 ret = gpio_request(DA850_MMCSD_WP_PIN, "MMC WP\n"); 1488 ret = gpio_request(DA850_MMCSD_WP_PIN, "MMC WP\n");
1483 if (ret) 1489 if (ret)
1484 pr_warning("da850_evm_init: can not open GPIO %d\n", 1490 pr_warn("%s: can not open GPIO %d\n",
1485 DA850_MMCSD_WP_PIN); 1491 __func__, DA850_MMCSD_WP_PIN);
1486 gpio_direction_input(DA850_MMCSD_WP_PIN); 1492 gpio_direction_input(DA850_MMCSD_WP_PIN);
1487 1493
1488 ret = da8xx_register_mmcsd0(&da850_mmc_config); 1494 ret = da8xx_register_mmcsd0(&da850_mmc_config);
1489 if (ret) 1495 if (ret)
1490 pr_warning("da850_evm_init: mmcsd0 registration failed:" 1496 pr_warn("%s: MMCSD0 registration failed: %d\n",
1491 " %d\n", ret); 1497 __func__, ret);
1492 1498
1493 ret = da850_wl12xx_init(); 1499 ret = da850_wl12xx_init();
1494 if (ret) 1500 if (ret)
1495 pr_warning("da850_evm_init: wl12xx initialization" 1501 pr_warn("%s: WL12xx initialization failed: %d\n",
1496 " failed: %d\n", ret); 1502 __func__, ret);
1497 } 1503 }
1498 1504
1499 davinci_serial_init(&da850_evm_uart_config); 1505 davinci_serial_init(&da850_evm_uart_config);
@@ -1511,16 +1517,14 @@ static __init void da850_evm_init(void)
1511 1517
1512 ret = davinci_cfg_reg_list(da850_evm_mcasp_pins); 1518 ret = davinci_cfg_reg_list(da850_evm_mcasp_pins);
1513 if (ret) 1519 if (ret)
1514 pr_warning("da850_evm_init: mcasp mux setup failed: %d\n", 1520 pr_warn("%s: McASP mux setup failed: %d\n", __func__, ret);
1515 ret);
1516 1521
1517 da850_evm_snd_data.sram_pool = sram_get_gen_pool(); 1522 da850_evm_snd_data.sram_pool = sram_get_gen_pool();
1518 da8xx_register_mcasp(0, &da850_evm_snd_data); 1523 da8xx_register_mcasp(0, &da850_evm_snd_data);
1519 1524
1520 ret = davinci_cfg_reg_list(da850_lcdcntl_pins); 1525 ret = davinci_cfg_reg_list(da850_lcdcntl_pins);
1521 if (ret) 1526 if (ret)
1522 pr_warning("da850_evm_init: lcdcntl mux setup failed: %d\n", 1527 pr_warn("%s: LCDC mux setup failed: %d\n", __func__, ret);
1523 ret);
1524 1528
1525 ret = da8xx_register_uio_pruss(); 1529 ret = da8xx_register_uio_pruss();
1526 if (ret) 1530 if (ret)
@@ -1530,51 +1534,49 @@ static __init void da850_evm_init(void)
1530 /* Handle board specific muxing for LCD here */ 1534 /* Handle board specific muxing for LCD here */
1531 ret = davinci_cfg_reg_list(da850_evm_lcdc_pins); 1535 ret = davinci_cfg_reg_list(da850_evm_lcdc_pins);
1532 if (ret) 1536 if (ret)
1533 pr_warning("da850_evm_init: evm specific lcd mux setup " 1537 pr_warn("%s: EVM specific LCD mux setup failed: %d\n",
1534 "failed: %d\n", ret); 1538 __func__, ret);
1535 1539
1536 ret = da850_lcd_hw_init(); 1540 ret = da850_lcd_hw_init();
1537 if (ret) 1541 if (ret)
1538 pr_warning("da850_evm_init: lcd initialization failed: %d\n", 1542 pr_warn("%s: LCD initialization failed: %d\n", __func__, ret);
1539 ret);
1540 1543
1541 sharp_lk043t1dg01_pdata.panel_power_ctrl = da850_panel_power_ctrl, 1544 sharp_lk043t1dg01_pdata.panel_power_ctrl = da850_panel_power_ctrl,
1542 ret = da8xx_register_lcdc(&sharp_lk043t1dg01_pdata); 1545 ret = da8xx_register_lcdc(&sharp_lk043t1dg01_pdata);
1543 if (ret) 1546 if (ret)
1544 pr_warning("da850_evm_init: lcdc registration failed: %d\n", 1547 pr_warn("%s: LCDC registration failed: %d\n", __func__, ret);
1545 ret);
1546 1548
1547 ret = da8xx_register_rtc(); 1549 ret = da8xx_register_rtc();
1548 if (ret) 1550 if (ret)
1549 pr_warning("da850_evm_init: rtc setup failed: %d\n", ret); 1551 pr_warn("%s: RTC setup failed: %d\n", __func__, ret);
1550 1552
1551 ret = da850_evm_init_cpufreq(); 1553 ret = da850_evm_init_cpufreq();
1552 if (ret) 1554 if (ret)
1553 pr_warning("da850_evm_init: cpufreq registration failed: %d\n", 1555 pr_warn("%s: cpufreq registration failed: %d\n", __func__, ret);
1554 ret);
1555 1556
1556 ret = da8xx_register_cpuidle(); 1557 ret = da8xx_register_cpuidle();
1557 if (ret) 1558 if (ret)
1558 pr_warning("da850_evm_init: cpuidle registration failed: %d\n", 1559 pr_warn("%s: cpuidle registration failed: %d\n", __func__, ret);
1559 ret);
1560 1560
1561 ret = da850_register_pm(&da850_pm_device); 1561 ret = da850_register_pm(&da850_pm_device);
1562 if (ret) 1562 if (ret)
1563 pr_warning("da850_evm_init: suspend registration failed: %d\n", 1563 pr_warn("%s: suspend registration failed: %d\n", __func__, ret);
1564 ret);
1565 1564
1566 da850_vpif_init(); 1565 da850_vpif_init();
1567 1566
1568 ret = da8xx_register_spi(1, da850evm_spi_info, 1567 ret = spi_register_board_info(da850evm_spi_info,
1569 ARRAY_SIZE(da850evm_spi_info)); 1568 ARRAY_SIZE(da850evm_spi_info));
1570 if (ret) 1569 if (ret)
1571 pr_warning("da850_evm_init: spi 1 registration failed: %d\n", 1570 pr_warn("%s: spi info registration failed: %d\n", __func__,
1572 ret); 1571 ret);
1572
1573 ret = da8xx_register_spi_bus(1, ARRAY_SIZE(da850evm_spi_info));
1574 if (ret)
1575 pr_warn("%s: SPI 1 registration failed: %d\n", __func__, ret);
1573 1576
1574 ret = da850_register_sata(DA850EVM_SATA_REFCLKPN_RATE); 1577 ret = da850_register_sata(DA850EVM_SATA_REFCLKPN_RATE);
1575 if (ret) 1578 if (ret)
1576 pr_warning("da850_evm_init: sata registration failed: %d\n", 1579 pr_warn("%s: SATA registration failed: %d\n", __func__, ret);
1577 ret);
1578 1580
1579 da850_evm_setup_mac_addr(); 1581 da850_evm_setup_mac_addr();
1580} 1582}
@@ -1599,7 +1601,7 @@ MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138/AM18x EVM")
1599 .atag_offset = 0x100, 1601 .atag_offset = 0x100,
1600 .map_io = da850_evm_map_io, 1602 .map_io = da850_evm_map_io,
1601 .init_irq = cp_intc_init, 1603 .init_irq = cp_intc_init,
1602 .timer = &davinci_timer, 1604 .init_time = davinci_timer_init,
1603 .init_machine = da850_evm_init, 1605 .init_machine = da850_evm_init,
1604 .init_late = davinci_init_late, 1606 .init_late = davinci_init_late,
1605 .dma_zone_size = SZ_128M, 1607 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
index cdf8d0746e79..147b8e1a4407 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -355,7 +355,7 @@ MACHINE_START(DAVINCI_DM355_EVM, "DaVinci DM355 EVM")
355 .atag_offset = 0x100, 355 .atag_offset = 0x100,
356 .map_io = dm355_evm_map_io, 356 .map_io = dm355_evm_map_io,
357 .init_irq = davinci_irq_init, 357 .init_irq = davinci_irq_init,
358 .timer = &davinci_timer, 358 .init_time = davinci_timer_init,
359 .init_machine = dm355_evm_init, 359 .init_machine = dm355_evm_init,
360 .init_late = davinci_init_late, 360 .init_late = davinci_init_late,
361 .dma_zone_size = SZ_128M, 361 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c
index d41954507fc2..dff4ddc5ef81 100644
--- a/arch/arm/mach-davinci/board-dm355-leopard.c
+++ b/arch/arm/mach-davinci/board-dm355-leopard.c
@@ -274,7 +274,7 @@ MACHINE_START(DM355_LEOPARD, "DaVinci DM355 leopard")
274 .atag_offset = 0x100, 274 .atag_offset = 0x100,
275 .map_io = dm355_leopard_map_io, 275 .map_io = dm355_leopard_map_io,
276 .init_irq = davinci_irq_init, 276 .init_irq = davinci_irq_init,
277 .timer = &davinci_timer, 277 .init_time = davinci_timer_init,
278 .init_machine = dm355_leopard_init, 278 .init_machine = dm355_leopard_init,
279 .init_late = davinci_init_late, 279 .init_late = davinci_init_late,
280 .dma_zone_size = SZ_128M, 280 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index 5d49c75388ca..c2d4958a0cb6 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -616,7 +616,7 @@ MACHINE_START(DAVINCI_DM365_EVM, "DaVinci DM365 EVM")
616 .atag_offset = 0x100, 616 .atag_offset = 0x100,
617 .map_io = dm365_evm_map_io, 617 .map_io = dm365_evm_map_io,
618 .init_irq = davinci_irq_init, 618 .init_irq = davinci_irq_init,
619 .timer = &davinci_timer, 619 .init_time = davinci_timer_init,
620 .init_machine = dm365_evm_init, 620 .init_machine = dm365_evm_init,
621 .init_late = davinci_init_late, 621 .init_late = davinci_init_late,
622 .dma_zone_size = SZ_128M, 622 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index f5e018de7fa5..71735e7797cc 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -690,7 +690,7 @@ static struct vpbe_output dm644xevm_vpbe_outputs[] = {
690 .std = VENC_STD_ALL, 690 .std = VENC_STD_ALL,
691 .capabilities = V4L2_OUT_CAP_STD, 691 .capabilities = V4L2_OUT_CAP_STD,
692 }, 692 },
693 .subdev_name = VPBE_VENC_SUBDEV_NAME, 693 .subdev_name = DM644X_VPBE_VENC_SUBDEV_NAME,
694 .default_mode = "ntsc", 694 .default_mode = "ntsc",
695 .num_modes = ARRAY_SIZE(dm644xevm_enc_std_timing), 695 .num_modes = ARRAY_SIZE(dm644xevm_enc_std_timing),
696 .modes = dm644xevm_enc_std_timing, 696 .modes = dm644xevm_enc_std_timing,
@@ -702,7 +702,7 @@ static struct vpbe_output dm644xevm_vpbe_outputs[] = {
702 .type = V4L2_OUTPUT_TYPE_ANALOG, 702 .type = V4L2_OUTPUT_TYPE_ANALOG,
703 .capabilities = V4L2_OUT_CAP_DV_TIMINGS, 703 .capabilities = V4L2_OUT_CAP_DV_TIMINGS,
704 }, 704 },
705 .subdev_name = VPBE_VENC_SUBDEV_NAME, 705 .subdev_name = DM644X_VPBE_VENC_SUBDEV_NAME,
706 .default_mode = "480p59_94", 706 .default_mode = "480p59_94",
707 .num_modes = ARRAY_SIZE(dm644xevm_enc_preset_timing), 707 .num_modes = ARRAY_SIZE(dm644xevm_enc_preset_timing),
708 .modes = dm644xevm_enc_preset_timing, 708 .modes = dm644xevm_enc_preset_timing,
@@ -713,10 +713,10 @@ static struct vpbe_config dm644xevm_display_cfg = {
713 .module_name = "dm644x-vpbe-display", 713 .module_name = "dm644x-vpbe-display",
714 .i2c_adapter_id = 1, 714 .i2c_adapter_id = 1,
715 .osd = { 715 .osd = {
716 .module_name = VPBE_OSD_SUBDEV_NAME, 716 .module_name = DM644X_VPBE_OSD_SUBDEV_NAME,
717 }, 717 },
718 .venc = { 718 .venc = {
719 .module_name = VPBE_VENC_SUBDEV_NAME, 719 .module_name = DM644X_VPBE_VENC_SUBDEV_NAME,
720 }, 720 },
721 .num_outputs = ARRAY_SIZE(dm644xevm_vpbe_outputs), 721 .num_outputs = ARRAY_SIZE(dm644xevm_vpbe_outputs),
722 .outputs = dm644xevm_vpbe_outputs, 722 .outputs = dm644xevm_vpbe_outputs,
@@ -825,7 +825,7 @@ MACHINE_START(DAVINCI_EVM, "DaVinci DM644x EVM")
825 .atag_offset = 0x100, 825 .atag_offset = 0x100,
826 .map_io = davinci_evm_map_io, 826 .map_io = davinci_evm_map_io,
827 .init_irq = davinci_irq_init, 827 .init_irq = davinci_irq_init,
828 .timer = &davinci_timer, 828 .init_time = davinci_timer_init,
829 .init_machine = davinci_evm_init, 829 .init_machine = davinci_evm_init,
830 .init_late = davinci_init_late, 830 .init_late = davinci_init_late,
831 .dma_zone_size = SZ_128M, 831 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index 6e2f1631df5b..de7adff324dc 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -818,7 +818,7 @@ MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM")
818 .atag_offset = 0x100, 818 .atag_offset = 0x100,
819 .map_io = davinci_map_io, 819 .map_io = davinci_map_io,
820 .init_irq = davinci_irq_init, 820 .init_irq = davinci_irq_init,
821 .timer = &davinci_timer, 821 .init_time = davinci_timer_init,
822 .init_machine = evm_init, 822 .init_machine = evm_init,
823 .init_late = davinci_init_late, 823 .init_late = davinci_init_late,
824 .dma_zone_size = SZ_128M, 824 .dma_zone_size = SZ_128M,
@@ -829,7 +829,7 @@ MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM")
829 .atag_offset = 0x100, 829 .atag_offset = 0x100,
830 .map_io = davinci_map_io, 830 .map_io = davinci_map_io,
831 .init_irq = davinci_irq_init, 831 .init_irq = davinci_irq_init,
832 .timer = &davinci_timer, 832 .init_time = davinci_timer_init,
833 .init_machine = evm_init, 833 .init_machine = evm_init,
834 .init_late = davinci_init_late, 834 .init_late = davinci_init_late,
835 .dma_zone_size = SZ_128M, 835 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c
index 43e4a0d663fa..9549d53aa63f 100644
--- a/arch/arm/mach-davinci/board-mityomapl138.c
+++ b/arch/arm/mach-davinci/board-mityomapl138.c
@@ -529,8 +529,13 @@ static void __init mityomapl138_init(void)
529 529
530 mityomapl138_setup_nand(); 530 mityomapl138_setup_nand();
531 531
532 ret = da8xx_register_spi(1, mityomapl138_spi_flash_info, 532 ret = spi_register_board_info(mityomapl138_spi_flash_info,
533 ARRAY_SIZE(mityomapl138_spi_flash_info)); 533 ARRAY_SIZE(mityomapl138_spi_flash_info));
534 if (ret)
535 pr_warn("spi info registration failed: %d\n", ret);
536
537 ret = da8xx_register_spi_bus(1,
538 ARRAY_SIZE(mityomapl138_spi_flash_info));
534 if (ret) 539 if (ret)
535 pr_warning("spi 1 registration failed: %d\n", ret); 540 pr_warning("spi 1 registration failed: %d\n", ret);
536 541
@@ -570,7 +575,7 @@ MACHINE_START(MITYOMAPL138, "MityDSP-L138/MityARM-1808")
570 .atag_offset = 0x100, 575 .atag_offset = 0x100,
571 .map_io = mityomapl138_map_io, 576 .map_io = mityomapl138_map_io,
572 .init_irq = cp_intc_init, 577 .init_irq = cp_intc_init,
573 .timer = &davinci_timer, 578 .init_time = davinci_timer_init,
574 .init_machine = mityomapl138_init, 579 .init_machine = mityomapl138_init,
575 .init_late = davinci_init_late, 580 .init_late = davinci_init_late,
576 .dma_zone_size = SZ_128M, 581 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c
index 3e3e3afebf88..1c98107527fa 100644
--- a/arch/arm/mach-davinci/board-neuros-osd2.c
+++ b/arch/arm/mach-davinci/board-neuros-osd2.c
@@ -237,7 +237,7 @@ MACHINE_START(NEUROS_OSD2, "Neuros OSD2")
237 .atag_offset = 0x100, 237 .atag_offset = 0x100,
238 .map_io = davinci_ntosd2_map_io, 238 .map_io = davinci_ntosd2_map_io,
239 .init_irq = davinci_irq_init, 239 .init_irq = davinci_irq_init,
240 .timer = &davinci_timer, 240 .init_time = davinci_timer_init,
241 .init_machine = davinci_ntosd2_init, 241 .init_machine = davinci_ntosd2_init,
242 .init_late = davinci_init_late, 242 .init_late = davinci_init_late,
243 .dma_zone_size = SZ_128M, 243 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/board-omapl138-hawk.c b/arch/arm/mach-davinci/board-omapl138-hawk.c
index dc1208e9e664..5a2bd44da54d 100644
--- a/arch/arm/mach-davinci/board-omapl138-hawk.c
+++ b/arch/arm/mach-davinci/board-omapl138-hawk.c
@@ -48,8 +48,7 @@ static __init void omapl138_hawk_config_emac(void)
48 val &= ~BIT(8); 48 val &= ~BIT(8);
49 ret = davinci_cfg_reg_list(omapl138_hawk_mii_pins); 49 ret = davinci_cfg_reg_list(omapl138_hawk_mii_pins);
50 if (ret) { 50 if (ret) {
51 pr_warning("%s: cpgmac/mii mux setup failed: %d\n", 51 pr_warn("%s: CPGMAC/MII mux setup failed: %d\n", __func__, ret);
52 __func__, ret);
53 return; 52 return;
54 } 53 }
55 54
@@ -61,8 +60,7 @@ static __init void omapl138_hawk_config_emac(void)
61 60
62 ret = da8xx_register_emac(); 61 ret = da8xx_register_emac();
63 if (ret) 62 if (ret)
64 pr_warning("%s: emac registration failed: %d\n", 63 pr_warn("%s: EMAC registration failed: %d\n", __func__, ret);
65 __func__, ret);
66} 64}
67 65
68/* 66/*
@@ -147,15 +145,14 @@ static __init void omapl138_hawk_mmc_init(void)
147 145
148 ret = davinci_cfg_reg_list(hawk_mmcsd0_pins); 146 ret = davinci_cfg_reg_list(hawk_mmcsd0_pins);
149 if (ret) { 147 if (ret) {
150 pr_warning("%s: MMC/SD0 mux setup failed: %d\n", 148 pr_warn("%s: MMC/SD0 mux setup failed: %d\n", __func__, ret);
151 __func__, ret);
152 return; 149 return;
153 } 150 }
154 151
155 ret = gpio_request_one(DA850_HAWK_MMCSD_CD_PIN, 152 ret = gpio_request_one(DA850_HAWK_MMCSD_CD_PIN,
156 GPIOF_DIR_IN, "MMC CD"); 153 GPIOF_DIR_IN, "MMC CD");
157 if (ret < 0) { 154 if (ret < 0) {
158 pr_warning("%s: can not open GPIO %d\n", 155 pr_warn("%s: can not open GPIO %d\n",
159 __func__, DA850_HAWK_MMCSD_CD_PIN); 156 __func__, DA850_HAWK_MMCSD_CD_PIN);
160 return; 157 return;
161 } 158 }
@@ -163,15 +160,14 @@ static __init void omapl138_hawk_mmc_init(void)
163 ret = gpio_request_one(DA850_HAWK_MMCSD_WP_PIN, 160 ret = gpio_request_one(DA850_HAWK_MMCSD_WP_PIN,
164 GPIOF_DIR_IN, "MMC WP"); 161 GPIOF_DIR_IN, "MMC WP");
165 if (ret < 0) { 162 if (ret < 0) {
166 pr_warning("%s: can not open GPIO %d\n", 163 pr_warn("%s: can not open GPIO %d\n",
167 __func__, DA850_HAWK_MMCSD_WP_PIN); 164 __func__, DA850_HAWK_MMCSD_WP_PIN);
168 goto mmc_setup_wp_fail; 165 goto mmc_setup_wp_fail;
169 } 166 }
170 167
171 ret = da8xx_register_mmcsd0(&da850_mmc_config); 168 ret = da8xx_register_mmcsd0(&da850_mmc_config);
172 if (ret) { 169 if (ret) {
173 pr_warning("%s: MMC/SD0 registration failed: %d\n", 170 pr_warn("%s: MMC/SD0 registration failed: %d\n", __func__, ret);
174 __func__, ret);
175 goto mmc_setup_mmcsd_fail; 171 goto mmc_setup_mmcsd_fail;
176 } 172 }
177 173
@@ -250,8 +246,7 @@ static __init void omapl138_hawk_usb_init(void)
250 246
251 ret = davinci_cfg_reg_list(da850_hawk_usb11_pins); 247 ret = davinci_cfg_reg_list(da850_hawk_usb11_pins);
252 if (ret) { 248 if (ret) {
253 pr_warning("%s: USB 1.1 PinMux setup failed: %d\n", 249 pr_warn("%s: USB 1.1 PinMux setup failed: %d\n", __func__, ret);
254 __func__, ret);
255 return; 250 return;
256 } 251 }
257 252
@@ -280,8 +275,7 @@ static __init void omapl138_hawk_usb_init(void)
280 275
281 ret = da8xx_register_usb11(&omapl138_hawk_usb11_pdata); 276 ret = da8xx_register_usb11(&omapl138_hawk_usb11_pdata);
282 if (ret) { 277 if (ret) {
283 pr_warning("%s: USB 1.1 registration failed: %d\n", 278 pr_warn("%s: USB 1.1 registration failed: %d\n", __func__, ret);
284 __func__, ret);
285 goto usb11_setup_fail; 279 goto usb11_setup_fail;
286 } 280 }
287 281
@@ -307,8 +301,7 @@ static __init void omapl138_hawk_init(void)
307 301
308 ret = da850_register_edma(da850_edma_rsv); 302 ret = da850_register_edma(da850_edma_rsv);
309 if (ret) 303 if (ret)
310 pr_warning("%s: EDMA registration failed: %d\n", 304 pr_warn("%s: EDMA registration failed: %d\n", __func__, ret);
311 __func__, ret);
312 305
313 omapl138_hawk_mmc_init(); 306 omapl138_hawk_mmc_init();
314 307
@@ -316,9 +309,8 @@ static __init void omapl138_hawk_init(void)
316 309
317 ret = da8xx_register_watchdog(); 310 ret = da8xx_register_watchdog();
318 if (ret) 311 if (ret)
319 pr_warning("omapl138_hawk_init: " 312 pr_warn("%s: watchdog registration failed: %d\n",
320 "watchdog registration failed: %d\n", 313 __func__, ret);
321 ret);
322} 314}
323 315
324#ifdef CONFIG_SERIAL_8250_CONSOLE 316#ifdef CONFIG_SERIAL_8250_CONSOLE
@@ -341,7 +333,7 @@ MACHINE_START(OMAPL138_HAWKBOARD, "AM18x/OMAP-L138 Hawkboard")
341 .atag_offset = 0x100, 333 .atag_offset = 0x100,
342 .map_io = omapl138_hawk_map_io, 334 .map_io = omapl138_hawk_map_io,
343 .init_irq = cp_intc_init, 335 .init_irq = cp_intc_init,
344 .timer = &davinci_timer, 336 .init_time = davinci_timer_init,
345 .init_machine = omapl138_hawk_init, 337 .init_machine = omapl138_hawk_init,
346 .init_late = davinci_init_late, 338 .init_late = davinci_init_late,
347 .dma_zone_size = SZ_128M, 339 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c
index 6957787fa7f3..739be7e738fe 100644
--- a/arch/arm/mach-davinci/board-sffsdr.c
+++ b/arch/arm/mach-davinci/board-sffsdr.c
@@ -155,7 +155,7 @@ MACHINE_START(SFFSDR, "Lyrtech SFFSDR")
155 .atag_offset = 0x100, 155 .atag_offset = 0x100,
156 .map_io = davinci_sffsdr_map_io, 156 .map_io = davinci_sffsdr_map_io,
157 .init_irq = davinci_irq_init, 157 .init_irq = davinci_irq_init,
158 .timer = &davinci_timer, 158 .init_time = davinci_timer_init,
159 .init_machine = davinci_sffsdr_init, 159 .init_machine = davinci_sffsdr_init,
160 .init_late = davinci_init_late, 160 .init_late = davinci_init_late,
161 .dma_zone_size = SZ_128M, 161 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/board-tnetv107x-evm.c b/arch/arm/mach-davinci/board-tnetv107x-evm.c
index be3099733b1f..4f416023d4e2 100644
--- a/arch/arm/mach-davinci/board-tnetv107x-evm.c
+++ b/arch/arm/mach-davinci/board-tnetv107x-evm.c
@@ -280,7 +280,7 @@ MACHINE_START(TNETV107X, "TNETV107X EVM")
280 .atag_offset = 0x100, 280 .atag_offset = 0x100,
281 .map_io = tnetv107x_init, 281 .map_io = tnetv107x_init,
282 .init_irq = cp_intc_init, 282 .init_irq = cp_intc_init,
283 .timer = &davinci_timer, 283 .init_time = davinci_timer_init,
284 .init_machine = tnetv107x_evm_board_init, 284 .init_machine = tnetv107x_evm_board_init,
285 .init_late = davinci_init_late, 285 .init_late = davinci_init_late,
286 .dma_zone_size = SZ_128M, 286 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c
index 34668ead53c7..d458558ee84a 100644
--- a/arch/arm/mach-davinci/clock.c
+++ b/arch/arm/mach-davinci/clock.c
@@ -52,6 +52,40 @@ static void __clk_disable(struct clk *clk)
52 __clk_disable(clk->parent); 52 __clk_disable(clk->parent);
53} 53}
54 54
55int davinci_clk_reset(struct clk *clk, bool reset)
56{
57 unsigned long flags;
58
59 if (clk == NULL || IS_ERR(clk))
60 return -EINVAL;
61
62 spin_lock_irqsave(&clockfw_lock, flags);
63 if (clk->flags & CLK_PSC)
64 davinci_psc_reset(clk->gpsc, clk->lpsc, reset);
65 spin_unlock_irqrestore(&clockfw_lock, flags);
66
67 return 0;
68}
69EXPORT_SYMBOL(davinci_clk_reset);
70
71int davinci_clk_reset_assert(struct clk *clk)
72{
73 if (clk == NULL || IS_ERR(clk) || !clk->reset)
74 return -EINVAL;
75
76 return clk->reset(clk, true);
77}
78EXPORT_SYMBOL(davinci_clk_reset_assert);
79
80int davinci_clk_reset_deassert(struct clk *clk)
81{
82 if (clk == NULL || IS_ERR(clk) || !clk->reset)
83 return -EINVAL;
84
85 return clk->reset(clk, false);
86}
87EXPORT_SYMBOL(davinci_clk_reset_deassert);
88
55int clk_enable(struct clk *clk) 89int clk_enable(struct clk *clk)
56{ 90{
57 unsigned long flags; 91 unsigned long flags;
@@ -535,7 +569,7 @@ int davinci_set_refclk_rate(unsigned long rate)
535} 569}
536 570
537int __init davinci_clk_init(struct clk_lookup *clocks) 571int __init davinci_clk_init(struct clk_lookup *clocks)
538 { 572{
539 struct clk_lookup *c; 573 struct clk_lookup *c;
540 struct clk *clk; 574 struct clk *clk;
541 size_t num_clocks = 0; 575 size_t num_clocks = 0;
@@ -576,6 +610,9 @@ int __init davinci_clk_init(struct clk_lookup *clocks)
576 if (clk->lpsc) 610 if (clk->lpsc)
577 clk->flags |= CLK_PSC; 611 clk->flags |= CLK_PSC;
578 612
613 if (clk->flags & PSC_LRST)
614 clk->reset = davinci_clk_reset;
615
579 clk_register(clk); 616 clk_register(clk);
580 num_clocks++; 617 num_clocks++;
581 618
diff --git a/arch/arm/mach-davinci/clock.h b/arch/arm/mach-davinci/clock.h
index 46f0f1bf1a4c..8694b395fc92 100644
--- a/arch/arm/mach-davinci/clock.h
+++ b/arch/arm/mach-davinci/clock.h
@@ -103,6 +103,7 @@ struct clk {
103 unsigned long (*recalc) (struct clk *); 103 unsigned long (*recalc) (struct clk *);
104 int (*set_rate) (struct clk *clk, unsigned long rate); 104 int (*set_rate) (struct clk *clk, unsigned long rate);
105 int (*round_rate) (struct clk *clk, unsigned long rate); 105 int (*round_rate) (struct clk *clk, unsigned long rate);
106 int (*reset) (struct clk *clk, bool reset);
106}; 107};
107 108
108/* Clock flags: SoC-specific flags start at BIT(16) */ 109/* Clock flags: SoC-specific flags start at BIT(16) */
@@ -112,6 +113,7 @@ struct clk {
112#define PRE_PLL BIT(4) /* source is before PLL mult/div */ 113#define PRE_PLL BIT(4) /* source is before PLL mult/div */
113#define PSC_SWRSTDISABLE BIT(5) /* Disable state is SwRstDisable */ 114#define PSC_SWRSTDISABLE BIT(5) /* Disable state is SwRstDisable */
114#define PSC_FORCE BIT(6) /* Force module state transtition */ 115#define PSC_FORCE BIT(6) /* Force module state transtition */
116#define PSC_LRST BIT(8) /* Use local reset on enable/disable */
115 117
116#define CLK(dev, con, ck) \ 118#define CLK(dev, con, ck) \
117 { \ 119 { \
@@ -126,6 +128,7 @@ int davinci_set_pllrate(struct pll_data *pll, unsigned int prediv,
126int davinci_set_sysclk_rate(struct clk *clk, unsigned long rate); 128int davinci_set_sysclk_rate(struct clk *clk, unsigned long rate);
127int davinci_set_refclk_rate(unsigned long rate); 129int davinci_set_refclk_rate(unsigned long rate);
128int davinci_simple_set_rate(struct clk *clk, unsigned long rate); 130int davinci_simple_set_rate(struct clk *clk, unsigned long rate);
131int davinci_clk_reset(struct clk *clk, bool reset);
129 132
130extern struct platform_device davinci_wdt_device; 133extern struct platform_device davinci_wdt_device;
131extern void davinci_watchdog_reset(struct platform_device *); 134extern void davinci_watchdog_reset(struct platform_device *);
diff --git a/arch/arm/mach-davinci/cpuidle.c b/arch/arm/mach-davinci/cpuidle.c
index 9107691adbdb..5ac9e9384b15 100644
--- a/arch/arm/mach-davinci/cpuidle.c
+++ b/arch/arm/mach-davinci/cpuidle.c
@@ -25,35 +25,44 @@
25 25
26#define DAVINCI_CPUIDLE_MAX_STATES 2 26#define DAVINCI_CPUIDLE_MAX_STATES 2
27 27
28struct davinci_ops { 28static DEFINE_PER_CPU(struct cpuidle_device, davinci_cpuidle_device);
29 void (*enter) (u32 flags); 29static void __iomem *ddr2_reg_base;
30 void (*exit) (u32 flags); 30static bool ddr2_pdown;
31 u32 flags; 31
32}; 32static void davinci_save_ddr_power(int enter, bool pdown)
33{
34 u32 val;
35
36 val = __raw_readl(ddr2_reg_base + DDR2_SDRCR_OFFSET);
37
38 if (enter) {
39 if (pdown)
40 val |= DDR2_SRPD_BIT;
41 else
42 val &= ~DDR2_SRPD_BIT;
43 val |= DDR2_LPMODEN_BIT;
44 } else {
45 val &= ~(DDR2_SRPD_BIT | DDR2_LPMODEN_BIT);
46 }
47
48 __raw_writel(val, ddr2_reg_base + DDR2_SDRCR_OFFSET);
49}
33 50
34/* Actual code that puts the SoC in different idle states */ 51/* Actual code that puts the SoC in different idle states */
35static int davinci_enter_idle(struct cpuidle_device *dev, 52static int davinci_enter_idle(struct cpuidle_device *dev,
36 struct cpuidle_driver *drv, 53 struct cpuidle_driver *drv,
37 int index) 54 int index)
38{ 55{
39 struct cpuidle_state_usage *state_usage = &dev->states_usage[index]; 56 davinci_save_ddr_power(1, ddr2_pdown);
40 struct davinci_ops *ops = cpuidle_get_statedata(state_usage);
41
42 if (ops && ops->enter)
43 ops->enter(ops->flags);
44 57
45 index = cpuidle_wrap_enter(dev, drv, index, 58 index = cpuidle_wrap_enter(dev, drv, index,
46 arm_cpuidle_simple_enter); 59 arm_cpuidle_simple_enter);
47 60
48 if (ops && ops->exit) 61 davinci_save_ddr_power(0, ddr2_pdown);
49 ops->exit(ops->flags);
50 62
51 return index; 63 return index;
52} 64}
53 65
54/* fields in davinci_ops.flags */
55#define DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN BIT(0)
56
57static struct cpuidle_driver davinci_idle_driver = { 66static struct cpuidle_driver davinci_idle_driver = {
58 .name = "cpuidle-davinci", 67 .name = "cpuidle-davinci",
59 .owner = THIS_MODULE, 68 .owner = THIS_MODULE,
@@ -70,45 +79,6 @@ static struct cpuidle_driver davinci_idle_driver = {
70 .state_count = DAVINCI_CPUIDLE_MAX_STATES, 79 .state_count = DAVINCI_CPUIDLE_MAX_STATES,
71}; 80};
72 81
73static DEFINE_PER_CPU(struct cpuidle_device, davinci_cpuidle_device);
74static void __iomem *ddr2_reg_base;
75
76static void davinci_save_ddr_power(int enter, bool pdown)
77{
78 u32 val;
79
80 val = __raw_readl(ddr2_reg_base + DDR2_SDRCR_OFFSET);
81
82 if (enter) {
83 if (pdown)
84 val |= DDR2_SRPD_BIT;
85 else
86 val &= ~DDR2_SRPD_BIT;
87 val |= DDR2_LPMODEN_BIT;
88 } else {
89 val &= ~(DDR2_SRPD_BIT | DDR2_LPMODEN_BIT);
90 }
91
92 __raw_writel(val, ddr2_reg_base + DDR2_SDRCR_OFFSET);
93}
94
95static void davinci_c2state_enter(u32 flags)
96{
97 davinci_save_ddr_power(1, !!(flags & DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN));
98}
99
100static void davinci_c2state_exit(u32 flags)
101{
102 davinci_save_ddr_power(0, !!(flags & DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN));
103}
104
105static struct davinci_ops davinci_states[DAVINCI_CPUIDLE_MAX_STATES] = {
106 [1] = {
107 .enter = davinci_c2state_enter,
108 .exit = davinci_c2state_exit,
109 },
110};
111
112static int __init davinci_cpuidle_probe(struct platform_device *pdev) 82static int __init davinci_cpuidle_probe(struct platform_device *pdev)
113{ 83{
114 int ret; 84 int ret;
@@ -124,11 +94,7 @@ static int __init davinci_cpuidle_probe(struct platform_device *pdev)
124 94
125 ddr2_reg_base = pdata->ddr2_ctlr_base; 95 ddr2_reg_base = pdata->ddr2_ctlr_base;
126 96
127 if (pdata->ddr2_pdown) 97 ddr2_pdown = pdata->ddr2_pdown;
128 davinci_states[1].flags |= DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN;
129 cpuidle_set_statedata(&device->states_usage[1], &davinci_states[1]);
130
131 device->state_count = DAVINCI_CPUIDLE_MAX_STATES;
132 98
133 ret = cpuidle_register_driver(&davinci_idle_driver); 99 ret = cpuidle_register_driver(&davinci_idle_driver);
134 if (ret) { 100 if (ret) {
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index 6b9154e9f908..0c4a26ddebba 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -76,6 +76,13 @@ static struct clk pll0_aux_clk = {
76 .flags = CLK_PLL | PRE_PLL, 76 .flags = CLK_PLL | PRE_PLL,
77}; 77};
78 78
79static struct clk pll0_sysclk1 = {
80 .name = "pll0_sysclk1",
81 .parent = &pll0_clk,
82 .flags = CLK_PLL,
83 .div_reg = PLLDIV1,
84};
85
79static struct clk pll0_sysclk2 = { 86static struct clk pll0_sysclk2 = {
80 .name = "pll0_sysclk2", 87 .name = "pll0_sysclk2",
81 .parent = &pll0_clk, 88 .parent = &pll0_clk,
@@ -368,10 +375,19 @@ static struct clk sata_clk = {
368 .flags = PSC_FORCE, 375 .flags = PSC_FORCE,
369}; 376};
370 377
378static struct clk dsp_clk = {
379 .name = "dsp",
380 .parent = &pll0_sysclk1,
381 .domain = DAVINCI_GPSC_DSPDOMAIN,
382 .lpsc = DA8XX_LPSC0_GEM,
383 .flags = PSC_LRST | PSC_FORCE,
384};
385
371static struct clk_lookup da850_clks[] = { 386static struct clk_lookup da850_clks[] = {
372 CLK(NULL, "ref", &ref_clk), 387 CLK(NULL, "ref", &ref_clk),
373 CLK(NULL, "pll0", &pll0_clk), 388 CLK(NULL, "pll0", &pll0_clk),
374 CLK(NULL, "pll0_aux", &pll0_aux_clk), 389 CLK(NULL, "pll0_aux", &pll0_aux_clk),
390 CLK(NULL, "pll0_sysclk1", &pll0_sysclk1),
375 CLK(NULL, "pll0_sysclk2", &pll0_sysclk2), 391 CLK(NULL, "pll0_sysclk2", &pll0_sysclk2),
376 CLK(NULL, "pll0_sysclk3", &pll0_sysclk3), 392 CLK(NULL, "pll0_sysclk3", &pll0_sysclk3),
377 CLK(NULL, "pll0_sysclk4", &pll0_sysclk4), 393 CLK(NULL, "pll0_sysclk4", &pll0_sysclk4),
@@ -413,6 +429,7 @@ static struct clk_lookup da850_clks[] = {
413 CLK("spi_davinci.1", NULL, &spi1_clk), 429 CLK("spi_davinci.1", NULL, &spi1_clk),
414 CLK("vpif", NULL, &vpif_clk), 430 CLK("vpif", NULL, &vpif_clk),
415 CLK("ahci", NULL, &sata_clk), 431 CLK("ahci", NULL, &sata_clk),
432 CLK("davinci-rproc.0", NULL, &dsp_clk),
416 CLK(NULL, NULL, NULL), 433 CLK(NULL, NULL, NULL),
417}; 434};
418 435
diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
index 37c27af18fa0..6b7a0a27fbd1 100644
--- a/arch/arm/mach-davinci/da8xx-dt.c
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -37,11 +37,18 @@ static void __init da8xx_init_irq(void)
37 of_irq_init(da8xx_irq_match); 37 of_irq_init(da8xx_irq_match);
38} 38}
39 39
40struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
41 OF_DEV_AUXDATA("ti,davinci-i2c", 0x01c22000, "i2c_davinci.1", NULL),
42 OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "watchdog", NULL),
43 {}
44};
45
40#ifdef CONFIG_ARCH_DAVINCI_DA850 46#ifdef CONFIG_ARCH_DAVINCI_DA850
41 47
42static void __init da850_init_machine(void) 48static void __init da850_init_machine(void)
43{ 49{
44 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 50 of_platform_populate(NULL, of_default_bus_match_table,
51 da850_auxdata_lookup, NULL);
45 52
46 da8xx_uart_clk_enable(); 53 da8xx_uart_clk_enable();
47} 54}
@@ -56,7 +63,7 @@ static const char *da850_boards_compat[] __initdata = {
56DT_MACHINE_START(DA850_DT, "Generic DA850/OMAP-L138/AM18x") 63DT_MACHINE_START(DA850_DT, "Generic DA850/OMAP-L138/AM18x")
57 .map_io = da850_init, 64 .map_io = da850_init,
58 .init_irq = da8xx_init_irq, 65 .init_irq = da8xx_init_irq,
59 .timer = &davinci_timer, 66 .init_time = davinci_timer_init,
60 .init_machine = da850_init_machine, 67 .init_machine = da850_init_machine,
61 .dt_compat = da850_boards_compat, 68 .dt_compat = da850_boards_compat,
62 .init_late = davinci_init_late, 69 .init_late = davinci_init_late,
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index 2d5502d84a22..fc50243b1481 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -359,7 +359,7 @@ static struct resource da8xx_watchdog_resources[] = {
359 }, 359 },
360}; 360};
361 361
362struct platform_device da8xx_wdt_device = { 362static struct platform_device da8xx_wdt_device = {
363 .name = "watchdog", 363 .name = "watchdog",
364 .id = -1, 364 .id = -1,
365 .num_resources = ARRAY_SIZE(da8xx_watchdog_resources), 365 .num_resources = ARRAY_SIZE(da8xx_watchdog_resources),
@@ -368,7 +368,15 @@ struct platform_device da8xx_wdt_device = {
368 368
369void da8xx_restart(char mode, const char *cmd) 369void da8xx_restart(char mode, const char *cmd)
370{ 370{
371 davinci_watchdog_reset(&da8xx_wdt_device); 371 struct device *dev;
372
373 dev = bus_find_device_by_name(&platform_bus_type, NULL, "watchdog");
374 if (!dev) {
375 pr_err("%s: failed to find watchdog device\n", __func__);
376 return;
377 }
378
379 davinci_watchdog_reset(to_platform_device(dev));
372} 380}
373 381
374int __init da8xx_register_watchdog(void) 382int __init da8xx_register_watchdog(void)
@@ -751,7 +759,7 @@ void __iomem * __init da8xx_get_mem_ctlr(void)
751 759
752 da8xx_ddr2_ctlr_base = ioremap(DA8XX_DDR2_CTL_BASE, SZ_32K); 760 da8xx_ddr2_ctlr_base = ioremap(DA8XX_DDR2_CTL_BASE, SZ_32K);
753 if (!da8xx_ddr2_ctlr_base) 761 if (!da8xx_ddr2_ctlr_base)
754 pr_warning("%s: Unable to map DDR2 controller", __func__); 762 pr_warn("%s: Unable to map DDR2 controller", __func__);
755 763
756 return da8xx_ddr2_ctlr_base; 764 return da8xx_ddr2_ctlr_base;
757} 765}
@@ -832,7 +840,7 @@ static struct resource da8xx_spi1_resources[] = {
832 }, 840 },
833}; 841};
834 842
835struct davinci_spi_platform_data da8xx_spi_pdata[] = { 843static struct davinci_spi_platform_data da8xx_spi_pdata[] = {
836 [0] = { 844 [0] = {
837 .version = SPI_VERSION_2, 845 .version = SPI_VERSION_2,
838 .intr_line = 1, 846 .intr_line = 1,
@@ -866,20 +874,12 @@ static struct platform_device da8xx_spi_device[] = {
866 }, 874 },
867}; 875};
868 876
869int __init da8xx_register_spi(int instance, const struct spi_board_info *info, 877int __init da8xx_register_spi_bus(int instance, unsigned num_chipselect)
870 unsigned len)
871{ 878{
872 int ret;
873
874 if (instance < 0 || instance > 1) 879 if (instance < 0 || instance > 1)
875 return -EINVAL; 880 return -EINVAL;
876 881
877 ret = spi_register_board_info(info, len); 882 da8xx_spi_pdata[instance].num_chipselect = num_chipselect;
878 if (ret)
879 pr_warning("%s: failed to register board info for spi %d :"
880 " %d\n", __func__, instance, ret);
881
882 da8xx_spi_pdata[instance].num_chipselect = len;
883 883
884 if (instance == 1 && cpu_is_davinci_da850()) { 884 if (instance == 1 && cpu_is_davinci_da850()) {
885 da8xx_spi1_resources[0].start = DA850_SPI1_BASE; 885 da8xx_spi1_resources[0].start = DA850_SPI1_BASE;
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index 11c79a3362ef..db1dd92e00af 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -669,19 +669,14 @@ static struct resource dm644x_osd_resources[] = {
669 }, 669 },
670}; 670};
671 671
672static struct osd_platform_data dm644x_osd_data = {
673 .vpbe_type = VPBE_VERSION_1,
674};
675
676static struct platform_device dm644x_osd_dev = { 672static struct platform_device dm644x_osd_dev = {
677 .name = VPBE_OSD_SUBDEV_NAME, 673 .name = DM644X_VPBE_OSD_SUBDEV_NAME,
678 .id = -1, 674 .id = -1,
679 .num_resources = ARRAY_SIZE(dm644x_osd_resources), 675 .num_resources = ARRAY_SIZE(dm644x_osd_resources),
680 .resource = dm644x_osd_resources, 676 .resource = dm644x_osd_resources,
681 .dev = { 677 .dev = {
682 .dma_mask = &dm644x_video_dma_mask, 678 .dma_mask = &dm644x_video_dma_mask,
683 .coherent_dma_mask = DMA_BIT_MASK(32), 679 .coherent_dma_mask = DMA_BIT_MASK(32),
684 .platform_data = &dm644x_osd_data,
685 }, 680 },
686}; 681};
687 682
@@ -751,12 +746,11 @@ static struct platform_device dm644x_vpbe_display = {
751}; 746};
752 747
753static struct venc_platform_data dm644x_venc_pdata = { 748static struct venc_platform_data dm644x_venc_pdata = {
754 .venc_type = VPBE_VERSION_1,
755 .setup_clock = dm644x_venc_setup_clock, 749 .setup_clock = dm644x_venc_setup_clock,
756}; 750};
757 751
758static struct platform_device dm644x_venc_dev = { 752static struct platform_device dm644x_venc_dev = {
759 .name = VPBE_VENC_SUBDEV_NAME, 753 .name = DM644X_VPBE_VENC_SUBDEV_NAME,
760 .id = -1, 754 .id = -1,
761 .num_resources = ARRAY_SIZE(dm644x_venc_resources), 755 .num_resources = ARRAY_SIZE(dm644x_venc_resources),
762 .resource = dm644x_venc_resources, 756 .resource = dm644x_venc_resources,
diff --git a/arch/arm/mach-davinci/include/mach/clock.h b/arch/arm/mach-davinci/include/mach/clock.h
index a3b040219876..3e8af6a0b64c 100644
--- a/arch/arm/mach-davinci/include/mach/clock.h
+++ b/arch/arm/mach-davinci/include/mach/clock.h
@@ -18,4 +18,7 @@ struct clk;
18extern int clk_register(struct clk *clk); 18extern int clk_register(struct clk *clk);
19extern void clk_unregister(struct clk *clk); 19extern void clk_unregister(struct clk *clk);
20 20
21int davinci_clk_reset_assert(struct clk *c);
22int davinci_clk_reset_deassert(struct clk *c);
23
21#endif 24#endif
diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h
index 046c7238a3d6..b124b77c90c5 100644
--- a/arch/arm/mach-davinci/include/mach/common.h
+++ b/arch/arm/mach-davinci/include/mach/common.h
@@ -15,9 +15,7 @@
15#include <linux/compiler.h> 15#include <linux/compiler.h>
16#include <linux/types.h> 16#include <linux/types.h>
17 17
18struct sys_timer; 18extern void davinci_timer_init(void);
19
20extern struct sys_timer davinci_timer;
21 19
22extern void davinci_irq_init(void); 20extern void davinci_irq_init(void);
23extern void __iomem *davinci_intc_base; 21extern void __iomem *davinci_intc_base;
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h
index 700d311c6854..de439b7b9af1 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -82,8 +82,7 @@ void __init da850_init(void);
82int da830_register_edma(struct edma_rsv_info *rsv); 82int da830_register_edma(struct edma_rsv_info *rsv);
83int da850_register_edma(struct edma_rsv_info *rsv[2]); 83int da850_register_edma(struct edma_rsv_info *rsv[2]);
84int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata); 84int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata);
85int da8xx_register_spi(int instance, 85int da8xx_register_spi_bus(int instance, unsigned num_chipselect);
86 const struct spi_board_info *info, unsigned len);
87int da8xx_register_watchdog(void); 86int da8xx_register_watchdog(void);
88int da8xx_register_usb20(unsigned mA, unsigned potpgt); 87int da8xx_register_usb20(unsigned mA, unsigned potpgt);
89int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata); 88int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata);
@@ -110,9 +109,7 @@ extern struct platform_device da8xx_serial_device;
110extern struct emac_platform_data da8xx_emac_pdata; 109extern struct emac_platform_data da8xx_emac_pdata;
111extern struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata; 110extern struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata;
112extern struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata; 111extern struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata;
113extern struct davinci_spi_platform_data da8xx_spi_pdata[];
114 112
115extern struct platform_device da8xx_wdt_device;
116 113
117extern const short da830_emif25_pins[]; 114extern const short da830_emif25_pins[];
118extern const short da830_spi0_pins[]; 115extern const short da830_spi0_pins[];
diff --git a/arch/arm/mach-davinci/include/mach/psc.h b/arch/arm/mach-davinci/include/mach/psc.h
index 40a0027838e8..0a22710493fd 100644
--- a/arch/arm/mach-davinci/include/mach/psc.h
+++ b/arch/arm/mach-davinci/include/mach/psc.h
@@ -246,6 +246,7 @@
246 246
247#define MDSTAT_STATE_MASK 0x3f 247#define MDSTAT_STATE_MASK 0x3f
248#define PDSTAT_STATE_MASK 0x1f 248#define PDSTAT_STATE_MASK 0x1f
249#define MDCTL_LRST BIT(8)
249#define MDCTL_FORCE BIT(31) 250#define MDCTL_FORCE BIT(31)
250#define PDCTL_NEXT BIT(0) 251#define PDCTL_NEXT BIT(0)
251#define PDCTL_EPCGOOD BIT(8) 252#define PDCTL_EPCGOOD BIT(8)
@@ -253,6 +254,8 @@
253#ifndef __ASSEMBLER__ 254#ifndef __ASSEMBLER__
254 255
255extern int davinci_psc_is_clk_active(unsigned int ctlr, unsigned int id); 256extern int davinci_psc_is_clk_active(unsigned int ctlr, unsigned int id);
257extern void davinci_psc_reset(unsigned int ctlr, unsigned int id,
258 bool reset);
256extern void davinci_psc_config(unsigned int domain, unsigned int ctlr, 259extern void davinci_psc_config(unsigned int domain, unsigned int ctlr,
257 unsigned int id, bool enable, u32 flags); 260 unsigned int id, bool enable, u32 flags);
258 261
diff --git a/arch/arm/mach-davinci/include/mach/uncompress.h b/arch/arm/mach-davinci/include/mach/uncompress.h
index 3a0ff905a69b..f49c2916aa3a 100644
--- a/arch/arm/mach-davinci/include/mach/uncompress.h
+++ b/arch/arm/mach-davinci/include/mach/uncompress.h
@@ -101,4 +101,3 @@ static inline void __arch_decomp_setup(unsigned long arch_id)
101} 101}
102 102
103#define arch_decomp_setup() __arch_decomp_setup(arch_id) 103#define arch_decomp_setup() __arch_decomp_setup(arch_id)
104#define arch_decomp_wdog()
diff --git a/arch/arm/mach-davinci/psc.c b/arch/arm/mach-davinci/psc.c
index d7e210f4b55c..82fdc69d5728 100644
--- a/arch/arm/mach-davinci/psc.c
+++ b/arch/arm/mach-davinci/psc.c
@@ -35,7 +35,7 @@ int __init davinci_psc_is_clk_active(unsigned int ctlr, unsigned int id)
35 struct davinci_soc_info *soc_info = &davinci_soc_info; 35 struct davinci_soc_info *soc_info = &davinci_soc_info;
36 36
37 if (!soc_info->psc_bases || (ctlr >= soc_info->psc_bases_num)) { 37 if (!soc_info->psc_bases || (ctlr >= soc_info->psc_bases_num)) {
38 pr_warning("PSC: Bad psc data: 0x%x[%d]\n", 38 pr_warn("PSC: Bad psc data: 0x%x[%d]\n",
39 (int)soc_info->psc_bases, ctlr); 39 (int)soc_info->psc_bases, ctlr);
40 return 0; 40 return 0;
41 } 41 }
@@ -48,6 +48,31 @@ int __init davinci_psc_is_clk_active(unsigned int ctlr, unsigned int id)
48 return mdstat & BIT(12); 48 return mdstat & BIT(12);
49} 49}
50 50
51/* Control "reset" line associated with PSC domain */
52void davinci_psc_reset(unsigned int ctlr, unsigned int id, bool reset)
53{
54 u32 mdctl;
55 void __iomem *psc_base;
56 struct davinci_soc_info *soc_info = &davinci_soc_info;
57
58 if (!soc_info->psc_bases || (ctlr >= soc_info->psc_bases_num)) {
59 pr_warn("PSC: Bad psc data: 0x%x[%d]\n",
60 (int)soc_info->psc_bases, ctlr);
61 return;
62 }
63
64 psc_base = ioremap(soc_info->psc_bases[ctlr], SZ_4K);
65
66 mdctl = readl(psc_base + MDCTL + 4 * id);
67 if (reset)
68 mdctl &= ~MDCTL_LRST;
69 else
70 mdctl |= MDCTL_LRST;
71 writel(mdctl, psc_base + MDCTL + 4 * id);
72
73 iounmap(psc_base);
74}
75
51/* Enable or disable a PSC domain */ 76/* Enable or disable a PSC domain */
52void davinci_psc_config(unsigned int domain, unsigned int ctlr, 77void davinci_psc_config(unsigned int domain, unsigned int ctlr,
53 unsigned int id, bool enable, u32 flags) 78 unsigned int id, bool enable, u32 flags)
@@ -58,7 +83,7 @@ void davinci_psc_config(unsigned int domain, unsigned int ctlr,
58 u32 next_state = PSC_STATE_ENABLE; 83 u32 next_state = PSC_STATE_ENABLE;
59 84
60 if (!soc_info->psc_bases || (ctlr >= soc_info->psc_bases_num)) { 85 if (!soc_info->psc_bases || (ctlr >= soc_info->psc_bases_num)) {
61 pr_warning("PSC: Bad psc data: 0x%x[%d]\n", 86 pr_warn("PSC: Bad psc data: 0x%x[%d]\n",
62 (int)soc_info->psc_bases, ctlr); 87 (int)soc_info->psc_bases, ctlr);
63 return; 88 return;
64 } 89 }
diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c
index 9847938785ca..bad361ec1666 100644
--- a/arch/arm/mach-davinci/time.c
+++ b/arch/arm/mach-davinci/time.c
@@ -337,7 +337,7 @@ static struct clock_event_device clockevent_davinci = {
337}; 337};
338 338
339 339
340static void __init davinci_timer_init(void) 340void __init davinci_timer_init(void)
341{ 341{
342 struct clk *timer_clk; 342 struct clk *timer_clk;
343 struct davinci_soc_info *soc_info = &davinci_soc_info; 343 struct davinci_soc_info *soc_info = &davinci_soc_info;
@@ -410,11 +410,6 @@ static void __init davinci_timer_init(void)
410 timer32_config(&timers[i]); 410 timer32_config(&timers[i]);
411} 411}
412 412
413struct sys_timer davinci_timer = {
414 .init = davinci_timer_init,
415};
416
417
418/* reset board using watchdog timer */ 413/* reset board using watchdog timer */
419void davinci_watchdog_reset(struct platform_device *pdev) 414void davinci_watchdog_reset(struct platform_device *pdev)
420{ 415{
diff --git a/arch/arm/mach-dove/Kconfig b/arch/arm/mach-dove/Kconfig
index 603c5fd99e8a..36469d813951 100644
--- a/arch/arm/mach-dove/Kconfig
+++ b/arch/arm/mach-dove/Kconfig
@@ -2,8 +2,12 @@ if ARCH_DOVE
2 2
3menu "Marvell Dove Implementations" 3menu "Marvell Dove Implementations"
4 4
5config DOVE_LEGACY
6 bool
7
5config MACH_DOVE_DB 8config MACH_DOVE_DB
6 bool "Marvell DB-MV88AP510 Development Board" 9 bool "Marvell DB-MV88AP510 Development Board"
10 select DOVE_LEGACY
7 select I2C_BOARDINFO 11 select I2C_BOARDINFO
8 help 12 help
9 Say 'Y' here if you want your kernel to support the 13 Say 'Y' here if you want your kernel to support the
@@ -11,6 +15,7 @@ config MACH_DOVE_DB
11 15
12config MACH_CM_A510 16config MACH_CM_A510
13 bool "CompuLab CM-A510 Board" 17 bool "CompuLab CM-A510 Board"
18 select DOVE_LEGACY
14 help 19 help
15 Say 'Y' here if you want your kernel to support the 20 Say 'Y' here if you want your kernel to support the
16 CompuLab CM-A510 Board. 21 CompuLab CM-A510 Board.
@@ -19,6 +24,8 @@ config MACH_DOVE_DT
19 bool "Marvell Dove Flattened Device Tree" 24 bool "Marvell Dove Flattened Device Tree"
20 select MVEBU_CLK_CORE 25 select MVEBU_CLK_CORE
21 select MVEBU_CLK_GATING 26 select MVEBU_CLK_GATING
27 select REGULATOR
28 select REGULATOR_FIXED_VOLTAGE
22 select USE_OF 29 select USE_OF
23 help 30 help
24 Say 'Y' here if you want your kernel to support the 31 Say 'Y' here if you want your kernel to support the
diff --git a/arch/arm/mach-dove/Makefile b/arch/arm/mach-dove/Makefile
index 5e683baf96cf..3f0a858fb597 100644
--- a/arch/arm/mach-dove/Makefile
+++ b/arch/arm/mach-dove/Makefile
@@ -1,4 +1,6 @@
1obj-y += common.o addr-map.o irq.o mpp.o 1obj-y += common.o addr-map.o irq.o
2obj-$(CONFIG_DOVE_LEGACY) += mpp.o
2obj-$(CONFIG_PCI) += pcie.o 3obj-$(CONFIG_PCI) += pcie.o
3obj-$(CONFIG_MACH_DOVE_DB) += dove-db-setup.o 4obj-$(CONFIG_MACH_DOVE_DB) += dove-db-setup.o
5obj-$(CONFIG_MACH_DOVE_DT) += board-dt.o
4obj-$(CONFIG_MACH_CM_A510) += cm-a510.o 6obj-$(CONFIG_MACH_CM_A510) += cm-a510.o
diff --git a/arch/arm/mach-dove/board-dt.c b/arch/arm/mach-dove/board-dt.c
new file mode 100644
index 000000000000..fbde1dd67113
--- /dev/null
+++ b/arch/arm/mach-dove/board-dt.c
@@ -0,0 +1,92 @@
1/*
2 * arch/arm/mach-dove/board-dt.c
3 *
4 * Marvell Dove 88AP510 System On Chip FDT Board
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#include <linux/init.h>
12#include <linux/clk-provider.h>
13#include <linux/clk/mvebu.h>
14#include <linux/of.h>
15#include <linux/of_platform.h>
16#include <linux/platform_data/usb-ehci-orion.h>
17#include <asm/hardware/cache-tauros2.h>
18#include <asm/mach/arch.h>
19#include <mach/pm.h>
20#include <plat/common.h>
21#include <plat/irq.h>
22#include "common.h"
23
24/*
25 * There are still devices that doesn't even know about DT,
26 * get clock gates here and add a clock lookup.
27 */
28static void __init dove_legacy_clk_init(void)
29{
30 struct device_node *np = of_find_compatible_node(NULL, NULL,
31 "marvell,dove-gating-clock");
32 struct of_phandle_args clkspec;
33
34 clkspec.np = np;
35 clkspec.args_count = 1;
36
37 clkspec.args[0] = CLOCK_GATING_BIT_GBE;
38 orion_clkdev_add(NULL, "mv643xx_eth_port.0",
39 of_clk_get_from_provider(&clkspec));
40
41 clkspec.args[0] = CLOCK_GATING_BIT_PCIE0;
42 orion_clkdev_add("0", "pcie",
43 of_clk_get_from_provider(&clkspec));
44
45 clkspec.args[0] = CLOCK_GATING_BIT_PCIE1;
46 orion_clkdev_add("1", "pcie",
47 of_clk_get_from_provider(&clkspec));
48}
49
50static void __init dove_of_clk_init(void)
51{
52 mvebu_clocks_init();
53 dove_legacy_clk_init();
54}
55
56static struct mv643xx_eth_platform_data dove_dt_ge00_data = {
57 .phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT,
58};
59
60static void __init dove_dt_init(void)
61{
62 pr_info("Dove 88AP510 SoC\n");
63
64#ifdef CONFIG_CACHE_TAUROS2
65 tauros2_init(0);
66#endif
67 dove_setup_cpu_mbus();
68
69 /* Setup root of clk tree */
70 dove_of_clk_init();
71
72 /* Internal devices not ported to DT yet */
73 dove_ge00_init(&dove_dt_ge00_data);
74 dove_pcie_init(1, 1);
75
76 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
77}
78
79static const char * const dove_dt_board_compat[] = {
80 "marvell,dove",
81 NULL
82};
83
84DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)")
85 .map_io = dove_map_io,
86 .init_early = dove_init_early,
87 .init_irq = orion_dt_init_irq,
88 .init_time = dove_timer_init,
89 .init_machine = dove_dt_init,
90 .restart = dove_restart,
91 .dt_compat = dove_dt_board_compat,
92MACHINE_END
diff --git a/arch/arm/mach-dove/cm-a510.c b/arch/arm/mach-dove/cm-a510.c
index 792b4e2e24f1..0dc39cf30fdd 100644
--- a/arch/arm/mach-dove/cm-a510.c
+++ b/arch/arm/mach-dove/cm-a510.c
@@ -92,6 +92,6 @@ MACHINE_START(CM_A510, "Compulab CM-A510 Board")
92 .map_io = dove_map_io, 92 .map_io = dove_map_io,
93 .init_early = dove_init_early, 93 .init_early = dove_init_early,
94 .init_irq = dove_init_irq, 94 .init_irq = dove_init_irq,
95 .timer = &dove_timer, 95 .init_time = dove_timer_init,
96 .restart = dove_restart, 96 .restart = dove_restart,
97MACHINE_END 97MACHINE_END
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
index 89f4f993cd03..c6b3b2bb50e7 100644
--- a/arch/arm/mach-dove/common.c
+++ b/arch/arm/mach-dove/common.c
@@ -8,35 +8,24 @@
8 * warranty of any kind, whether express or implied. 8 * warranty of any kind, whether express or implied.
9 */ 9 */
10 10
11#include <linux/kernel.h>
12#include <linux/delay.h>
13#include <linux/init.h>
14#include <linux/platform_device.h>
15#include <linux/pci.h>
16#include <linux/clk-provider.h> 11#include <linux/clk-provider.h>
17#include <linux/clk/mvebu.h> 12#include <linux/clk/mvebu.h>
18#include <linux/ata_platform.h> 13#include <linux/dma-mapping.h>
19#include <linux/gpio.h> 14#include <linux/init.h>
20#include <linux/of.h> 15#include <linux/of.h>
21#include <linux/of_platform.h> 16#include <linux/of_platform.h>
22#include <asm/page.h> 17#include <linux/platform_data/dma-mv_xor.h>
23#include <asm/setup.h> 18#include <linux/platform_data/usb-ehci-orion.h>
24#include <asm/timex.h> 19#include <linux/platform_device.h>
25#include <asm/hardware/cache-tauros2.h> 20#include <asm/hardware/cache-tauros2.h>
21#include <asm/mach/arch.h>
26#include <asm/mach/map.h> 22#include <asm/mach/map.h>
27#include <asm/mach/time.h> 23#include <asm/mach/time.h>
28#include <asm/mach/pci.h>
29#include <mach/dove.h>
30#include <mach/pm.h>
31#include <mach/bridge-regs.h> 24#include <mach/bridge-regs.h>
32#include <asm/mach/arch.h> 25#include <mach/pm.h>
33#include <linux/irq.h>
34#include <plat/time.h>
35#include <linux/platform_data/usb-ehci-orion.h>
36#include <linux/platform_data/dma-mv_xor.h>
37#include <plat/irq.h>
38#include <plat/common.h> 26#include <plat/common.h>
39#include <plat/addr-map.h> 27#include <plat/irq.h>
28#include <plat/time.h>
40#include "common.h" 29#include "common.h"
41 30
42/***************************************************************************** 31/*****************************************************************************
@@ -242,17 +231,13 @@ static int __init dove_find_tclk(void)
242 return 166666667; 231 return 166666667;
243} 232}
244 233
245static void __init dove_timer_init(void) 234void __init dove_timer_init(void)
246{ 235{
247 dove_tclk = dove_find_tclk(); 236 dove_tclk = dove_find_tclk();
248 orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR, 237 orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR,
249 IRQ_DOVE_BRIDGE, dove_tclk); 238 IRQ_DOVE_BRIDGE, dove_tclk);
250} 239}
251 240
252struct sys_timer dove_timer = {
253 .init = dove_timer_init,
254};
255
256/***************************************************************************** 241/*****************************************************************************
257 * Cryptographic Engines and Security Accelerator (CESA) 242 * Cryptographic Engines and Security Accelerator (CESA)
258 ****************************************************************************/ 243 ****************************************************************************/
@@ -375,88 +360,3 @@ void dove_restart(char mode, const char *cmd)
375 while (1) 360 while (1)
376 ; 361 ;
377} 362}
378
379#if defined(CONFIG_MACH_DOVE_DT)
380/*
381 * There are still devices that doesn't even know about DT,
382 * get clock gates here and add a clock lookup.
383 */
384static void __init dove_legacy_clk_init(void)
385{
386 struct device_node *np = of_find_compatible_node(NULL, NULL,
387 "marvell,dove-gating-clock");
388 struct of_phandle_args clkspec;
389
390 clkspec.np = np;
391 clkspec.args_count = 1;
392
393 clkspec.args[0] = CLOCK_GATING_BIT_USB0;
394 orion_clkdev_add(NULL, "orion-ehci.0",
395 of_clk_get_from_provider(&clkspec));
396
397 clkspec.args[0] = CLOCK_GATING_BIT_USB1;
398 orion_clkdev_add(NULL, "orion-ehci.1",
399 of_clk_get_from_provider(&clkspec));
400
401 clkspec.args[0] = CLOCK_GATING_BIT_GBE;
402 orion_clkdev_add(NULL, "mv643xx_eth_port.0",
403 of_clk_get_from_provider(&clkspec));
404
405 clkspec.args[0] = CLOCK_GATING_BIT_PCIE0;
406 orion_clkdev_add("0", "pcie",
407 of_clk_get_from_provider(&clkspec));
408
409 clkspec.args[0] = CLOCK_GATING_BIT_PCIE1;
410 orion_clkdev_add("1", "pcie",
411 of_clk_get_from_provider(&clkspec));
412}
413
414static void __init dove_of_clk_init(void)
415{
416 mvebu_clocks_init();
417 dove_legacy_clk_init();
418}
419
420static struct mv643xx_eth_platform_data dove_dt_ge00_data = {
421 .phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT,
422};
423
424static void __init dove_dt_init(void)
425{
426 pr_info("Dove 88AP510 SoC, TCLK = %d MHz.\n",
427 (dove_tclk + 499999) / 1000000);
428
429#ifdef CONFIG_CACHE_TAUROS2
430 tauros2_init(0);
431#endif
432 dove_setup_cpu_mbus();
433
434 /* Setup root of clk tree */
435 dove_of_clk_init();
436
437 /* Internal devices not ported to DT yet */
438 dove_rtc_init();
439
440 dove_ge00_init(&dove_dt_ge00_data);
441 dove_ehci0_init();
442 dove_ehci1_init();
443 dove_pcie_init(1, 1);
444
445 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
446}
447
448static const char * const dove_dt_board_compat[] = {
449 "marvell,dove",
450 NULL
451};
452
453DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)")
454 .map_io = dove_map_io,
455 .init_early = dove_init_early,
456 .init_irq = orion_dt_init_irq,
457 .timer = &dove_timer,
458 .init_machine = dove_dt_init,
459 .restart = dove_restart,
460 .dt_compat = dove_dt_board_compat,
461MACHINE_END
462#endif
diff --git a/arch/arm/mach-dove/common.h b/arch/arm/mach-dove/common.h
index 1a233404b735..ee59fba4c6d1 100644
--- a/arch/arm/mach-dove/common.h
+++ b/arch/arm/mach-dove/common.h
@@ -14,7 +14,7 @@
14struct mv643xx_eth_platform_data; 14struct mv643xx_eth_platform_data;
15struct mv_sata_platform_data; 15struct mv_sata_platform_data;
16 16
17extern struct sys_timer dove_timer; 17extern void dove_timer_init(void);
18 18
19/* 19/*
20 * Basic Dove init functions used early by machine-setup. 20 * Basic Dove init functions used early by machine-setup.
diff --git a/arch/arm/mach-dove/dove-db-setup.c b/arch/arm/mach-dove/dove-db-setup.c
index bc2867f11346..76e26f949c27 100644
--- a/arch/arm/mach-dove/dove-db-setup.c
+++ b/arch/arm/mach-dove/dove-db-setup.c
@@ -98,6 +98,6 @@ MACHINE_START(DOVE_DB, "Marvell DB-MV88AP510-BP Development Board")
98 .map_io = dove_map_io, 98 .map_io = dove_map_io,
99 .init_early = dove_init_early, 99 .init_early = dove_init_early,
100 .init_irq = dove_init_irq, 100 .init_irq = dove_init_irq,
101 .timer = &dove_timer, 101 .init_time = dove_timer_init,
102 .restart = dove_restart, 102 .restart = dove_restart,
103MACHINE_END 103MACHINE_END
diff --git a/arch/arm/mach-dove/include/mach/uncompress.h b/arch/arm/mach-dove/include/mach/uncompress.h
index 2c5cdd7a3eed..5c8ae9b9d39a 100644
--- a/arch/arm/mach-dove/include/mach/uncompress.h
+++ b/arch/arm/mach-dove/include/mach/uncompress.h
@@ -34,4 +34,3 @@ static void flush(void)
34 * nothing to do 34 * nothing to do
35 */ 35 */
36#define arch_decomp_setup() 36#define arch_decomp_setup()
37#define arch_decomp_wdog()
diff --git a/arch/arm/mach-ebsa110/core.c b/arch/arm/mach-ebsa110/core.c
index f0fe6b5350e2..b13cc74114db 100644
--- a/arch/arm/mach-ebsa110/core.c
+++ b/arch/arm/mach-ebsa110/core.c
@@ -158,7 +158,7 @@ static void __init ebsa110_init_early(void)
158 * interrupt, then the PIT counter will roll over (ie, be negative). 158 * interrupt, then the PIT counter will roll over (ie, be negative).
159 * This actually works out to be convenient. 159 * This actually works out to be convenient.
160 */ 160 */
161static unsigned long ebsa110_gettimeoffset(void) 161static u32 ebsa110_gettimeoffset(void)
162{ 162{
163 unsigned long offset, count; 163 unsigned long offset, count;
164 164
@@ -181,7 +181,7 @@ static unsigned long ebsa110_gettimeoffset(void)
181 */ 181 */
182 offset = offset * (1000000 / HZ) / COUNT; 182 offset = offset * (1000000 / HZ) / COUNT;
183 183
184 return offset; 184 return offset * 1000;
185} 185}
186 186
187static irqreturn_t 187static irqreturn_t
@@ -213,8 +213,10 @@ static struct irqaction ebsa110_timer_irq = {
213/* 213/*
214 * Set up timer interrupt. 214 * Set up timer interrupt.
215 */ 215 */
216static void __init ebsa110_timer_init(void) 216void __init ebsa110_timer_init(void)
217{ 217{
218 arch_gettimeoffset = ebsa110_gettimeoffset;
219
218 /* 220 /*
219 * Timer 1, mode 2, LSB/MSB 221 * Timer 1, mode 2, LSB/MSB
220 */ 222 */
@@ -225,11 +227,6 @@ static void __init ebsa110_timer_init(void)
225 setup_irq(IRQ_EBSA110_TIMER0, &ebsa110_timer_irq); 227 setup_irq(IRQ_EBSA110_TIMER0, &ebsa110_timer_irq);
226} 228}
227 229
228static struct sys_timer ebsa110_timer = {
229 .init = ebsa110_timer_init,
230 .offset = ebsa110_gettimeoffset,
231};
232
233static struct plat_serial8250_port serial_platform_data[] = { 230static struct plat_serial8250_port serial_platform_data[] = {
234 { 231 {
235 .iobase = 0x3f8, 232 .iobase = 0x3f8,
@@ -328,6 +325,6 @@ MACHINE_START(EBSA110, "EBSA110")
328 .map_io = ebsa110_map_io, 325 .map_io = ebsa110_map_io,
329 .init_early = ebsa110_init_early, 326 .init_early = ebsa110_init_early,
330 .init_irq = ebsa110_init_irq, 327 .init_irq = ebsa110_init_irq,
331 .timer = &ebsa110_timer, 328 .init_time = ebsa110_timer_init,
332 .restart = ebsa110_restart, 329 .restart = ebsa110_restart,
333MACHINE_END 330MACHINE_END
diff --git a/arch/arm/mach-ebsa110/include/mach/uncompress.h b/arch/arm/mach-ebsa110/include/mach/uncompress.h
index 32041509fbf8..ab64bea69c72 100644
--- a/arch/arm/mach-ebsa110/include/mach/uncompress.h
+++ b/arch/arm/mach-ebsa110/include/mach/uncompress.h
@@ -42,4 +42,3 @@ static inline void flush(void)
42 * nothing to do 42 * nothing to do
43 */ 43 */
44#define arch_decomp_setup() 44#define arch_decomp_setup()
45#define arch_decomp_wdog()
diff --git a/arch/arm/mach-ep93xx/adssphere.c b/arch/arm/mach-ep93xx/adssphere.c
index 41383bf03d4b..bda6c3a5c923 100644
--- a/arch/arm/mach-ep93xx/adssphere.c
+++ b/arch/arm/mach-ep93xx/adssphere.c
@@ -17,7 +17,6 @@
17 17
18#include <mach/hardware.h> 18#include <mach/hardware.h>
19 19
20#include <asm/hardware/vic.h>
21#include <asm/mach-types.h> 20#include <asm/mach-types.h>
22#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
23 22
@@ -39,8 +38,7 @@ MACHINE_START(ADSSPHERE, "ADS Sphere board")
39 .atag_offset = 0x100, 38 .atag_offset = 0x100,
40 .map_io = ep93xx_map_io, 39 .map_io = ep93xx_map_io,
41 .init_irq = ep93xx_init_irq, 40 .init_irq = ep93xx_init_irq,
42 .handle_irq = vic_handle_irq, 41 .init_time = ep93xx_timer_init,
43 .timer = &ep93xx_timer,
44 .init_machine = adssphere_init_machine, 42 .init_machine = adssphere_init_machine,
45 .init_late = ep93xx_init_late, 43 .init_late = ep93xx_init_late,
46 .restart = ep93xx_restart, 44 .restart = ep93xx_restart,
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index e85bf17f2d2a..c49ed3dc1aea 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -34,6 +34,7 @@
34#include <linux/i2c-gpio.h> 34#include <linux/i2c-gpio.h>
35#include <linux/spi/spi.h> 35#include <linux/spi/spi.h>
36#include <linux/export.h> 36#include <linux/export.h>
37#include <linux/irqchip/arm-vic.h>
37 38
38#include <mach/hardware.h> 39#include <mach/hardware.h>
39#include <linux/platform_data/video-ep93xx.h> 40#include <linux/platform_data/video-ep93xx.h>
@@ -44,8 +45,6 @@
44#include <asm/mach/map.h> 45#include <asm/mach/map.h>
45#include <asm/mach/time.h> 46#include <asm/mach/time.h>
46 47
47#include <asm/hardware/vic.h>
48
49#include "soc.h" 48#include "soc.h"
50 49
51/************************************************************************* 50/*************************************************************************
@@ -140,11 +139,29 @@ static struct irqaction ep93xx_timer_irq = {
140 .handler = ep93xx_timer_interrupt, 139 .handler = ep93xx_timer_interrupt,
141}; 140};
142 141
143static void __init ep93xx_timer_init(void) 142static u32 ep93xx_gettimeoffset(void)
143{
144 int offset;
145
146 offset = __raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time;
147
148 /*
149 * Timer 4 is based on a 983.04 kHz reference clock,
150 * so dividing by 983040 gives the fraction of a second,
151 * so dividing by 0.983040 converts to uS.
152 * Refactor the calculation to avoid overflow.
153 * Finally, multiply by 1000 to give nS.
154 */
155 return (offset + (53 * offset / 3072)) * 1000;
156}
157
158void __init ep93xx_timer_init(void)
144{ 159{
145 u32 tmode = EP93XX_TIMER123_CONTROL_MODE | 160 u32 tmode = EP93XX_TIMER123_CONTROL_MODE |
146 EP93XX_TIMER123_CONTROL_CLKSEL; 161 EP93XX_TIMER123_CONTROL_CLKSEL;
147 162
163 arch_gettimeoffset = ep93xx_gettimeoffset;
164
148 /* Enable periodic HZ timer. */ 165 /* Enable periodic HZ timer. */
149 __raw_writel(tmode, EP93XX_TIMER1_CONTROL); 166 __raw_writel(tmode, EP93XX_TIMER1_CONTROL);
150 __raw_writel(TIMER1_RELOAD, EP93XX_TIMER1_LOAD); 167 __raw_writel(TIMER1_RELOAD, EP93XX_TIMER1_LOAD);
@@ -158,21 +175,6 @@ static void __init ep93xx_timer_init(void)
158 setup_irq(IRQ_EP93XX_TIMER1, &ep93xx_timer_irq); 175 setup_irq(IRQ_EP93XX_TIMER1, &ep93xx_timer_irq);
159} 176}
160 177
161static unsigned long ep93xx_gettimeoffset(void)
162{
163 int offset;
164
165 offset = __raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time;
166
167 /* Calculate (1000000 / 983040) * offset. */
168 return offset + (53 * offset / 3072);
169}
170
171struct sys_timer ep93xx_timer = {
172 .init = ep93xx_timer_init,
173 .offset = ep93xx_gettimeoffset,
174};
175
176 178
177/************************************************************************* 179/*************************************************************************
178 * EP93xx IRQ handling 180 * EP93xx IRQ handling
diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c
index b8f53d57a299..27b14ae92c7e 100644
--- a/arch/arm/mach-ep93xx/edb93xx.c
+++ b/arch/arm/mach-ep93xx/edb93xx.c
@@ -39,7 +39,6 @@
39#include <linux/platform_data/spi-ep93xx.h> 39#include <linux/platform_data/spi-ep93xx.h>
40#include <mach/gpio-ep93xx.h> 40#include <mach/gpio-ep93xx.h>
41 41
42#include <asm/hardware/vic.h>
43#include <asm/mach-types.h> 42#include <asm/mach-types.h>
44#include <asm/mach/arch.h> 43#include <asm/mach/arch.h>
45 44
@@ -276,8 +275,7 @@ MACHINE_START(EDB9301, "Cirrus Logic EDB9301 Evaluation Board")
276 .atag_offset = 0x100, 275 .atag_offset = 0x100,
277 .map_io = ep93xx_map_io, 276 .map_io = ep93xx_map_io,
278 .init_irq = ep93xx_init_irq, 277 .init_irq = ep93xx_init_irq,
279 .handle_irq = vic_handle_irq, 278 .init_time = ep93xx_timer_init,
280 .timer = &ep93xx_timer,
281 .init_machine = edb93xx_init_machine, 279 .init_machine = edb93xx_init_machine,
282 .init_late = ep93xx_init_late, 280 .init_late = ep93xx_init_late,
283 .restart = ep93xx_restart, 281 .restart = ep93xx_restart,
@@ -290,8 +288,7 @@ MACHINE_START(EDB9302, "Cirrus Logic EDB9302 Evaluation Board")
290 .atag_offset = 0x100, 288 .atag_offset = 0x100,
291 .map_io = ep93xx_map_io, 289 .map_io = ep93xx_map_io,
292 .init_irq = ep93xx_init_irq, 290 .init_irq = ep93xx_init_irq,
293 .handle_irq = vic_handle_irq, 291 .init_time = ep93xx_timer_init,
294 .timer = &ep93xx_timer,
295 .init_machine = edb93xx_init_machine, 292 .init_machine = edb93xx_init_machine,
296 .init_late = ep93xx_init_late, 293 .init_late = ep93xx_init_late,
297 .restart = ep93xx_restart, 294 .restart = ep93xx_restart,
@@ -304,8 +301,7 @@ MACHINE_START(EDB9302A, "Cirrus Logic EDB9302A Evaluation Board")
304 .atag_offset = 0x100, 301 .atag_offset = 0x100,
305 .map_io = ep93xx_map_io, 302 .map_io = ep93xx_map_io,
306 .init_irq = ep93xx_init_irq, 303 .init_irq = ep93xx_init_irq,
307 .handle_irq = vic_handle_irq, 304 .init_time = ep93xx_timer_init,
308 .timer = &ep93xx_timer,
309 .init_machine = edb93xx_init_machine, 305 .init_machine = edb93xx_init_machine,
310 .init_late = ep93xx_init_late, 306 .init_late = ep93xx_init_late,
311 .restart = ep93xx_restart, 307 .restart = ep93xx_restart,
@@ -318,8 +314,7 @@ MACHINE_START(EDB9307, "Cirrus Logic EDB9307 Evaluation Board")
318 .atag_offset = 0x100, 314 .atag_offset = 0x100,
319 .map_io = ep93xx_map_io, 315 .map_io = ep93xx_map_io,
320 .init_irq = ep93xx_init_irq, 316 .init_irq = ep93xx_init_irq,
321 .handle_irq = vic_handle_irq, 317 .init_time = ep93xx_timer_init,
322 .timer = &ep93xx_timer,
323 .init_machine = edb93xx_init_machine, 318 .init_machine = edb93xx_init_machine,
324 .init_late = ep93xx_init_late, 319 .init_late = ep93xx_init_late,
325 .restart = ep93xx_restart, 320 .restart = ep93xx_restart,
@@ -332,8 +327,7 @@ MACHINE_START(EDB9307A, "Cirrus Logic EDB9307A Evaluation Board")
332 .atag_offset = 0x100, 327 .atag_offset = 0x100,
333 .map_io = ep93xx_map_io, 328 .map_io = ep93xx_map_io,
334 .init_irq = ep93xx_init_irq, 329 .init_irq = ep93xx_init_irq,
335 .handle_irq = vic_handle_irq, 330 .init_time = ep93xx_timer_init,
336 .timer = &ep93xx_timer,
337 .init_machine = edb93xx_init_machine, 331 .init_machine = edb93xx_init_machine,
338 .init_late = ep93xx_init_late, 332 .init_late = ep93xx_init_late,
339 .restart = ep93xx_restart, 333 .restart = ep93xx_restart,
@@ -346,8 +340,7 @@ MACHINE_START(EDB9312, "Cirrus Logic EDB9312 Evaluation Board")
346 .atag_offset = 0x100, 340 .atag_offset = 0x100,
347 .map_io = ep93xx_map_io, 341 .map_io = ep93xx_map_io,
348 .init_irq = ep93xx_init_irq, 342 .init_irq = ep93xx_init_irq,
349 .handle_irq = vic_handle_irq, 343 .init_time = ep93xx_timer_init,
350 .timer = &ep93xx_timer,
351 .init_machine = edb93xx_init_machine, 344 .init_machine = edb93xx_init_machine,
352 .init_late = ep93xx_init_late, 345 .init_late = ep93xx_init_late,
353 .restart = ep93xx_restart, 346 .restart = ep93xx_restart,
@@ -360,8 +353,7 @@ MACHINE_START(EDB9315, "Cirrus Logic EDB9315 Evaluation Board")
360 .atag_offset = 0x100, 353 .atag_offset = 0x100,
361 .map_io = ep93xx_map_io, 354 .map_io = ep93xx_map_io,
362 .init_irq = ep93xx_init_irq, 355 .init_irq = ep93xx_init_irq,
363 .handle_irq = vic_handle_irq, 356 .init_time = ep93xx_timer_init,
364 .timer = &ep93xx_timer,
365 .init_machine = edb93xx_init_machine, 357 .init_machine = edb93xx_init_machine,
366 .init_late = ep93xx_init_late, 358 .init_late = ep93xx_init_late,
367 .restart = ep93xx_restart, 359 .restart = ep93xx_restart,
@@ -374,8 +366,7 @@ MACHINE_START(EDB9315A, "Cirrus Logic EDB9315A Evaluation Board")
374 .atag_offset = 0x100, 366 .atag_offset = 0x100,
375 .map_io = ep93xx_map_io, 367 .map_io = ep93xx_map_io,
376 .init_irq = ep93xx_init_irq, 368 .init_irq = ep93xx_init_irq,
377 .handle_irq = vic_handle_irq, 369 .init_time = ep93xx_timer_init,
378 .timer = &ep93xx_timer,
379 .init_machine = edb93xx_init_machine, 370 .init_machine = edb93xx_init_machine,
380 .init_late = ep93xx_init_late, 371 .init_late = ep93xx_init_late,
381 .restart = ep93xx_restart, 372 .restart = ep93xx_restart,
diff --git a/arch/arm/mach-ep93xx/gesbc9312.c b/arch/arm/mach-ep93xx/gesbc9312.c
index 7fd705b5efe4..0cca5b183309 100644
--- a/arch/arm/mach-ep93xx/gesbc9312.c
+++ b/arch/arm/mach-ep93xx/gesbc9312.c
@@ -17,7 +17,6 @@
17 17
18#include <mach/hardware.h> 18#include <mach/hardware.h>
19 19
20#include <asm/hardware/vic.h>
21#include <asm/mach-types.h> 20#include <asm/mach-types.h>
22#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
23 22
@@ -39,8 +38,7 @@ MACHINE_START(GESBC9312, "Glomation GESBC-9312-sx")
39 .atag_offset = 0x100, 38 .atag_offset = 0x100,
40 .map_io = ep93xx_map_io, 39 .map_io = ep93xx_map_io,
41 .init_irq = ep93xx_init_irq, 40 .init_irq = ep93xx_init_irq,
42 .handle_irq = vic_handle_irq, 41 .init_time = ep93xx_timer_init,
43 .timer = &ep93xx_timer,
44 .init_machine = gesbc9312_init_machine, 42 .init_machine = gesbc9312_init_machine,
45 .init_late = ep93xx_init_late, 43 .init_late = ep93xx_init_late,
46 .restart = ep93xx_restart, 44 .restart = ep93xx_restart,
diff --git a/arch/arm/mach-ep93xx/include/mach/platform.h b/arch/arm/mach-ep93xx/include/mach/platform.h
index 33a5122c6dc8..a14e1b37beff 100644
--- a/arch/arm/mach-ep93xx/include/mach/platform.h
+++ b/arch/arm/mach-ep93xx/include/mach/platform.h
@@ -53,7 +53,7 @@ int ep93xx_ide_acquire_gpio(struct platform_device *pdev);
53void ep93xx_ide_release_gpio(struct platform_device *pdev); 53void ep93xx_ide_release_gpio(struct platform_device *pdev);
54 54
55void ep93xx_init_devices(void); 55void ep93xx_init_devices(void);
56extern struct sys_timer ep93xx_timer; 56extern void ep93xx_timer_init(void);
57 57
58void ep93xx_restart(char, const char *); 58void ep93xx_restart(char, const char *);
59void ep93xx_init_late(void); 59void ep93xx_init_late(void);
diff --git a/arch/arm/mach-ep93xx/include/mach/uncompress.h b/arch/arm/mach-ep93xx/include/mach/uncompress.h
index d64274fc5760..d2afb4dd82ab 100644
--- a/arch/arm/mach-ep93xx/include/mach/uncompress.h
+++ b/arch/arm/mach-ep93xx/include/mach/uncompress.h
@@ -86,5 +86,3 @@ static void arch_decomp_setup(void)
86{ 86{
87 ethernet_reset(); 87 ethernet_reset();
88} 88}
89
90#define arch_decomp_wdog()
diff --git a/arch/arm/mach-ep93xx/micro9.c b/arch/arm/mach-ep93xx/micro9.c
index 3d7cdab725b2..373583c29825 100644
--- a/arch/arm/mach-ep93xx/micro9.c
+++ b/arch/arm/mach-ep93xx/micro9.c
@@ -18,7 +18,6 @@
18 18
19#include <mach/hardware.h> 19#include <mach/hardware.h>
20 20
21#include <asm/hardware/vic.h>
22#include <asm/mach-types.h> 21#include <asm/mach-types.h>
23#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
24 23
@@ -82,8 +81,7 @@ MACHINE_START(MICRO9, "Contec Micro9-High")
82 .atag_offset = 0x100, 81 .atag_offset = 0x100,
83 .map_io = ep93xx_map_io, 82 .map_io = ep93xx_map_io,
84 .init_irq = ep93xx_init_irq, 83 .init_irq = ep93xx_init_irq,
85 .handle_irq = vic_handle_irq, 84 .init_time = ep93xx_timer_init,
86 .timer = &ep93xx_timer,
87 .init_machine = micro9_init_machine, 85 .init_machine = micro9_init_machine,
88 .init_late = ep93xx_init_late, 86 .init_late = ep93xx_init_late,
89 .restart = ep93xx_restart, 87 .restart = ep93xx_restart,
@@ -96,8 +94,7 @@ MACHINE_START(MICRO9M, "Contec Micro9-Mid")
96 .atag_offset = 0x100, 94 .atag_offset = 0x100,
97 .map_io = ep93xx_map_io, 95 .map_io = ep93xx_map_io,
98 .init_irq = ep93xx_init_irq, 96 .init_irq = ep93xx_init_irq,
99 .handle_irq = vic_handle_irq, 97 .init_time = ep93xx_timer_init,
100 .timer = &ep93xx_timer,
101 .init_machine = micro9_init_machine, 98 .init_machine = micro9_init_machine,
102 .init_late = ep93xx_init_late, 99 .init_late = ep93xx_init_late,
103 .restart = ep93xx_restart, 100 .restart = ep93xx_restart,
@@ -110,8 +107,7 @@ MACHINE_START(MICRO9L, "Contec Micro9-Lite")
110 .atag_offset = 0x100, 107 .atag_offset = 0x100,
111 .map_io = ep93xx_map_io, 108 .map_io = ep93xx_map_io,
112 .init_irq = ep93xx_init_irq, 109 .init_irq = ep93xx_init_irq,
113 .handle_irq = vic_handle_irq, 110 .init_time = ep93xx_timer_init,
114 .timer = &ep93xx_timer,
115 .init_machine = micro9_init_machine, 111 .init_machine = micro9_init_machine,
116 .init_late = ep93xx_init_late, 112 .init_late = ep93xx_init_late,
117 .restart = ep93xx_restart, 113 .restart = ep93xx_restart,
@@ -124,8 +120,7 @@ MACHINE_START(MICRO9S, "Contec Micro9-Slim")
124 .atag_offset = 0x100, 120 .atag_offset = 0x100,
125 .map_io = ep93xx_map_io, 121 .map_io = ep93xx_map_io,
126 .init_irq = ep93xx_init_irq, 122 .init_irq = ep93xx_init_irq,
127 .handle_irq = vic_handle_irq, 123 .init_time = ep93xx_timer_init,
128 .timer = &ep93xx_timer,
129 .init_machine = micro9_init_machine, 124 .init_machine = micro9_init_machine,
130 .init_late = ep93xx_init_late, 125 .init_late = ep93xx_init_late,
131 .restart = ep93xx_restart, 126 .restart = ep93xx_restart,
diff --git a/arch/arm/mach-ep93xx/simone.c b/arch/arm/mach-ep93xx/simone.c
index 0eb3f17a6fa2..36f22c1a31fe 100644
--- a/arch/arm/mach-ep93xx/simone.c
+++ b/arch/arm/mach-ep93xx/simone.c
@@ -25,7 +25,6 @@
25#include <linux/platform_data/video-ep93xx.h> 25#include <linux/platform_data/video-ep93xx.h>
26#include <mach/gpio-ep93xx.h> 26#include <mach/gpio-ep93xx.h>
27 27
28#include <asm/hardware/vic.h>
29#include <asm/mach-types.h> 28#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
31 30
@@ -83,8 +82,7 @@ MACHINE_START(SIM_ONE, "Simplemachines Sim.One Board")
83 .atag_offset = 0x100, 82 .atag_offset = 0x100,
84 .map_io = ep93xx_map_io, 83 .map_io = ep93xx_map_io,
85 .init_irq = ep93xx_init_irq, 84 .init_irq = ep93xx_init_irq,
86 .handle_irq = vic_handle_irq, 85 .init_time = ep93xx_timer_init,
87 .timer = &ep93xx_timer,
88 .init_machine = simone_init_machine, 86 .init_machine = simone_init_machine,
89 .init_late = ep93xx_init_late, 87 .init_late = ep93xx_init_late,
90 .restart = ep93xx_restart, 88 .restart = ep93xx_restart,
diff --git a/arch/arm/mach-ep93xx/snappercl15.c b/arch/arm/mach-ep93xx/snappercl15.c
index 50043eef1cf2..aa86f86638dd 100644
--- a/arch/arm/mach-ep93xx/snappercl15.c
+++ b/arch/arm/mach-ep93xx/snappercl15.c
@@ -31,7 +31,6 @@
31#include <linux/platform_data/video-ep93xx.h> 31#include <linux/platform_data/video-ep93xx.h>
32#include <mach/gpio-ep93xx.h> 32#include <mach/gpio-ep93xx.h>
33 33
34#include <asm/hardware/vic.h>
35#include <asm/mach-types.h> 34#include <asm/mach-types.h>
36#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
37 36
@@ -176,8 +175,7 @@ MACHINE_START(SNAPPER_CL15, "Bluewater Systems Snapper CL15")
176 .atag_offset = 0x100, 175 .atag_offset = 0x100,
177 .map_io = ep93xx_map_io, 176 .map_io = ep93xx_map_io,
178 .init_irq = ep93xx_init_irq, 177 .init_irq = ep93xx_init_irq,
179 .handle_irq = vic_handle_irq, 178 .init_time = ep93xx_timer_init,
180 .timer = &ep93xx_timer,
181 .init_machine = snappercl15_init_machine, 179 .init_machine = snappercl15_init_machine,
182 .init_late = ep93xx_init_late, 180 .init_late = ep93xx_init_late,
183 .restart = ep93xx_restart, 181 .restart = ep93xx_restart,
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 3c4c233391dc..61f4b5dc4d7d 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -22,7 +22,6 @@
22 22
23#include <mach/hardware.h> 23#include <mach/hardware.h>
24 24
25#include <asm/hardware/vic.h>
26#include <asm/mach-types.h> 25#include <asm/mach-types.h>
27#include <asm/mach/map.h> 26#include <asm/mach/map.h>
28#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
@@ -246,8 +245,7 @@ MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
246 .atag_offset = 0x100, 245 .atag_offset = 0x100,
247 .map_io = ts72xx_map_io, 246 .map_io = ts72xx_map_io,
248 .init_irq = ep93xx_init_irq, 247 .init_irq = ep93xx_init_irq,
249 .handle_irq = vic_handle_irq, 248 .init_time = ep93xx_timer_init,
250 .timer = &ep93xx_timer,
251 .init_machine = ts72xx_init_machine, 249 .init_machine = ts72xx_init_machine,
252 .init_late = ep93xx_init_late, 250 .init_late = ep93xx_init_late,
253 .restart = ep93xx_restart, 251 .restart = ep93xx_restart,
diff --git a/arch/arm/mach-ep93xx/vision_ep9307.c b/arch/arm/mach-ep93xx/vision_ep9307.c
index ba92e25e3016..605956fd07a2 100644
--- a/arch/arm/mach-ep93xx/vision_ep9307.c
+++ b/arch/arm/mach-ep93xx/vision_ep9307.c
@@ -34,7 +34,6 @@
34#include <linux/platform_data/spi-ep93xx.h> 34#include <linux/platform_data/spi-ep93xx.h>
35#include <mach/gpio-ep93xx.h> 35#include <mach/gpio-ep93xx.h>
36 36
37#include <asm/hardware/vic.h>
38#include <asm/mach-types.h> 37#include <asm/mach-types.h>
39#include <asm/mach/map.h> 38#include <asm/mach/map.h>
40#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
@@ -364,8 +363,7 @@ MACHINE_START(VISION_EP9307, "Vision Engraving Systems EP9307")
364 .atag_offset = 0x100, 363 .atag_offset = 0x100,
365 .map_io = vision_map_io, 364 .map_io = vision_map_io,
366 .init_irq = ep93xx_init_irq, 365 .init_irq = ep93xx_init_irq,
367 .handle_irq = vic_handle_irq, 366 .init_time = ep93xx_timer_init,
368 .timer = &ep93xx_timer,
369 .init_machine = vision_init_machine, 367 .init_machine = vision_init_machine,
370 .init_late = ep93xx_init_late, 368 .init_late = ep93xx_init_late,
371 .restart = ep93xx_restart, 369 .restart = ep93xx_restart,
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index e103c290bc9e..70f94c87479d 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -105,11 +105,6 @@ config EXYNOS4_SETUP_FIMD0
105 help 105 help
106 Common setup code for FIMD0. 106 Common setup code for FIMD0.
107 107
108config EXYNOS_DEV_SYSMMU
109 bool
110 help
111 Common setup code for SYSTEM MMU in EXYNOS platforms
112
113config EXYNOS4_DEV_USB_OHCI 108config EXYNOS4_DEV_USB_OHCI
114 bool 109 bool
115 help 110 help
@@ -414,7 +409,7 @@ config MACH_EXYNOS4_DT
414 select CPU_EXYNOS4210 409 select CPU_EXYNOS4210
415 select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD 410 select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD
416 select PINCTRL 411 select PINCTRL
417 select PINCTRL_EXYNOS4 412 select PINCTRL_EXYNOS
418 select USE_OF 413 select USE_OF
419 help 414 help
420 Machine support for Samsung Exynos4 machine with device tree enabled. 415 Machine support for Samsung Exynos4 machine with device tree enabled.
diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index b189881657ec..435757e57bb4 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -52,7 +52,6 @@ obj-$(CONFIG_ARCH_EXYNOS4) += dev-audio.o
52obj-$(CONFIG_EXYNOS4_DEV_AHCI) += dev-ahci.o 52obj-$(CONFIG_EXYNOS4_DEV_AHCI) += dev-ahci.o
53obj-$(CONFIG_EXYNOS_DEV_DMA) += dma.o 53obj-$(CONFIG_EXYNOS_DEV_DMA) += dma.o
54obj-$(CONFIG_EXYNOS4_DEV_USB_OHCI) += dev-ohci.o 54obj-$(CONFIG_EXYNOS4_DEV_USB_OHCI) += dev-ohci.o
55obj-$(CONFIG_EXYNOS_DEV_SYSMMU) += dev-sysmmu.o
56 55
57obj-$(CONFIG_ARCH_EXYNOS) += setup-i2c0.o 56obj-$(CONFIG_ARCH_EXYNOS) += setup-i2c0.o
58obj-$(CONFIG_EXYNOS4_SETUP_FIMC) += setup-fimc.o 57obj-$(CONFIG_EXYNOS4_SETUP_FIMC) += setup-fimc.o
diff --git a/arch/arm/mach-exynos/clock-exynos4.c b/arch/arm/mach-exynos/clock-exynos4.c
index bbcb3dea0d40..8a8468d83c8c 100644
--- a/arch/arm/mach-exynos/clock-exynos4.c
+++ b/arch/arm/mach-exynos/clock-exynos4.c
@@ -24,7 +24,6 @@
24 24
25#include <mach/map.h> 25#include <mach/map.h>
26#include <mach/regs-clock.h> 26#include <mach/regs-clock.h>
27#include <mach/sysmmu.h>
28 27
29#include "common.h" 28#include "common.h"
30#include "clock-exynos4.h" 29#include "clock-exynos4.h"
@@ -709,53 +708,53 @@ static struct clk exynos4_init_clocks_off[] = {
709 .enable = exynos4_clk_ip_peril_ctrl, 708 .enable = exynos4_clk_ip_peril_ctrl,
710 .ctrlbit = (1 << 14), 709 .ctrlbit = (1 << 14),
711 }, { 710 }, {
712 .name = SYSMMU_CLOCK_NAME, 711 .name = "sysmmu",
713 .devname = SYSMMU_CLOCK_DEVNAME(mfc_l, 0), 712 .devname = "exynos-sysmmu.0",
714 .enable = exynos4_clk_ip_mfc_ctrl, 713 .enable = exynos4_clk_ip_mfc_ctrl,
715 .ctrlbit = (1 << 1), 714 .ctrlbit = (1 << 1),
716 }, { 715 }, {
717 .name = SYSMMU_CLOCK_NAME, 716 .name = "sysmmu",
718 .devname = SYSMMU_CLOCK_DEVNAME(mfc_r, 1), 717 .devname = "exynos-sysmmu.1",
719 .enable = exynos4_clk_ip_mfc_ctrl, 718 .enable = exynos4_clk_ip_mfc_ctrl,
720 .ctrlbit = (1 << 2), 719 .ctrlbit = (1 << 2),
721 }, { 720 }, {
722 .name = SYSMMU_CLOCK_NAME, 721 .name = "sysmmu",
723 .devname = SYSMMU_CLOCK_DEVNAME(tv, 2), 722 .devname = "exynos-sysmmu.2",
724 .enable = exynos4_clk_ip_tv_ctrl, 723 .enable = exynos4_clk_ip_tv_ctrl,
725 .ctrlbit = (1 << 4), 724 .ctrlbit = (1 << 4),
726 }, { 725 }, {
727 .name = SYSMMU_CLOCK_NAME, 726 .name = "sysmmu",
728 .devname = SYSMMU_CLOCK_DEVNAME(jpeg, 3), 727 .devname = "exynos-sysmmu.3",
729 .enable = exynos4_clk_ip_cam_ctrl, 728 .enable = exynos4_clk_ip_cam_ctrl,
730 .ctrlbit = (1 << 11), 729 .ctrlbit = (1 << 11),
731 }, { 730 }, {
732 .name = SYSMMU_CLOCK_NAME, 731 .name = "sysmmu",
733 .devname = SYSMMU_CLOCK_DEVNAME(rot, 4), 732 .devname = "exynos-sysmmu.4",
734 .enable = exynos4_clk_ip_image_ctrl, 733 .enable = exynos4_clk_ip_image_ctrl,
735 .ctrlbit = (1 << 4), 734 .ctrlbit = (1 << 4),
736 }, { 735 }, {
737 .name = SYSMMU_CLOCK_NAME, 736 .name = "sysmmu",
738 .devname = SYSMMU_CLOCK_DEVNAME(fimc0, 5), 737 .devname = "exynos-sysmmu.5",
739 .enable = exynos4_clk_ip_cam_ctrl, 738 .enable = exynos4_clk_ip_cam_ctrl,
740 .ctrlbit = (1 << 7), 739 .ctrlbit = (1 << 7),
741 }, { 740 }, {
742 .name = SYSMMU_CLOCK_NAME, 741 .name = "sysmmu",
743 .devname = SYSMMU_CLOCK_DEVNAME(fimc1, 6), 742 .devname = "exynos-sysmmu.6",
744 .enable = exynos4_clk_ip_cam_ctrl, 743 .enable = exynos4_clk_ip_cam_ctrl,
745 .ctrlbit = (1 << 8), 744 .ctrlbit = (1 << 8),
746 }, { 745 }, {
747 .name = SYSMMU_CLOCK_NAME, 746 .name = "sysmmu",
748 .devname = SYSMMU_CLOCK_DEVNAME(fimc2, 7), 747 .devname = "exynos-sysmmu.7",
749 .enable = exynos4_clk_ip_cam_ctrl, 748 .enable = exynos4_clk_ip_cam_ctrl,
750 .ctrlbit = (1 << 9), 749 .ctrlbit = (1 << 9),
751 }, { 750 }, {
752 .name = SYSMMU_CLOCK_NAME, 751 .name = "sysmmu",
753 .devname = SYSMMU_CLOCK_DEVNAME(fimc3, 8), 752 .devname = "exynos-sysmmu.8",
754 .enable = exynos4_clk_ip_cam_ctrl, 753 .enable = exynos4_clk_ip_cam_ctrl,
755 .ctrlbit = (1 << 10), 754 .ctrlbit = (1 << 10),
756 }, { 755 }, {
757 .name = SYSMMU_CLOCK_NAME, 756 .name = "sysmmu",
758 .devname = SYSMMU_CLOCK_DEVNAME(fimd0, 10), 757 .devname = "exynos-sysmmu.10",
759 .enable = exynos4_clk_ip_lcd0_ctrl, 758 .enable = exynos4_clk_ip_lcd0_ctrl,
760 .ctrlbit = (1 << 4), 759 .ctrlbit = (1 << 4),
761 } 760 }
diff --git a/arch/arm/mach-exynos/clock-exynos4210.c b/arch/arm/mach-exynos/clock-exynos4210.c
index fed4c26e9dad..19af9f783c56 100644
--- a/arch/arm/mach-exynos/clock-exynos4210.c
+++ b/arch/arm/mach-exynos/clock-exynos4210.c
@@ -26,7 +26,6 @@
26#include <mach/hardware.h> 26#include <mach/hardware.h>
27#include <mach/map.h> 27#include <mach/map.h>
28#include <mach/regs-clock.h> 28#include <mach/regs-clock.h>
29#include <mach/sysmmu.h>
30 29
31#include "common.h" 30#include "common.h"
32#include "clock-exynos4.h" 31#include "clock-exynos4.h"
@@ -129,13 +128,13 @@ static struct clk init_clocks_off[] = {
129 .enable = exynos4_clk_ip_lcd1_ctrl, 128 .enable = exynos4_clk_ip_lcd1_ctrl,
130 .ctrlbit = (1 << 0), 129 .ctrlbit = (1 << 0),
131 }, { 130 }, {
132 .name = SYSMMU_CLOCK_NAME, 131 .name = "sysmmu",
133 .devname = SYSMMU_CLOCK_DEVNAME(2d, 14), 132 .devname = "exynos-sysmmu.9",
134 .enable = exynos4_clk_ip_image_ctrl, 133 .enable = exynos4_clk_ip_image_ctrl,
135 .ctrlbit = (1 << 3), 134 .ctrlbit = (1 << 3),
136 }, { 135 }, {
137 .name = SYSMMU_CLOCK_NAME, 136 .name = "sysmmu",
138 .devname = SYSMMU_CLOCK_DEVNAME(fimd1, 11), 137 .devname = "exynos-sysmmu.11",
139 .enable = exynos4_clk_ip_lcd1_ctrl, 138 .enable = exynos4_clk_ip_lcd1_ctrl,
140 .ctrlbit = (1 << 4), 139 .ctrlbit = (1 << 4),
141 }, { 140 }, {
diff --git a/arch/arm/mach-exynos/clock-exynos4212.c b/arch/arm/mach-exynos/clock-exynos4212.c
index 8fba0b5fb8ab..529476f8ec71 100644
--- a/arch/arm/mach-exynos/clock-exynos4212.c
+++ b/arch/arm/mach-exynos/clock-exynos4212.c
@@ -26,7 +26,6 @@
26#include <mach/hardware.h> 26#include <mach/hardware.h>
27#include <mach/map.h> 27#include <mach/map.h>
28#include <mach/regs-clock.h> 28#include <mach/regs-clock.h>
29#include <mach/sysmmu.h>
30 29
31#include "common.h" 30#include "common.h"
32#include "clock-exynos4.h" 31#include "clock-exynos4.h"
@@ -111,21 +110,31 @@ static struct clksrc_clk clksrcs[] = {
111 110
112static struct clk init_clocks_off[] = { 111static struct clk init_clocks_off[] = {
113 { 112 {
114 .name = SYSMMU_CLOCK_NAME, 113 .name = "sysmmu",
115 .devname = SYSMMU_CLOCK_DEVNAME(2d, 14), 114 .devname = "exynos-sysmmu.9",
116 .enable = exynos4_clk_ip_dmc_ctrl, 115 .enable = exynos4_clk_ip_dmc_ctrl,
117 .ctrlbit = (1 << 24), 116 .ctrlbit = (1 << 24),
118 }, { 117 }, {
119 .name = SYSMMU_CLOCK_NAME, 118 .name = "sysmmu",
120 .devname = SYSMMU_CLOCK_DEVNAME(isp, 9), 119 .devname = "exynos-sysmmu.12",
121 .enable = exynos4212_clk_ip_isp0_ctrl, 120 .enable = exynos4212_clk_ip_isp0_ctrl,
122 .ctrlbit = (7 << 8), 121 .ctrlbit = (7 << 8),
123 }, { 122 }, {
124 .name = SYSMMU_CLOCK_NAME2, 123 .name = "sysmmu",
125 .devname = SYSMMU_CLOCK_DEVNAME(isp, 9), 124 .devname = "exynos-sysmmu.13",
126 .enable = exynos4212_clk_ip_isp1_ctrl, 125 .enable = exynos4212_clk_ip_isp1_ctrl,
127 .ctrlbit = (1 << 4), 126 .ctrlbit = (1 << 4),
128 }, { 127 }, {
128 .name = "sysmmu",
129 .devname = "exynos-sysmmu.14",
130 .enable = exynos4212_clk_ip_isp0_ctrl,
131 .ctrlbit = (1 << 11),
132 }, {
133 .name = "sysmmu",
134 .devname = "exynos-sysmmu.15",
135 .enable = exynos4212_clk_ip_isp0_ctrl,
136 .ctrlbit = (1 << 12),
137 }, {
129 .name = "flite", 138 .name = "flite",
130 .devname = "exynos-fimc-lite.0", 139 .devname = "exynos-fimc-lite.0",
131 .enable = exynos4212_clk_ip_isp0_ctrl, 140 .enable = exynos4212_clk_ip_isp0_ctrl,
diff --git a/arch/arm/mach-exynos/clock-exynos5.c b/arch/arm/mach-exynos/clock-exynos5.c
index e9d7b80bae49..b0ea31fc9fb8 100644
--- a/arch/arm/mach-exynos/clock-exynos5.c
+++ b/arch/arm/mach-exynos/clock-exynos5.c
@@ -24,7 +24,6 @@
24 24
25#include <mach/map.h> 25#include <mach/map.h>
26#include <mach/regs-clock.h> 26#include <mach/regs-clock.h>
27#include <mach/sysmmu.h>
28 27
29#include "common.h" 28#include "common.h"
30 29
@@ -859,73 +858,78 @@ static struct clk exynos5_init_clocks_off[] = {
859 .enable = exynos5_clk_ip_gscl_ctrl, 858 .enable = exynos5_clk_ip_gscl_ctrl,
860 .ctrlbit = (1 << 3), 859 .ctrlbit = (1 << 3),
861 }, { 860 }, {
862 .name = SYSMMU_CLOCK_NAME, 861 .name = "sysmmu",
863 .devname = SYSMMU_CLOCK_DEVNAME(mfc_l, 0), 862 .devname = "exynos-sysmmu.1",
864 .enable = &exynos5_clk_ip_mfc_ctrl, 863 .enable = &exynos5_clk_ip_mfc_ctrl,
865 .ctrlbit = (1 << 1), 864 .ctrlbit = (1 << 1),
866 }, { 865 }, {
867 .name = SYSMMU_CLOCK_NAME, 866 .name = "sysmmu",
868 .devname = SYSMMU_CLOCK_DEVNAME(mfc_r, 1), 867 .devname = "exynos-sysmmu.0",
869 .enable = &exynos5_clk_ip_mfc_ctrl, 868 .enable = &exynos5_clk_ip_mfc_ctrl,
870 .ctrlbit = (1 << 2), 869 .ctrlbit = (1 << 2),
871 }, { 870 }, {
872 .name = SYSMMU_CLOCK_NAME, 871 .name = "sysmmu",
873 .devname = SYSMMU_CLOCK_DEVNAME(tv, 2), 872 .devname = "exynos-sysmmu.2",
874 .enable = &exynos5_clk_ip_disp1_ctrl, 873 .enable = &exynos5_clk_ip_disp1_ctrl,
875 .ctrlbit = (1 << 9) 874 .ctrlbit = (1 << 9)
876 }, { 875 }, {
877 .name = SYSMMU_CLOCK_NAME, 876 .name = "sysmmu",
878 .devname = SYSMMU_CLOCK_DEVNAME(jpeg, 3), 877 .devname = "exynos-sysmmu.3",
879 .enable = &exynos5_clk_ip_gen_ctrl, 878 .enable = &exynos5_clk_ip_gen_ctrl,
880 .ctrlbit = (1 << 7), 879 .ctrlbit = (1 << 7),
881 }, { 880 }, {
882 .name = SYSMMU_CLOCK_NAME, 881 .name = "sysmmu",
883 .devname = SYSMMU_CLOCK_DEVNAME(rot, 4), 882 .devname = "exynos-sysmmu.4",
884 .enable = &exynos5_clk_ip_gen_ctrl, 883 .enable = &exynos5_clk_ip_gen_ctrl,
885 .ctrlbit = (1 << 6) 884 .ctrlbit = (1 << 6)
886 }, { 885 }, {
887 .name = SYSMMU_CLOCK_NAME, 886 .name = "sysmmu",
888 .devname = SYSMMU_CLOCK_DEVNAME(gsc0, 5), 887 .devname = "exynos-sysmmu.5",
889 .enable = &exynos5_clk_ip_gscl_ctrl, 888 .enable = &exynos5_clk_ip_gscl_ctrl,
890 .ctrlbit = (1 << 7), 889 .ctrlbit = (1 << 7),
891 }, { 890 }, {
892 .name = SYSMMU_CLOCK_NAME, 891 .name = "sysmmu",
893 .devname = SYSMMU_CLOCK_DEVNAME(gsc1, 6), 892 .devname = "exynos-sysmmu.6",
894 .enable = &exynos5_clk_ip_gscl_ctrl, 893 .enable = &exynos5_clk_ip_gscl_ctrl,
895 .ctrlbit = (1 << 8), 894 .ctrlbit = (1 << 8),
896 }, { 895 }, {
897 .name = SYSMMU_CLOCK_NAME, 896 .name = "sysmmu",
898 .devname = SYSMMU_CLOCK_DEVNAME(gsc2, 7), 897 .devname = "exynos-sysmmu.7",
899 .enable = &exynos5_clk_ip_gscl_ctrl, 898 .enable = &exynos5_clk_ip_gscl_ctrl,
900 .ctrlbit = (1 << 9), 899 .ctrlbit = (1 << 9),
901 }, { 900 }, {
902 .name = SYSMMU_CLOCK_NAME, 901 .name = "sysmmu",
903 .devname = SYSMMU_CLOCK_DEVNAME(gsc3, 8), 902 .devname = "exynos-sysmmu.8",
904 .enable = &exynos5_clk_ip_gscl_ctrl, 903 .enable = &exynos5_clk_ip_gscl_ctrl,
905 .ctrlbit = (1 << 10), 904 .ctrlbit = (1 << 10),
906 }, { 905 }, {
907 .name = SYSMMU_CLOCK_NAME, 906 .name = "sysmmu",
908 .devname = SYSMMU_CLOCK_DEVNAME(isp, 9), 907 .devname = "exynos-sysmmu.9",
909 .enable = &exynos5_clk_ip_isp0_ctrl, 908 .enable = &exynos5_clk_ip_isp0_ctrl,
910 .ctrlbit = (0x3F << 8), 909 .ctrlbit = (0x3F << 8),
911 }, { 910 }, {
912 .name = SYSMMU_CLOCK_NAME2, 911 .name = "sysmmu",
913 .devname = SYSMMU_CLOCK_DEVNAME(isp, 9), 912 .devname = "exynos-sysmmu.10",
914 .enable = &exynos5_clk_ip_isp1_ctrl, 913 .enable = &exynos5_clk_ip_isp1_ctrl,
915 .ctrlbit = (0xF << 4), 914 .ctrlbit = (0xF << 4),
916 }, { 915 }, {
917 .name = SYSMMU_CLOCK_NAME, 916 .name = "sysmmu",
918 .devname = SYSMMU_CLOCK_DEVNAME(camif0, 12), 917 .devname = "exynos-sysmmu.11",
918 .enable = &exynos5_clk_ip_disp1_ctrl,
919 .ctrlbit = (1 << 8)
920 }, {
921 .name = "sysmmu",
922 .devname = "exynos-sysmmu.12",
919 .enable = &exynos5_clk_ip_gscl_ctrl, 923 .enable = &exynos5_clk_ip_gscl_ctrl,
920 .ctrlbit = (1 << 11), 924 .ctrlbit = (1 << 11),
921 }, { 925 }, {
922 .name = SYSMMU_CLOCK_NAME, 926 .name = "sysmmu",
923 .devname = SYSMMU_CLOCK_DEVNAME(camif1, 13), 927 .devname = "exynos-sysmmu.13",
924 .enable = &exynos5_clk_ip_gscl_ctrl, 928 .enable = &exynos5_clk_ip_gscl_ctrl,
925 .ctrlbit = (1 << 12), 929 .ctrlbit = (1 << 12),
926 }, { 930 }, {
927 .name = SYSMMU_CLOCK_NAME, 931 .name = "sysmmu",
928 .devname = SYSMMU_CLOCK_DEVNAME(2d, 14), 932 .devname = "exynos-sysmmu.14",
929 .enable = &exynos5_clk_ip_acp_ctrl, 933 .enable = &exynos5_clk_ip_acp_ctrl,
930 .ctrlbit = (1 << 7) 934 .ctrlbit = (1 << 7)
931 } 935 }
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index 1a89824a5f78..d63d399c7bae 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -12,6 +12,7 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/interrupt.h> 13#include <linux/interrupt.h>
14#include <linux/irq.h> 14#include <linux/irq.h>
15#include <linux/irqchip.h>
15#include <linux/io.h> 16#include <linux/io.h>
16#include <linux/device.h> 17#include <linux/device.h>
17#include <linux/gpio.h> 18#include <linux/gpio.h>
@@ -22,12 +23,13 @@
22#include <linux/of_irq.h> 23#include <linux/of_irq.h>
23#include <linux/export.h> 24#include <linux/export.h>
24#include <linux/irqdomain.h> 25#include <linux/irqdomain.h>
26#include <linux/irqchip.h>
25#include <linux/of_address.h> 27#include <linux/of_address.h>
28#include <linux/irqchip/arm-gic.h>
26 29
27#include <asm/proc-fns.h> 30#include <asm/proc-fns.h>
28#include <asm/exception.h> 31#include <asm/exception.h>
29#include <asm/hardware/cache-l2x0.h> 32#include <asm/hardware/cache-l2x0.h>
30#include <asm/hardware/gic.h>
31#include <asm/mach/map.h> 33#include <asm/mach/map.h>
32#include <asm/mach/irq.h> 34#include <asm/mach/irq.h>
33#include <asm/cacheflush.h> 35#include <asm/cacheflush.h>
@@ -35,7 +37,6 @@
35#include <mach/regs-irq.h> 37#include <mach/regs-irq.h>
36#include <mach/regs-pmu.h> 38#include <mach/regs-pmu.h>
37#include <mach/regs-gpio.h> 39#include <mach/regs-gpio.h>
38#include <mach/pmu.h>
39 40
40#include <plat/cpu.h> 41#include <plat/cpu.h>
41#include <plat/clock.h> 42#include <plat/clock.h>
@@ -299,6 +300,7 @@ void exynos4_restart(char mode, const char *cmd)
299 300
300void exynos5_restart(char mode, const char *cmd) 301void exynos5_restart(char mode, const char *cmd)
301{ 302{
303 struct device_node *np;
302 u32 val; 304 u32 val;
303 void __iomem *addr; 305 void __iomem *addr;
304 306
@@ -306,8 +308,9 @@ void exynos5_restart(char mode, const char *cmd)
306 val = 0x1; 308 val = 0x1;
307 addr = EXYNOS_SWRESET; 309 addr = EXYNOS_SWRESET;
308 } else if (of_machine_is_compatible("samsung,exynos5440")) { 310 } else if (of_machine_is_compatible("samsung,exynos5440")) {
309 val = (0x10 << 20) | (0x1 << 16); 311 np = of_find_compatible_node(NULL, NULL, "samsung,exynos5440-clock");
310 addr = EXYNOS5440_SWRESET; 312 addr = of_iomap(np, 0) + 0xcc;
313 val = (0xfff << 20) | (0x1 << 16);
311 } else { 314 } else {
312 pr_err("%s: cannot support non-DT\n", __func__); 315 pr_err("%s: cannot support non-DT\n", __func__);
313 return; 316 return;
@@ -438,220 +441,6 @@ static void __init exynos5_init_clocks(int xtal)
438#endif 441#endif
439} 442}
440 443
441#define COMBINER_ENABLE_SET 0x0
442#define COMBINER_ENABLE_CLEAR 0x4
443#define COMBINER_INT_STATUS 0xC
444
445static DEFINE_SPINLOCK(irq_controller_lock);
446
447struct combiner_chip_data {
448 unsigned int irq_offset;
449 unsigned int irq_mask;
450 void __iomem *base;
451};
452
453static struct irq_domain *combiner_irq_domain;
454static struct combiner_chip_data combiner_data[MAX_COMBINER_NR];
455
456static inline void __iomem *combiner_base(struct irq_data *data)
457{
458 struct combiner_chip_data *combiner_data =
459 irq_data_get_irq_chip_data(data);
460
461 return combiner_data->base;
462}
463
464static void combiner_mask_irq(struct irq_data *data)
465{
466 u32 mask = 1 << (data->hwirq % 32);
467
468 __raw_writel(mask, combiner_base(data) + COMBINER_ENABLE_CLEAR);
469}
470
471static void combiner_unmask_irq(struct irq_data *data)
472{
473 u32 mask = 1 << (data->hwirq % 32);
474
475 __raw_writel(mask, combiner_base(data) + COMBINER_ENABLE_SET);
476}
477
478static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
479{
480 struct combiner_chip_data *chip_data = irq_get_handler_data(irq);
481 struct irq_chip *chip = irq_get_chip(irq);
482 unsigned int cascade_irq, combiner_irq;
483 unsigned long status;
484
485 chained_irq_enter(chip, desc);
486
487 spin_lock(&irq_controller_lock);
488 status = __raw_readl(chip_data->base + COMBINER_INT_STATUS);
489 spin_unlock(&irq_controller_lock);
490 status &= chip_data->irq_mask;
491
492 if (status == 0)
493 goto out;
494
495 combiner_irq = __ffs(status);
496
497 cascade_irq = combiner_irq + (chip_data->irq_offset & ~31);
498 if (unlikely(cascade_irq >= NR_IRQS))
499 do_bad_IRQ(cascade_irq, desc);
500 else
501 generic_handle_irq(cascade_irq);
502
503 out:
504 chained_irq_exit(chip, desc);
505}
506
507static struct irq_chip combiner_chip = {
508 .name = "COMBINER",
509 .irq_mask = combiner_mask_irq,
510 .irq_unmask = combiner_unmask_irq,
511};
512
513static void __init combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq)
514{
515 unsigned int max_nr;
516
517 if (soc_is_exynos5250())
518 max_nr = EXYNOS5_MAX_COMBINER_NR;
519 else
520 max_nr = EXYNOS4_MAX_COMBINER_NR;
521
522 if (combiner_nr >= max_nr)
523 BUG();
524 if (irq_set_handler_data(irq, &combiner_data[combiner_nr]) != 0)
525 BUG();
526 irq_set_chained_handler(irq, combiner_handle_cascade_irq);
527}
528
529static void __init combiner_init_one(unsigned int combiner_nr,
530 void __iomem *base)
531{
532 combiner_data[combiner_nr].base = base;
533 combiner_data[combiner_nr].irq_offset = irq_find_mapping(
534 combiner_irq_domain, combiner_nr * MAX_IRQ_IN_COMBINER);
535 combiner_data[combiner_nr].irq_mask = 0xff << ((combiner_nr % 4) << 3);
536
537 /* Disable all interrupts */
538 __raw_writel(combiner_data[combiner_nr].irq_mask,
539 base + COMBINER_ENABLE_CLEAR);
540}
541
542#ifdef CONFIG_OF
543static int combiner_irq_domain_xlate(struct irq_domain *d,
544 struct device_node *controller,
545 const u32 *intspec, unsigned int intsize,
546 unsigned long *out_hwirq,
547 unsigned int *out_type)
548{
549 if (d->of_node != controller)
550 return -EINVAL;
551
552 if (intsize < 2)
553 return -EINVAL;
554
555 *out_hwirq = intspec[0] * MAX_IRQ_IN_COMBINER + intspec[1];
556 *out_type = 0;
557
558 return 0;
559}
560#else
561static int combiner_irq_domain_xlate(struct irq_domain *d,
562 struct device_node *controller,
563 const u32 *intspec, unsigned int intsize,
564 unsigned long *out_hwirq,
565 unsigned int *out_type)
566{
567 return -EINVAL;
568}
569#endif
570
571static int combiner_irq_domain_map(struct irq_domain *d, unsigned int irq,
572 irq_hw_number_t hw)
573{
574 irq_set_chip_and_handler(irq, &combiner_chip, handle_level_irq);
575 irq_set_chip_data(irq, &combiner_data[hw >> 3]);
576 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
577
578 return 0;
579}
580
581static struct irq_domain_ops combiner_irq_domain_ops = {
582 .xlate = combiner_irq_domain_xlate,
583 .map = combiner_irq_domain_map,
584};
585
586static void __init combiner_init(void __iomem *combiner_base,
587 struct device_node *np)
588{
589 int i, irq, irq_base;
590 unsigned int max_nr, nr_irq;
591
592 if (np) {
593 if (of_property_read_u32(np, "samsung,combiner-nr", &max_nr)) {
594 pr_warning("%s: number of combiners not specified, "
595 "setting default as %d.\n",
596 __func__, EXYNOS4_MAX_COMBINER_NR);
597 max_nr = EXYNOS4_MAX_COMBINER_NR;
598 }
599 } else {
600 max_nr = soc_is_exynos5250() ? EXYNOS5_MAX_COMBINER_NR :
601 EXYNOS4_MAX_COMBINER_NR;
602 }
603 nr_irq = max_nr * MAX_IRQ_IN_COMBINER;
604
605 irq_base = irq_alloc_descs(COMBINER_IRQ(0, 0), 1, nr_irq, 0);
606 if (IS_ERR_VALUE(irq_base)) {
607 irq_base = COMBINER_IRQ(0, 0);
608 pr_warning("%s: irq desc alloc failed. Continuing with %d as linux irq base\n", __func__, irq_base);
609 }
610
611 combiner_irq_domain = irq_domain_add_legacy(np, nr_irq, irq_base, 0,
612 &combiner_irq_domain_ops, &combiner_data);
613 if (WARN_ON(!combiner_irq_domain)) {
614 pr_warning("%s: irq domain init failed\n", __func__);
615 return;
616 }
617
618 for (i = 0; i < max_nr; i++) {
619 combiner_init_one(i, combiner_base + (i >> 2) * 0x10);
620 irq = IRQ_SPI(i);
621#ifdef CONFIG_OF
622 if (np)
623 irq = irq_of_parse_and_map(np, i);
624#endif
625 combiner_cascade_irq(i, irq);
626 }
627}
628
629#ifdef CONFIG_OF
630static int __init combiner_of_init(struct device_node *np,
631 struct device_node *parent)
632{
633 void __iomem *combiner_base;
634
635 combiner_base = of_iomap(np, 0);
636 if (!combiner_base) {
637 pr_err("%s: failed to map combiner registers\n", __func__);
638 return -ENXIO;
639 }
640
641 combiner_init(combiner_base, np);
642
643 return 0;
644}
645
646static const struct of_device_id exynos_dt_irq_match[] = {
647 { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
648 { .compatible = "arm,cortex-a15-gic", .data = gic_of_init, },
649 { .compatible = "samsung,exynos4210-combiner",
650 .data = combiner_of_init, },
651 {},
652};
653#endif
654
655void __init exynos4_init_irq(void) 444void __init exynos4_init_irq(void)
656{ 445{
657 unsigned int gic_bank_offset; 446 unsigned int gic_bank_offset;
@@ -662,7 +451,7 @@ void __init exynos4_init_irq(void)
662 gic_init_bases(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU, gic_bank_offset, NULL); 451 gic_init_bases(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU, gic_bank_offset, NULL);
663#ifdef CONFIG_OF 452#ifdef CONFIG_OF
664 else 453 else
665 of_irq_init(exynos_dt_irq_match); 454 irqchip_init();
666#endif 455#endif
667 456
668 if (!of_have_populated_dt()) 457 if (!of_have_populated_dt())
@@ -679,7 +468,7 @@ void __init exynos4_init_irq(void)
679void __init exynos5_init_irq(void) 468void __init exynos5_init_irq(void)
680{ 469{
681#ifdef CONFIG_OF 470#ifdef CONFIG_OF
682 of_irq_init(exynos_dt_irq_match); 471 irqchip_init();
683#endif 472#endif
684 /* 473 /*
685 * The parameters of s5p_init_irq() are for VIC init. 474 * The parameters of s5p_init_irq() are for VIC init.
@@ -1031,8 +820,8 @@ static int __init exynos_init_irq_eint(void)
1031 * interrupt support code here can be completely removed. 820 * interrupt support code here can be completely removed.
1032 */ 821 */
1033 static const struct of_device_id exynos_pinctrl_ids[] = { 822 static const struct of_device_id exynos_pinctrl_ids[] = {
1034 { .compatible = "samsung,pinctrl-exynos4210", }, 823 { .compatible = "samsung,exynos4210-pinctrl", },
1035 { .compatible = "samsung,pinctrl-exynos4x12", }, 824 { .compatible = "samsung,exynos4x12-pinctrl", },
1036 }; 825 };
1037 struct device_node *pctrl_np, *wkup_np; 826 struct device_node *pctrl_np, *wkup_np;
1038 const char *wkup_compat = "samsung,exynos4210-wakeup-eint"; 827 const char *wkup_compat = "samsung,exynos4210-wakeup-eint";
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 04744f9c120f..9339bb8954be 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -12,7 +12,7 @@
12#ifndef __ARCH_ARM_MACH_EXYNOS_COMMON_H 12#ifndef __ARCH_ARM_MACH_EXYNOS_COMMON_H
13#define __ARCH_ARM_MACH_EXYNOS_COMMON_H 13#define __ARCH_ARM_MACH_EXYNOS_COMMON_H
14 14
15extern struct sys_timer exynos4_timer; 15extern void exynos4_timer_init(void);
16 16
17struct map_desc; 17struct map_desc;
18void exynos_init_io(struct map_desc *mach_desc, int size); 18void exynos_init_io(struct map_desc *mach_desc, int size);
@@ -60,8 +60,31 @@ void exynos4212_register_clocks(void);
60#define exynos4212_register_clocks() 60#define exynos4212_register_clocks()
61#endif 61#endif
62 62
63struct device_node;
64void combiner_init(void __iomem *combiner_base, struct device_node *np);
65
63extern struct smp_operations exynos_smp_ops; 66extern struct smp_operations exynos_smp_ops;
64 67
65extern void exynos_cpu_die(unsigned int cpu); 68extern void exynos_cpu_die(unsigned int cpu);
66 69
70/* PMU(Power Management Unit) support */
71
72#define PMU_TABLE_END NULL
73
74enum sys_powerdown {
75 SYS_AFTR,
76 SYS_LPA,
77 SYS_SLEEP,
78 NUM_SYS_POWERDOWN,
79};
80
81extern unsigned long l2x0_regs_phys;
82struct exynos_pmu_conf {
83 void __iomem *reg;
84 unsigned int val[NUM_SYS_POWERDOWN];
85};
86
87extern void exynos_sys_powerdown_conf(enum sys_powerdown mode);
88extern void s3c_cpu_resume(void);
89
67#endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */ 90#endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */
diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c
index 050924152776..fcfe0251aa3e 100644
--- a/arch/arm/mach-exynos/cpuidle.c
+++ b/arch/arm/mach-exynos/cpuidle.c
@@ -23,10 +23,11 @@
23#include <asm/cpuidle.h> 23#include <asm/cpuidle.h>
24#include <mach/regs-clock.h> 24#include <mach/regs-clock.h>
25#include <mach/regs-pmu.h> 25#include <mach/regs-pmu.h>
26#include <mach/pmu.h>
27 26
28#include <plat/cpu.h> 27#include <plat/cpu.h>
29 28
29#include "common.h"
30
30#define REG_DIRECTGO_ADDR (samsung_rev() == EXYNOS4210_REV_1_1 ? \ 31#define REG_DIRECTGO_ADDR (samsung_rev() == EXYNOS4210_REV_1_1 ? \
31 S5P_INFORM7 : (samsung_rev() == EXYNOS4210_REV_1_0 ? \ 32 S5P_INFORM7 : (samsung_rev() == EXYNOS4210_REV_1_0 ? \
32 (S5P_VA_SYSRAM + 0x24) : S5P_INFORM0)) 33 (S5P_VA_SYSRAM + 0x24) : S5P_INFORM0))
diff --git a/arch/arm/mach-exynos/dev-audio.c b/arch/arm/mach-exynos/dev-audio.c
index 9d1a60951d7b..c662c89794b2 100644
--- a/arch/arm/mach-exynos/dev-audio.c
+++ b/arch/arm/mach-exynos/dev-audio.c
@@ -21,7 +21,8 @@
21#include <mach/map.h> 21#include <mach/map.h>
22#include <mach/dma.h> 22#include <mach/dma.h>
23#include <mach/irqs.h> 23#include <mach/irqs.h>
24#include <mach/regs-audss.h> 24
25#define EXYNOS4_AUDSS_INT_MEM (0x03000000)
25 26
26static int exynos4_cfg_i2s(struct platform_device *pdev) 27static int exynos4_cfg_i2s(struct platform_device *pdev)
27{ 28{
diff --git a/arch/arm/mach-exynos/dev-sysmmu.c b/arch/arm/mach-exynos/dev-sysmmu.c
deleted file mode 100644
index c5b1ea301df0..000000000000
--- a/arch/arm/mach-exynos/dev-sysmmu.c
+++ /dev/null
@@ -1,274 +0,0 @@
1/* linux/arch/arm/mach-exynos/dev-sysmmu.c
2 *
3 * Copyright (c) 2010-2012 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * EXYNOS - System MMU 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/platform_device.h>
14#include <linux/dma-mapping.h>
15
16#include <plat/cpu.h>
17
18#include <mach/map.h>
19#include <mach/irqs.h>
20#include <mach/sysmmu.h>
21
22static u64 exynos_sysmmu_dma_mask = DMA_BIT_MASK(32);
23
24#define SYSMMU_PLATFORM_DEVICE(ipname, devid) \
25static struct sysmmu_platform_data platdata_##ipname = { \
26 .dbgname = #ipname, \
27}; \
28struct platform_device SYSMMU_PLATDEV(ipname) = \
29{ \
30 .name = SYSMMU_DEVNAME_BASE, \
31 .id = devid, \
32 .dev = { \
33 .dma_mask = &exynos_sysmmu_dma_mask, \
34 .coherent_dma_mask = DMA_BIT_MASK(32), \
35 .platform_data = &platdata_##ipname, \
36 }, \
37}
38
39SYSMMU_PLATFORM_DEVICE(mfc_l, 0);
40SYSMMU_PLATFORM_DEVICE(mfc_r, 1);
41SYSMMU_PLATFORM_DEVICE(tv, 2);
42SYSMMU_PLATFORM_DEVICE(jpeg, 3);
43SYSMMU_PLATFORM_DEVICE(rot, 4);
44SYSMMU_PLATFORM_DEVICE(fimc0, 5); /* fimc* and gsc* exist exclusively */
45SYSMMU_PLATFORM_DEVICE(fimc1, 6);
46SYSMMU_PLATFORM_DEVICE(fimc2, 7);
47SYSMMU_PLATFORM_DEVICE(fimc3, 8);
48SYSMMU_PLATFORM_DEVICE(gsc0, 5);
49SYSMMU_PLATFORM_DEVICE(gsc1, 6);
50SYSMMU_PLATFORM_DEVICE(gsc2, 7);
51SYSMMU_PLATFORM_DEVICE(gsc3, 8);
52SYSMMU_PLATFORM_DEVICE(isp, 9);
53SYSMMU_PLATFORM_DEVICE(fimd0, 10);
54SYSMMU_PLATFORM_DEVICE(fimd1, 11);
55SYSMMU_PLATFORM_DEVICE(camif0, 12);
56SYSMMU_PLATFORM_DEVICE(camif1, 13);
57SYSMMU_PLATFORM_DEVICE(2d, 14);
58
59#define SYSMMU_RESOURCE_NAME(core, ipname) sysmmures_##core##_##ipname
60
61#define SYSMMU_RESOURCE(core, ipname) \
62 static struct resource SYSMMU_RESOURCE_NAME(core, ipname)[] __initdata =
63
64#define DEFINE_SYSMMU_RESOURCE(core, mem, irq) \
65 DEFINE_RES_MEM_NAMED(core##_PA_SYSMMU_##mem, SZ_4K, #mem), \
66 DEFINE_RES_IRQ_NAMED(core##_IRQ_SYSMMU_##irq##_0, #mem)
67
68#define SYSMMU_RESOURCE_DEFINE(core, ipname, mem, irq) \
69 SYSMMU_RESOURCE(core, ipname) { \
70 DEFINE_SYSMMU_RESOURCE(core, mem, irq) \
71 }
72
73struct sysmmu_resource_map {
74 struct platform_device *pdev;
75 struct resource *res;
76 u32 rnum;
77 struct device *pdd;
78 char *clocknames;
79};
80
81#define SYSMMU_RESOURCE_MAPPING(core, ipname, resname) { \
82 .pdev = &SYSMMU_PLATDEV(ipname), \
83 .res = SYSMMU_RESOURCE_NAME(EXYNOS##core, resname), \
84 .rnum = ARRAY_SIZE(SYSMMU_RESOURCE_NAME(EXYNOS##core, resname)),\
85 .clocknames = SYSMMU_CLOCK_NAME, \
86}
87
88#define SYSMMU_RESOURCE_MAPPING_MC(core, ipname, resname, pdata) { \
89 .pdev = &SYSMMU_PLATDEV(ipname), \
90 .res = SYSMMU_RESOURCE_NAME(EXYNOS##core, resname), \
91 .rnum = ARRAY_SIZE(SYSMMU_RESOURCE_NAME(EXYNOS##core, resname)),\
92 .clocknames = SYSMMU_CLOCK_NAME "," SYSMMU_CLOCK_NAME2, \
93}
94
95#ifdef CONFIG_EXYNOS_DEV_PD
96#define SYSMMU_RESOURCE_MAPPING_PD(core, ipname, resname, pd) { \
97 .pdev = &SYSMMU_PLATDEV(ipname), \
98 .res = &SYSMMU_RESOURCE_NAME(EXYNOS##core, resname), \
99 .rnum = ARRAY_SIZE(SYSMMU_RESOURCE_NAME(EXYNOS##core, resname)),\
100 .clocknames = SYSMMU_CLOCK_NAME, \
101 .pdd = &exynos##core##_device_pd[pd].dev, \
102}
103
104#define SYSMMU_RESOURCE_MAPPING_MCPD(core, ipname, resname, pd, pdata) {\
105 .pdev = &SYSMMU_PLATDEV(ipname), \
106 .res = &SYSMMU_RESOURCE_NAME(EXYNOS##core, resname), \
107 .rnum = ARRAY_SIZE(SYSMMU_RESOURCE_NAME(EXYNOS##core, resname)),\
108 .clocknames = SYSMMU_CLOCK_NAME "," SYSMMU_CLOCK_NAME2, \
109 .pdd = &exynos##core##_device_pd[pd].dev, \
110}
111#else
112#define SYSMMU_RESOURCE_MAPPING_PD(core, ipname, resname, pd) \
113 SYSMMU_RESOURCE_MAPPING(core, ipname, resname)
114#define SYSMMU_RESOURCE_MAPPING_MCPD(core, ipname, resname, pd, pdata) \
115 SYSMMU_RESOURCE_MAPPING_MC(core, ipname, resname, pdata)
116
117#endif /* CONFIG_EXYNOS_DEV_PD */
118
119#ifdef CONFIG_ARCH_EXYNOS4
120SYSMMU_RESOURCE_DEFINE(EXYNOS4, fimc0, FIMC0, FIMC0);
121SYSMMU_RESOURCE_DEFINE(EXYNOS4, fimc1, FIMC1, FIMC1);
122SYSMMU_RESOURCE_DEFINE(EXYNOS4, fimc2, FIMC2, FIMC2);
123SYSMMU_RESOURCE_DEFINE(EXYNOS4, fimc3, FIMC3, FIMC3);
124SYSMMU_RESOURCE_DEFINE(EXYNOS4, jpeg, JPEG, JPEG);
125SYSMMU_RESOURCE_DEFINE(EXYNOS4, 2d, G2D, 2D);
126SYSMMU_RESOURCE_DEFINE(EXYNOS4, tv, TV, TV_M0);
127SYSMMU_RESOURCE_DEFINE(EXYNOS4, 2d_acp, 2D_ACP, 2D);
128SYSMMU_RESOURCE_DEFINE(EXYNOS4, rot, ROTATOR, ROTATOR);
129SYSMMU_RESOURCE_DEFINE(EXYNOS4, fimd0, FIMD0, LCD0_M0);
130SYSMMU_RESOURCE_DEFINE(EXYNOS4, fimd1, FIMD1, LCD1_M1);
131SYSMMU_RESOURCE_DEFINE(EXYNOS4, flite0, FIMC_LITE0, FIMC_LITE0);
132SYSMMU_RESOURCE_DEFINE(EXYNOS4, flite1, FIMC_LITE1, FIMC_LITE1);
133SYSMMU_RESOURCE_DEFINE(EXYNOS4, mfc_r, MFC_R, MFC_M0);
134SYSMMU_RESOURCE_DEFINE(EXYNOS4, mfc_l, MFC_L, MFC_M1);
135SYSMMU_RESOURCE(EXYNOS4, isp) {
136 DEFINE_SYSMMU_RESOURCE(EXYNOS4, FIMC_ISP, FIMC_ISP),
137 DEFINE_SYSMMU_RESOURCE(EXYNOS4, FIMC_DRC, FIMC_DRC),
138 DEFINE_SYSMMU_RESOURCE(EXYNOS4, FIMC_FD, FIMC_FD),
139 DEFINE_SYSMMU_RESOURCE(EXYNOS4, ISPCPU, FIMC_CX),
140};
141
142static struct sysmmu_resource_map sysmmu_resmap4[] __initdata = {
143 SYSMMU_RESOURCE_MAPPING_PD(4, fimc0, fimc0, PD_CAM),
144 SYSMMU_RESOURCE_MAPPING_PD(4, fimc1, fimc1, PD_CAM),
145 SYSMMU_RESOURCE_MAPPING_PD(4, fimc2, fimc2, PD_CAM),
146 SYSMMU_RESOURCE_MAPPING_PD(4, fimc3, fimc3, PD_CAM),
147 SYSMMU_RESOURCE_MAPPING_PD(4, tv, tv, PD_TV),
148 SYSMMU_RESOURCE_MAPPING_PD(4, mfc_r, mfc_r, PD_MFC),
149 SYSMMU_RESOURCE_MAPPING_PD(4, mfc_l, mfc_l, PD_MFC),
150 SYSMMU_RESOURCE_MAPPING_PD(4, rot, rot, PD_LCD0),
151 SYSMMU_RESOURCE_MAPPING_PD(4, jpeg, jpeg, PD_CAM),
152 SYSMMU_RESOURCE_MAPPING_PD(4, fimd0, fimd0, PD_LCD0),
153};
154
155static struct sysmmu_resource_map sysmmu_resmap4210[] __initdata = {
156 SYSMMU_RESOURCE_MAPPING_PD(4, 2d, 2d, PD_LCD0),
157 SYSMMU_RESOURCE_MAPPING_PD(4, fimd1, fimd1, PD_LCD1),
158};
159
160static struct sysmmu_resource_map sysmmu_resmap4212[] __initdata = {
161 SYSMMU_RESOURCE_MAPPING(4, 2d, 2d_acp),
162 SYSMMU_RESOURCE_MAPPING_PD(4, camif0, flite0, PD_ISP),
163 SYSMMU_RESOURCE_MAPPING_PD(4, camif1, flite1, PD_ISP),
164 SYSMMU_RESOURCE_MAPPING_PD(4, isp, isp, PD_ISP),
165};
166#endif /* CONFIG_ARCH_EXYNOS4 */
167
168#ifdef CONFIG_ARCH_EXYNOS5
169SYSMMU_RESOURCE_DEFINE(EXYNOS5, jpeg, JPEG, JPEG);
170SYSMMU_RESOURCE_DEFINE(EXYNOS5, fimd1, FIMD1, FIMD1);
171SYSMMU_RESOURCE_DEFINE(EXYNOS5, 2d, 2D, 2D);
172SYSMMU_RESOURCE_DEFINE(EXYNOS5, rot, ROTATOR, ROTATOR);
173SYSMMU_RESOURCE_DEFINE(EXYNOS5, tv, TV, TV);
174SYSMMU_RESOURCE_DEFINE(EXYNOS5, flite0, LITE0, LITE0);
175SYSMMU_RESOURCE_DEFINE(EXYNOS5, flite1, LITE1, LITE1);
176SYSMMU_RESOURCE_DEFINE(EXYNOS5, gsc0, GSC0, GSC0);
177SYSMMU_RESOURCE_DEFINE(EXYNOS5, gsc1, GSC1, GSC1);
178SYSMMU_RESOURCE_DEFINE(EXYNOS5, gsc2, GSC2, GSC2);
179SYSMMU_RESOURCE_DEFINE(EXYNOS5, gsc3, GSC3, GSC3);
180SYSMMU_RESOURCE_DEFINE(EXYNOS5, mfc_r, MFC_R, MFC_R);
181SYSMMU_RESOURCE_DEFINE(EXYNOS5, mfc_l, MFC_L, MFC_L);
182SYSMMU_RESOURCE(EXYNOS5, isp) {
183 DEFINE_SYSMMU_RESOURCE(EXYNOS5, ISP, ISP),
184 DEFINE_SYSMMU_RESOURCE(EXYNOS5, DRC, DRC),
185 DEFINE_SYSMMU_RESOURCE(EXYNOS5, FD, FD),
186 DEFINE_SYSMMU_RESOURCE(EXYNOS5, ISPCPU, MCUISP),
187 DEFINE_SYSMMU_RESOURCE(EXYNOS5, SCALERC, SCALERCISP),
188 DEFINE_SYSMMU_RESOURCE(EXYNOS5, SCALERP, SCALERPISP),
189 DEFINE_SYSMMU_RESOURCE(EXYNOS5, ODC, ODC),
190 DEFINE_SYSMMU_RESOURCE(EXYNOS5, DIS0, DIS0),
191 DEFINE_SYSMMU_RESOURCE(EXYNOS5, DIS1, DIS1),
192 DEFINE_SYSMMU_RESOURCE(EXYNOS5, 3DNR, 3DNR),
193};
194
195static struct sysmmu_resource_map sysmmu_resmap5[] __initdata = {
196 SYSMMU_RESOURCE_MAPPING(5, jpeg, jpeg),
197 SYSMMU_RESOURCE_MAPPING(5, fimd1, fimd1),
198 SYSMMU_RESOURCE_MAPPING(5, 2d, 2d),
199 SYSMMU_RESOURCE_MAPPING(5, rot, rot),
200 SYSMMU_RESOURCE_MAPPING_PD(5, tv, tv, PD_DISP1),
201 SYSMMU_RESOURCE_MAPPING_PD(5, camif0, flite0, PD_GSCL),
202 SYSMMU_RESOURCE_MAPPING_PD(5, camif1, flite1, PD_GSCL),
203 SYSMMU_RESOURCE_MAPPING_PD(5, gsc0, gsc0, PD_GSCL),
204 SYSMMU_RESOURCE_MAPPING_PD(5, gsc1, gsc1, PD_GSCL),
205 SYSMMU_RESOURCE_MAPPING_PD(5, gsc2, gsc2, PD_GSCL),
206 SYSMMU_RESOURCE_MAPPING_PD(5, gsc3, gsc3, PD_GSCL),
207 SYSMMU_RESOURCE_MAPPING_PD(5, mfc_r, mfc_r, PD_MFC),
208 SYSMMU_RESOURCE_MAPPING_PD(5, mfc_l, mfc_l, PD_MFC),
209 SYSMMU_RESOURCE_MAPPING_MCPD(5, isp, isp, PD_ISP, mc_platdata),
210};
211#endif /* CONFIG_ARCH_EXYNOS5 */
212
213static int __init init_sysmmu_platform_device(void)
214{
215 int i, j;
216 struct sysmmu_resource_map *resmap[2] = {NULL, NULL};
217 int nmap[2] = {0, 0};
218
219#ifdef CONFIG_ARCH_EXYNOS5
220 if (soc_is_exynos5250()) {
221 resmap[0] = sysmmu_resmap5;
222 nmap[0] = ARRAY_SIZE(sysmmu_resmap5);
223 nmap[1] = 0;
224 }
225#endif
226
227#ifdef CONFIG_ARCH_EXYNOS4
228 if (resmap[0] == NULL) {
229 resmap[0] = sysmmu_resmap4;
230 nmap[0] = ARRAY_SIZE(sysmmu_resmap4);
231 }
232
233 if (soc_is_exynos4210()) {
234 resmap[1] = sysmmu_resmap4210;
235 nmap[1] = ARRAY_SIZE(sysmmu_resmap4210);
236 }
237
238 if (soc_is_exynos4412() || soc_is_exynos4212()) {
239 resmap[1] = sysmmu_resmap4212;
240 nmap[1] = ARRAY_SIZE(sysmmu_resmap4212);
241 }
242#endif
243
244 for (j = 0; j < 2; j++) {
245 for (i = 0; i < nmap[j]; i++) {
246 struct sysmmu_resource_map *map;
247 struct sysmmu_platform_data *platdata;
248
249 map = &resmap[j][i];
250
251 map->pdev->dev.parent = map->pdd;
252
253 platdata = map->pdev->dev.platform_data;
254 platdata->clockname = map->clocknames;
255
256 if (platform_device_add_resources(map->pdev, map->res,
257 map->rnum)) {
258 pr_err("%s: Failed to add device resources for "
259 "%s.%d\n", __func__,
260 map->pdev->name, map->pdev->id);
261 continue;
262 }
263
264 if (platform_device_register(map->pdev)) {
265 pr_err("%s: Failed to register %s.%d\n",
266 __func__, map->pdev->name,
267 map->pdev->id);
268 }
269 }
270 }
271
272 return 0;
273}
274arch_initcall(init_sysmmu_platform_device);
diff --git a/arch/arm/mach-exynos/include/mach/cpufreq.h b/arch/arm/mach-exynos/include/mach/cpufreq.h
deleted file mode 100644
index 7517c3f417af..000000000000
--- a/arch/arm/mach-exynos/include/mach/cpufreq.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/* linux/arch/arm/mach-exynos/include/mach/cpufreq.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * EXYNOS - CPUFreq 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
13enum cpufreq_level_index {
14 L0, L1, L2, L3, L4,
15 L5, L6, L7, L8, L9,
16 L10, L11, L12, L13, L14,
17 L15, L16, L17, L18, L19,
18 L20,
19};
20
21struct exynos_dvfs_info {
22 unsigned long mpll_freq_khz;
23 unsigned int pll_safe_idx;
24 unsigned int pm_lock_idx;
25 unsigned int max_support_idx;
26 unsigned int min_support_idx;
27 struct clk *cpu_clk;
28 unsigned int *volt_table;
29 struct cpufreq_frequency_table *freq_table;
30 void (*set_freq)(unsigned int, unsigned int);
31 bool (*need_apll_change)(unsigned int, unsigned int);
32};
33
34extern int exynos4210_cpufreq_init(struct exynos_dvfs_info *);
35extern int exynos4x12_cpufreq_init(struct exynos_dvfs_info *);
36extern int exynos5250_cpufreq_init(struct exynos_dvfs_info *);
diff --git a/arch/arm/mach-exynos/include/mach/pmu.h b/arch/arm/mach-exynos/include/mach/pmu.h
deleted file mode 100644
index 7c27c2d4bf44..000000000000
--- a/arch/arm/mach-exynos/include/mach/pmu.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/* linux/arch/arm/mach-exynos4/include/mach/pmu.h
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * EXYNOS4210 - PMU(Power Management Unit) 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_PMU_H
14#define __ASM_ARCH_PMU_H __FILE__
15
16#define PMU_TABLE_END NULL
17
18enum sys_powerdown {
19 SYS_AFTR,
20 SYS_LPA,
21 SYS_SLEEP,
22 NUM_SYS_POWERDOWN,
23};
24
25extern unsigned long l2x0_regs_phys;
26struct exynos_pmu_conf {
27 void __iomem *reg;
28 unsigned int val[NUM_SYS_POWERDOWN];
29};
30
31extern void exynos_sys_powerdown_conf(enum sys_powerdown mode);
32extern void s3c_cpu_resume(void);
33
34#endif /* __ASM_ARCH_PMU_H */
diff --git a/arch/arm/mach-exynos/include/mach/regs-audss.h b/arch/arm/mach-exynos/include/mach/regs-audss.h
deleted file mode 100644
index ca5a8b64218a..000000000000
--- a/arch/arm/mach-exynos/include/mach/regs-audss.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/* arch/arm/mach-exynos4/include/mach/regs-audss.h
2 *
3 * Copyright (c) 2011 Samsung Electronics
4 * http://www.samsung.com
5 *
6 * Exynos4 Audio SubSystem clock 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 __PLAT_REGS_AUDSS_H
14#define __PLAT_REGS_AUDSS_H __FILE__
15
16#define EXYNOS4_AUDSS_INT_MEM (0x03000000)
17
18#endif /* _PLAT_REGS_AUDSS_H */
diff --git a/arch/arm/mach-exynos/include/mach/regs-irq.h b/arch/arm/mach-exynos/include/mach/regs-irq.h
index 9c7b4bfd546f..f2b50506b9f6 100644
--- a/arch/arm/mach-exynos/include/mach/regs-irq.h
+++ b/arch/arm/mach-exynos/include/mach/regs-irq.h
@@ -13,7 +13,7 @@
13#ifndef __ASM_ARCH_REGS_IRQ_H 13#ifndef __ASM_ARCH_REGS_IRQ_H
14#define __ASM_ARCH_REGS_IRQ_H __FILE__ 14#define __ASM_ARCH_REGS_IRQ_H __FILE__
15 15
16#include <asm/hardware/gic.h> 16#include <linux/irqchip/arm-gic.h>
17#include <mach/map.h> 17#include <mach/map.h>
18 18
19#endif /* __ASM_ARCH_REGS_IRQ_H */ 19#endif /* __ASM_ARCH_REGS_IRQ_H */
diff --git a/arch/arm/mach-exynos/include/mach/sysmmu.h b/arch/arm/mach-exynos/include/mach/sysmmu.h
deleted file mode 100644
index 88a4543b0001..000000000000
--- a/arch/arm/mach-exynos/include/mach/sysmmu.h
+++ /dev/null
@@ -1,66 +0,0 @@
1/*
2 * Copyright (c) 2011-2012 Samsung Electronics Co., Ltd.
3 * http://www.samsung.com
4 *
5 * EXYNOS - System MMU support
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef _ARM_MACH_EXYNOS_SYSMMU_H_
13#define _ARM_MACH_EXYNOS_SYSMMU_H_
14
15struct sysmmu_platform_data {
16 char *dbgname;
17 /* comma(,) separated list of clock names for clock gating */
18 char *clockname;
19};
20
21#define SYSMMU_DEVNAME_BASE "exynos-sysmmu"
22
23#define SYSMMU_CLOCK_NAME "sysmmu"
24#define SYSMMU_CLOCK_NAME2 "sysmmu_mc"
25
26#ifdef CONFIG_EXYNOS_DEV_SYSMMU
27#include <linux/device.h>
28struct platform_device;
29
30#define SYSMMU_PLATDEV(ipname) exynos_device_sysmmu_##ipname
31
32extern struct platform_device SYSMMU_PLATDEV(mfc_l);
33extern struct platform_device SYSMMU_PLATDEV(mfc_r);
34extern struct platform_device SYSMMU_PLATDEV(tv);
35extern struct platform_device SYSMMU_PLATDEV(jpeg);
36extern struct platform_device SYSMMU_PLATDEV(rot);
37extern struct platform_device SYSMMU_PLATDEV(fimc0);
38extern struct platform_device SYSMMU_PLATDEV(fimc1);
39extern struct platform_device SYSMMU_PLATDEV(fimc2);
40extern struct platform_device SYSMMU_PLATDEV(fimc3);
41extern struct platform_device SYSMMU_PLATDEV(gsc0);
42extern struct platform_device SYSMMU_PLATDEV(gsc1);
43extern struct platform_device SYSMMU_PLATDEV(gsc2);
44extern struct platform_device SYSMMU_PLATDEV(gsc3);
45extern struct platform_device SYSMMU_PLATDEV(isp);
46extern struct platform_device SYSMMU_PLATDEV(fimd0);
47extern struct platform_device SYSMMU_PLATDEV(fimd1);
48extern struct platform_device SYSMMU_PLATDEV(camif0);
49extern struct platform_device SYSMMU_PLATDEV(camif1);
50extern struct platform_device SYSMMU_PLATDEV(2d);
51
52#ifdef CONFIG_IOMMU_API
53static inline void platform_set_sysmmu(
54 struct device *sysmmu, struct device *dev)
55{
56 dev->archdata.iommu = sysmmu;
57}
58#endif
59
60#else /* !CONFIG_EXYNOS_DEV_SYSMMU */
61#define platform_set_sysmmu(sysmmu, dev) do { } while (0)
62#endif
63
64#define SYSMMU_CLOCK_DEVNAME(ipname, id) (SYSMMU_DEVNAME_BASE "." #id)
65
66#endif /* _ARM_MACH_EXYNOS_SYSMMU_H_ */
diff --git a/arch/arm/mach-exynos/mach-armlex4210.c b/arch/arm/mach-exynos/mach-armlex4210.c
index b938f9fc1dd1..685f29173afa 100644
--- a/arch/arm/mach-exynos/mach-armlex4210.c
+++ b/arch/arm/mach-exynos/mach-armlex4210.c
@@ -16,7 +16,6 @@
16#include <linux/smsc911x.h> 16#include <linux/smsc911x.h>
17 17
18#include <asm/mach/arch.h> 18#include <asm/mach/arch.h>
19#include <asm/hardware/gic.h>
20#include <asm/mach-types.h> 19#include <asm/mach-types.h>
21 20
22#include <plat/cpu.h> 21#include <plat/cpu.h>
@@ -201,9 +200,8 @@ MACHINE_START(ARMLEX4210, "ARMLEX4210")
201 .smp = smp_ops(exynos_smp_ops), 200 .smp = smp_ops(exynos_smp_ops),
202 .init_irq = exynos4_init_irq, 201 .init_irq = exynos4_init_irq,
203 .map_io = armlex4210_map_io, 202 .map_io = armlex4210_map_io,
204 .handle_irq = gic_handle_irq,
205 .init_machine = armlex4210_machine_init, 203 .init_machine = armlex4210_machine_init,
206 .init_late = exynos_init_late, 204 .init_late = exynos_init_late,
207 .timer = &exynos4_timer, 205 .init_time = exynos4_timer_init,
208 .restart = exynos4_restart, 206 .restart = exynos4_restart,
209MACHINE_END 207MACHINE_END
diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c b/arch/arm/mach-exynos/mach-exynos4-dt.c
index 92757ff817ae..3358088c822a 100644
--- a/arch/arm/mach-exynos/mach-exynos4-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos4-dt.c
@@ -15,7 +15,6 @@
15#include <linux/serial_core.h> 15#include <linux/serial_core.h>
16 16
17#include <asm/mach/arch.h> 17#include <asm/mach/arch.h>
18#include <asm/hardware/gic.h>
19#include <mach/map.h> 18#include <mach/map.h>
20 19
21#include <plat/cpu.h> 20#include <plat/cpu.h>
@@ -80,6 +79,40 @@ static const struct of_dev_auxdata exynos4_auxdata_lookup[] __initconst = {
80 OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_MDMA1, "dma-pl330.2", NULL), 79 OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_MDMA1, "dma-pl330.2", NULL),
81 OF_DEV_AUXDATA("samsung,exynos4210-tmu", EXYNOS4_PA_TMU, 80 OF_DEV_AUXDATA("samsung,exynos4210-tmu", EXYNOS4_PA_TMU,
82 "exynos-tmu", NULL), 81 "exynos-tmu", NULL),
82 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x13620000,
83 "exynos-sysmmu.0", NULL), /* MFC_L */
84 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x13630000,
85 "exynos-sysmmu.1", NULL), /* MFC_R */
86 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x13E20000,
87 "exynos-sysmmu.2", NULL), /* TV */
88 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x11A60000,
89 "exynos-sysmmu.3", NULL), /* JPEG */
90 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x12A30000,
91 "exynos-sysmmu.4", NULL), /* ROTATOR */
92 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x11A20000,
93 "exynos-sysmmu.5", NULL), /* FIMC0 */
94 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x11A30000,
95 "exynos-sysmmu.6", NULL), /* FIMC1 */
96 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x11A40000,
97 "exynos-sysmmu.7", NULL), /* FIMC2 */
98 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x11A50000,
99 "exynos-sysmmu.8", NULL), /* FIMC3 */
100 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x12A20000,
101 "exynos-sysmmu.9", NULL), /* G2D(4210) */
102 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x10A40000,
103 "exynos-sysmmu.9", NULL), /* G2D(4x12) */
104 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x11E20000,
105 "exynos-sysmmu.10", NULL), /* FIMD0 */
106 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x12220000,
107 "exynos-sysmmu.11", NULL), /* FIMD1(4210) */
108 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x12260000,
109 "exynos-sysmmu.12", NULL), /* IS0(4x12) */
110 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x122B0000,
111 "exynos-sysmmu.13", NULL), /* IS1(4x12) */
112 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x123B0000,
113 "exynos-sysmmu.14", NULL), /* FIMC-LITE0(4x12) */
114 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x123C0000,
115 "exynos-sysmmu.15", NULL), /* FIMC-LITE1(4x12) */
83 {}, 116 {},
84}; 117};
85 118
@@ -107,10 +140,9 @@ DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)")
107 .smp = smp_ops(exynos_smp_ops), 140 .smp = smp_ops(exynos_smp_ops),
108 .init_irq = exynos4_init_irq, 141 .init_irq = exynos4_init_irq,
109 .map_io = exynos4_dt_map_io, 142 .map_io = exynos4_dt_map_io,
110 .handle_irq = gic_handle_irq,
111 .init_machine = exynos4_dt_machine_init, 143 .init_machine = exynos4_dt_machine_init,
112 .init_late = exynos_init_late, 144 .init_late = exynos_init_late,
113 .timer = &exynos4_timer, 145 .init_time = exynos4_timer_init,
114 .dt_compat = exynos4_dt_compat, 146 .dt_compat = exynos4_dt_compat,
115 .restart = exynos4_restart, 147 .restart = exynos4_restart,
116MACHINE_END 148MACHINE_END
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c
index e99d3d8f2bcf..acaeb14db54b 100644
--- a/arch/arm/mach-exynos/mach-exynos5-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos5-dt.c
@@ -16,7 +16,6 @@
16#include <linux/io.h> 16#include <linux/io.h>
17 17
18#include <asm/mach/arch.h> 18#include <asm/mach/arch.h>
19#include <asm/hardware/gic.h>
20#include <mach/map.h> 19#include <mach/map.h>
21#include <mach/regs-pmu.h> 20#include <mach/regs-pmu.h>
22 21
@@ -104,6 +103,42 @@ static const struct of_dev_auxdata exynos5250_auxdata_lookup[] __initconst = {
104 OF_DEV_AUXDATA("samsung,mfc-v6", 0x11000000, "s5p-mfc-v6", NULL), 103 OF_DEV_AUXDATA("samsung,mfc-v6", 0x11000000, "s5p-mfc-v6", NULL),
105 OF_DEV_AUXDATA("samsung,exynos5250-tmu", 0x10060000, 104 OF_DEV_AUXDATA("samsung,exynos5250-tmu", 0x10060000,
106 "exynos-tmu", NULL), 105 "exynos-tmu", NULL),
106 OF_DEV_AUXDATA("samsung,i2s-v5", 0x03830000,
107 "samsung-i2s.0", NULL),
108 OF_DEV_AUXDATA("samsung,i2s-v5", 0x12D60000,
109 "samsung-i2s.1", NULL),
110 OF_DEV_AUXDATA("samsung,i2s-v5", 0x12D70000,
111 "samsung-i2s.2", NULL),
112 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x11210000,
113 "exynos-sysmmu.0", "mfc"), /* MFC_L */
114 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x11200000,
115 "exynos-sysmmu.1", "mfc"), /* MFC_R */
116 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x14650000,
117 "exynos-sysmmu.2", NULL), /* TV */
118 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x11F20000,
119 "exynos-sysmmu.3", "jpeg"), /* JPEG */
120 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x11D40000,
121 "exynos-sysmmu.4", NULL), /* ROTATOR */
122 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x13E80000,
123 "exynos-sysmmu.5", "gscl"), /* GSCL0 */
124 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x13E90000,
125 "exynos-sysmmu.6", "gscl"), /* GSCL1 */
126 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x13EA0000,
127 "exynos-sysmmu.7", "gscl"), /* GSCL2 */
128 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x13EB0000,
129 "exynos-sysmmu.8", "gscl"), /* GSCL3 */
130 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x13260000,
131 "exynos-sysmmu.9", NULL), /* FIMC-IS0 */
132 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x132C0000,
133 "exynos-sysmmu.10", NULL), /* FIMC-IS1 */
134 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x14640000,
135 "exynos-sysmmu.11", NULL), /* FIMD1 */
136 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x13C40000,
137 "exynos-sysmmu.12", NULL), /* FIMC-LITE0 */
138 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x13C50000,
139 "exynos-sysmmu.13", NULL), /* FIMC-LITE1 */
140 OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x10A60000,
141 "exynos-sysmmu.14", NULL), /* G2D */
107 {}, 142 {},
108}; 143};
109 144
@@ -179,10 +214,9 @@ DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)")
179 .init_irq = exynos5_init_irq, 214 .init_irq = exynos5_init_irq,
180 .smp = smp_ops(exynos_smp_ops), 215 .smp = smp_ops(exynos_smp_ops),
181 .map_io = exynos5_dt_map_io, 216 .map_io = exynos5_dt_map_io,
182 .handle_irq = gic_handle_irq,
183 .init_machine = exynos5_dt_machine_init, 217 .init_machine = exynos5_dt_machine_init,
184 .init_late = exynos_init_late, 218 .init_late = exynos_init_late,
185 .timer = &exynos4_timer, 219 .init_time = exynos4_timer_init,
186 .dt_compat = exynos5_dt_compat, 220 .dt_compat = exynos5_dt_compat,
187 .restart = exynos5_restart, 221 .restart = exynos5_restart,
188 .reserve = exynos5_reserve, 222 .reserve = exynos5_reserve,
diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c
index 27d4ed8b116e..1ea79730187f 100644
--- a/arch/arm/mach-exynos/mach-nuri.c
+++ b/arch/arm/mach-exynos/mach-nuri.c
@@ -39,7 +39,6 @@
39#include <media/v4l2-mediabus.h> 39#include <media/v4l2-mediabus.h>
40 40
41#include <asm/mach/arch.h> 41#include <asm/mach/arch.h>
42#include <asm/hardware/gic.h>
43#include <asm/mach-types.h> 42#include <asm/mach-types.h>
44 43
45#include <plat/adc.h> 44#include <plat/adc.h>
@@ -1209,25 +1208,25 @@ static struct i2c_board_info m5mols_board_info = {
1209 .platform_data = &m5mols_platdata, 1208 .platform_data = &m5mols_platdata,
1210}; 1209};
1211 1210
1212static struct s5p_fimc_isp_info nuri_camera_sensors[] = { 1211static struct fimc_source_info nuri_camera_sensors[] = {
1213 { 1212 {
1214 .flags = V4L2_MBUS_PCLK_SAMPLE_RISING | 1213 .flags = V4L2_MBUS_PCLK_SAMPLE_RISING |
1215 V4L2_MBUS_VSYNC_ACTIVE_LOW, 1214 V4L2_MBUS_VSYNC_ACTIVE_LOW,
1216 .bus_type = FIMC_ITU_601, 1215 .fimc_bus_type = FIMC_BUS_TYPE_ITU_601,
1217 .board_info = &s5k6aa_board_info, 1216 .board_info = &s5k6aa_board_info,
1218 .clk_frequency = 24000000UL, 1217 .clk_frequency = 24000000UL,
1219 .i2c_bus_num = 6, 1218 .i2c_bus_num = 6,
1220 }, { 1219 }, {
1221 .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING | 1220 .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING |
1222 V4L2_MBUS_VSYNC_ACTIVE_LOW, 1221 V4L2_MBUS_VSYNC_ACTIVE_LOW,
1223 .bus_type = FIMC_MIPI_CSI2, 1222 .fimc_bus_type = FIMC_BUS_TYPE_MIPI_CSI2,
1224 .board_info = &m5mols_board_info, 1223 .board_info = &m5mols_board_info,
1225 .clk_frequency = 24000000UL, 1224 .clk_frequency = 24000000UL,
1226 }, 1225 },
1227}; 1226};
1228 1227
1229static struct s5p_platform_fimc fimc_md_platdata = { 1228static struct s5p_platform_fimc fimc_md_platdata = {
1230 .isp_info = nuri_camera_sensors, 1229 .source_info = nuri_camera_sensors,
1231 .num_clients = ARRAY_SIZE(nuri_camera_sensors), 1230 .num_clients = ARRAY_SIZE(nuri_camera_sensors),
1232}; 1231};
1233 1232
@@ -1379,10 +1378,9 @@ MACHINE_START(NURI, "NURI")
1379 .smp = smp_ops(exynos_smp_ops), 1378 .smp = smp_ops(exynos_smp_ops),
1380 .init_irq = exynos4_init_irq, 1379 .init_irq = exynos4_init_irq,
1381 .map_io = nuri_map_io, 1380 .map_io = nuri_map_io,
1382 .handle_irq = gic_handle_irq,
1383 .init_machine = nuri_machine_init, 1381 .init_machine = nuri_machine_init,
1384 .init_late = exynos_init_late, 1382 .init_late = exynos_init_late,
1385 .timer = &exynos4_timer, 1383 .init_time = exynos4_timer_init,
1386 .reserve = &nuri_reserve, 1384 .reserve = &nuri_reserve,
1387 .restart = exynos4_restart, 1385 .restart = exynos4_restart,
1388MACHINE_END 1386MACHINE_END
diff --git a/arch/arm/mach-exynos/mach-origen.c b/arch/arm/mach-exynos/mach-origen.c
index 5e34b9c16196..579d2d171daa 100644
--- a/arch/arm/mach-exynos/mach-origen.c
+++ b/arch/arm/mach-exynos/mach-origen.c
@@ -29,7 +29,6 @@
29#include <linux/platform_data/usb-exynos.h> 29#include <linux/platform_data/usb-exynos.h>
30 30
31#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
32#include <asm/hardware/gic.h>
33#include <asm/mach-types.h> 32#include <asm/mach-types.h>
34 33
35#include <video/platform_lcd.h> 34#include <video/platform_lcd.h>
@@ -814,10 +813,9 @@ MACHINE_START(ORIGEN, "ORIGEN")
814 .smp = smp_ops(exynos_smp_ops), 813 .smp = smp_ops(exynos_smp_ops),
815 .init_irq = exynos4_init_irq, 814 .init_irq = exynos4_init_irq,
816 .map_io = origen_map_io, 815 .map_io = origen_map_io,
817 .handle_irq = gic_handle_irq,
818 .init_machine = origen_machine_init, 816 .init_machine = origen_machine_init,
819 .init_late = exynos_init_late, 817 .init_late = exynos_init_late,
820 .timer = &exynos4_timer, 818 .init_time = exynos4_timer_init,
821 .reserve = &origen_reserve, 819 .reserve = &origen_reserve,
822 .restart = exynos4_restart, 820 .restart = exynos4_restart,
823MACHINE_END 821MACHINE_END
diff --git a/arch/arm/mach-exynos/mach-smdk4x12.c b/arch/arm/mach-exynos/mach-smdk4x12.c
index ae6da40c2aa9..fe6149624b84 100644
--- a/arch/arm/mach-exynos/mach-smdk4x12.c
+++ b/arch/arm/mach-exynos/mach-smdk4x12.c
@@ -25,7 +25,6 @@
25#include <linux/platform_data/s3c-hsotg.h> 25#include <linux/platform_data/s3c-hsotg.h>
26 26
27#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
28#include <asm/hardware/gic.h>
29#include <asm/mach-types.h> 28#include <asm/mach-types.h>
30 29
31#include <video/samsung_fimd.h> 30#include <video/samsung_fimd.h>
@@ -376,9 +375,8 @@ MACHINE_START(SMDK4212, "SMDK4212")
376 .smp = smp_ops(exynos_smp_ops), 375 .smp = smp_ops(exynos_smp_ops),
377 .init_irq = exynos4_init_irq, 376 .init_irq = exynos4_init_irq,
378 .map_io = smdk4x12_map_io, 377 .map_io = smdk4x12_map_io,
379 .handle_irq = gic_handle_irq,
380 .init_machine = smdk4x12_machine_init, 378 .init_machine = smdk4x12_machine_init,
381 .timer = &exynos4_timer, 379 .init_time = exynos4_timer_init,
382 .restart = exynos4_restart, 380 .restart = exynos4_restart,
383 .reserve = &smdk4x12_reserve, 381 .reserve = &smdk4x12_reserve,
384MACHINE_END 382MACHINE_END
@@ -390,10 +388,9 @@ MACHINE_START(SMDK4412, "SMDK4412")
390 .smp = smp_ops(exynos_smp_ops), 388 .smp = smp_ops(exynos_smp_ops),
391 .init_irq = exynos4_init_irq, 389 .init_irq = exynos4_init_irq,
392 .map_io = smdk4x12_map_io, 390 .map_io = smdk4x12_map_io,
393 .handle_irq = gic_handle_irq,
394 .init_machine = smdk4x12_machine_init, 391 .init_machine = smdk4x12_machine_init,
395 .init_late = exynos_init_late, 392 .init_late = exynos_init_late,
396 .timer = &exynos4_timer, 393 .init_time = exynos4_timer_init,
397 .restart = exynos4_restart, 394 .restart = exynos4_restart,
398 .reserve = &smdk4x12_reserve, 395 .reserve = &smdk4x12_reserve,
399MACHINE_END 396MACHINE_END
diff --git a/arch/arm/mach-exynos/mach-smdkv310.c b/arch/arm/mach-exynos/mach-smdkv310.c
index 35548e3c097d..d71672922b19 100644
--- a/arch/arm/mach-exynos/mach-smdkv310.c
+++ b/arch/arm/mach-exynos/mach-smdkv310.c
@@ -26,7 +26,6 @@
26#include <linux/platform_data/usb-exynos.h> 26#include <linux/platform_data/usb-exynos.h>
27 27
28#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
29#include <asm/hardware/gic.h>
30#include <asm/mach-types.h> 29#include <asm/mach-types.h>
31 30
32#include <video/platform_lcd.h> 31#include <video/platform_lcd.h>
@@ -423,9 +422,8 @@ MACHINE_START(SMDKV310, "SMDKV310")
423 .smp = smp_ops(exynos_smp_ops), 422 .smp = smp_ops(exynos_smp_ops),
424 .init_irq = exynos4_init_irq, 423 .init_irq = exynos4_init_irq,
425 .map_io = smdkv310_map_io, 424 .map_io = smdkv310_map_io,
426 .handle_irq = gic_handle_irq,
427 .init_machine = smdkv310_machine_init, 425 .init_machine = smdkv310_machine_init,
428 .timer = &exynos4_timer, 426 .init_time = exynos4_timer_init,
429 .reserve = &smdkv310_reserve, 427 .reserve = &smdkv310_reserve,
430 .restart = exynos4_restart, 428 .restart = exynos4_restart,
431MACHINE_END 429MACHINE_END
@@ -436,10 +434,9 @@ MACHINE_START(SMDKC210, "SMDKC210")
436 .smp = smp_ops(exynos_smp_ops), 434 .smp = smp_ops(exynos_smp_ops),
437 .init_irq = exynos4_init_irq, 435 .init_irq = exynos4_init_irq,
438 .map_io = smdkv310_map_io, 436 .map_io = smdkv310_map_io,
439 .handle_irq = gic_handle_irq,
440 .init_machine = smdkv310_machine_init, 437 .init_machine = smdkv310_machine_init,
441 .init_late = exynos_init_late, 438 .init_late = exynos_init_late,
442 .timer = &exynos4_timer, 439 .init_time = exynos4_timer_init,
443 .reserve = &smdkv310_reserve, 440 .reserve = &smdkv310_reserve,
444 .restart = exynos4_restart, 441 .restart = exynos4_restart,
445MACHINE_END 442MACHINE_END
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c
index 9e3340f18950..497fcb793dc1 100644
--- a/arch/arm/mach-exynos/mach-universal_c210.c
+++ b/arch/arm/mach-exynos/mach-universal_c210.c
@@ -29,7 +29,6 @@
29#include <drm/exynos_drm.h> 29#include <drm/exynos_drm.h>
30 30
31#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
32#include <asm/hardware/gic.h>
33#include <asm/mach-types.h> 32#include <asm/mach-types.h>
34 33
35#include <video/samsung_fimd.h> 34#include <video/samsung_fimd.h>
@@ -988,12 +987,12 @@ static struct i2c_board_info m5mols_board_info = {
988 .platform_data = &m5mols_platdata, 987 .platform_data = &m5mols_platdata,
989}; 988};
990 989
991static struct s5p_fimc_isp_info universal_camera_sensors[] = { 990static struct fimc_source_info universal_camera_sensors[] = {
992 { 991 {
993 .mux_id = 0, 992 .mux_id = 0,
994 .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING | 993 .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING |
995 V4L2_MBUS_VSYNC_ACTIVE_LOW, 994 V4L2_MBUS_VSYNC_ACTIVE_LOW,
996 .bus_type = FIMC_ITU_601, 995 .fimc_bus_type = FIMC_BUS_TYPE_ITU_601,
997 .board_info = &s5k6aa_board_info, 996 .board_info = &s5k6aa_board_info,
998 .i2c_bus_num = 0, 997 .i2c_bus_num = 0,
999 .clk_frequency = 24000000UL, 998 .clk_frequency = 24000000UL,
@@ -1001,7 +1000,7 @@ static struct s5p_fimc_isp_info universal_camera_sensors[] = {
1001 .mux_id = 0, 1000 .mux_id = 0,
1002 .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING | 1001 .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING |
1003 V4L2_MBUS_VSYNC_ACTIVE_LOW, 1002 V4L2_MBUS_VSYNC_ACTIVE_LOW,
1004 .bus_type = FIMC_MIPI_CSI2, 1003 .fimc_bus_type = FIMC_BUS_TYPE_MIPI_CSI2,
1005 .board_info = &m5mols_board_info, 1004 .board_info = &m5mols_board_info,
1006 .i2c_bus_num = 0, 1005 .i2c_bus_num = 0,
1007 .clk_frequency = 24000000UL, 1006 .clk_frequency = 24000000UL,
@@ -1009,7 +1008,7 @@ static struct s5p_fimc_isp_info universal_camera_sensors[] = {
1009}; 1008};
1010 1009
1011static struct s5p_platform_fimc fimc_md_platdata = { 1010static struct s5p_platform_fimc fimc_md_platdata = {
1012 .isp_info = universal_camera_sensors, 1011 .source_info = universal_camera_sensors,
1013 .num_clients = ARRAY_SIZE(universal_camera_sensors), 1012 .num_clients = ARRAY_SIZE(universal_camera_sensors),
1014}; 1013};
1015 1014
@@ -1151,10 +1150,9 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
1151 .smp = smp_ops(exynos_smp_ops), 1150 .smp = smp_ops(exynos_smp_ops),
1152 .init_irq = exynos4_init_irq, 1151 .init_irq = exynos4_init_irq,
1153 .map_io = universal_map_io, 1152 .map_io = universal_map_io,
1154 .handle_irq = gic_handle_irq,
1155 .init_machine = universal_machine_init, 1153 .init_machine = universal_machine_init,
1156 .init_late = exynos_init_late, 1154 .init_late = exynos_init_late,
1157 .timer = &s5p_timer, 1155 .init_time = s5p_timer_init,
1158 .reserve = &universal_reserve, 1156 .reserve = &universal_reserve,
1159 .restart = exynos4_restart, 1157 .restart = exynos4_restart,
1160MACHINE_END 1158MACHINE_END
diff --git a/arch/arm/mach-exynos/mct.c b/arch/arm/mach-exynos/mct.c
index 57668eb68e75..c9d6650f9b5d 100644
--- a/arch/arm/mach-exynos/mct.c
+++ b/arch/arm/mach-exynos/mct.c
@@ -22,7 +22,6 @@
22#include <linux/of.h> 22#include <linux/of.h>
23 23
24#include <asm/arch_timer.h> 24#include <asm/arch_timer.h>
25#include <asm/hardware/gic.h>
26#include <asm/localtimer.h> 25#include <asm/localtimer.h>
27 26
28#include <plat/cpu.h> 27#include <plat/cpu.h>
@@ -255,13 +254,9 @@ static struct irqaction mct_comp_event_irq = {
255 254
256static void exynos4_clockevent_init(void) 255static void exynos4_clockevent_init(void)
257{ 256{
258 clockevents_calc_mult_shift(&mct_comp_device, clk_rate, 5);
259 mct_comp_device.max_delta_ns =
260 clockevent_delta2ns(0xffffffff, &mct_comp_device);
261 mct_comp_device.min_delta_ns =
262 clockevent_delta2ns(0xf, &mct_comp_device);
263 mct_comp_device.cpumask = cpumask_of(0); 257 mct_comp_device.cpumask = cpumask_of(0);
264 clockevents_register_device(&mct_comp_device); 258 clockevents_config_and_register(&mct_comp_device, clk_rate,
259 0xf, 0xffffffff);
265 260
266 if (soc_is_exynos5250()) 261 if (soc_is_exynos5250())
267 setup_irq(EXYNOS5_IRQ_MCT_G0, &mct_comp_event_irq); 262 setup_irq(EXYNOS5_IRQ_MCT_G0, &mct_comp_event_irq);
@@ -404,14 +399,8 @@ static int __cpuinit exynos4_local_timer_setup(struct clock_event_device *evt)
404 evt->set_mode = exynos4_tick_set_mode; 399 evt->set_mode = exynos4_tick_set_mode;
405 evt->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT; 400 evt->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT;
406 evt->rating = 450; 401 evt->rating = 450;
407 402 clockevents_config_and_register(evt, clk_rate / (TICK_BASE_CNT + 1),
408 clockevents_calc_mult_shift(evt, clk_rate / (TICK_BASE_CNT + 1), 5); 403 0xf, 0x7fffffff);
409 evt->max_delta_ns =
410 clockevent_delta2ns(0x7fffffff, evt);
411 evt->min_delta_ns =
412 clockevent_delta2ns(0xf, evt);
413
414 clockevents_register_device(evt);
415 404
416 exynos4_mct_write(TICK_BASE_CNT, mevt->base + MCT_L_TCNTB_OFFSET); 405 exynos4_mct_write(TICK_BASE_CNT, mevt->base + MCT_L_TCNTB_OFFSET);
417 406
@@ -478,7 +467,7 @@ static void __init exynos4_timer_resources(void)
478#endif /* CONFIG_LOCAL_TIMERS */ 467#endif /* CONFIG_LOCAL_TIMERS */
479} 468}
480 469
481static void __init exynos_timer_init(void) 470void __init exynos4_timer_init(void)
482{ 471{
483 if (soc_is_exynos5440()) { 472 if (soc_is_exynos5440()) {
484 arch_timer_of_register(); 473 arch_timer_of_register();
@@ -494,7 +483,3 @@ static void __init exynos_timer_init(void)
494 exynos4_clocksource_init(); 483 exynos4_clocksource_init();
495 exynos4_clockevent_init(); 484 exynos4_clockevent_init();
496} 485}
497
498struct sys_timer exynos4_timer = {
499 .init = exynos_timer_init,
500};
diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index c5c840e947b8..60f7c5be057d 100644
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -20,9 +20,9 @@
20#include <linux/jiffies.h> 20#include <linux/jiffies.h>
21#include <linux/smp.h> 21#include <linux/smp.h>
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/irqchip/arm-gic.h>
23 24
24#include <asm/cacheflush.h> 25#include <asm/cacheflush.h>
25#include <asm/hardware/gic.h>
26#include <asm/smp_plat.h> 26#include <asm/smp_plat.h>
27#include <asm/smp_scu.h> 27#include <asm/smp_scu.h>
28 28
@@ -149,7 +149,7 @@ static int __cpuinit exynos_boot_secondary(unsigned int cpu, struct task_struct
149 149
150 __raw_writel(virt_to_phys(exynos4_secondary_startup), 150 __raw_writel(virt_to_phys(exynos4_secondary_startup),
151 cpu_boot_reg(phys_cpu)); 151 cpu_boot_reg(phys_cpu));
152 gic_raise_softirq(cpumask_of(cpu), 0); 152 arch_send_wakeup_ipi_mask(cpumask_of(cpu));
153 153
154 if (pen_release == -1) 154 if (pen_release == -1)
155 break; 155 break;
@@ -190,8 +190,6 @@ static void __init exynos_smp_init_cpus(void)
190 190
191 for (i = 0; i < ncores; i++) 191 for (i = 0; i < ncores; i++)
192 set_cpu_possible(i, true); 192 set_cpu_possible(i, true);
193
194 set_smp_cross_call(gic_raise_softirq);
195} 193}
196 194
197static void __init exynos_smp_prepare_cpus(unsigned int max_cpus) 195static void __init exynos_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index b9b539cac81e..e3faaa812016 100644
--- a/arch/arm/mach-exynos/pm.c
+++ b/arch/arm/mach-exynos/pm.c
@@ -34,7 +34,8 @@
34#include <mach/regs-clock.h> 34#include <mach/regs-clock.h>
35#include <mach/regs-pmu.h> 35#include <mach/regs-pmu.h>
36#include <mach/pm-core.h> 36#include <mach/pm-core.h>
37#include <mach/pmu.h> 37
38#include "common.h"
38 39
39static struct sleep_save exynos4_set_clksrc[] = { 40static struct sleep_save exynos4_set_clksrc[] = {
40 { .reg = EXYNOS4_CLKSRC_MASK_TOP , .val = 0x00000001, }, 41 { .reg = EXYNOS4_CLKSRC_MASK_TOP , .val = 0x00000001, },
@@ -91,8 +92,8 @@ static int exynos_cpu_suspend(unsigned long arg)
91 /* issue the standby signal into the pm unit. */ 92 /* issue the standby signal into the pm unit. */
92 cpu_do_idle(); 93 cpu_do_idle();
93 94
94 /* we should never get past here */ 95 pr_info("Failed to suspend the system\n");
95 panic("sleep resumed to originator?"); 96 return 1; /* Aborting suspend */
96} 97}
97 98
98static void exynos_pm_prepare(void) 99static void exynos_pm_prepare(void)
@@ -282,6 +283,8 @@ static void exynos_pm_resume(void)
282 if (!(tmp & S5P_CENTRAL_LOWPWR_CFG)) { 283 if (!(tmp & S5P_CENTRAL_LOWPWR_CFG)) {
283 tmp |= S5P_CENTRAL_LOWPWR_CFG; 284 tmp |= S5P_CENTRAL_LOWPWR_CFG;
284 __raw_writel(tmp, S5P_CENTRAL_SEQ_CONFIGURATION); 285 __raw_writel(tmp, S5P_CENTRAL_SEQ_CONFIGURATION);
286 /* clear the wakeup state register */
287 __raw_writel(0x0, S5P_WAKEUP_STAT);
285 /* No need to perform below restore code */ 288 /* No need to perform below restore code */
286 goto early_wakeup; 289 goto early_wakeup;
287 } 290 }
diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c
index 3a48c852be6c..daebc1abc966 100644
--- a/arch/arm/mach-exynos/pmu.c
+++ b/arch/arm/mach-exynos/pmu.c
@@ -14,7 +14,8 @@
14#include <linux/bug.h> 14#include <linux/bug.h>
15 15
16#include <mach/regs-clock.h> 16#include <mach/regs-clock.h>
17#include <mach/pmu.h> 17
18#include "common.h"
18 19
19static struct exynos_pmu_conf *exynos_pmu_config; 20static struct exynos_pmu_conf *exynos_pmu_config;
20 21
diff --git a/arch/arm/mach-footbridge/cats-hw.c b/arch/arm/mach-footbridge/cats-hw.c
index 25b453601acc..6987a09ec219 100644
--- a/arch/arm/mach-footbridge/cats-hw.c
+++ b/arch/arm/mach-footbridge/cats-hw.c
@@ -90,6 +90,6 @@ MACHINE_START(CATS, "Chalice-CATS")
90 .fixup = fixup_cats, 90 .fixup = fixup_cats,
91 .map_io = footbridge_map_io, 91 .map_io = footbridge_map_io,
92 .init_irq = footbridge_init_irq, 92 .init_irq = footbridge_init_irq,
93 .timer = &isa_timer, 93 .init_time = isa_timer_init,
94 .restart = footbridge_restart, 94 .restart = footbridge_restart,
95MACHINE_END 95MACHINE_END
diff --git a/arch/arm/mach-footbridge/common.h b/arch/arm/mach-footbridge/common.h
index c9767b892cb2..a846e50a07b8 100644
--- a/arch/arm/mach-footbridge/common.h
+++ b/arch/arm/mach-footbridge/common.h
@@ -1,6 +1,6 @@
1 1
2extern struct sys_timer footbridge_timer; 2extern void footbridge_timer_init(void);
3extern struct sys_timer isa_timer; 3extern void isa_timer_init(void);
4 4
5extern void isa_rtc_init(void); 5extern void isa_rtc_init(void);
6 6
diff --git a/arch/arm/mach-footbridge/dc21285-timer.c b/arch/arm/mach-footbridge/dc21285-timer.c
index 3b54196447c7..9ee78f7b4990 100644
--- a/arch/arm/mach-footbridge/dc21285-timer.c
+++ b/arch/arm/mach-footbridge/dc21285-timer.c
@@ -93,7 +93,7 @@ static struct irqaction footbridge_timer_irq = {
93/* 93/*
94 * Set up timer interrupt. 94 * Set up timer interrupt.
95 */ 95 */
96static void __init footbridge_timer_init(void) 96void __init footbridge_timer_init(void)
97{ 97{
98 struct clock_event_device *ce = &ckevt_dc21285; 98 struct clock_event_device *ce = &ckevt_dc21285;
99 99
@@ -101,14 +101,6 @@ static void __init footbridge_timer_init(void)
101 101
102 setup_irq(ce->irq, &footbridge_timer_irq); 102 setup_irq(ce->irq, &footbridge_timer_irq);
103 103
104 clockevents_calc_mult_shift(ce, mem_fclk_21285, 5);
105 ce->max_delta_ns = clockevent_delta2ns(0xffffff, ce);
106 ce->min_delta_ns = clockevent_delta2ns(0x000004, ce);
107 ce->cpumask = cpumask_of(smp_processor_id()); 104 ce->cpumask = cpumask_of(smp_processor_id());
108 105 clockevents_config_and_register(ce, mem_fclk_21285, 0x4, 0xffffff);
109 clockevents_register_device(ce);
110} 106}
111
112struct sys_timer footbridge_timer = {
113 .init = footbridge_timer_init,
114};
diff --git a/arch/arm/mach-footbridge/ebsa285.c b/arch/arm/mach-footbridge/ebsa285.c
index b09551ef89ca..b08243500e2e 100644
--- a/arch/arm/mach-footbridge/ebsa285.c
+++ b/arch/arm/mach-footbridge/ebsa285.c
@@ -101,7 +101,7 @@ MACHINE_START(EBSA285, "EBSA285")
101 .video_end = 0x000bffff, 101 .video_end = 0x000bffff,
102 .map_io = footbridge_map_io, 102 .map_io = footbridge_map_io,
103 .init_irq = footbridge_init_irq, 103 .init_irq = footbridge_init_irq,
104 .timer = &footbridge_timer, 104 .init_time = footbridge_timer_init,
105 .restart = footbridge_restart, 105 .restart = footbridge_restart,
106MACHINE_END 106MACHINE_END
107 107
diff --git a/arch/arm/mach-footbridge/include/mach/uncompress.h b/arch/arm/mach-footbridge/include/mach/uncompress.h
index 5dfa44287346..a69398c05a52 100644
--- a/arch/arm/mach-footbridge/include/mach/uncompress.h
+++ b/arch/arm/mach-footbridge/include/mach/uncompress.h
@@ -35,4 +35,3 @@ static inline void flush(void)
35 * nothing to do 35 * nothing to do
36 */ 36 */
37#define arch_decomp_setup() 37#define arch_decomp_setup()
38#define arch_decomp_wdog()
diff --git a/arch/arm/mach-footbridge/isa-timer.c b/arch/arm/mach-footbridge/isa-timer.c
index c40bb415f4b5..d9301dd56354 100644
--- a/arch/arm/mach-footbridge/isa-timer.c
+++ b/arch/arm/mach-footbridge/isa-timer.c
@@ -31,14 +31,10 @@ static struct irqaction pit_timer_irq = {
31 .dev_id = &i8253_clockevent, 31 .dev_id = &i8253_clockevent,
32}; 32};
33 33
34static void __init isa_timer_init(void) 34void __init isa_timer_init(void)
35{ 35{
36 clocksource_i8253_init(); 36 clocksource_i8253_init();
37 37
38 setup_irq(i8253_clockevent.irq, &pit_timer_irq); 38 setup_irq(i8253_clockevent.irq, &pit_timer_irq);
39 clockevent_i8253_init(false); 39 clockevent_i8253_init(false);
40} 40}
41
42struct sys_timer isa_timer = {
43 .init = isa_timer_init,
44};
diff --git a/arch/arm/mach-footbridge/netwinder-hw.c b/arch/arm/mach-footbridge/netwinder-hw.c
index d2d14339c6c4..90ea23fdce4c 100644
--- a/arch/arm/mach-footbridge/netwinder-hw.c
+++ b/arch/arm/mach-footbridge/netwinder-hw.c
@@ -766,6 +766,6 @@ MACHINE_START(NETWINDER, "Rebel-NetWinder")
766 .fixup = fixup_netwinder, 766 .fixup = fixup_netwinder,
767 .map_io = footbridge_map_io, 767 .map_io = footbridge_map_io,
768 .init_irq = footbridge_init_irq, 768 .init_irq = footbridge_init_irq,
769 .timer = &isa_timer, 769 .init_time = isa_timer_init,
770 .restart = netwinder_restart, 770 .restart = netwinder_restart,
771MACHINE_END 771MACHINE_END
diff --git a/arch/arm/mach-footbridge/personal.c b/arch/arm/mach-footbridge/personal.c
index e1e9990fa957..7bdeabdcd4d8 100644
--- a/arch/arm/mach-footbridge/personal.c
+++ b/arch/arm/mach-footbridge/personal.c
@@ -18,7 +18,7 @@ MACHINE_START(PERSONAL_SERVER, "Compaq-PersonalServer")
18 .atag_offset = 0x100, 18 .atag_offset = 0x100,
19 .map_io = footbridge_map_io, 19 .map_io = footbridge_map_io,
20 .init_irq = footbridge_init_irq, 20 .init_irq = footbridge_init_irq,
21 .timer = &footbridge_timer, 21 .init_time = footbridge_timer_init,
22 .restart = footbridge_restart, 22 .restart = footbridge_restart,
23MACHINE_END 23MACHINE_END
24 24
diff --git a/arch/arm/mach-gemini/board-nas4220b.c b/arch/arm/mach-gemini/board-nas4220b.c
index 5927d3c253aa..08bd650c42f3 100644
--- a/arch/arm/mach-gemini/board-nas4220b.c
+++ b/arch/arm/mach-gemini/board-nas4220b.c
@@ -31,10 +31,6 @@
31 31
32#include "common.h" 32#include "common.h"
33 33
34static struct sys_timer ib4220b_timer = {
35 .init = gemini_timer_init,
36};
37
38static struct gpio_led ib4220b_leds[] = { 34static struct gpio_led ib4220b_leds[] = {
39 { 35 {
40 .name = "nas4220b:orange:hdd", 36 .name = "nas4220b:orange:hdd",
@@ -105,6 +101,6 @@ MACHINE_START(NAS4220B, "Raidsonic NAS IB-4220-B")
105 .atag_offset = 0x100, 101 .atag_offset = 0x100,
106 .map_io = gemini_map_io, 102 .map_io = gemini_map_io,
107 .init_irq = gemini_init_irq, 103 .init_irq = gemini_init_irq,
108 .timer = &ib4220b_timer, 104 .init_time = gemini_timer_init,
109 .init_machine = ib4220b_init, 105 .init_machine = ib4220b_init,
110MACHINE_END 106MACHINE_END
diff --git a/arch/arm/mach-gemini/board-rut1xx.c b/arch/arm/mach-gemini/board-rut1xx.c
index cd7437a1cea0..fa0a36337f4d 100644
--- a/arch/arm/mach-gemini/board-rut1xx.c
+++ b/arch/arm/mach-gemini/board-rut1xx.c
@@ -71,10 +71,6 @@ static struct platform_device rut1xx_leds = {
71 }, 71 },
72}; 72};
73 73
74static struct sys_timer rut1xx_timer = {
75 .init = gemini_timer_init,
76};
77
78static void __init rut1xx_init(void) 74static void __init rut1xx_init(void)
79{ 75{
80 gemini_gpio_init(); 76 gemini_gpio_init();
@@ -89,6 +85,6 @@ MACHINE_START(RUT100, "Teltonika RUT100")
89 .atag_offset = 0x100, 85 .atag_offset = 0x100,
90 .map_io = gemini_map_io, 86 .map_io = gemini_map_io,
91 .init_irq = gemini_init_irq, 87 .init_irq = gemini_init_irq,
92 .timer = &rut1xx_timer, 88 .init_time = gemini_timer_init,
93 .init_machine = rut1xx_init, 89 .init_machine = rut1xx_init,
94MACHINE_END 90MACHINE_END
diff --git a/arch/arm/mach-gemini/board-wbd111.c b/arch/arm/mach-gemini/board-wbd111.c
index a367880368f1..3321cd6cc1f3 100644
--- a/arch/arm/mach-gemini/board-wbd111.c
+++ b/arch/arm/mach-gemini/board-wbd111.c
@@ -80,10 +80,6 @@ static struct platform_device wbd111_leds_device = {
80 }, 80 },
81}; 81};
82 82
83static struct sys_timer wbd111_timer = {
84 .init = gemini_timer_init,
85};
86
87static struct mtd_partition wbd111_partitions[] = { 83static struct mtd_partition wbd111_partitions[] = {
88 { 84 {
89 .name = "RedBoot", 85 .name = "RedBoot",
@@ -132,6 +128,6 @@ MACHINE_START(WBD111, "Wiliboard WBD-111")
132 .atag_offset = 0x100, 128 .atag_offset = 0x100,
133 .map_io = gemini_map_io, 129 .map_io = gemini_map_io,
134 .init_irq = gemini_init_irq, 130 .init_irq = gemini_init_irq,
135 .timer = &wbd111_timer, 131 .init_time = gemini_timer_init,
136 .init_machine = wbd111_init, 132 .init_machine = wbd111_init,
137MACHINE_END 133MACHINE_END
diff --git a/arch/arm/mach-gemini/board-wbd222.c b/arch/arm/mach-gemini/board-wbd222.c
index f382811c1319..fe33c825fdaf 100644
--- a/arch/arm/mach-gemini/board-wbd222.c
+++ b/arch/arm/mach-gemini/board-wbd222.c
@@ -80,10 +80,6 @@ static struct platform_device wbd222_leds_device = {
80 }, 80 },
81}; 81};
82 82
83static struct sys_timer wbd222_timer = {
84 .init = gemini_timer_init,
85};
86
87static struct mtd_partition wbd222_partitions[] = { 83static struct mtd_partition wbd222_partitions[] = {
88 { 84 {
89 .name = "RedBoot", 85 .name = "RedBoot",
@@ -132,6 +128,6 @@ MACHINE_START(WBD222, "Wiliboard WBD-222")
132 .atag_offset = 0x100, 128 .atag_offset = 0x100,
133 .map_io = gemini_map_io, 129 .map_io = gemini_map_io,
134 .init_irq = gemini_init_irq, 130 .init_irq = gemini_init_irq,
135 .timer = &wbd222_timer, 131 .init_time = gemini_timer_init,
136 .init_machine = wbd222_init, 132 .init_machine = wbd222_init,
137MACHINE_END 133MACHINE_END
diff --git a/arch/arm/mach-gemini/include/mach/uncompress.h b/arch/arm/mach-gemini/include/mach/uncompress.h
index 0efa26247235..02e225673acb 100644
--- a/arch/arm/mach-gemini/include/mach/uncompress.h
+++ b/arch/arm/mach-gemini/include/mach/uncompress.h
@@ -39,6 +39,4 @@ static inline void flush(void)
39 */ 39 */
40#define arch_decomp_setup() 40#define arch_decomp_setup()
41 41
42#define arch_decomp_wdog()
43
44#endif /* __MACH_UNCOMPRESS_H */ 42#endif /* __MACH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-h720x/common.c b/arch/arm/mach-h720x/common.c
index aa1331e86bcf..17ef91fa3d56 100644
--- a/arch/arm/mach-h720x/common.c
+++ b/arch/arm/mach-h720x/common.c
@@ -42,12 +42,12 @@ void __init arch_dma_init(dma_t *dma)
42} 42}
43 43
44/* 44/*
45 * Return usecs since last timer reload 45 * Return nsecs since last timer reload
46 * (timercount * (usecs perjiffie)) / (ticks per jiffie) 46 * (timercount * (usecs perjiffie)) / (ticks per jiffie)
47 */ 47 */
48unsigned long h720x_gettimeoffset(void) 48u32 h720x_gettimeoffset(void)
49{ 49{
50 return (CPU_REG (TIMER_VIRT, TM0_COUNT) * tick_usec) / LATCH; 50 return ((CPU_REG(TIMER_VIRT, TM0_COUNT) * tick_usec) / LATCH) * 1000;
51} 51}
52 52
53/* 53/*
diff --git a/arch/arm/mach-h720x/common.h b/arch/arm/mach-h720x/common.h
index 2489537d33dd..7e738410ca93 100644
--- a/arch/arm/mach-h720x/common.h
+++ b/arch/arm/mach-h720x/common.h
@@ -13,18 +13,18 @@
13 * 13 *
14 */ 14 */
15 15
16extern unsigned long h720x_gettimeoffset(void); 16extern u32 h720x_gettimeoffset(void);
17extern void __init h720x_init_irq(void); 17extern void __init h720x_init_irq(void);
18extern void __init h720x_map_io(void); 18extern void __init h720x_map_io(void);
19extern void h720x_restart(char, const char *); 19extern void h720x_restart(char, const char *);
20 20
21#ifdef CONFIG_ARCH_H7202 21#ifdef CONFIG_ARCH_H7202
22extern struct sys_timer h7202_timer; 22extern void h7202_timer_init(void);
23extern void __init init_hw_h7202(void); 23extern void __init init_hw_h7202(void);
24extern void __init h7202_init_irq(void); 24extern void __init h7202_init_irq(void);
25extern void __init h7202_init_time(void); 25extern void __init h7202_init_time(void);
26#endif 26#endif
27 27
28#ifdef CONFIG_ARCH_H7201 28#ifdef CONFIG_ARCH_H7201
29extern struct sys_timer h7201_timer; 29extern void h7201_timer_init(void);
30#endif 30#endif
diff --git a/arch/arm/mach-h720x/cpu-h7201.c b/arch/arm/mach-h720x/cpu-h7201.c
index 24df2a349a98..13c741215387 100644
--- a/arch/arm/mach-h720x/cpu-h7201.c
+++ b/arch/arm/mach-h720x/cpu-h7201.c
@@ -44,8 +44,10 @@ static struct irqaction h7201_timer_irq = {
44/* 44/*
45 * Setup TIMER0 as system timer 45 * Setup TIMER0 as system timer
46 */ 46 */
47void __init h7201_init_time(void) 47void __init h7201_timer_init(void)
48{ 48{
49 arch_gettimeoffset = h720x_gettimeoffset;
50
49 CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH; 51 CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH;
50 CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET; 52 CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET;
51 CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START; 53 CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START;
@@ -53,8 +55,3 @@ void __init h7201_init_time(void)
53 55
54 setup_irq(IRQ_TIMER0, &h7201_timer_irq); 56 setup_irq(IRQ_TIMER0, &h7201_timer_irq);
55} 57}
56
57struct sys_timer h7201_timer = {
58 .init = h7201_init_time,
59 .offset = h720x_gettimeoffset,
60};
diff --git a/arch/arm/mach-h720x/cpu-h7202.c b/arch/arm/mach-h720x/cpu-h7202.c
index c37d570b852d..e2ae7e898f9d 100644
--- a/arch/arm/mach-h720x/cpu-h7202.c
+++ b/arch/arm/mach-h720x/cpu-h7202.c
@@ -178,8 +178,10 @@ static struct irqaction h7202_timer_irq = {
178/* 178/*
179 * Setup TIMER0 as system timer 179 * Setup TIMER0 as system timer
180 */ 180 */
181void __init h7202_init_time(void) 181void __init h7202_timer_init(void)
182{ 182{
183 arch_gettimeoffset = h720x_gettimeoffset;
184
183 CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH; 185 CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH;
184 CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET; 186 CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET;
185 CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START; 187 CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START;
@@ -188,11 +190,6 @@ void __init h7202_init_time(void)
188 setup_irq(IRQ_TIMER0, &h7202_timer_irq); 190 setup_irq(IRQ_TIMER0, &h7202_timer_irq);
189} 191}
190 192
191struct sys_timer h7202_timer = {
192 .init = h7202_init_time,
193 .offset = h720x_gettimeoffset,
194};
195
196void __init h7202_init_irq (void) 193void __init h7202_init_irq (void)
197{ 194{
198 int irq; 195 int irq;
diff --git a/arch/arm/mach-h720x/h7201-eval.c b/arch/arm/mach-h720x/h7201-eval.c
index 5fdb20c855e2..4fdeb686c0a9 100644
--- a/arch/arm/mach-h720x/h7201-eval.c
+++ b/arch/arm/mach-h720x/h7201-eval.c
@@ -32,7 +32,7 @@ MACHINE_START(H7201, "Hynix GMS30C7201")
32 .atag_offset = 0x1000, 32 .atag_offset = 0x1000,
33 .map_io = h720x_map_io, 33 .map_io = h720x_map_io,
34 .init_irq = h720x_init_irq, 34 .init_irq = h720x_init_irq,
35 .timer = &h7201_timer, 35 .init_time = h7201_timer_init,
36 .dma_zone_size = SZ_256M, 36 .dma_zone_size = SZ_256M,
37 .restart = h720x_restart, 37 .restart = h720x_restart,
38MACHINE_END 38MACHINE_END
diff --git a/arch/arm/mach-h720x/h7202-eval.c b/arch/arm/mach-h720x/h7202-eval.c
index 169673036c59..f68e967a2062 100644
--- a/arch/arm/mach-h720x/h7202-eval.c
+++ b/arch/arm/mach-h720x/h7202-eval.c
@@ -74,7 +74,7 @@ MACHINE_START(H7202, "Hynix HMS30C7202")
74 .atag_offset = 0x100, 74 .atag_offset = 0x100,
75 .map_io = h720x_map_io, 75 .map_io = h720x_map_io,
76 .init_irq = h7202_init_irq, 76 .init_irq = h7202_init_irq,
77 .timer = &h7202_timer, 77 .init_time = h7202_timer_init,
78 .init_machine = init_eval_h7202, 78 .init_machine = init_eval_h7202,
79 .dma_zone_size = SZ_256M, 79 .dma_zone_size = SZ_256M,
80 .restart = h720x_restart, 80 .restart = h720x_restart,
diff --git a/arch/arm/mach-h720x/include/mach/uncompress.h b/arch/arm/mach-h720x/include/mach/uncompress.h
index d6623234f61e..43e343c4b50a 100644
--- a/arch/arm/mach-h720x/include/mach/uncompress.h
+++ b/arch/arm/mach-h720x/include/mach/uncompress.h
@@ -32,6 +32,5 @@ static inline void flush(void)
32 * nothing to do 32 * nothing to do
33 */ 33 */
34#define arch_decomp_setup() 34#define arch_decomp_setup()
35#define arch_decomp_wdog()
36 35
37#endif 36#endif
diff --git a/arch/arm/mach-highbank/Kconfig b/arch/arm/mach-highbank/Kconfig
index 551c97e87a78..44b12f9c1584 100644
--- a/arch/arm/mach-highbank/Kconfig
+++ b/arch/arm/mach-highbank/Kconfig
@@ -1,5 +1,7 @@
1config ARCH_HIGHBANK 1config ARCH_HIGHBANK
2 bool "Calxeda ECX-1000/2000 (Highbank/Midway)" if ARCH_MULTI_V7 2 bool "Calxeda ECX-1000/2000 (Highbank/Midway)" if ARCH_MULTI_V7
3 select ARCH_HAS_CPUFREQ
4 select ARCH_HAS_OPP
3 select ARCH_WANT_OPTIONAL_GPIOLIB 5 select ARCH_WANT_OPTIONAL_GPIOLIB
4 select ARM_AMBA 6 select ARM_AMBA
5 select ARM_GIC 7 select ARM_GIC
@@ -11,5 +13,7 @@ config ARCH_HIGHBANK
11 select GENERIC_CLOCKEVENTS 13 select GENERIC_CLOCKEVENTS
12 select HAVE_ARM_SCU 14 select HAVE_ARM_SCU
13 select HAVE_SMP 15 select HAVE_SMP
16 select MAILBOX
17 select PL320_MBOX
14 select SPARSE_IRQ 18 select SPARSE_IRQ
15 select USE_OF 19 select USE_OF
diff --git a/arch/arm/mach-highbank/core.h b/arch/arm/mach-highbank/core.h
index 80235b46cb58..3f65206a9b92 100644
--- a/arch/arm/mach-highbank/core.h
+++ b/arch/arm/mach-highbank/core.h
@@ -2,7 +2,6 @@
2#define __HIGHBANK_CORE_H 2#define __HIGHBANK_CORE_H
3 3
4extern void highbank_set_cpu_jump(int cpu, void *jump_addr); 4extern void highbank_set_cpu_jump(int cpu, void *jump_addr);
5extern void highbank_clocks_init(void);
6extern void highbank_restart(char, const char *); 5extern void highbank_restart(char, const char *);
7extern void __iomem *scu_base_addr; 6extern void __iomem *scu_base_addr;
8 7
diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c
index 981dc1e1da51..a4f9f50247d4 100644
--- a/arch/arm/mach-highbank/highbank.c
+++ b/arch/arm/mach-highbank/highbank.c
@@ -18,6 +18,7 @@
18#include <linux/dma-mapping.h> 18#include <linux/dma-mapping.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/irq.h> 20#include <linux/irq.h>
21#include <linux/irqchip.h>
21#include <linux/irqdomain.h> 22#include <linux/irqdomain.h>
22#include <linux/of.h> 23#include <linux/of.h>
23#include <linux/of_irq.h> 24#include <linux/of_irq.h>
@@ -25,14 +26,15 @@
25#include <linux/of_address.h> 26#include <linux/of_address.h>
26#include <linux/smp.h> 27#include <linux/smp.h>
27#include <linux/amba/bus.h> 28#include <linux/amba/bus.h>
29#include <linux/clk-provider.h>
28 30
29#include <asm/arch_timer.h> 31#include <asm/arch_timer.h>
30#include <asm/cacheflush.h> 32#include <asm/cacheflush.h>
33#include <asm/cputype.h>
31#include <asm/smp_plat.h> 34#include <asm/smp_plat.h>
32#include <asm/smp_twd.h> 35#include <asm/smp_twd.h>
33#include <asm/hardware/arm_timer.h> 36#include <asm/hardware/arm_timer.h>
34#include <asm/hardware/timer-sp.h> 37#include <asm/hardware/timer-sp.h>
35#include <asm/hardware/gic.h>
36#include <asm/hardware/cache-l2x0.h> 38#include <asm/hardware/cache-l2x0.h>
37#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
38#include <asm/mach/map.h> 40#include <asm/mach/map.h>
@@ -59,19 +61,13 @@ static void __init highbank_scu_map_io(void)
59 61
60void highbank_set_cpu_jump(int cpu, void *jump_addr) 62void highbank_set_cpu_jump(int cpu, void *jump_addr)
61{ 63{
62 cpu = cpu_logical_map(cpu); 64 cpu = MPIDR_AFFINITY_LEVEL(cpu_logical_map(cpu), 0);
63 writel(virt_to_phys(jump_addr), HB_JUMP_TABLE_VIRT(cpu)); 65 writel(virt_to_phys(jump_addr), HB_JUMP_TABLE_VIRT(cpu));
64 __cpuc_flush_dcache_area(HB_JUMP_TABLE_VIRT(cpu), 16); 66 __cpuc_flush_dcache_area(HB_JUMP_TABLE_VIRT(cpu), 16);
65 outer_clean_range(HB_JUMP_TABLE_PHYS(cpu), 67 outer_clean_range(HB_JUMP_TABLE_PHYS(cpu),
66 HB_JUMP_TABLE_PHYS(cpu) + 15); 68 HB_JUMP_TABLE_PHYS(cpu) + 15);
67} 69}
68 70
69const static struct of_device_id irq_match[] = {
70 { .compatible = "arm,cortex-a15-gic", .data = gic_of_init, },
71 { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
72 {}
73};
74
75#ifdef CONFIG_CACHE_L2X0 71#ifdef CONFIG_CACHE_L2X0
76static void highbank_l2x0_disable(void) 72static void highbank_l2x0_disable(void)
77{ 73{
@@ -82,7 +78,7 @@ static void highbank_l2x0_disable(void)
82 78
83static void __init highbank_init_irq(void) 79static void __init highbank_init_irq(void)
84{ 80{
85 of_irq_init(irq_match); 81 irqchip_init();
86 82
87 if (of_find_compatible_node(NULL, NULL, "arm,cortex-a9")) 83 if (of_find_compatible_node(NULL, NULL, "arm,cortex-a9"))
88 highbank_scu_map_io(); 84 highbank_scu_map_io();
@@ -116,7 +112,7 @@ static void __init highbank_timer_init(void)
116 WARN_ON(!timer_base); 112 WARN_ON(!timer_base);
117 irq = irq_of_parse_and_map(np, 0); 113 irq = irq_of_parse_and_map(np, 0);
118 114
119 highbank_clocks_init(); 115 of_clk_init(NULL);
120 lookup.clk = of_clk_get(np, 0); 116 lookup.clk = of_clk_get(np, 0);
121 clkdev_add(&lookup); 117 clkdev_add(&lookup);
122 118
@@ -129,10 +125,6 @@ static void __init highbank_timer_init(void)
129 arch_timer_sched_clock_init(); 125 arch_timer_sched_clock_init();
130} 126}
131 127
132static struct sys_timer highbank_timer = {
133 .init = highbank_timer_init,
134};
135
136static void highbank_power_off(void) 128static void highbank_power_off(void)
137{ 129{
138 highbank_set_pwr_shutdown(); 130 highbank_set_pwr_shutdown();
@@ -209,8 +201,7 @@ DT_MACHINE_START(HIGHBANK, "Highbank")
209 .smp = smp_ops(highbank_smp_ops), 201 .smp = smp_ops(highbank_smp_ops),
210 .map_io = debug_ll_io_init, 202 .map_io = debug_ll_io_init,
211 .init_irq = highbank_init_irq, 203 .init_irq = highbank_init_irq,
212 .timer = &highbank_timer, 204 .init_time = highbank_timer_init,
213 .handle_irq = gic_handle_irq,
214 .init_machine = highbank_init, 205 .init_machine = highbank_init,
215 .dt_compat = highbank_match, 206 .dt_compat = highbank_match,
216 .restart = highbank_restart, 207 .restart = highbank_restart,
diff --git a/arch/arm/mach-highbank/platsmp.c b/arch/arm/mach-highbank/platsmp.c
index 4ecc864ac8b9..8797a7001720 100644
--- a/arch/arm/mach-highbank/platsmp.c
+++ b/arch/arm/mach-highbank/platsmp.c
@@ -17,9 +17,9 @@
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/smp.h> 18#include <linux/smp.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/irqchip/arm-gic.h>
20 21
21#include <asm/smp_scu.h> 22#include <asm/smp_scu.h>
22#include <asm/hardware/gic.h>
23 23
24#include "core.h" 24#include "core.h"
25 25
@@ -33,7 +33,7 @@ static void __cpuinit highbank_secondary_init(unsigned int cpu)
33static int __cpuinit highbank_boot_secondary(unsigned int cpu, struct task_struct *idle) 33static int __cpuinit highbank_boot_secondary(unsigned int cpu, struct task_struct *idle)
34{ 34{
35 highbank_set_cpu_jump(cpu, secondary_startup); 35 highbank_set_cpu_jump(cpu, secondary_startup);
36 gic_raise_softirq(cpumask_of(cpu), 0); 36 arch_send_wakeup_ipi_mask(cpumask_of(cpu));
37 return 0; 37 return 0;
38} 38}
39 39
@@ -56,8 +56,6 @@ static void __init highbank_smp_init_cpus(void)
56 56
57 for (i = 0; i < ncores; i++) 57 for (i = 0; i < ncores; i++)
58 set_cpu_possible(i, true); 58 set_cpu_possible(i, true);
59
60 set_smp_cross_call(gic_raise_softirq);
61} 59}
62 60
63static void __init highbank_smp_prepare_cpus(unsigned int max_cpus) 61static void __init highbank_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-highbank/sysregs.h b/arch/arm/mach-highbank/sysregs.h
index 70af9d13fcef..5995df7f2622 100644
--- a/arch/arm/mach-highbank/sysregs.h
+++ b/arch/arm/mach-highbank/sysregs.h
@@ -37,7 +37,7 @@ extern void __iomem *sregs_base;
37 37
38static inline void highbank_set_core_pwr(void) 38static inline void highbank_set_core_pwr(void)
39{ 39{
40 int cpu = cpu_logical_map(smp_processor_id()); 40 int cpu = MPIDR_AFFINITY_LEVEL(cpu_logical_map(smp_processor_id()), 0);
41 if (scu_base_addr) 41 if (scu_base_addr)
42 scu_power_mode(scu_base_addr, SCU_PM_POWEROFF); 42 scu_power_mode(scu_base_addr, SCU_PM_POWEROFF);
43 else 43 else
@@ -46,7 +46,7 @@ static inline void highbank_set_core_pwr(void)
46 46
47static inline void highbank_clear_core_pwr(void) 47static inline void highbank_clear_core_pwr(void)
48{ 48{
49 int cpu = cpu_logical_map(smp_processor_id()); 49 int cpu = MPIDR_AFFINITY_LEVEL(cpu_logical_map(smp_processor_id()), 0);
50 if (scu_base_addr) 50 if (scu_base_addr)
51 scu_power_mode(scu_base_addr, SCU_PM_NORMAL); 51 scu_power_mode(scu_base_addr, SCU_PM_NORMAL);
52 else 52 else
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 0a2349dc7018..4c9c6f9d2c55 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -95,9 +95,6 @@ config MACH_MX27
95config ARCH_MX5 95config ARCH_MX5
96 bool 96 bool
97 97
98config ARCH_MX50
99 bool
100
101config ARCH_MX51 98config ARCH_MX51
102 bool 99 bool
103 100
@@ -164,11 +161,6 @@ config SOC_IMX5
164 select CPU_V7 161 select CPU_V7
165 select MXC_TZIC 162 select MXC_TZIC
166 163
167config SOC_IMX50
168 bool
169 select ARCH_MX50
170 select SOC_IMX5
171
172config SOC_IMX51 164config SOC_IMX51
173 bool 165 bool
174 select ARCH_MX5 166 select ARCH_MX5
@@ -488,7 +480,7 @@ config MACH_MX31ADS_WM1133_EV1
488 bool "Support Wolfson Microelectronics 1133-EV1 module" 480 bool "Support Wolfson Microelectronics 1133-EV1 module"
489 depends on MACH_MX31ADS 481 depends on MACH_MX31ADS
490 depends on MFD_WM8350_I2C 482 depends on MFD_WM8350_I2C
491 depends on REGULATOR_WM8350 483 depends on REGULATOR_WM8350 = y
492 select MFD_WM8350_CONFIG_MODE_0 484 select MFD_WM8350_CONFIG_MODE_0
493 select MFD_WM8352_CONFIG_MODE_0 485 select MFD_WM8352_CONFIG_MODE_0
494 help 486 help
@@ -738,25 +730,10 @@ endif
738 730
739if ARCH_MULTI_V7 731if ARCH_MULTI_V7
740 732
741comment "i.MX5 platforms:"
742
743config MACH_MX50_RDP
744 bool "Support MX50 reference design platform"
745 depends on BROKEN
746 select IMX_HAVE_PLATFORM_IMX_I2C
747 select IMX_HAVE_PLATFORM_IMX_UART
748 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
749 select IMX_HAVE_PLATFORM_SPI_IMX
750 select SOC_IMX50
751 help
752 Include support for MX50 reference design platform (RDP) board. This
753 includes specific configurations for the board and its peripherals.
754
755comment "i.MX51 machines:" 733comment "i.MX51 machines:"
756 734
757config MACH_IMX51_DT 735config MACH_IMX51_DT
758 bool "Support i.MX51 platforms from device tree" 736 bool "Support i.MX51 platforms from device tree"
759 select MACH_MX51_BABBAGE
760 select SOC_IMX51 737 select SOC_IMX51
761 help 738 help
762 Include support for Freescale i.MX51 based platforms 739 Include support for Freescale i.MX51 based platforms
@@ -777,19 +754,6 @@ config MACH_MX51_BABBAGE
777 u-boot. This includes specific configurations for the board and its 754 u-boot. This includes specific configurations for the board and its
778 peripherals. 755 peripherals.
779 756
780config MACH_MX51_3DS
781 bool "Support MX51PDK (3DS)"
782 select IMX_HAVE_PLATFORM_IMX2_WDT
783 select IMX_HAVE_PLATFORM_IMX_KEYPAD
784 select IMX_HAVE_PLATFORM_IMX_UART
785 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
786 select IMX_HAVE_PLATFORM_SPI_IMX
787 select MXC_DEBUG_BOARD
788 select SOC_IMX51
789 help
790 Include support for MX51PDK (3DS) platform. This includes specific
791 configurations for the board and its peripherals.
792
793config MACH_EUKREA_CPUIMX51SD 757config MACH_EUKREA_CPUIMX51SD
794 bool "Support Eukrea CPUIMX51SD module" 758 bool "Support Eukrea CPUIMX51SD module"
795 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 759 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 0634b3152c24..c4ce0906d76a 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -28,7 +28,11 @@ obj-$(CONFIG_MXC_ULPI) += ulpi.o
28obj-$(CONFIG_MXC_USE_EPIT) += epit.o 28obj-$(CONFIG_MXC_USE_EPIT) += epit.o
29obj-$(CONFIG_MXC_DEBUG_BOARD) += 3ds_debugboard.o 29obj-$(CONFIG_MXC_DEBUG_BOARD) += 3ds_debugboard.o
30obj-$(CONFIG_CPU_FREQ_IMX) += cpufreq.o 30obj-$(CONFIG_CPU_FREQ_IMX) += cpufreq.o
31obj-$(CONFIG_CPU_IDLE) += cpuidle.o 31
32ifeq ($(CONFIG_CPU_IDLE),y)
33obj-y += cpuidle.o
34obj-$(CONFIG_SOC_IMX6Q) += cpuidle-imx6q.o
35endif
32 36
33ifdef CONFIG_SND_IMX_SOC 37ifdef CONFIG_SND_IMX_SOC
34obj-y += ssi-fiq.o 38obj-y += ssi-fiq.o
@@ -88,7 +92,6 @@ obj-$(CONFIG_MACH_EUKREA_CPUIMX35SD) += mach-cpuimx35.o
88obj-$(CONFIG_MACH_EUKREA_MBIMXSD35_BASEBOARD) += eukrea_mbimxsd35-baseboard.o 92obj-$(CONFIG_MACH_EUKREA_MBIMXSD35_BASEBOARD) += eukrea_mbimxsd35-baseboard.o
89obj-$(CONFIG_MACH_VPR200) += mach-vpr200.o 93obj-$(CONFIG_MACH_VPR200) += mach-vpr200.o
90 94
91obj-$(CONFIG_DEBUG_LL) += lluart.o
92obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o 95obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o
93obj-$(CONFIG_HAVE_IMX_MMDC) += mmdc.o 96obj-$(CONFIG_HAVE_IMX_MMDC) += mmdc.o
94obj-$(CONFIG_HAVE_IMX_SRC) += src.o 97obj-$(CONFIG_HAVE_IMX_SRC) += src.o
@@ -103,10 +106,8 @@ endif
103 106
104# i.MX5 based machines 107# i.MX5 based machines
105obj-$(CONFIG_MACH_MX51_BABBAGE) += mach-mx51_babbage.o 108obj-$(CONFIG_MACH_MX51_BABBAGE) += mach-mx51_babbage.o
106obj-$(CONFIG_MACH_MX51_3DS) += mach-mx51_3ds.o
107obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += mach-cpuimx51sd.o 109obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += mach-cpuimx51sd.o
108obj-$(CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD) += eukrea_mbimxsd51-baseboard.o 110obj-$(CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD) += eukrea_mbimxsd51-baseboard.o
109obj-$(CONFIG_MACH_MX50_RDP) += mach-mx50_rdp.o
110 111
111obj-$(CONFIG_MACH_IMX51_DT) += imx51-dt.o 112obj-$(CONFIG_MACH_IMX51_DT) += imx51-dt.o
112obj-$(CONFIG_SOC_IMX53) += mach-imx53.o 113obj-$(CONFIG_SOC_IMX53) += mach-imx53.o
diff --git a/arch/arm/mach-imx/Makefile.boot b/arch/arm/mach-imx/Makefile.boot
index b27815de8473..41ba1bb0437b 100644
--- a/arch/arm/mach-imx/Makefile.boot
+++ b/arch/arm/mach-imx/Makefile.boot
@@ -22,10 +22,6 @@ zreladdr-$(CONFIG_SOC_IMX35) += 0x80008000
22params_phys-$(CONFIG_SOC_IMX35) := 0x80000100 22params_phys-$(CONFIG_SOC_IMX35) := 0x80000100
23initrd_phys-$(CONFIG_SOC_IMX35) := 0x80800000 23initrd_phys-$(CONFIG_SOC_IMX35) := 0x80800000
24 24
25zreladdr-$(CONFIG_SOC_IMX50) += 0x70008000
26params_phys-$(CONFIG_SOC_IMX50) := 0x70000100
27initrd_phys-$(CONFIG_SOC_IMX50) := 0x70800000
28
29zreladdr-$(CONFIG_SOC_IMX51) += 0x90008000 25zreladdr-$(CONFIG_SOC_IMX51) += 0x90008000
30params_phys-$(CONFIG_SOC_IMX51) := 0x90000100 26params_phys-$(CONFIG_SOC_IMX51) := 0x90000100
31initrd_phys-$(CONFIG_SOC_IMX51) := 0x90800000 27initrd_phys-$(CONFIG_SOC_IMX51) := 0x90800000
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
index 2c570cdaae7b..69858c78f40d 100644
--- a/arch/arm/mach-imx/clk-imx25.c
+++ b/arch/arm/mach-imx/clk-imx25.c
@@ -224,6 +224,9 @@ static int __init __mx25_clocks_init(unsigned long osc_rate)
224 224
225 clk_prepare_enable(clk[emi_ahb]); 225 clk_prepare_enable(clk[emi_ahb]);
226 226
227 /* Clock source for gpt must be derived from AHB */
228 clk_set_parent(clk[per5_sel], clk[ahb]);
229
227 clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0"); 230 clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0");
228 clk_register_clkdev(clk[gpt_ipg_per], "per", "imx-gpt.0"); 231 clk_register_clkdev(clk[gpt_ipg_per], "per", "imx-gpt.0");
229 232
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
index 1ffe3b534e51..30b3242a7d49 100644
--- a/arch/arm/mach-imx/clk-imx27.c
+++ b/arch/arm/mach-imx/clk-imx27.c
@@ -62,7 +62,7 @@ static const char *clko_sel_clks[] = {
62 "32k", "usb_div", "dptc", 62 "32k", "usb_div", "dptc",
63}; 63};
64 64
65static const char *ssi_sel_clks[] = { "spll", "mpll", }; 65static const char *ssi_sel_clks[] = { "spll_gate", "mpll", };
66 66
67enum mx27_clks { 67enum mx27_clks {
68 dummy, ckih, ckil, mpll, spll, mpll_main2, ahb, ipg, nfc_div, per1_div, 68 dummy, ckih, ckil, mpll, spll, mpll_main2, ahb, ipg, nfc_div, per1_div,
@@ -82,7 +82,7 @@ enum mx27_clks {
82 csi_ahb_gate, brom_ahb_gate, ata_ahb_gate, wdog_ipg_gate, usb_ipg_gate, 82 csi_ahb_gate, brom_ahb_gate, ata_ahb_gate, wdog_ipg_gate, usb_ipg_gate,
83 uart6_ipg_gate, uart5_ipg_gate, uart4_ipg_gate, uart3_ipg_gate, 83 uart6_ipg_gate, uart5_ipg_gate, uart4_ipg_gate, uart3_ipg_gate,
84 uart2_ipg_gate, uart1_ipg_gate, ckih_div1p5, fpm, mpll_osc_sel, 84 uart2_ipg_gate, uart1_ipg_gate, ckih_div1p5, fpm, mpll_osc_sel,
85 mpll_sel, clk_max 85 mpll_sel, spll_gate, clk_max
86}; 86};
87 87
88static struct clk *clk[clk_max]; 88static struct clk *clk[clk_max];
@@ -104,6 +104,7 @@ int __init mx27_clocks_init(unsigned long fref)
104 ARRAY_SIZE(mpll_sel_clks)); 104 ARRAY_SIZE(mpll_sel_clks));
105 clk[mpll] = imx_clk_pllv1("mpll", "mpll_sel", CCM_MPCTL0); 105 clk[mpll] = imx_clk_pllv1("mpll", "mpll_sel", CCM_MPCTL0);
106 clk[spll] = imx_clk_pllv1("spll", "ckih", CCM_SPCTL0); 106 clk[spll] = imx_clk_pllv1("spll", "ckih", CCM_SPCTL0);
107 clk[spll_gate] = imx_clk_gate("spll_gate", "spll", CCM_CSCR, 1);
107 clk[mpll_main2] = imx_clk_fixed_factor("mpll_main2", "mpll", 2, 3); 108 clk[mpll_main2] = imx_clk_fixed_factor("mpll_main2", "mpll", 2, 3);
108 109
109 if (mx27_revision() >= IMX_CHIP_REVISION_2_0) { 110 if (mx27_revision() >= IMX_CHIP_REVISION_2_0) {
@@ -121,7 +122,7 @@ int __init mx27_clocks_init(unsigned long fref)
121 clk[per4_div] = imx_clk_divider("per4_div", "mpll_main2", CCM_PCDR1, 24, 6); 122 clk[per4_div] = imx_clk_divider("per4_div", "mpll_main2", CCM_PCDR1, 24, 6);
122 clk[vpu_sel] = imx_clk_mux("vpu_sel", CCM_CSCR, 21, 1, vpu_sel_clks, ARRAY_SIZE(vpu_sel_clks)); 123 clk[vpu_sel] = imx_clk_mux("vpu_sel", CCM_CSCR, 21, 1, vpu_sel_clks, ARRAY_SIZE(vpu_sel_clks));
123 clk[vpu_div] = imx_clk_divider("vpu_div", "vpu_sel", CCM_PCDR0, 10, 6); 124 clk[vpu_div] = imx_clk_divider("vpu_div", "vpu_sel", CCM_PCDR0, 10, 6);
124 clk[usb_div] = imx_clk_divider("usb_div", "spll", CCM_CSCR, 28, 3); 125 clk[usb_div] = imx_clk_divider("usb_div", "spll_gate", CCM_CSCR, 28, 3);
125 clk[cpu_sel] = imx_clk_mux("cpu_sel", CCM_CSCR, 15, 1, cpu_sel_clks, ARRAY_SIZE(cpu_sel_clks)); 126 clk[cpu_sel] = imx_clk_mux("cpu_sel", CCM_CSCR, 15, 1, cpu_sel_clks, ARRAY_SIZE(cpu_sel_clks));
126 clk[clko_sel] = imx_clk_mux("clko_sel", CCM_CCSR, 0, 5, clko_sel_clks, ARRAY_SIZE(clko_sel_clks)); 127 clk[clko_sel] = imx_clk_mux("clko_sel", CCM_CCSR, 0, 5, clko_sel_clks, ARRAY_SIZE(clko_sel_clks));
127 if (mx27_revision() >= IMX_CHIP_REVISION_2_0) 128 if (mx27_revision() >= IMX_CHIP_REVISION_2_0)
@@ -228,9 +229,12 @@ int __init mx27_clocks_init(unsigned long fref)
228 clk_register_clkdev(clk[sdhc2_ipg_gate], "ipg", "imx21-mmc.1"); 229 clk_register_clkdev(clk[sdhc2_ipg_gate], "ipg", "imx21-mmc.1");
229 clk_register_clkdev(clk[per2_gate], "per", "imx21-mmc.2"); 230 clk_register_clkdev(clk[per2_gate], "per", "imx21-mmc.2");
230 clk_register_clkdev(clk[sdhc2_ipg_gate], "ipg", "imx21-mmc.2"); 231 clk_register_clkdev(clk[sdhc2_ipg_gate], "ipg", "imx21-mmc.2");
231 clk_register_clkdev(clk[cspi1_ipg_gate], NULL, "imx27-cspi.0"); 232 clk_register_clkdev(clk[per2_gate], "per", "imx27-cspi.0");
232 clk_register_clkdev(clk[cspi2_ipg_gate], NULL, "imx27-cspi.1"); 233 clk_register_clkdev(clk[cspi1_ipg_gate], "ipg", "imx27-cspi.0");
233 clk_register_clkdev(clk[cspi3_ipg_gate], NULL, "imx27-cspi.2"); 234 clk_register_clkdev(clk[per2_gate], "per", "imx27-cspi.1");
235 clk_register_clkdev(clk[cspi2_ipg_gate], "ipg", "imx27-cspi.1");
236 clk_register_clkdev(clk[per2_gate], "per", "imx27-cspi.2");
237 clk_register_clkdev(clk[cspi3_ipg_gate], "ipg", "imx27-cspi.2");
234 clk_register_clkdev(clk[per3_gate], "per", "imx21-fb.0"); 238 clk_register_clkdev(clk[per3_gate], "per", "imx21-fb.0");
235 clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx21-fb.0"); 239 clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx21-fb.0");
236 clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx21-fb.0"); 240 clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx21-fb.0");
diff --git a/arch/arm/mach-imx/clk-imx31.c b/arch/arm/mach-imx/clk-imx31.c
index 16ccbd41dea9..b5b65f3efaf1 100644
--- a/arch/arm/mach-imx/clk-imx31.c
+++ b/arch/arm/mach-imx/clk-imx31.c
@@ -34,8 +34,8 @@ static const char *csi_sel[] = { "upll", "spll", };
34static const char *fir_sel[] = { "mcu_main", "upll", "spll" }; 34static const char *fir_sel[] = { "mcu_main", "upll", "spll" };
35 35
36enum mx31_clks { 36enum mx31_clks {
37 ckih, ckil, mpll, spll, upll, mcu_main, hsp, ahb, nfc, ipg, per_div, 37 dummy, ckih, ckil, mpll, spll, upll, mcu_main, hsp, ahb, nfc, ipg,
38 per, csi, fir, csi_div, usb_div_pre, usb_div_post, fir_div_pre, 38 per_div, per, csi, fir, csi_div, usb_div_pre, usb_div_post, fir_div_pre,
39 fir_div_post, sdhc1_gate, sdhc2_gate, gpt_gate, epit1_gate, epit2_gate, 39 fir_div_post, sdhc1_gate, sdhc2_gate, gpt_gate, epit1_gate, epit2_gate,
40 iim_gate, ata_gate, sdma_gate, cspi3_gate, rng_gate, uart1_gate, 40 iim_gate, ata_gate, sdma_gate, cspi3_gate, rng_gate, uart1_gate,
41 uart2_gate, ssi1_gate, i2c1_gate, i2c2_gate, i2c3_gate, hantro_gate, 41 uart2_gate, ssi1_gate, i2c1_gate, i2c2_gate, i2c3_gate, hantro_gate,
@@ -46,12 +46,15 @@ enum mx31_clks {
46}; 46};
47 47
48static struct clk *clk[clk_max]; 48static struct clk *clk[clk_max];
49static struct clk_onecell_data clk_data;
49 50
50int __init mx31_clocks_init(unsigned long fref) 51int __init mx31_clocks_init(unsigned long fref)
51{ 52{
52 void __iomem *base = MX31_IO_ADDRESS(MX31_CCM_BASE_ADDR); 53 void __iomem *base = MX31_IO_ADDRESS(MX31_CCM_BASE_ADDR);
53 int i; 54 int i;
55 struct device_node *np;
54 56
57 clk[dummy] = imx_clk_fixed("dummy", 0);
55 clk[ckih] = imx_clk_fixed("ckih", fref); 58 clk[ckih] = imx_clk_fixed("ckih", fref);
56 clk[ckil] = imx_clk_fixed("ckil", 32768); 59 clk[ckil] = imx_clk_fixed("ckil", 32768);
57 clk[mpll] = imx_clk_pllv1("mpll", "ckih", base + MXC_CCM_MPCTL); 60 clk[mpll] = imx_clk_pllv1("mpll", "ckih", base + MXC_CCM_MPCTL);
@@ -116,6 +119,14 @@ int __init mx31_clocks_init(unsigned long fref)
116 pr_err("imx31 clk %d: register failed with %ld\n", 119 pr_err("imx31 clk %d: register failed with %ld\n",
117 i, PTR_ERR(clk[i])); 120 i, PTR_ERR(clk[i]));
118 121
122 np = of_find_compatible_node(NULL, NULL, "fsl,imx31-ccm");
123
124 if (np) {
125 clk_data.clks = clk;
126 clk_data.clk_num = ARRAY_SIZE(clk);
127 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
128 }
129
119 clk_register_clkdev(clk[gpt_gate], "per", "imx-gpt.0"); 130 clk_register_clkdev(clk[gpt_gate], "per", "imx-gpt.0");
120 clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0"); 131 clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0");
121 clk_register_clkdev(clk[cspi1_gate], NULL, "imx31-cspi.0"); 132 clk_register_clkdev(clk[cspi1_gate], NULL, "imx31-cspi.0");
diff --git a/arch/arm/mach-imx/clk-imx35.c b/arch/arm/mach-imx/clk-imx35.c
index f0727e80815d..74e3a34d78b8 100644
--- a/arch/arm/mach-imx/clk-imx35.c
+++ b/arch/arm/mach-imx/clk-imx35.c
@@ -67,13 +67,13 @@ enum mx35_clks {
67 67
68static struct clk *clk[clk_max]; 68static struct clk *clk[clk_max];
69 69
70int __init mx35_clocks_init() 70int __init mx35_clocks_init(void)
71{ 71{
72 void __iomem *base = MX35_IO_ADDRESS(MX35_CCM_BASE_ADDR); 72 void __iomem *base = MX35_IO_ADDRESS(MX35_CCM_BASE_ADDR);
73 u32 pdr0, consumer_sel, hsp_sel; 73 u32 pdr0, consumer_sel, hsp_sel;
74 struct arm_ahb_div *aad; 74 struct arm_ahb_div *aad;
75 unsigned char *hsp_div; 75 unsigned char *hsp_div;
76 int i; 76 u32 i;
77 77
78 pdr0 = __raw_readl(base + MXC_CCM_PDR0); 78 pdr0 = __raw_readl(base + MXC_CCM_PDR0);
79 consumer_sel = (pdr0 >> 16) & 0xf; 79 consumer_sel = (pdr0 >> 16) & 0xf;
diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c
index fb7cb841b64c..0f39f8c93b94 100644
--- a/arch/arm/mach-imx/clk-imx51-imx53.c
+++ b/arch/arm/mach-imx/clk-imx51-imx53.c
@@ -83,6 +83,7 @@ enum imx5_clks {
83 ssi2_root_gate, ssi3_root_gate, ssi_ext1_gate, ssi_ext2_gate, 83 ssi2_root_gate, ssi3_root_gate, ssi_ext1_gate, ssi_ext2_gate,
84 epit1_ipg_gate, epit1_hf_gate, epit2_ipg_gate, epit2_hf_gate, 84 epit1_ipg_gate, epit1_hf_gate, epit2_ipg_gate, epit2_hf_gate,
85 can_sel, can1_serial_gate, can1_ipg_gate, 85 can_sel, can1_serial_gate, can1_ipg_gate,
86 owire_gate,
86 clk_max 87 clk_max
87}; 88};
88 89
@@ -233,12 +234,13 @@ static void __init mx5_clocks_common_init(unsigned long rate_ckil,
233 clk[epit1_hf_gate] = imx_clk_gate2("epit1_hf_gate", "per_root", MXC_CCM_CCGR2, 4); 234 clk[epit1_hf_gate] = imx_clk_gate2("epit1_hf_gate", "per_root", MXC_CCM_CCGR2, 4);
234 clk[epit2_ipg_gate] = imx_clk_gate2("epit2_ipg_gate", "ipg", MXC_CCM_CCGR2, 6); 235 clk[epit2_ipg_gate] = imx_clk_gate2("epit2_ipg_gate", "ipg", MXC_CCM_CCGR2, 6);
235 clk[epit2_hf_gate] = imx_clk_gate2("epit2_hf_gate", "per_root", MXC_CCM_CCGR2, 8); 236 clk[epit2_hf_gate] = imx_clk_gate2("epit2_hf_gate", "per_root", MXC_CCM_CCGR2, 8);
237 clk[owire_gate] = imx_clk_gate2("owire_gate", "per_root", MXC_CCM_CCGR2, 22);
236 238
237 for (i = 0; i < ARRAY_SIZE(clk); i++) 239 for (i = 0; i < ARRAY_SIZE(clk); i++)
238 if (IS_ERR(clk[i])) 240 if (IS_ERR(clk[i]))
239 pr_err("i.MX5 clk %d: register failed with %ld\n", 241 pr_err("i.MX5 clk %d: register failed with %ld\n",
240 i, PTR_ERR(clk[i])); 242 i, PTR_ERR(clk[i]));
241 243
242 clk_register_clkdev(clk[gpt_hf_gate], "per", "imx-gpt.0"); 244 clk_register_clkdev(clk[gpt_hf_gate], "per", "imx-gpt.0");
243 clk_register_clkdev(clk[gpt_ipg_gate], "ipg", "imx-gpt.0"); 245 clk_register_clkdev(clk[gpt_ipg_gate], "ipg", "imx-gpt.0");
244 clk_register_clkdev(clk[uart1_per_gate], "per", "imx21-uart.0"); 246 clk_register_clkdev(clk[uart1_per_gate], "per", "imx21-uart.0");
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
index c0c4e723b7f5..7b025ee528a5 100644
--- a/arch/arm/mach-imx/clk-imx6q.c
+++ b/arch/arm/mach-imx/clk-imx6q.c
@@ -54,9 +54,18 @@
54#define BM_CLPCR_MASK_SCU_IDLE (0x1 << 26) 54#define BM_CLPCR_MASK_SCU_IDLE (0x1 << 26)
55#define BM_CLPCR_MASK_L2CC_IDLE (0x1 << 27) 55#define BM_CLPCR_MASK_L2CC_IDLE (0x1 << 27)
56 56
57#define CGPR 0x64
58#define BM_CGPR_CHICKEN_BIT (0x1 << 17)
59
57static void __iomem *ccm_base; 60static void __iomem *ccm_base;
58 61
59void __init imx6q_clock_map_io(void) { } 62void imx6q_set_chicken_bit(void)
63{
64 u32 val = readl_relaxed(ccm_base + CGPR);
65
66 val |= BM_CGPR_CHICKEN_BIT;
67 writel_relaxed(val, ccm_base + CGPR);
68}
60 69
61int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode) 70int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode)
62{ 71{
@@ -68,6 +77,7 @@ int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode)
68 break; 77 break;
69 case WAIT_UNCLOCKED: 78 case WAIT_UNCLOCKED:
70 val |= 0x1 << BP_CLPCR_LPM; 79 val |= 0x1 << BP_CLPCR_LPM;
80 val |= BM_CLPCR_ARM_CLK_DIS_ON_LPM;
71 break; 81 break;
72 case STOP_POWER_ON: 82 case STOP_POWER_ON:
73 val |= 0x2 << BP_CLPCR_LPM; 83 val |= 0x2 << BP_CLPCR_LPM;
@@ -154,8 +164,8 @@ enum mx6q_clks {
154 usdhc4, vdo_axi, vpu_axi, cko1, pll1_sys, pll2_bus, pll3_usb_otg, 164 usdhc4, vdo_axi, vpu_axi, cko1, pll1_sys, pll2_bus, pll3_usb_otg,
155 pll4_audio, pll5_video, pll8_mlb, pll7_usb_host, pll6_enet, ssi1_ipg, 165 pll4_audio, pll5_video, pll8_mlb, pll7_usb_host, pll6_enet, ssi1_ipg,
156 ssi2_ipg, ssi3_ipg, rom, usbphy1, usbphy2, ldb_di0_div_3_5, ldb_di1_div_3_5, 166 ssi2_ipg, ssi3_ipg, rom, usbphy1, usbphy2, ldb_di0_div_3_5, ldb_di1_div_3_5,
157 sata_ref, sata_ref_100m, pcie_ref, pcie_ref_125m, enet_ref, 167 sata_ref, sata_ref_100m, pcie_ref, pcie_ref_125m, enet_ref, usbphy1_gate,
158 clk_max 168 usbphy2_gate, clk_max
159}; 169};
160 170
161static struct clk *clk[clk_max]; 171static struct clk *clk[clk_max];
@@ -208,8 +218,21 @@ int __init mx6q_clocks_init(void)
208 clk[pll7_usb_host] = imx_clk_pllv3(IMX_PLLV3_USB, "pll7_usb_host","osc", base + 0x20, 0x3); 218 clk[pll7_usb_host] = imx_clk_pllv3(IMX_PLLV3_USB, "pll7_usb_host","osc", base + 0x20, 0x3);
209 clk[pll8_mlb] = imx_clk_pllv3(IMX_PLLV3_MLB, "pll8_mlb", "osc", base + 0xd0, 0x0); 219 clk[pll8_mlb] = imx_clk_pllv3(IMX_PLLV3_MLB, "pll8_mlb", "osc", base + 0xd0, 0x0);
210 220
211 clk[usbphy1] = imx_clk_gate("usbphy1", "pll3_usb_otg", base + 0x10, 6); 221 /*
212 clk[usbphy2] = imx_clk_gate("usbphy2", "pll7_usb_host", base + 0x20, 6); 222 * Bit 20 is the reserved and read-only bit, we do this only for:
223 * - Do nothing for usbphy clk_enable/disable
224 * - Keep refcount when do usbphy clk_enable/disable, in that case,
225 * the clk framework may need to enable/disable usbphy's parent
226 */
227 clk[usbphy1] = imx_clk_gate("usbphy1", "pll3_usb_otg", base + 0x10, 20);
228 clk[usbphy2] = imx_clk_gate("usbphy2", "pll7_usb_host", base + 0x20, 20);
229
230 /*
231 * usbphy*_gate needs to be on after system boots up, and software
232 * never needs to control it anymore.
233 */
234 clk[usbphy1_gate] = imx_clk_gate("usbphy1_gate", "dummy", base + 0x10, 6);
235 clk[usbphy2_gate] = imx_clk_gate("usbphy2_gate", "dummy", base + 0x20, 6);
213 236
214 clk[sata_ref] = imx_clk_fixed_factor("sata_ref", "pll6_enet", 1, 5); 237 clk[sata_ref] = imx_clk_fixed_factor("sata_ref", "pll6_enet", 1, 5);
215 clk[pcie_ref] = imx_clk_fixed_factor("pcie_ref", "pll6_enet", 1, 4); 238 clk[pcie_ref] = imx_clk_fixed_factor("pcie_ref", "pll6_enet", 1, 4);
@@ -436,6 +459,11 @@ int __init mx6q_clocks_init(void)
436 for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) 459 for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
437 clk_prepare_enable(clk[clks_init_on[i]]); 460 clk_prepare_enable(clk[clks_init_on[i]]);
438 461
462 if (IS_ENABLED(CONFIG_USB_MXS_PHY)) {
463 clk_prepare_enable(clk[usbphy1_gate]);
464 clk_prepare_enable(clk[usbphy2_gate]);
465 }
466
439 /* Set initial power mode */ 467 /* Set initial power mode */
440 imx6q_set_lpm(WAIT_CLOCKED); 468 imx6q_set_lpm(WAIT_CLOCKED);
441 469
diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h
index fa36fb84ab19..5a800bfcec5b 100644
--- a/arch/arm/mach-imx/common.h
+++ b/arch/arm/mach-imx/common.h
@@ -21,7 +21,6 @@ extern void mx25_map_io(void);
21extern void mx27_map_io(void); 21extern void mx27_map_io(void);
22extern void mx31_map_io(void); 22extern void mx31_map_io(void);
23extern void mx35_map_io(void); 23extern void mx35_map_io(void);
24extern void mx50_map_io(void);
25extern void mx51_map_io(void); 24extern void mx51_map_io(void);
26extern void mx53_map_io(void); 25extern void mx53_map_io(void);
27extern void imx1_init_early(void); 26extern void imx1_init_early(void);
@@ -30,7 +29,6 @@ extern void imx25_init_early(void);
30extern void imx27_init_early(void); 29extern void imx27_init_early(void);
31extern void imx31_init_early(void); 30extern void imx31_init_early(void);
32extern void imx35_init_early(void); 31extern void imx35_init_early(void);
33extern void imx50_init_early(void);
34extern void imx51_init_early(void); 32extern void imx51_init_early(void);
35extern void imx53_init_early(void); 33extern void imx53_init_early(void);
36extern void mxc_init_irq(void __iomem *); 34extern void mxc_init_irq(void __iomem *);
@@ -41,7 +39,6 @@ extern void mx25_init_irq(void);
41extern void mx27_init_irq(void); 39extern void mx27_init_irq(void);
42extern void mx31_init_irq(void); 40extern void mx31_init_irq(void);
43extern void mx35_init_irq(void); 41extern void mx35_init_irq(void);
44extern void mx50_init_irq(void);
45extern void mx51_init_irq(void); 42extern void mx51_init_irq(void);
46extern void mx53_init_irq(void); 43extern void mx53_init_irq(void);
47extern void imx1_soc_init(void); 44extern void imx1_soc_init(void);
@@ -50,7 +47,6 @@ extern void imx25_soc_init(void);
50extern void imx27_soc_init(void); 47extern void imx27_soc_init(void);
51extern void imx31_soc_init(void); 48extern void imx31_soc_init(void);
52extern void imx35_soc_init(void); 49extern void imx35_soc_init(void);
53extern void imx50_soc_init(void);
54extern void imx51_soc_init(void); 50extern void imx51_soc_init(void);
55extern void imx51_init_late(void); 51extern void imx51_init_late(void);
56extern void imx53_init_late(void); 52extern void imx53_init_late(void);
@@ -109,27 +105,22 @@ void tzic_handle_irq(struct pt_regs *);
109#define imx27_handle_irq avic_handle_irq 105#define imx27_handle_irq avic_handle_irq
110#define imx31_handle_irq avic_handle_irq 106#define imx31_handle_irq avic_handle_irq
111#define imx35_handle_irq avic_handle_irq 107#define imx35_handle_irq avic_handle_irq
112#define imx50_handle_irq tzic_handle_irq
113#define imx51_handle_irq tzic_handle_irq 108#define imx51_handle_irq tzic_handle_irq
114#define imx53_handle_irq tzic_handle_irq 109#define imx53_handle_irq tzic_handle_irq
115#define imx6q_handle_irq gic_handle_irq
116 110
117extern void imx_enable_cpu(int cpu, bool enable); 111extern void imx_enable_cpu(int cpu, bool enable);
118extern void imx_set_cpu_jump(int cpu, void *jump_addr); 112extern void imx_set_cpu_jump(int cpu, void *jump_addr);
119#ifdef CONFIG_DEBUG_LL
120extern void imx_lluart_map_io(void);
121#else
122static inline void imx_lluart_map_io(void) {}
123#endif
124extern void v7_cpu_resume(void); 113extern void v7_cpu_resume(void);
125extern u32 *pl310_get_save_ptr(void); 114extern u32 *pl310_get_save_ptr(void);
126#ifdef CONFIG_SMP 115#ifdef CONFIG_SMP
127extern void v7_secondary_startup(void); 116extern void v7_secondary_startup(void);
128extern void imx_scu_map_io(void); 117extern void imx_scu_map_io(void);
129extern void imx_smp_prepare(void); 118extern void imx_smp_prepare(void);
119extern void imx_scu_standby_enable(void);
130#else 120#else
131static inline void imx_scu_map_io(void) {} 121static inline void imx_scu_map_io(void) {}
132static inline void imx_smp_prepare(void) {} 122static inline void imx_smp_prepare(void) {}
123static inline void imx_scu_standby_enable(void) {}
133#endif 124#endif
134extern void imx_enable_cpu(int cpu, bool enable); 125extern void imx_enable_cpu(int cpu, bool enable);
135extern void imx_set_cpu_jump(int cpu, void *jump_addr); 126extern void imx_set_cpu_jump(int cpu, void *jump_addr);
@@ -139,7 +130,7 @@ extern void imx_gpc_init(void);
139extern void imx_gpc_pre_suspend(void); 130extern void imx_gpc_pre_suspend(void);
140extern void imx_gpc_post_resume(void); 131extern void imx_gpc_post_resume(void);
141extern int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode); 132extern int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode);
142extern void imx6q_clock_map_io(void); 133extern void imx6q_set_chicken_bit(void);
143 134
144extern void imx_cpu_die(unsigned int cpu); 135extern void imx_cpu_die(unsigned int cpu);
145extern int imx_cpu_kill(unsigned int cpu); 136extern int imx_cpu_kill(unsigned int cpu);
diff --git a/arch/arm/mach-imx/cpu-imx5.c b/arch/arm/mach-imx/cpu-imx5.c
index d88760014ff9..d7ce72252a4e 100644
--- a/arch/arm/mach-imx/cpu-imx5.c
+++ b/arch/arm/mach-imx/cpu-imx5.c
@@ -22,7 +22,6 @@
22static int mx5_cpu_rev = -1; 22static int mx5_cpu_rev = -1;
23 23
24#define IIM_SREV 0x24 24#define IIM_SREV 0x24
25#define MX50_HW_ADADIG_DIGPROG 0xB0
26 25
27static int get_mx51_srev(void) 26static int get_mx51_srev(void)
28{ 27{
@@ -108,41 +107,3 @@ int mx53_revision(void)
108 return mx5_cpu_rev; 107 return mx5_cpu_rev;
109} 108}
110EXPORT_SYMBOL(mx53_revision); 109EXPORT_SYMBOL(mx53_revision);
111
112static int get_mx50_srev(void)
113{
114 void __iomem *anatop = ioremap(MX50_ANATOP_BASE_ADDR, SZ_8K);
115 u32 rev;
116
117 if (!anatop) {
118 mx5_cpu_rev = -EINVAL;
119 return 0;
120 }
121
122 rev = readl(anatop + MX50_HW_ADADIG_DIGPROG);
123 rev &= 0xff;
124
125 iounmap(anatop);
126 if (rev == 0x0)
127 return IMX_CHIP_REVISION_1_0;
128 else if (rev == 0x1)
129 return IMX_CHIP_REVISION_1_1;
130 return 0;
131}
132
133/*
134 * Returns:
135 * the silicon revision of the cpu
136 * -EINVAL - not a mx50
137 */
138int mx50_revision(void)
139{
140 if (!cpu_is_mx50())
141 return -EINVAL;
142
143 if (mx5_cpu_rev == -1)
144 mx5_cpu_rev = get_mx50_srev();
145
146 return mx5_cpu_rev;
147}
148EXPORT_SYMBOL(mx50_revision);
diff --git a/arch/arm/mach-imx/cpuidle-imx6q.c b/arch/arm/mach-imx/cpuidle-imx6q.c
new file mode 100644
index 000000000000..d533e2695f0e
--- /dev/null
+++ b/arch/arm/mach-imx/cpuidle-imx6q.c
@@ -0,0 +1,95 @@
1/*
2 * Copyright (C) 2012 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#include <linux/clockchips.h>
10#include <linux/cpuidle.h>
11#include <linux/module.h>
12#include <asm/cpuidle.h>
13#include <asm/proc-fns.h>
14
15#include "common.h"
16#include "cpuidle.h"
17
18static atomic_t master = ATOMIC_INIT(0);
19static DEFINE_SPINLOCK(master_lock);
20
21static int imx6q_enter_wait(struct cpuidle_device *dev,
22 struct cpuidle_driver *drv, int index)
23{
24 int cpu = dev->cpu;
25
26 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu);
27
28 if (atomic_inc_return(&master) == num_online_cpus()) {
29 /*
30 * With this lock, we prevent other cpu to exit and enter
31 * this function again and become the master.
32 */
33 if (!spin_trylock(&master_lock))
34 goto idle;
35 imx6q_set_lpm(WAIT_UNCLOCKED);
36 cpu_do_idle();
37 imx6q_set_lpm(WAIT_CLOCKED);
38 spin_unlock(&master_lock);
39 goto done;
40 }
41
42idle:
43 cpu_do_idle();
44done:
45 atomic_dec(&master);
46 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu);
47
48 return index;
49}
50
51/*
52 * For each cpu, setup the broadcast timer because local timer
53 * stops for the states other than WFI.
54 */
55static void imx6q_setup_broadcast_timer(void *arg)
56{
57 int cpu = smp_processor_id();
58
59 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ON, &cpu);
60}
61
62static struct cpuidle_driver imx6q_cpuidle_driver = {
63 .name = "imx6q_cpuidle",
64 .owner = THIS_MODULE,
65 .en_core_tk_irqen = 1,
66 .states = {
67 /* WFI */
68 ARM_CPUIDLE_WFI_STATE,
69 /* WAIT */
70 {
71 .exit_latency = 50,
72 .target_residency = 75,
73 .flags = CPUIDLE_FLAG_TIME_VALID,
74 .enter = imx6q_enter_wait,
75 .name = "WAIT",
76 .desc = "Clock off",
77 },
78 },
79 .state_count = 2,
80 .safe_state_index = 0,
81};
82
83int __init imx6q_cpuidle_init(void)
84{
85 /* Need to enable SCU standby for entering WAIT modes */
86 imx_scu_standby_enable();
87
88 /* Set chicken bit to get a reliable WAIT mode support */
89 imx6q_set_chicken_bit();
90
91 /* Configure the broadcast timer on each cpu */
92 on_each_cpu(imx6q_setup_broadcast_timer, NULL, 1);
93
94 return imx_cpuidle_init(&imx6q_cpuidle_driver);
95}
diff --git a/arch/arm/mach-imx/cpuidle.h b/arch/arm/mach-imx/cpuidle.h
index bc932d1af372..e092d1359d94 100644
--- a/arch/arm/mach-imx/cpuidle.h
+++ b/arch/arm/mach-imx/cpuidle.h
@@ -14,9 +14,14 @@
14 14
15#ifdef CONFIG_CPU_IDLE 15#ifdef CONFIG_CPU_IDLE
16extern int imx_cpuidle_init(struct cpuidle_driver *drv); 16extern int imx_cpuidle_init(struct cpuidle_driver *drv);
17extern int imx6q_cpuidle_init(void);
17#else 18#else
18static inline int imx_cpuidle_init(struct cpuidle_driver *drv) 19static inline int imx_cpuidle_init(struct cpuidle_driver *drv)
19{ 20{
20 return -ENODEV; 21 return -ENODEV;
21} 22}
23static inline int imx6q_cpuidle_init(void)
24{
25 return -ENODEV;
26}
22#endif 27#endif
diff --git a/arch/arm/mach-imx/devices-imx50.h b/arch/arm/mach-imx/devices-imx50.h
deleted file mode 100644
index 2c290391f298..000000000000
--- a/arch/arm/mach-imx/devices-imx50.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/*
2 * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
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 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#include "devices/devices-common.h"
22
23extern const struct imx_imx_uart_1irq_data imx50_imx_uart_data[];
24#define imx50_add_imx_uart(id, pdata) \
25 imx_add_imx_uart_1irq(&imx50_imx_uart_data[id], pdata)
26
27extern const struct imx_fec_data imx50_fec_data;
28#define imx50_add_fec(pdata) \
29 imx_add_fec(&imx50_fec_data, pdata)
30
31extern const struct imx_imx_i2c_data imx50_imx_i2c_data[];
32#define imx50_add_imx_i2c(id, pdata) \
33 imx_add_imx_i2c(&imx50_imx_i2c_data[id], pdata)
diff --git a/arch/arm/mach-imx/devices/Kconfig b/arch/arm/mach-imx/devices/Kconfig
index 9a8f1ca7bcb1..9b9ba1f4ffe1 100644
--- a/arch/arm/mach-imx/devices/Kconfig
+++ b/arch/arm/mach-imx/devices/Kconfig
@@ -1,6 +1,6 @@
1config IMX_HAVE_PLATFORM_FEC 1config IMX_HAVE_PLATFORM_FEC
2 bool 2 bool
3 default y if ARCH_MX25 || SOC_IMX27 || SOC_IMX35 || SOC_IMX50 || SOC_IMX51 || SOC_IMX53 3 default y if ARCH_MX25 || SOC_IMX27 || SOC_IMX35 || SOC_IMX51 || SOC_IMX53
4 4
5config IMX_HAVE_PLATFORM_FLEXCAN 5config IMX_HAVE_PLATFORM_FLEXCAN
6 bool 6 bool
diff --git a/arch/arm/mach-imx/devices/platform-fec.c b/arch/arm/mach-imx/devices/platform-fec.c
index 2cb188ad9a0a..63eba08f87b1 100644
--- a/arch/arm/mach-imx/devices/platform-fec.c
+++ b/arch/arm/mach-imx/devices/platform-fec.c
@@ -35,12 +35,6 @@ const struct imx_fec_data imx35_fec_data __initconst =
35 imx_fec_data_entry_single(MX35, "imx27-fec"); 35 imx_fec_data_entry_single(MX35, "imx27-fec");
36#endif 36#endif
37 37
38#ifdef CONFIG_SOC_IMX50
39/* i.mx50 has the i.mx25 type fec */
40const struct imx_fec_data imx50_fec_data __initconst =
41 imx_fec_data_entry_single(MX50, "imx25-fec");
42#endif
43
44#ifdef CONFIG_SOC_IMX51 38#ifdef CONFIG_SOC_IMX51
45/* i.mx51 has the i.mx27 type fec */ 39/* i.mx51 has the i.mx27 type fec */
46const struct imx_fec_data imx51_fec_data __initconst = 40const struct imx_fec_data imx51_fec_data __initconst =
diff --git a/arch/arm/mach-imx/devices/platform-imx-i2c.c b/arch/arm/mach-imx/devices/platform-imx-i2c.c
index 8e30e5703cd2..57d342e85c2f 100644
--- a/arch/arm/mach-imx/devices/platform-imx-i2c.c
+++ b/arch/arm/mach-imx/devices/platform-imx-i2c.c
@@ -70,16 +70,6 @@ const struct imx_imx_i2c_data imx35_imx_i2c_data[] __initconst = {
70}; 70};
71#endif /* ifdef CONFIG_SOC_IMX35 */ 71#endif /* ifdef CONFIG_SOC_IMX35 */
72 72
73#ifdef CONFIG_SOC_IMX50
74const struct imx_imx_i2c_data imx50_imx_i2c_data[] __initconst = {
75#define imx50_imx_i2c_data_entry(_id, _hwid) \
76 imx_imx_i2c_data_entry(MX50, "imx21-i2c", _id, _hwid, SZ_4K)
77 imx50_imx_i2c_data_entry(0, 1),
78 imx50_imx_i2c_data_entry(1, 2),
79 imx50_imx_i2c_data_entry(2, 3),
80};
81#endif /* ifdef CONFIG_SOC_IMX51 */
82
83#ifdef CONFIG_SOC_IMX51 73#ifdef CONFIG_SOC_IMX51
84const struct imx_imx_i2c_data imx51_imx_i2c_data[] __initconst = { 74const struct imx_imx_i2c_data imx51_imx_i2c_data[] __initconst = {
85#define imx51_imx_i2c_data_entry(_id, _hwid) \ 75#define imx51_imx_i2c_data_entry(_id, _hwid) \
diff --git a/arch/arm/mach-imx/devices/platform-imx-uart.c b/arch/arm/mach-imx/devices/platform-imx-uart.c
index 67bf866a2cb6..faac4aa6ca6d 100644
--- a/arch/arm/mach-imx/devices/platform-imx-uart.c
+++ b/arch/arm/mach-imx/devices/platform-imx-uart.c
@@ -94,18 +94,6 @@ const struct imx_imx_uart_1irq_data imx35_imx_uart_data[] __initconst = {
94}; 94};
95#endif /* ifdef CONFIG_SOC_IMX35 */ 95#endif /* ifdef CONFIG_SOC_IMX35 */
96 96
97#ifdef CONFIG_SOC_IMX50
98const struct imx_imx_uart_1irq_data imx50_imx_uart_data[] __initconst = {
99#define imx50_imx_uart_data_entry(_id, _hwid) \
100 imx_imx_uart_1irq_data_entry(MX50, _id, _hwid, SZ_4K)
101 imx50_imx_uart_data_entry(0, 1),
102 imx50_imx_uart_data_entry(1, 2),
103 imx50_imx_uart_data_entry(2, 3),
104 imx50_imx_uart_data_entry(3, 4),
105 imx50_imx_uart_data_entry(4, 5),
106};
107#endif /* ifdef CONFIG_SOC_IMX50 */
108
109#ifdef CONFIG_SOC_IMX51 97#ifdef CONFIG_SOC_IMX51
110const struct imx_imx_uart_1irq_data imx51_imx_uart_data[] __initconst = { 98const struct imx_imx_uart_1irq_data imx51_imx_uart_data[] __initconst = {
111#define imx51_imx_uart_data_entry(_id, _hwid) \ 99#define imx51_imx_uart_data_entry(_id, _hwid) \
diff --git a/arch/arm/mach-imx/epit.c b/arch/arm/mach-imx/epit.c
index 04a5961beeac..e02de188ae83 100644
--- a/arch/arm/mach-imx/epit.c
+++ b/arch/arm/mach-imx/epit.c
@@ -178,7 +178,6 @@ static struct irqaction epit_timer_irq = {
178static struct clock_event_device clockevent_epit = { 178static struct clock_event_device clockevent_epit = {
179 .name = "epit", 179 .name = "epit",
180 .features = CLOCK_EVT_FEAT_ONESHOT, 180 .features = CLOCK_EVT_FEAT_ONESHOT,
181 .shift = 32,
182 .set_mode = epit_set_mode, 181 .set_mode = epit_set_mode,
183 .set_next_event = epit_set_next_event, 182 .set_next_event = epit_set_next_event,
184 .rating = 200, 183 .rating = 200,
@@ -186,18 +185,10 @@ static struct clock_event_device clockevent_epit = {
186 185
187static int __init epit_clockevent_init(struct clk *timer_clk) 186static int __init epit_clockevent_init(struct clk *timer_clk)
188{ 187{
189 unsigned int c = clk_get_rate(timer_clk);
190
191 clockevent_epit.mult = div_sc(c, NSEC_PER_SEC,
192 clockevent_epit.shift);
193 clockevent_epit.max_delta_ns =
194 clockevent_delta2ns(0xfffffffe, &clockevent_epit);
195 clockevent_epit.min_delta_ns =
196 clockevent_delta2ns(0x800, &clockevent_epit);
197
198 clockevent_epit.cpumask = cpumask_of(0); 188 clockevent_epit.cpumask = cpumask_of(0);
199 189 clockevents_config_and_register(&clockevent_epit,
200 clockevents_register_device(&clockevent_epit); 190 clk_get_rate(timer_clk),
191 0x800, 0xfffffffe);
201 192
202 return 0; 193 return 0;
203} 194}
diff --git a/arch/arm/mach-imx/gpc.c b/arch/arm/mach-imx/gpc.c
index e1537f9e45b8..a96ccc7f5012 100644
--- a/arch/arm/mach-imx/gpc.c
+++ b/arch/arm/mach-imx/gpc.c
@@ -15,7 +15,7 @@
15#include <linux/of.h> 15#include <linux/of.h>
16#include <linux/of_address.h> 16#include <linux/of_address.h>
17#include <linux/of_irq.h> 17#include <linux/of_irq.h>
18#include <asm/hardware/gic.h> 18#include <linux/irqchip/arm-gic.h>
19 19
20#define GPC_IMR1 0x008 20#define GPC_IMR1 0x008
21#define GPC_PGC_CPU_PDN 0x2a0 21#define GPC_PGC_CPU_PDN 0x2a0
@@ -101,11 +101,16 @@ static void imx_gpc_irq_mask(struct irq_data *d)
101void __init imx_gpc_init(void) 101void __init imx_gpc_init(void)
102{ 102{
103 struct device_node *np; 103 struct device_node *np;
104 int i;
104 105
105 np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-gpc"); 106 np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-gpc");
106 gpc_base = of_iomap(np, 0); 107 gpc_base = of_iomap(np, 0);
107 WARN_ON(!gpc_base); 108 WARN_ON(!gpc_base);
108 109
110 /* Initially mask all interrupts */
111 for (i = 0; i < IMR_NUM; i++)
112 writel_relaxed(~0, gpc_base + GPC_IMR1 + i * 4);
113
109 /* Register GPC as the secondary interrupt controller behind GIC */ 114 /* Register GPC as the secondary interrupt controller behind GIC */
110 gic_arch_extn.irq_mask = imx_gpc_irq_mask; 115 gic_arch_extn.irq_mask = imx_gpc_irq_mask;
111 gic_arch_extn.irq_unmask = imx_gpc_irq_unmask; 116 gic_arch_extn.irq_unmask = imx_gpc_irq_unmask;
diff --git a/arch/arm/mach-imx/hardware.h b/arch/arm/mach-imx/hardware.h
index 3ce7fa3bd43f..911e9b31b03f 100644
--- a/arch/arm/mach-imx/hardware.h
+++ b/arch/arm/mach-imx/hardware.h
@@ -72,11 +72,6 @@
72 * AVIC 0x68000000+0x100000 -> 0xf5800000+0x100000 72 * AVIC 0x68000000+0x100000 -> 0xf5800000+0x100000
73 * X_MEMC 0xb8000000+0x010000 -> 0xf5c00000+0x010000 73 * X_MEMC 0xb8000000+0x010000 -> 0xf5c00000+0x010000
74 * SPBA0 0x50000000+0x100000 -> 0xf5400000+0x100000 74 * SPBA0 0x50000000+0x100000 -> 0xf5400000+0x100000
75 * mx50:
76 * TZIC 0x0fffc000+0x004000 -> 0xf4bfc000+0x004000
77 * AIPS1 0x53f00000+0x100000 -> 0xf5700000+0x100000
78 * SPBA0 0x50000000+0x100000 -> 0xf5400000+0x100000
79 * AIPS2 0x63f00000+0x100000 -> 0xf5300000+0x100000
80 * mx51: 75 * mx51:
81 * TZIC 0x0fffc000+0x004000 -> 0xf4bfc000+0x004000 76 * TZIC 0x0fffc000+0x004000 -> 0xf4bfc000+0x004000
82 * IRAM 0x1ffe0000+0x020000 -> 0xf4fe0000+0x020000 77 * IRAM 0x1ffe0000+0x020000 -> 0xf4fe0000+0x020000
@@ -108,7 +103,6 @@
108#include "mxc.h" 103#include "mxc.h"
109 104
110#include "mx6q.h" 105#include "mx6q.h"
111#include "mx50.h"
112#include "mx51.h" 106#include "mx51.h"
113#include "mx53.h" 107#include "mx53.h"
114#include "mx3x.h" 108#include "mx3x.h"
diff --git a/arch/arm/mach-imx/headsmp.S b/arch/arm/mach-imx/headsmp.S
index 7e49deb128a4..921fc1555854 100644
--- a/arch/arm/mach-imx/headsmp.S
+++ b/arch/arm/mach-imx/headsmp.S
@@ -17,53 +17,6 @@
17 17
18 .section ".text.head", "ax" 18 .section ".text.head", "ax"
19 19
20/*
21 * The secondary kernel init calls v7_flush_dcache_all before it enables
22 * the L1; however, the L1 comes out of reset in an undefined state, so
23 * the clean + invalidate performed by v7_flush_dcache_all causes a bunch
24 * of cache lines with uninitialized data and uninitialized tags to get
25 * written out to memory, which does really unpleasant things to the main
26 * processor. We fix this by performing an invalidate, rather than a
27 * clean + invalidate, before jumping into the kernel.
28 *
29 * This funciton is cloned from arch/arm/mach-tegra/headsmp.S, and needs
30 * to be called for both secondary cores startup and primary core resume
31 * procedures. Ideally, it should be moved into arch/arm/mm/cache-v7.S.
32 */
33ENTRY(v7_invalidate_l1)
34 mov r0, #0
35 mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache
36 mcr p15, 2, r0, c0, c0, 0
37 mrc p15, 1, r0, c0, c0, 0
38
39 ldr r1, =0x7fff
40 and r2, r1, r0, lsr #13
41
42 ldr r1, =0x3ff
43
44 and r3, r1, r0, lsr #3 @ NumWays - 1
45 add r2, r2, #1 @ NumSets
46
47 and r0, r0, #0x7
48 add r0, r0, #4 @ SetShift
49
50 clz r1, r3 @ WayShift
51 add r4, r3, #1 @ NumWays
521: sub r2, r2, #1 @ NumSets--
53 mov r3, r4 @ Temp = NumWays
542: subs r3, r3, #1 @ Temp--
55 mov r5, r3, lsl r1
56 mov r6, r2, lsl r0
57 orr r5, r5, r6 @ Reg = (Temp<<WayShift)|(NumSets<<SetShift)
58 mcr p15, 0, r5, c7, c6, 2
59 bgt 2b
60 cmp r2, #0
61 bgt 1b
62 dsb
63 isb
64 mov pc, lr
65ENDPROC(v7_invalidate_l1)
66
67#ifdef CONFIG_SMP 20#ifdef CONFIG_SMP
68ENTRY(v7_secondary_startup) 21ENTRY(v7_secondary_startup)
69 bl v7_invalidate_l1 22 bl v7_invalidate_l1
diff --git a/arch/arm/mach-imx/imx25-dt.c b/arch/arm/mach-imx/imx25-dt.c
index e17dfbc42192..03b65e5ea541 100644
--- a/arch/arm/mach-imx/imx25-dt.c
+++ b/arch/arm/mach-imx/imx25-dt.c
@@ -22,15 +22,6 @@ static void __init imx25_dt_init(void)
22 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 22 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
23} 23}
24 24
25static void __init imx25_timer_init(void)
26{
27 mx25_clocks_init_dt();
28}
29
30static struct sys_timer imx25_timer = {
31 .init = imx25_timer_init,
32};
33
34static const char * const imx25_dt_board_compat[] __initconst = { 25static const char * const imx25_dt_board_compat[] __initconst = {
35 "fsl,imx25", 26 "fsl,imx25",
36 NULL 27 NULL
@@ -41,7 +32,7 @@ DT_MACHINE_START(IMX25_DT, "Freescale i.MX25 (Device Tree Support)")
41 .init_early = imx25_init_early, 32 .init_early = imx25_init_early,
42 .init_irq = mx25_init_irq, 33 .init_irq = mx25_init_irq,
43 .handle_irq = imx25_handle_irq, 34 .handle_irq = imx25_handle_irq,
44 .timer = &imx25_timer, 35 .init_time = imx25_timer_init,
45 .init_machine = imx25_dt_init, 36 .init_machine = imx25_dt_init,
46 .dt_compat = imx25_dt_board_compat, 37 .dt_compat = imx25_dt_board_compat,
47 .restart = mxc_restart, 38 .restart = mxc_restart,
diff --git a/arch/arm/mach-imx/imx27-dt.c b/arch/arm/mach-imx/imx27-dt.c
index ebfae96543c4..c915a490a11c 100644
--- a/arch/arm/mach-imx/imx27-dt.c
+++ b/arch/arm/mach-imx/imx27-dt.c
@@ -39,26 +39,22 @@ static void __init imx27_dt_init(void)
39 imx27_auxdata_lookup, NULL); 39 imx27_auxdata_lookup, NULL);
40} 40}
41 41
42static void __init imx27_timer_init(void)
43{
44 mx27_clocks_init_dt();
45}
46
47static struct sys_timer imx27_timer = {
48 .init = imx27_timer_init,
49};
50
51static const char * const imx27_dt_board_compat[] __initconst = { 42static const char * const imx27_dt_board_compat[] __initconst = {
52 "fsl,imx27", 43 "fsl,imx27",
53 NULL 44 NULL
54}; 45};
55 46
47static void __init imx27_timer_init(void)
48{
49 mx27_clocks_init_dt();
50}
51
56DT_MACHINE_START(IMX27_DT, "Freescale i.MX27 (Device Tree Support)") 52DT_MACHINE_START(IMX27_DT, "Freescale i.MX27 (Device Tree Support)")
57 .map_io = mx27_map_io, 53 .map_io = mx27_map_io,
58 .init_early = imx27_init_early, 54 .init_early = imx27_init_early,
59 .init_irq = mx27_init_irq, 55 .init_irq = mx27_init_irq,
60 .handle_irq = imx27_handle_irq, 56 .handle_irq = imx27_handle_irq,
61 .timer = &imx27_timer, 57 .init_time = imx27_timer_init,
62 .init_machine = imx27_dt_init, 58 .init_machine = imx27_dt_init,
63 .dt_compat = imx27_dt_board_compat, 59 .dt_compat = imx27_dt_board_compat,
64 .restart = mxc_restart, 60 .restart = mxc_restart,
diff --git a/arch/arm/mach-imx/imx31-dt.c b/arch/arm/mach-imx/imx31-dt.c
index af476de2570e..67de611e29ab 100644
--- a/arch/arm/mach-imx/imx31-dt.c
+++ b/arch/arm/mach-imx/imx31-dt.c
@@ -18,46 +18,27 @@
18#include "common.h" 18#include "common.h"
19#include "mx31.h" 19#include "mx31.h"
20 20
21static const struct of_dev_auxdata imx31_auxdata_lookup[] __initconst = {
22 OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART1_BASE_ADDR,
23 "imx21-uart.0", NULL),
24 OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART2_BASE_ADDR,
25 "imx21-uart.1", NULL),
26 OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART3_BASE_ADDR,
27 "imx21-uart.2", NULL),
28 OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART4_BASE_ADDR,
29 "imx21-uart.3", NULL),
30 OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART5_BASE_ADDR,
31 "imx21-uart.4", NULL),
32 { /* sentinel */ }
33};
34
35static void __init imx31_dt_init(void) 21static void __init imx31_dt_init(void)
36{ 22{
37 of_platform_populate(NULL, of_default_bus_match_table, 23 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
38 imx31_auxdata_lookup, NULL);
39}
40
41static void __init imx31_timer_init(void)
42{
43 mx31_clocks_init_dt();
44} 24}
45 25
46static struct sys_timer imx31_timer = {
47 .init = imx31_timer_init,
48};
49
50static const char *imx31_dt_board_compat[] __initdata = { 26static const char *imx31_dt_board_compat[] __initdata = {
51 "fsl,imx31", 27 "fsl,imx31",
52 NULL 28 NULL
53}; 29};
54 30
31static void __init imx31_dt_timer_init(void)
32{
33 mx31_clocks_init_dt();
34}
35
55DT_MACHINE_START(IMX31_DT, "Freescale i.MX31 (Device Tree Support)") 36DT_MACHINE_START(IMX31_DT, "Freescale i.MX31 (Device Tree Support)")
56 .map_io = mx31_map_io, 37 .map_io = mx31_map_io,
57 .init_early = imx31_init_early, 38 .init_early = imx31_init_early,
58 .init_irq = mx31_init_irq, 39 .init_irq = mx31_init_irq,
59 .handle_irq = imx31_handle_irq, 40 .handle_irq = imx31_handle_irq,
60 .timer = &imx31_timer, 41 .init_time = imx31_dt_timer_init,
61 .init_machine = imx31_dt_init, 42 .init_machine = imx31_dt_init,
62 .dt_compat = imx31_dt_board_compat, 43 .dt_compat = imx31_dt_board_compat,
63 .restart = mxc_restart, 44 .restart = mxc_restart,
diff --git a/arch/arm/mach-imx/imx51-dt.c b/arch/arm/mach-imx/imx51-dt.c
index 5ffa40c673f8..e2926a8863f8 100644
--- a/arch/arm/mach-imx/imx51-dt.c
+++ b/arch/arm/mach-imx/imx51-dt.c
@@ -24,26 +24,22 @@ static void __init imx51_dt_init(void)
24 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 24 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
25} 25}
26 26
27static void __init imx51_timer_init(void)
28{
29 mx51_clocks_init_dt();
30}
31
32static struct sys_timer imx51_timer = {
33 .init = imx51_timer_init,
34};
35
36static const char *imx51_dt_board_compat[] __initdata = { 27static const char *imx51_dt_board_compat[] __initdata = {
37 "fsl,imx51", 28 "fsl,imx51",
38 NULL 29 NULL
39}; 30};
40 31
32static void __init imx51_timer_init(void)
33{
34 mx51_clocks_init_dt();
35}
36
41DT_MACHINE_START(IMX51_DT, "Freescale i.MX51 (Device Tree Support)") 37DT_MACHINE_START(IMX51_DT, "Freescale i.MX51 (Device Tree Support)")
42 .map_io = mx51_map_io, 38 .map_io = mx51_map_io,
43 .init_early = imx51_init_early, 39 .init_early = imx51_init_early,
44 .init_irq = mx51_init_irq, 40 .init_irq = mx51_init_irq,
45 .handle_irq = imx51_handle_irq, 41 .handle_irq = imx51_handle_irq,
46 .timer = &imx51_timer, 42 .init_time = imx51_timer_init,
47 .init_machine = imx51_dt_init, 43 .init_machine = imx51_dt_init,
48 .init_late = imx51_init_late, 44 .init_late = imx51_init_late,
49 .dt_compat = imx51_dt_board_compat, 45 .dt_compat = imx51_dt_board_compat,
diff --git a/arch/arm/mach-imx/iomux-mx50.h b/arch/arm/mach-imx/iomux-mx50.h
deleted file mode 100644
index 00f56e0e8009..000000000000
--- a/arch/arm/mach-imx/iomux-mx50.h
+++ /dev/null
@@ -1,977 +0,0 @@
1/*
2 * Copyright (C) 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 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19#ifndef __MACH_IOMUX_MX50_H__
20#define __MACH_IOMUX_MX50_H__
21
22#include "iomux-v3.h"
23
24#define MX50_ELCDIF_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_DSE_HIGH)
25
26#define MX50_SD_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PKE | PAD_CTL_PUE | \
27 PAD_CTL_PUS_47K_UP | PAD_CTL_DSE_HIGH)
28
29#define MX50_UART_PAD_CTRL (PAD_CTL_DSE_HIGH | PAD_CTL_PKE)
30
31#define MX50_I2C_PAD_CTRL (PAD_CTL_ODE | PAD_CTL_DSE_HIGH | \
32 PAD_CTL_PUS_100K_UP | PAD_CTL_HYS)
33
34#define MX50_USB_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \
35 PAD_CTL_DSE_HIGH | PAD_CTL_PUS_47K_UP)
36
37#define MX50_FEC_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PKE | PAD_CTL_PUE | \
38 PAD_CTL_PUS_22K_UP | PAD_CTL_ODE | \
39 PAD_CTL_DSE_HIGH)
40
41#define MX50_OWIRE_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PKE | PAD_CTL_PUE | \
42 PAD_CTL_PUS_100K_UP | PAD_CTL_ODE | \
43 PAD_CTL_DSE_HIGH | PAD_CTL_SRE_FAST)
44
45#define MX50_KEYPAD_CTRL (PAD_CTL_HYS | PAD_CTL_PKE | PAD_CTL_PUE | \
46 PAD_CTL_PUS_100K_UP | PAD_CTL_DSE_HIGH)
47
48#define MX50_CSPI_SS_PAD (PAD_CTL_PKE | PAD_CTL_PUE | \
49 PAD_CTL_PUS_22K_UP | PAD_CTL_DSE_HIGH)
50
51#define MX50_PAD_KEY_COL0__KEY_COL0 IOMUX_PAD(0x2CC, 0x20, 0, 0x0, 0, NO_PAD_CTRL)
52#define MX50_PAD_KEY_COL0__GPIO_4_0 IOMUX_PAD(0x2CC, 0x20, 1, 0x0, 0, NO_PAD_CTRL)
53#define MX50_PAD_KEY_COL0__NANDF_CLE IOMUX_PAD(0x2CC, 0x20, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
54
55#define MX50_PAD_KEY_ROW0__KEY_ROW0 IOMUX_PAD(0x2D0, 0x24, 0, 0x0, 0, MX50_KEYPAD_CTRL)
56#define MX50_PAD_KEY_ROW0__GPIO_4_1 IOMUX_PAD(0x2D0, 0x24, 1, 0x0, 0, NO_PAD_CTRL)
57#define MX50_PAD_KEY_ROW0__NANDF_ALE IOMUX_PAD(0x2D0, 0x24, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
58
59#define MX50_PAD_KEY_COL1__KEY_COL1 IOMUX_PAD(0x2D4, 0x28, 0, 0x0, 0, NO_PAD_CTRL)
60#define MX50_PAD_KEY_COL1__GPIO_4_2 IOMUX_PAD(0x2D4, 0x28, 1, 0x0, 0, NO_PAD_CTRL)
61#define MX50_PAD_KEY_COL1__NANDF_CE0 IOMUX_PAD(0x2D4, 0x28, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
62
63#define MX50_PAD_KEY_ROW1__KEY_ROW1 IOMUX_PAD(0x2D8, 0x2C, 0, 0x0, 0, MX50_KEYPAD_CTRL)
64#define MX50_PAD_KEY_ROW1__GPIO_4_3 IOMUX_PAD(0x2D8, 0x2C, 1, 0x0, 0, NO_PAD_CTRL)
65#define MX50_PAD_KEY_ROW1__NANDF_CE1 IOMUX_PAD(0x2D8, 0x2C, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
66
67#define MX50_PAD_KEY_COL2__KEY_COL2 IOMUX_PAD(0x2DC, 0x30, 0, 0x0, 0, MX50_KEYPAD_CTRL)
68#define MX50_PAD_KEY_COL2__GPIO_4_4 IOMUX_PAD(0x2DC, 0x30, 1, 0x0, 0, NO_PAD_CTRL)
69#define MX50_PAD_KEY_COL2__NANDF_CE2 IOMUX_PAD(0x2DC, 0x30, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
70
71#define MX50_PAD_KEY_ROW2__KEY_ROW2 IOMUX_PAD(0x2E0, 0x34, 0, 0x0, 0, MX50_KEYPAD_CTRL)
72#define MX50_PAD_KEY_ROW2__GPIO_4_5 IOMUX_PAD(0x2E0, 0x34, 1, 0x0, 0, NO_PAD_CTRL)
73#define MX50_PAD_KEY_ROW2__NANDF_CE3 IOMUX_PAD(0x2E0, 0x34, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
74
75#define MX50_PAD_KEY_COL3__KEY_COL3 IOMUX_PAD(0x2E4, 0x38, 0, 0x0, 0, NO_PAD_CTRL)
76#define MX50_PAD_KEY_COL3__GPIO_4_6 IOMUX_PAD(0x2E4, 0x38, 1, 0x0, 0, NO_PAD_CTRL)
77#define MX50_PAD_KEY_COL3__NANDF_READY IOMUX_PAD(0x2E4, 0x38, 2, 0x7b4, 0, PAD_CTL_PKE | \
78 PAD_CTL_PUE | PAD_CTL_PUS_100K_UP)
79#define MX50_PAD_KEY_COL3__SDMA_EXT0 IOMUX_PAD(0x2E4, 0x38, 6, 0x7b8, 0, NO_PAD_CTRL)
80
81#define MX50_PAD_KEY_ROW3__KEY_ROW3 IOMUX_PAD(0x2E8, 0x3C, 0, 0x0, 0, MX50_KEYPAD_CTRL)
82#define MX50_PAD_KEY_ROW3__GPIO_4_7 IOMUX_PAD(0x2E8, 0x3C, 1, 0x0, 0, NO_PAD_CTRL)
83#define MX50_PAD_KEY_ROW3__NANDF_DQS IOMUX_PAD(0x2E8, 0x3C, 2, 0x7b0, 0, PAD_CTL_DSE_HIGH)
84#define MX50_PAD_KEY_ROW3__SDMA_EXT1 IOMUX_PAD(0x2E8, 0x3C, 6, 0x7bc, 0, NO_PAD_CTRL)
85
86#define MX50_PAD_I2C1_SCL__I2C1_SCL IOMUX_PAD(0x2EC, 0x40, IOMUX_CONFIG_SION, 0x0, 0, \
87 MX50_I2C_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, 0x0, 0, MX50_UART_PAD_CTRL)
90
91#define MX50_PAD_I2C1_SDA__I2C1_SDA IOMUX_PAD(0x2F0, 0x44, IOMUX_CONFIG_SION, 0x0, 0, \
92 MX50_I2C_PAD_CTRL)
93#define MX50_PAD_I2C1_SDA__GPIO_6_19 IOMUX_PAD(0x2F0, 0x44, 1, 0x0, 0, NO_PAD_CTRL)
94#define MX50_PAD_I2C1_SDA__UART2_RXD IOMUX_PAD(0x2F0, 0x44, 2, 0x7cc, 1, MX50_UART_PAD_CTRL)
95
96#define MX50_PAD_I2C2_SCL__I2C2_SCL IOMUX_PAD(0x2F4, 0x48, IOMUX_CONFIG_SION, 0x0, 0, \
97 MX50_I2C_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, 0x0, 0, MX50_UART_PAD_CTRL)
100#define MX50_PAD_I2C2_SCL__DCDC_OK IOMUX_PAD(0x2F4, 0x48, 7, 0x0, 0, NO_PAD_CTRL)
101
102#define MX50_PAD_I2C2_SDA__I2C2_SDA IOMUX_PAD(0x2F8, 0x4C, IOMUX_CONFIG_SION, 0x0, 0, \
103 MX50_I2C_PAD_CTRL)
104#define MX50_PAD_I2C2_SDA__GPIO_6_21 IOMUX_PAD(0x2F8, 0x4C, 1, 0x0, 0, NO_PAD_CTRL)
105#define MX50_PAD_I2C2_SDA__UART2_RTS IOMUX_PAD(0x2F8, 0x4C, 2, 0x7c8, 1, MX50_UART_PAD_CTRL)
106#define MX50_PAD_I2C2_SDA__PWRSTABLE IOMUX_PAD(0x2F8, 0x4C, 7, 0x0, 0, NO_PAD_CTRL)
107
108#define MX50_PAD_I2C3_SCL__I2C3_SCL IOMUX_PAD(0x2FC, 0x50, IOMUX_CONFIG_SION, 0x0, 0, \
109 MX50_I2C_PAD_CTRL)
110#define MX50_PAD_I2C3_SCL__GPIO_6_22 IOMUX_PAD(0x2FC, 0x50, 1, 0x0, 0, NO_PAD_CTRL)
111#define MX50_PAD_I2C3_SCL__FEC_MDC IOMUX_PAD(0x2FC, 0x50, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
112#define MX50_PAD_I2C3_SCL__PMIC_RDY IOMUX_PAD(0x2FC, 0x50, 3, 0x0, 0, NO_PAD_CTRL)
113#define MX50_PAD_I2C3_SCL__GPT_CAPIN1 IOMUX_PAD(0x2FC, 0x50, 5, 0x0, 0, NO_PAD_CTRL)
114#define MX50_PAD_I2C3_SCL__USBOTG_OC IOMUX_PAD(0x2FC, 0x50, 7, 0x7E8, 0, MX50_USB_PAD_CTRL)
115
116#define MX50_PAD_I2C3_SDA__I2C3_SDA IOMUX_PAD(0x300, 0x54, IOMUX_CONFIG_SION, 0x0, 0, \
117 MX50_I2C_PAD_CTRL)
118#define MX50_PAD_I2C3_SDA__GPIO_6_23 IOMUX_PAD(0x300, 0x54, 1, 0x0, 0, NO_PAD_CTRL)
119#define MX50_PAD_I2C3_SDA__FEC_MDIO IOMUX_PAD(0x300, 0x54, 2, 0x774, 0, MX50_FEC_PAD_CTRL)
120#define MX50_PAD_I2C3_SDA__PWRFAIL_INT IOMUX_PAD(0x300, 0x54, 3, 0x0, 0, NO_PAD_CTRL)
121#define MX50_PAD_I2C3_SDA__ALARM_DEB IOMUX_PAD(0x300, 0x54, 4, 0x0, 0, NO_PAD_CTRL)
122#define MX50_PAD_I2C3_SDA__GPT_CAPIN1 IOMUX_PAD(0x300, 0x54, 5, 0x0, 0, NO_PAD_CTRL)
123#define MX50_PAD_I2C3_SDA__USBOTG_PWR IOMUX_PAD(0x300, 0x54, 7, 0x0, 0, \
124 PAD_CTL_PKE | PAD_CTL_DSE_HIGH)
125
126#define MX50_PAD_PWM1__PWM1_PWMO IOMUX_PAD(0x304, 0x58, 0, 0x0, 0, NO_PAD_CTRL)
127#define MX50_PAD_PWM1__GPIO_6_24 IOMUX_PAD(0x304, 0x58, 1, 0x0, 0, NO_PAD_CTRL)
128#define MX50_PAD_PWM1__USBOTG_OC IOMUX_PAD(0x304, 0x58, 2, 0x7E8, 1, MX50_USB_PAD_CTRL)
129#define MX50_PAD_PWM1__GPT_CMPOUT1 IOMUX_PAD(0x304, 0x58, 5, 0x0, 0, NO_PAD_CTRL)
130
131#define MX50_PAD_PWM2__PWM2_PWMO IOMUX_PAD(0x308, 0x5C, 0, 0x0, 0, NO_PAD_CTRL)
132#define MX50_PAD_PWM2__GPIO_6_25 IOMUX_PAD(0x308, 0x5C, 1, 0x0, 0, NO_PAD_CTRL)
133#define MX50_PAD_PWM2__USBOTG_PWR IOMUX_PAD(0x308, 0x5C, 2, 0x0, 0, \
134 PAD_CTL_PKE | PAD_CTL_DSE_HIGH)
135#define MX50_PAD_PWM2__DCDC_PWM IOMUX_PAD(0x308, 0x5C, 4, 0x0, 0, NO_PAD_CTRL)
136#define MX50_PAD_PWM2__GPT_CMPOUT2 IOMUX_PAD(0x308, 0x5C, 5, 0x0, 0, NO_PAD_CTRL)
137#define MX50_PAD_PWM2__ANY_PU_RST IOMUX_PAD(0x308, 0x5C, 7, 0x0, 0, NO_PAD_CTRL)
138
139#define MX50_PAD_OWIRE__OWIRE IOMUX_PAD(0x30C, 0x60, 0, 0x0, 0, MX50_OWIRE_PAD_CTRL)
140#define MX50_PAD_OWIRE__GPIO_6_26 IOMUX_PAD(0x30C, 0x60, 1, 0x0, 0, NO_PAD_CTRL)
141#define MX50_PAD_OWIRE__USBH1_OC IOMUX_PAD(0x30C, 0x60, 2, 0x0, 0, MX50_USB_PAD_CTRL)
142#define MX50_PAD_OWIRE__SSI_EXT1_CLK IOMUX_PAD(0x30C, 0x60, 3, 0x0, 0, NO_PAD_CTRL)
143#define MX50_PAD_OWIRE__EPDC_PWRIRQ IOMUX_PAD(0x30C, 0x60, 4, 0x0, 0, NO_PAD_CTRL)
144#define MX50_PAD_OWIRE__GPT_CMPOUT3 IOMUX_PAD(0x30C, 0x60, 5, 0x0, 0, NO_PAD_CTRL)
145
146#define MX50_PAD_EPITO__EPITO IOMUX_PAD(0x310, 0x64, 0, 0x0, 0, NO_PAD_CTRL)
147#define MX50_PAD_EPITO__GPIO_6_27 IOMUX_PAD(0x310, 0x64, 1, 0x0, 0, NO_PAD_CTRL)
148#define MX50_PAD_EPITO__USBH1_PWR IOMUX_PAD(0x310, 0x64, 2, 0x0, 0, \
149 PAD_CTL_PKE | PAD_CTL_DSE_HIGH)
150#define MX50_PAD_EPITO__SSI_EXT2_CLK IOMUX_PAD(0x310, 0x64, 3, 0x0, 0, NO_PAD_CTRL)
151#define MX50_PAD_EPITO__TOG_EN IOMUX_PAD(0x310, 0x64, 4, 0x0, 0, NO_PAD_CTRL)
152#define MX50_PAD_EPITO__GPT_CLKIN IOMUX_PAD(0x310, 0x64, 5, 0x0, 0, NO_PAD_CTRL)
153
154#define MX50_PAD_WDOG__WDOG IOMUX_PAD(0x314, 0x68, 0, 0x0, 0, NO_PAD_CTRL)
155#define MX50_PAD_WDOG__GPIO_6_28 IOMUX_PAD(0x314, 0x68, 1, 0x0, 0, NO_PAD_CTRL)
156#define MX50_PAD_WDOG__WDOG_RST IOMUX_PAD(0x314, 0x68, 2, 0x0, 0, NO_PAD_CTRL)
157#define MX50_PAD_WDOG__XTAL32K IOMUX_PAD(0x314, 0x68, 6, 0x0, 0, NO_PAD_CTRL)
158
159#define MX50_PAD_SSI_TXFS__SSI_TXFS IOMUX_PAD(0x318, 0x6C, 0, 0x0, 0, NO_PAD_CTRL)
160#define MX50_PAD_SSI_TXFS__GPIO_6_0 IOMUX_PAD(0x318, 0x6C, 1, 0x0, 0, NO_PAD_CTRL)
161
162#define MX50_PAD_SSI_TXC__SSI_TXC IOMUX_PAD(0x31C, 0x70, 0, 0x0, 0, NO_PAD_CTRL)
163#define MX50_PAD_SSI_TXC__GPIO_6_1 IOMUX_PAD(0x31C, 0x70, 1, 0x0, 0, NO_PAD_CTRL)
164
165#define MX50_PAD_SSI_TXD__SSI_TXD IOMUX_PAD(0x320, 0x74, 0, 0x0, 0, NO_PAD_CTRL)
166#define MX50_PAD_SSI_TXD__GPIO_6_2 IOMUX_PAD(0x320, 0x74, 1, 0x0, 0, NO_PAD_CTRL)
167#define MX50_PAD_SSI_TXD__CSPI_RDY IOMUX_PAD(0x320, 0x74, 4, 0x6e8, 0, NO_PAD_CTRL)
168
169#define MX50_PAD_SSI_RXD__SSI_RXD IOMUX_PAD(0x324, 0x78, 0, 0x0, 0, NO_PAD_CTRL)
170#define MX50_PAD_SSI_RXD__GPIO_6_3 IOMUX_PAD(0x324, 0x78, 1, 0x0, 0, NO_PAD_CTRL)
171#define MX50_PAD_SSI_RXD__CSPI_SS3 IOMUX_PAD(0x324, 0x78, 4, 0x6f4, 0, MX50_CSPI_SS_PAD)
172
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)
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)
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)
179#define MX50_PAD_SSI_RXFS__FEC_MDC IOMUX_PAD(0x328, 0x7C, 6, 0x0, 0, PAD_CTL_DSE_HIGH)
180
181#define MX50_PAD_SSI_RXC__AUD3_RXC IOMUX_PAD(0x32C, 0x80, 0, 0x0, 0, NO_PAD_CTRL)
182#define MX50_PAD_SSI_RXC__GPIO_6_5 IOMUX_PAD(0x32C, 0x80, 1, 0x0, 0, NO_PAD_CTRL)
183#define MX50_PAD_SSI_RXC__UART5_RXD IOMUX_PAD(0x32C, 0x80, 2, 0x7e4, 1, MX50_UART_PAD_CTRL)
184#define MX50_PAD_SSI_RXC__WEIM_D7 IOMUX_PAD(0x32C, 0x80, 3, 0x808, 0, NO_PAD_CTRL)
185#define MX50_PAD_SSI_RXC__CSPI_SS1 IOMUX_PAD(0x32C, 0x80, 4, 0x6ec, 0, MX50_CSPI_SS_PAD)
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)
188
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)
191
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)
194
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)
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)
199#define MX50_PAD_UART1_CTS__SD4_CMD IOMUX_PAD(0x338, 0x8C, 5, 0x74c, 0, MX50_SD_PAD_CTRL)
200
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)
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, 0x764, 0, MX50_SD_PAD_CTRL)
205#define MX50_PAD_UART1_RTS__SD4_CLK IOMUX_PAD(0x33C, 0x90, 5, 0x748, 0, MX50_SD_PAD_CTRL)
206
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)
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)
211
212#define MX50_PAD_UART2_RXD__UART2_RXD IOMUX_PAD(0x344, 0x98, 0, 0x7cc, 3, MX50_UART_PAD_CTRL)
213#define MX50_PAD_UART2_RXD__GPIO_6_11 IOMUX_PAD(0x344, 0x98, 1, 0x0, 0, NO_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)
216
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)
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)
221
222#define MX50_PAD_UART2_RTS__UART2_RTS IOMUX_PAD(0x34C, 0xA0, 0, 0x7c8, 3, MX50_UART_PAD_CTRL)
223#define MX50_PAD_UART2_RTS__GPIO_6_13 IOMUX_PAD(0x34C, 0xA0, 1, 0x0, 0, NO_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)
226
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)
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)
231#define MX50_PAD_UART3_TXD__SD2_WP IOMUX_PAD(0x350, 0xA4, 5, 0x744, 0, MX50_SD_PAD_CTRL)
232#define MX50_PAD_UART3_TXD__WEIM_D12 IOMUX_PAD(0x350, 0xA4, 6, 0x81c, 0, NO_PAD_CTRL)
233
234#define MX50_PAD_UART3_RXD__UART3_RXD IOMUX_PAD(0x354, 0xA8, 0, 0x7d4, 1, MX50_UART_PAD_CTRL)
235#define MX50_PAD_UART3_RXD__GPIO_6_15 IOMUX_PAD(0x354, 0xA8, 1, 0x0, 0, NO_PAD_CTRL)
236#define MX50_PAD_UART3_RXD__SD1_D5 IOMUX_PAD(0x354, 0xA8, 3, 0x0, 0, MX50_SD_PAD_CTRL)
237#define MX50_PAD_UART3_RXD__SD4_D1 IOMUX_PAD(0x354, 0xA8, 4, 0x754, 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)
240
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)
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)
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)
247#define MX50_PAD_UART4_TXD__WEIM_D14 IOMUX_PAD(0x358, 0xAC, 6, 0x824, 0, NO_PAD_CTRL)
248
249#define MX50_PAD_UART4_RXD__UART4_RXD IOMUX_PAD(0x35C, 0xB0, 0, 0x7dc, 1, MX50_UART_PAD_CTRL)
250#define MX50_PAD_UART4_RXD__GPIO_6_17 IOMUX_PAD(0x35C, 0xB0, 1, 0x0, 0, NO_PAD_CTRL)
251#define MX50_PAD_UART4_RXD__UART3_RTS IOMUX_PAD(0x35C, 0xB0, 2, 0x7d0, 1, MX50_UART_PAD_CTRL)
252#define MX50_PAD_UART4_RXD__SD1_D7 IOMUX_PAD(0x35C, 0xB0, 3, 0x0, 0, MX50_SD_PAD_CTRL)
253#define MX50_PAD_UART4_RXD__SD4_D3 IOMUX_PAD(0x35C, 0xB0, 4, 0x75c, 0, MX50_SD_PAD_CTRL)
254#define MX50_PAD_UART4_RXD__SD1_LCTL IOMUX_PAD(0x35C, 0xB0, 5, 0x0, 0, MX50_SD_PAD_CTRL)
255#define MX50_PAD_UART4_RXD__WEIM_D15 IOMUX_PAD(0x35C, 0xB0, 6, 0x828, 0, NO_PAD_CTRL)
256
257#define MX50_PAD_CSPI_SCLK__CSPI_SCLK IOMUX_PAD(0x360, 0xB4, 0, 0x0, 0, NO_PAD_CTRL)
258#define MX50_PAD_CSPI_SCLK__GPIO_4_8 IOMUX_PAD(0x360, 0xB4, 1, 0x0, 0, NO_PAD_CTRL)
259
260#define MX50_PAD_CSPI_MOSI__CSPI_MOSI IOMUX_PAD(0x364, 0xB8, 0, 0x0, 0, NO_PAD_CTRL)
261#define MX50_PAD_CSPI_MOSI__GPIO_4_9 IOMUX_PAD(0x364, 0xB8, 1, 0x0, 0, NO_PAD_CTRL)
262
263#define MX50_PAD_CSPI_MISO__CSPI_MISO IOMUX_PAD(0x368, 0xBC, 0, 0x0, 0, NO_PAD_CTRL)
264#define MX50_PAD_CSPI_MISO__GPIO_4_10 IOMUX_PAD(0x368, 0xBC, 1, 0x0, 0, NO_PAD_CTRL)
265
266#define MX50_PAD_CSPI_SS0__CSPI_SS0 IOMUX_PAD(0x36C, 0xC0, 0, 0x0, 0, MX50_CSPI_SS_PAD)
267#define MX50_PAD_CSPI_SS0__GPIO_4_11 IOMUX_PAD(0x36C, 0xC0, 1, 0x0, 0, NO_PAD_CTRL)
268
269#define MX50_PAD_ECSPI1_SCLK__ECSPI1_SCLK IOMUX_PAD(0x370, 0xC4, 0, 0x0, 0, NO_PAD_CTRL)
270#define MX50_PAD_ECSPI1_SCLK__GPIO_4_12 IOMUX_PAD(0x370, 0xC4, 1, 0x0, 0, NO_PAD_CTRL)
271#define MX50_PAD_ECSPI1_SCLK__CSPI_RDY IOMUX_PAD(0x370, 0xC4, 2, 0x6e8, 1, NO_PAD_CTRL)
272#define MX50_PAD_ECSPI1_SCLK__ECSPI2_RDY IOMUX_PAD(0x370, 0xC4, 3, 0x0, 0, NO_PAD_CTRL)
273#define MX50_PAD_ECSPI1_SCLK__UART3_RTS IOMUX_PAD(0x370, 0xC4, 4, 0x7d0, 2, MX50_UART_PAD_CTRL)
274#define MX50_PAD_ECSPI1_SCLK__EPDC_SDCE6 IOMUX_PAD(0x370, 0xC4, 5, 0x0, 0, NO_PAD_CTRL)
275#define MX50_PAD_ECSPI1_SCLK__WEIM_D8 IOMUX_PAD(0x370, 0xC4, 7, 0x80c, 0, NO_PAD_CTRL)
276
277#define MX50_PAD_ECSPI1_MOSI__ECSPI1_MOSI IOMUX_PAD(0x374, 0xC8, 0, 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)
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, 0x0, 0, MX50_UART_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)
284
285#define MX50_PAD_ECSPI1_MISO__ECSPI1_MISO IOMUX_PAD(0x378, 0xCC, 0, 0x0, 0, NO_PAD_CTRL)
286#define MX50_PAD_ECSPI1_MISO__GPIO_4_14 IOMUX_PAD(0x378, 0xCC, 1, 0x0, 0, NO_PAD_CTRL)
287#define MX50_PAD_ECSPI1_MISO__CSPI_SS2 IOMUX_PAD(0x378, 0xCC, 2, 0x6f0, 1, MX50_CSPI_SS_PAD)
288#define MX50_PAD_ECSPI1_MISO__ECSPI2_SS2 IOMUX_PAD(0x378, 0xCC, 3, 0x0, 0, MX50_CSPI_SS_PAD)
289#define MX50_PAD_ECSPI1_MISO__UART4_RTS IOMUX_PAD(0x378, 0xCC, 4, 0x7d8, 0, MX50_UART_PAD_CTRL)
290#define MX50_PAD_ECSPI1_MISO__EPDC_SDCE8 IOMUX_PAD(0x378, 0xCC, 5, 0x0, 0, NO_PAD_CTRL)
291#define MX50_PAD_ECSPI1_MISO__WEIM_D10 IOMUX_PAD(0x378, 0xCC, 7, 0x814, 0, NO_PAD_CTRL)
292
293#define MX50_PAD_ECSPI1_SS0__ECSPI1_SS0 IOMUX_PAD(0x37C, 0xD0, 0, 0x0, 0, MX50_CSPI_SS_PAD)
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)
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, 0x0, 0, MX50_UART_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)
300
301#define MX50_PAD_ECSPI2_SCLK__ECSPI2_SCLK IOMUX_PAD(0x380, 0xD4, 0, 0x0, 0, NO_PAD_CTRL)
302#define MX50_PAD_ECSPI2_SCLK__GPIO_4_16 IOMUX_PAD(0x380, 0xD4, 1, 0x0, 0, NO_PAD_CTRL)
303#define MX50_PAD_ECSPI2_SCLK__ELCDIF_WR IOMUX_PAD(0x380, 0xD4, 2, 0x0, 0, NO_PAD_CTRL)
304#define MX50_PAD_ECSPI2_SCLK__ECSPI1_RDY IOMUX_PAD(0x380, 0xD4, 3, 0x0, 0, NO_PAD_CTRL)
305#define MX50_PAD_ECSPI2_SCLK__UART5_RTS IOMUX_PAD(0x380, 0xD4, 4, 0x7e0, 0, MX50_UART_PAD_CTRL)
306#define MX50_PAD_ECSPI2_SCLK__ELCDIF_DOTCLK IOMUX_PAD(0x380, 0xD4, 5, 0x0, 0, NO_PAD_CTRL)
307#define MX50_PAD_ECSPI2_SCLK__NANDF_CEN4 IOMUX_PAD(0x380, 0xD4, 6, 0x0, 0, NO_PAD_CTRL)
308#define MX50_PAD_ECSPI2_SCLK__WEIM_D8 IOMUX_PAD(0x380, 0xD4, 7, 0x80c, 1, NO_PAD_CTRL)
309
310#define MX50_PAD_ECSPI2_MOSI__ECSPI2_MOSI IOMUX_PAD(0x384, 0xD8, 0, 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)
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, 0x0, 0, MX50_UART_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)
317#define MX50_PAD_ECSPI2_MOSI__WEIM_D9 IOMUX_PAD(0x384, 0xD8, 7, 0x810, 1, NO_PAD_CTRL)
318
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)
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)
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, 0x73c, 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)
327
328#define MX50_PAD_ECSPI2_SS0__ECSPI2_SS0 IOMUX_PAD(0x38C, 0xE0, 0, 0x0, 0, MX50_CSPI_SS_PAD)
329#define MX50_PAD_ECSPI2_SS0__GPIO_4_19 IOMUX_PAD(0x38C, 0xE0, 1, 0x0, 0, NO_PAD_CTRL)
330#define MX50_PAD_ECSPI2_SS0__ELCDIF_CS IOMUX_PAD(0x38C, 0xE0, 2, 0x0, 0, NO_PAD_CTRL)
331#define MX50_PAD_ECSPI2_SS0__ECSPI1_SS3 IOMUX_PAD(0x38C, 0xE0, 3, 0x0, 0, MX50_CSPI_SS_PAD)
332#define MX50_PAD_ECSPI2_SS0__UART5_RXD IOMUX_PAD(0x38C, 0xE0, 4, 0x7e4, 5, MX50_UART_PAD_CTRL)
333#define MX50_PAD_ECSPI2_SS0__ELCDIF_HSYNC IOMUX_PAD(0x38C, 0xE0, 5, 0x6f8, 0, NO_PAD_CTRL)
334#define MX50_PAD_ECSPI2_SS0__NANDF_CEN7 IOMUX_PAD(0x38C, 0xE0, 6, 0x0, 0, NO_PAD_CTRL)
335#define MX50_PAD_ECSPI2_SS0__WEIM_D11 IOMUX_PAD(0x38C, 0xE0, 7, 0x818, 1, NO_PAD_CTRL)
336
337#define MX50_PAD_SD1_CLK__SD1_CLK IOMUX_PAD(0x390, 0xE4, IOMUX_CONFIG_SION, 0x0, 0, MX50_SD_PAD_CTRL)
338#define MX50_PAD_SD1_CLK__GPIO_5_0 IOMUX_PAD(0x390, 0xE4, 1, 0x0, 0, NO_PAD_CTRL)
339#define MX50_PAD_SD1_CLK__CLKO IOMUX_PAD(0x390, 0xE4, 7, 0x0, 0, NO_PAD_CTRL)
340
341#define MX50_PAD_SD1_CMD__SD1_CMD IOMUX_PAD(0x394, 0xE8, IOMUX_CONFIG_SION, 0x0, 0, MX50_SD_PAD_CTRL)
342#define MX50_PAD_SD1_CMD__GPIO_5_1 IOMUX_PAD(0x394, 0xE8, 1, 0x0, 0, NO_PAD_CTRL)
343#define MX50_PAD_SD1_CMD__CLKO2 IOMUX_PAD(0x394, 0xE8, 7, 0x0, 0, NO_PAD_CTRL)
344
345#define MX50_PAD_SD1_D0__SD1_D0 IOMUX_PAD(0x398, 0xEC, 0, 0x0, 0, MX50_SD_PAD_CTRL)
346#define MX50_PAD_SD1_D0__GPIO_5_2 IOMUX_PAD(0x398, 0xEC, 1, 0x0, 0, NO_PAD_CTRL)
347#define MX50_PAD_SD1_D0__PLL1_BYP IOMUX_PAD(0x398, 0xEC, 7, 0x6dc, 0, NO_PAD_CTRL)
348
349#define MX50_PAD_SD1_D1__SD1_D1 IOMUX_PAD(0x39C, 0xF0, 0, 0x0, 0, MX50_SD_PAD_CTRL)
350#define MX50_PAD_SD1_D1__GPIO_5_3 IOMUX_PAD(0x39C, 0xF0, 1, 0x0, 0, NO_PAD_CTRL)
351#define MX50_PAD_SD1_D1__PLL2_BYP IOMUX_PAD(0x39C, 0xF0, 7, 0x6e0, 0, NO_PAD_CTRL)
352
353#define MX50_PAD_SD1_D2__SD1_D2 IOMUX_PAD(0x3A0, 0xF4, 0, 0x0, 0, MX50_SD_PAD_CTRL)
354#define MX50_PAD_SD1_D2__GPIO_5_4 IOMUX_PAD(0x3A0, 0xF4, 1, 0x0, 0, NO_PAD_CTRL)
355#define MX50_PAD_SD1_D2__PLL3_BYP IOMUX_PAD(0x3A0, 0xF4, 7, 0x6e4, 0, NO_PAD_CTRL)
356
357#define MX50_PAD_SD1_D3__SD1_D3 IOMUX_PAD(0x3A4, 0xF8, 0, 0x0, 0, MX50_SD_PAD_CTRL)
358#define MX50_PAD_SD1_D3__GPIO_5_5 IOMUX_PAD(0x3A4, 0xF8, 1, 0x0, 0, NO_PAD_CTRL)
359
360#define MX50_PAD_SD2_CLK__SD2_CLK IOMUX_PAD(0x3A8, 0xFC, IOMUX_CONFIG_SION, 0x0, 0, MX50_SD_PAD_CTRL)
361#define MX50_PAD_SD2_CLK__GPIO_5_6 IOMUX_PAD(0x3A8, 0xFC, 1, 0x0, 0, NO_PAD_CTRL)
362#define MX50_PAD_SD2_CLK__MSHC_SCLK IOMUX_PAD(0x3A8, 0xFC, 2, 0x0, 0, MX50_SD_PAD_CTRL)
363
364#define MX50_PAD_SD2_CMD__SD2_CMD IOMUX_PAD(0x3AC, 0x100, IOMUX_CONFIG_SION, 0x0, 0, MX50_SD_PAD_CTRL)
365#define MX50_PAD_SD2_CMD__GPIO_5_7 IOMUX_PAD(0x3AC, 0x100, 1, 0x0, 0, NO_PAD_CTRL)
366#define MX50_PAD_SD2_CMD__MSHC_BS IOMUX_PAD(0x3AC, 0x100, 2, 0x0, 0, MX50_SD_PAD_CTRL)
367
368#define MX50_PAD_SD2_D0__SD2_D0 IOMUX_PAD(0x3B0, 0x104, 0, 0x0, 0, MX50_SD_PAD_CTRL)
369#define MX50_PAD_SD2_D0__GPIO_5_8 IOMUX_PAD(0x3B0, 0x104, 1, 0x0, 0, NO_PAD_CTRL)
370#define MX50_PAD_SD2_D0__MSHC_D0 IOMUX_PAD(0x3B0, 0x104, 2, 0x0, 0, MX50_SD_PAD_CTRL)
371#define MX50_PAD_SD2_D0__KEY_COL4 IOMUX_PAD(0x3B0, 0x104, 3, 0x790, 0, NO_PAD_CTRL)
372
373#define MX50_PAD_SD2_D1__SD2_D1 IOMUX_PAD(0x3B4, 0x108, 0, 0x0, 0, MX50_SD_PAD_CTRL)
374#define MX50_PAD_SD2_D1__GPIO_5_9 IOMUX_PAD(0x3B4, 0x108, 1, 0x0, 0, NO_PAD_CTRL)
375#define MX50_PAD_SD2_D1__MSHC_D1 IOMUX_PAD(0x3B4, 0x108, 2, 0x0, 0, MX50_SD_PAD_CTRL)
376#define MX50_PAD_SD2_D1__KEY_ROW4 IOMUX_PAD(0x3B4, 0x108, 3, 0x7a0, 0, NO_PAD_CTRL)
377
378#define MX50_PAD_SD2_D2__SD2_D2 IOMUX_PAD(0x3B8, 0x10C, 0, 0x0, 0, MX50_SD_PAD_CTRL)
379#define MX50_PAD_SD2_D2__GPIO_5_10 IOMUX_PAD(0x3B8, 0x10C, 1, 0x0, 0, NO_PAD_CTRL)
380#define MX50_PAD_SD2_D2__MSHC_D2 IOMUX_PAD(0x3B8, 0x10C, 2, 0x0, 0, MX50_SD_PAD_CTRL)
381#define MX50_PAD_SD2_D2__KEY_COL5 IOMUX_PAD(0x3B8, 0x10C, 3, 0x794, 0, NO_PAD_CTRL)
382
383#define MX50_PAD_SD2_D3__SD2_D3 IOMUX_PAD(0x3BC, 0x110, 0, 0x0, 0, MX50_SD_PAD_CTRL)
384#define MX50_PAD_SD2_D3__GPIO_5_11 IOMUX_PAD(0x3BC, 0x110, 1, 0x0, 0, NO_PAD_CTRL)
385#define MX50_PAD_SD2_D3__MSHC_D3 IOMUX_PAD(0x3BC, 0x110, 2, 0x0, 0, MX50_SD_PAD_CTRL)
386#define MX50_PAD_SD2_D3__KEY_ROW5 IOMUX_PAD(0x3BC, 0x110, 3, 0x7a4, 0, NO_PAD_CTRL)
387
388#define MX50_PAD_SD2_D4__SD2_D4 IOMUX_PAD(0x3C0, 0x114, 0, 0x0, 0, MX50_SD_PAD_CTRL)
389#define MX50_PAD_SD2_D4__GPIO_5_12 IOMUX_PAD(0x3C0, 0x114, 1, 0x0, 0, NO_PAD_CTRL)
390#define MX50_PAD_SD2_D4__AUD4_RXFS IOMUX_PAD(0x3C0, 0x114, 2, 0x6d0, 0, NO_PAD_CTRL)
391#define MX50_PAD_SD2_D4__KEY_COL6 IOMUX_PAD(0x3C0, 0x114, 3, 0x798, 0, NO_PAD_CTRL)
392#define MX50_PAD_SD2_D4__WEIM_D0 IOMUX_PAD(0x3C0, 0x114, 4, 0x7ec, 0, NO_PAD_CTRL)
393#define MX50_PAD_SD2_D4__CCM_OUT0 IOMUX_PAD(0x3C0, 0x114, 7, 0x0, 0, NO_PAD_CTRL)
394
395#define MX50_PAD_SD2_D5__SD2_D5 IOMUX_PAD(0x3C4, 0x118, 0, 0x0, 0, MX50_SD_PAD_CTRL)
396#define MX50_PAD_SD2_D5__GPIO_5_13 IOMUX_PAD(0x3C4, 0x118, 1, 0x0, 0, NO_PAD_CTRL)
397#define MX50_PAD_SD2_D5__AUD4_RXC IOMUX_PAD(0x3C4, 0x118, 2, 0x6cc, 0, NO_PAD_CTRL)
398#define MX50_PAD_SD2_D5__KEY_ROW6 IOMUX_PAD(0x3C4, 0x118, 3, 0x7a8, 0, NO_PAD_CTRL)
399#define MX50_PAD_SD2_D5__WEIM_D1 IOMUX_PAD(0x3C4, 0x118, 4, 0x7f0, 0, NO_PAD_CTRL)
400#define MX50_PAD_SD2_D5__CCM_OUT1 IOMUX_PAD(0x3C4, 0x118, 7, 0x0, 0, NO_PAD_CTRL)
401
402#define MX50_PAD_SD2_D6__SD2_D6 IOMUX_PAD(0x3C8, 0x11C, 0, 0x0, 0, MX50_SD_PAD_CTRL)
403#define MX50_PAD_SD2_D6__GPIO_5_14 IOMUX_PAD(0x3C8, 0x11C, 1, 0x0, 0, NO_PAD_CTRL)
404#define MX50_PAD_SD2_D6__AUD4_RXD IOMUX_PAD(0x3C8, 0x11C, 2, 0x6c4, 0, NO_PAD_CTRL)
405#define MX50_PAD_SD2_D6__KEY_COL7 IOMUX_PAD(0x3C8, 0x11C, 3, 0x79c, 0, NO_PAD_CTRL)
406#define MX50_PAD_SD2_D6__WEIM_D2 IOMUX_PAD(0x3C8, 0x11C, 4, 0x7f4, 0, NO_PAD_CTRL)
407#define MX50_PAD_SD2_D6__CCM_OUT2 IOMUX_PAD(0x3C8, 0x11C, 7, 0x0, 0, NO_PAD_CTRL)
408
409#define MX50_PAD_SD2_D7__SD2_D7 IOMUX_PAD(0x3CC, 0x120, 0, 0x0, 0, MX50_SD_PAD_CTRL)
410#define MX50_PAD_SD2_D7__GPIO_5_15 IOMUX_PAD(0x3CC, 0x120, 1, 0x0, 0, NO_PAD_CTRL)
411#define MX50_PAD_SD2_D7__AUD4_TXFS IOMUX_PAD(0x3CC, 0x120, 2, 0x6d8, 0, NO_PAD_CTRL)
412#define MX50_PAD_SD2_D7__KEY_ROW7 IOMUX_PAD(0x3CC, 0x120, 3, 0x7ac, 0, NO_PAD_CTRL)
413#define MX50_PAD_SD2_D7__WEIM_D3 IOMUX_PAD(0x3CC, 0x120, 4, 0x7f8, 0, NO_PAD_CTRL)
414#define MX50_PAD_SD2_D7__CCM_STOP IOMUX_PAD(0x3CC, 0x120, 7, 0x0, 0, NO_PAD_CTRL)
415
416#define MX50_PAD_SD2_WP__SD2_WP IOMUX_PAD(0x3D0, 0x124, 0, 0x744, 1, MX50_SD_PAD_CTRL)
417#define MX50_PAD_SD2_WP__GPIO_5_16 IOMUX_PAD(0x3D0, 0x124, 1, 0x0, 0, NO_PAD_CTRL)
418#define MX50_PAD_SD2_WP__AUD4_TXD IOMUX_PAD(0x3D0, 0x124, 2, 0x6c8, 0, NO_PAD_CTRL)
419#define MX50_PAD_SD2_WP__WEIM_D4 IOMUX_PAD(0x3D0, 0x124, 4, 0x7fc, 0, NO_PAD_CTRL)
420#define MX50_PAD_SD2_WP__CCM_WAIT IOMUX_PAD(0x3D0, 0x124, 7, 0x0, 0, NO_PAD_CTRL)
421
422#define MX50_PAD_SD2_CD__SD2_CD IOMUX_PAD(0x3D4, 0x128, 0, 0x740, 1, MX50_SD_PAD_CTRL)
423#define MX50_PAD_SD2_CD__GPIO_5_17 IOMUX_PAD(0x3D4, 0x128, 1, 0x0, 0, NO_PAD_CTRL)
424#define MX50_PAD_SD2_CD__AUD4_TXC IOMUX_PAD(0x3D4, 0x128, 2, 0x6d4, 0, NO_PAD_CTRL)
425#define MX50_PAD_SD2_CD__WEIM_D5 IOMUX_PAD(0x3D4, 0x128, 4, 0x800, 0, NO_PAD_CTRL)
426#define MX50_PAD_SD2_CD__CCM_REF_EN IOMUX_PAD(0x3D4, 0x128, 7, 0x0, 0, NO_PAD_CTRL)
427
428#define MX50_PAD_PMIC_ON_REQ__PMIC_ON_REQ IOMUX_PAD(0x3D8, 0, 0, 0x0, 0, NO_PAD_CTRL)
429
430#define MX50_PAD_PMIC_STBY_REQ__PMIC_STBY_REQ IOMUX_PAD(0x3DC, 0, 0, 0x0, 0, NO_PAD_CTRL)
431
432#define MX50_PAD_PMIC_PORT_B__PMIC_PORT_B IOMUX_PAD(0x3E0, 0, 0, 0x0, 0, NO_PAD_CTRL)
433
434#define MX50_PAD_PMIC_BOOT_MODE1__PMIC_BOOT_MODE1 IOMUX_PAD(0x3E4, 0, 0, 0x0, 0, NO_PAD_CTRL)
435
436#define MX50_PAD_PMIC_RESET_IN_B__PMIC_RESET_IN_B IOMUX_PAD(0x3E8, 0, 0, 0x0, 0, NO_PAD_CTRL)
437
438#define MX50_PAD_PMIC_BOOT_MODE0__PMIC_BOOT_MODE0 IOMUX_PAD(0x3EC, 0, 0, 0x0, 0, NO_PAD_CTRL)
439
440#define MX50_PAD_PMIC_TEST_MODE__PMIC_TEST_MODE IOMUX_PAD(0x3F0, 0, 0, 0x0, 0, NO_PAD_CTRL)
441
442#define MX50_PAD_PMIC_JTAG_TMS__PMIC_JTAG_TMS IOMUX_PAD(0x3F4, 0, 0, 0x0, 0, NO_PAD_CTRL)
443
444#define MX50_PAD_PMIC_JTAG_MOD__PMIC_JTAG_MOD IOMUX_PAD(0x3F8, 0, 0, 0x0, 0, NO_PAD_CTRL)
445
446#define MX50_PAD_PMIC_JTAG_TRSTB__PMIC_JTAG_TRSTB IOMUX_PAD(0x3FC, 0, 0, 0x0, 0, NO_PAD_CTRL)
447
448#define MX50_PAD_PMIC_JTAG_TDI__PMIC_JTAG_TDI IOMUX_PAD(0x400, 0, 0, 0x0, 0, NO_PAD_CTRL)
449
450#define MX50_PAD_PMIC_JTAG_TCK__PMIC_JTAG_TCK IOMUX_PAD(0x404, 0, 0, 0x0, 0, NO_PAD_CTRL)
451
452#define MX50_PAD_PMIC_JTAG_TDO__PMIC_JTAG_TDO IOMUX_PAD(0x408, 0, 0, 0x0, 0, NO_PAD_CTRL)
453
454#define MX50_PAD_DISP_D0__DISP_D0 IOMUX_PAD(0x40C, 0x12C, 0, 0x6fc, 0, MX50_ELCDIF_PAD_CTRL)
455#define MX50_PAD_DISP_D0__GPIO_2_0 IOMUX_PAD(0x40C, 0x12C, 1, 0x0, 0, NO_PAD_CTRL)
456#define MX50_PAD_DISP_D0__FEC_TXCLK IOMUX_PAD(0x40C, 0x12C, 2, 0x78c, 0, PAD_CTL_HYS | PAD_CTL_PKE)
457
458#define MX50_PAD_DISP_D1__DISP_D1 IOMUX_PAD(0x410, 0x130, 0, 0x700, 0, MX50_ELCDIF_PAD_CTRL)
459#define MX50_PAD_DISP_D1__GPIO_2_1 IOMUX_PAD(0x410, 0x130, 1, 0x0, 0, NO_PAD_CTRL)
460#define MX50_PAD_DISP_D1__FEC_RX_ER IOMUX_PAD(0x410, 0x130, 2, 0x788, 0, PAD_CTL_HYS | PAD_CTL_PKE)
461#define MX50_PAD_DISP_D1__WEIM_A17 IOMUX_PAD(0x410, 0x130, 3, 0x0, 0, NO_PAD_CTRL)
462
463#define MX50_PAD_DISP_D2__DISP_D2 IOMUX_PAD(0x414, 0x134, 0, 0x704, 0, MX50_ELCDIF_PAD_CTRL)
464#define MX50_PAD_DISP_D2__GPIO_2_2 IOMUX_PAD(0x414, 0x134, 1, 0x0, 0, NO_PAD_CTRL)
465#define MX50_PAD_DISP_D2__FEC_RX_DV IOMUX_PAD(0x414, 0x134, 2, 0x784, 0, PAD_CTL_HYS | PAD_CTL_PKE)
466#define MX50_PAD_DISP_D2__WEIM_A18 IOMUX_PAD(0x414, 0x134, 3, 0x0, 0, NO_PAD_CTRL)
467
468#define MX50_PAD_DISP_D3__DISP_D3 IOMUX_PAD(0x418, 0x138, 0, 0x708, 0, MX50_ELCDIF_PAD_CTRL)
469#define MX50_PAD_DISP_D3__GPIO_2_3 IOMUX_PAD(0x418, 0x138, 1, 0x0, 0, NO_PAD_CTRL)
470#define MX50_PAD_DISP_D3__FEC_RXD1 IOMUX_PAD(0x418, 0x138, 2, 0x77C, 0, PAD_CTL_HYS | PAD_CTL_PKE)
471#define MX50_PAD_DISP_D3__WEIM_A19 IOMUX_PAD(0x418, 0x138, 3, 0x0, 0, NO_PAD_CTRL)
472#define MX50_PAD_DISP_D3__FEC_COL IOMUX_PAD(0x418, 0x138, 4, 0x770, 1, NO_PAD_CTRL)
473
474#define MX50_PAD_DISP_D4__DISP_D4 IOMUX_PAD(0x41C, 0x13C, 0, 0x70c, 0, MX50_ELCDIF_PAD_CTRL)
475#define MX50_PAD_DISP_D4__GPIO_2_4 IOMUX_PAD(0x41C, 0x13C, 1, 0x0, 0, NO_PAD_CTRL)
476#define MX50_PAD_DISP_D4__FEC_RXD0 IOMUX_PAD(0x41C, 0x13C, 2, 0x778, 0, PAD_CTL_HYS | PAD_CTL_PKE)
477#define MX50_PAD_DISP_D4__WEIM_A20 IOMUX_PAD(0x41C, 0x13C, 3, 0x0, 0, NO_PAD_CTRL)
478
479#define MX50_PAD_DISP_D5__DISP_D5 IOMUX_PAD(0x420, 0x140, 0, 0x710, 0, MX50_ELCDIF_PAD_CTRL)
480#define MX50_PAD_DISP_D5__GPIO_2_5 IOMUX_PAD(0x420, 0x140, 1, 0x0, 0, NO_PAD_CTRL)
481#define MX50_PAD_DISP_D5__FEC_TX_EN IOMUX_PAD(0x420, 0x140, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
482#define MX50_PAD_DISP_D5__WEIM_A21 IOMUX_PAD(0x420, 0x140, 3, 0x0, 0, NO_PAD_CTRL)
483
484#define MX50_PAD_DISP_D6__DISP_D6 IOMUX_PAD(0x424, 0x144, 0, 0x714, 0, MX50_ELCDIF_PAD_CTRL)
485#define MX50_PAD_DISP_D6__GPIO_2_6 IOMUX_PAD(0x424, 0x144, 1, 0x0, 0, NO_PAD_CTRL)
486#define MX50_PAD_DISP_D6__FEC_TXD1 IOMUX_PAD(0x424, 0x144, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
487#define MX50_PAD_DISP_D6__WEIM_A22 IOMUX_PAD(0x424, 0x144, 3, 0x0, 0, NO_PAD_CTRL)
488#define MX50_PAD_DISP_D6__FEC_RX_CLK IOMUX_PAD(0x424, 0x144, 4, 0x780, 1, NO_PAD_CTRL)
489
490#define MX50_PAD_DISP_D7__DISP_D7 IOMUX_PAD(0x428, 0x148, 0, 0x718, 0, MX50_ELCDIF_PAD_CTRL)
491#define MX50_PAD_DISP_D7__GPIO_2_7 IOMUX_PAD(0x428, 0x148, 1, 0x0, 0, NO_PAD_CTRL)
492#define MX50_PAD_DISP_D7__FEC_TXD0 IOMUX_PAD(0x428, 0x148, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
493#define MX50_PAD_DISP_D7__WEIM_A23 IOMUX_PAD(0x428, 0x148, 3, 0x0, 0, NO_PAD_CTRL)
494
495
496#define MX50_PAD_DISP_WR__ELCDIF_WR IOMUX_PAD(0x42C, 0x14C, 0, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
497#define MX50_PAD_DISP_WR__GPIO_2_16 IOMUX_PAD(0x42C, 0x14C, 1, 0x0, 0, NO_PAD_CTRL)
498#define MX50_PAD_DISP_WR__ELCDIF_PIXCLK IOMUX_PAD(0x42C, 0x14C, 2, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
499#define MX50_PAD_DISP_WR__WEIM_A24 IOMUX_PAD(0x42C, 0x14C, 3, 0x0, 0, NO_PAD_CTRL)
500
501#define MX50_PAD_DISP_RD__ELCDIF_RD IOMUX_PAD(0x430, 0x150, 0, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
502#define MX50_PAD_DISP_RD__GPIO_2_19 IOMUX_PAD(0x430, 0x150, 1, 0x0, 0, NO_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)
505
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)
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)
510
511#define MX50_PAD_DISP_CS__ELCDIF_CS IOMUX_PAD(0x438, 0x158, 0, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
512#define MX50_PAD_DISP_CS__GPIO_2_21 IOMUX_PAD(0x438, 0x158, 1, 0x0, 0, NO_PAD_CTRL)
513#define MX50_PAD_DISP_CS__ELCDIF_HSYNC IOMUX_PAD(0x438, 0x158, 2, 0x6f8, 1, MX50_ELCDIF_PAD_CTRL)
514#define MX50_PAD_DISP_CS__WEIM_A27 IOMUX_PAD(0x438, 0x158, 3, 0x0, 0, NO_PAD_CTRL)
515#define MX50_PAD_DISP_CS__WEIM_CS3 IOMUX_PAD(0x438, 0x158, 4, 0x0, 0, NO_PAD_CTRL)
516
517#define MX50_PAD_DISP_BUSY__ELCDIF_HSYNC IOMUX_PAD(0x43C, 0x15C, 0, 0x6f8, 2, MX50_ELCDIF_PAD_CTRL)
518#define MX50_PAD_DISP_BUSY__GPIO_2_18 IOMUX_PAD(0x43C, 0x15C, 1, 0x0, 0, NO_PAD_CTRL)
519#define MX50_PAD_DISP_BUSY__WEIM_CS3 IOMUX_PAD(0x43C, 0x15C, 3, 0x0, 0, NO_PAD_CTRL)
520
521#define MX50_PAD_DISP_RESET__ELCDIF_RST IOMUX_PAD(0x440, 0x160, 0, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
522#define MX50_PAD_DISP_RESET__GPIO_2_20 IOMUX_PAD(0x440, 0x160, 1, 0x0, 0, NO_PAD_CTRL)
523#define MX50_PAD_DISP_RESET__WEIM_CS3 IOMUX_PAD(0x440, 0x160, 4, 0x0, 0, NO_PAD_CTRL)
524
525#define MX50_PAD_SD3_CMD__SD3_CMD IOMUX_PAD(0x444, 0x164, 0, 0x0, 0, MX50_SD_PAD_CTRL)
526#define MX50_PAD_SD3_CMD__GPIO_5_18 IOMUX_PAD(0x444, 0x164, 1, 0x0, 0, NO_PAD_CTRL)
527#define MX50_PIN_SD3_CMD__NANDF_WRN IOMUX_PAD(0x444, 0x164, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
528#define MX50_PAD_SD3_CMD__SSP_CMD IOMUX_PAD(0x444, 0x164, 3, 0x0, 0, NO_PAD_CTRL)
529
530#define MX50_PAD_SD3_CLK__SD3_CLK IOMUX_PAD(0x448, 0x168, 0, 0x0, 0, MX50_SD_PAD_CTRL)
531#define MX50_PAD_SD3_CLK__GPIO_5_19 IOMUX_PAD(0x448, 0x168, 1, 0x0, 0, NO_PAD_CTRL)
532#define MX50_PIN_SD3_CLK__NANDF_RDN IOMUX_PAD(0x448, 0x168, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
533#define MX50_PAD_SD3_CLK__SSP_CLK IOMUX_PAD(0x448, 0x168, 3, 0x0, 0, NO_PAD_CTRL)
534
535#define MX50_PAD_SD3_D0__SD3_D0 IOMUX_PAD(0x44C, 0x16C, 0, 0x0, 0, MX50_SD_PAD_CTRL)
536#define MX50_PAD_SD3_D0__GPIO_5_20 IOMUX_PAD(0x44C, 0x16C, 1, 0x0, 0, NO_PAD_CTRL)
537#define MX50_PIN_SD3_D0__NANDF_D4 IOMUX_PAD(0x44C, 0x16C, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
538#define MX50_PAD_SD3_D0__SSP_D0 IOMUX_PAD(0x44C, 0x16C, 3, 0x0, 0, NO_PAD_CTRL)
539#define MX50_PAD_SD3_D0__PLL1_BYP IOMUX_PAD(0x44C, 0x16C, 7, 0x6dc, 1, NO_PAD_CTRL)
540
541#define MX50_PAD_SD3_D1__SD3_D1 IOMUX_PAD(0x450, 0x170, 0, 0x0, 0, MX50_SD_PAD_CTRL)
542#define MX50_PAD_SD3_D1__GPIO_5_21 IOMUX_PAD(0x450, 0x170, 1, 0x0, 0, NO_PAD_CTRL)
543#define MX50_PIN_SD3_D1__NANDF_D5 IOMUX_PAD(0x450, 0x170, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
544#define MX50_PAD_SD3_D1__PLL2_BYP IOMUX_PAD(0x450, 0x170, 7, 0x6e0, 1, NO_PAD_CTRL)
545
546#define MX50_PAD_SD3_D2__SD3_D2 IOMUX_PAD(0x454, 0x174, 0, 0x0, 0, MX50_SD_PAD_CTRL)
547#define MX50_PAD_SD3_D2__GPIO_5_22 IOMUX_PAD(0x454, 0x174, 1, 0x0, 0, NO_PAD_CTRL)
548#define MX50_PIN_SD3_D2__NANDF_D6 IOMUX_PAD(0x454, 0x174, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
549#define MX50_PAD_SD3_D2__SSP_D2 IOMUX_PAD(0x454, 0x174, 3, 0x0, 0, NO_PAD_CTRL)
550#define MX50_PAD_SD3_D2__PLL3_BYP IOMUX_PAD(0x454, 0x174, 7, 0x6e4, 1, NO_PAD_CTRL)
551
552#define MX50_PAD_SD3_D3__SD3_D3 IOMUX_PAD(0x458, 0x178, 0, 0x0, 0, MX50_SD_PAD_CTRL)
553#define MX50_PAD_SD3_D3__GPIO_5_23 IOMUX_PAD(0x458, 0x178, 1, 0x0, 0, NO_PAD_CTRL)
554#define MX50_PIN_SD3_D3__NANDF_D7 IOMUX_PAD(0x458, 0x178, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
555#define MX50_PAD_SD3_D3__SSP_D3 IOMUX_PAD(0x458, 0x178, 3, 0x0, 0, NO_PAD_CTRL)
556
557#define MX50_PAD_SD3_D4__SD3_D4 IOMUX_PAD(0x45C, 0x17C, 0, 0x0, 0, MX50_SD_PAD_CTRL)
558#define MX50_PAD_SD3_D4__GPIO_5_24 IOMUX_PAD(0x45C, 0x17C, 1, 0x0, 0, NO_PAD_CTRL)
559#define MX50_PIN_SD3_D4__NANDF_D0 IOMUX_PAD(0x45C, 0x17C, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
560#define MX50_PAD_SD3_D4__SSP_D4 IOMUX_PAD(0x45C, 0x17C, 1, 0x0, 0, NO_PAD_CTRL)
561
562#define MX50_PAD_SD3_D5__SD3_D5 IOMUX_PAD(0x460, 0x180, 0, 0x0, 0, MX50_SD_PAD_CTRL)
563#define MX50_PAD_SD3_D5__GPIO_5_25 IOMUX_PAD(0x460, 0x180, 1, 0x0, 0, NO_PAD_CTRL)
564#define MX50_PIN_SD3_D5__NANDF_D1 IOMUX_PAD(0x460, 0x180, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
565#define MX50_PAD_SD3_D5__SSP_D5 IOMUX_PAD(0x460, 0x180, 3, 0x0, 0, NO_PAD_CTRL)
566
567#define MX50_PAD_SD3_D6__SD3_D6 IOMUX_PAD(0x464, 0x184, 0, 0x0, 0, MX50_SD_PAD_CTRL)
568#define MX50_PAD_SD3_D6__GPIO_5_26 IOMUX_PAD(0x464, 0x184, 1, 0x0, 0, NO_PAD_CTRL)
569#define MX50_PIN_SD3_D6__NANDF_D2 IOMUX_PAD(0x464, 0x184, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
570#define MX50_PAD_SD3_D6__SSP_D6 IOMUX_PAD(0x464, 0x184, 3, 0x0, 0, NO_PAD_CTRL)
571
572#define MX50_PAD_SD3_D7__SD3_D7 IOMUX_PAD(0x468, 0x188, 0, 0x0, 0, MX50_SD_PAD_CTRL)
573#define MX50_PAD_SD3_D7__GPIO_5_27 IOMUX_PAD(0x468, 0x188, 1, 0x0, 0, NO_PAD_CTRL)
574#define MX50_PIN_SD3_D7__NANDF_D3 IOMUX_PAD(0x468, 0x188, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
575#define MX50_PAD_SD3_D7__SSP_D7 IOMUX_PAD(0x468, 0x188, 3, 0x0, 0, NO_PAD_CTRL)
576
577#define MX50_PAD_SD3_WP__SD3_WP IOMUX_PAD(0x46C, 0x18C, 0, 0x0, 0, MX50_SD_PAD_CTRL)
578#define MX50_PAD_SD3_WP__GPIO_5_28 IOMUX_PAD(0x46C, 0x18C, 1, 0x0, 0, NO_PAD_CTRL)
579#define MX50_PIN_SD3_WP__NANDF_RESETN IOMUX_PAD(0x46C, 0x18C, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
580#define MX50_PAD_SD3_WP__SSP_CD IOMUX_PAD(0x46C, 0x18C, 3, 0x0, 0, NO_PAD_CTRL)
581#define MX50_PAD_SD3_WP__SD4_LCTL IOMUX_PAD(0x46C, 0x18C, 4, 0x0, 0, MX50_SD_PAD_CTRL)
582#define MX50_PAD_SD3_WP__WEIM_CS3 IOMUX_PAD(0x46C, 0x18C, 5, 0x0, 0, NO_PAD_CTRL)
583
584#define MX50_PAD_DISP_D8__DISP_D8 IOMUX_PAD(0x470, 0x190, 0, 0x71c, 0, MX50_ELCDIF_PAD_CTRL)
585#define MX50_PAD_DISP_D8__GPIO_2_8 IOMUX_PAD(0x470, 0x190, 1, 0x0, 0, NO_PAD_CTRL)
586#define MX50_PAD_DISP_D8__NANDF_CLE IOMUX_PAD(0x470, 0x190, 2, 0x0, 0, NO_PAD_CTRL)
587#define MX50_PAD_DISP_D8__SD1_LCTL IOMUX_PAD(0x470, 0x190, 3, 0x0, 0, MX50_SD_PAD_CTRL)
588#define MX50_PAD_DISP_D8__SD4_CMD IOMUX_PAD(0x470, 0x190, 4, 0x74c, 2, MX50_SD_PAD_CTRL)
589#define MX50_PAD_DISP_D8__KEY_COL4 IOMUX_PAD(0x470, 0x190, 5, 0x790, 1, NO_PAD_CTRL)
590#define MX50_PAD_DISP_D8__FEC_TX_CLK IOMUX_PAD(0x470, 0x190, 6, 0x78c, 1, NO_PAD_CTRL)
591
592#define MX50_PAD_DISP_D9__DISP_D9 IOMUX_PAD(0x474, 0x194, 0, 0x720, 0, MX50_ELCDIF_PAD_CTRL)
593#define MX50_PAD_DISP_D9__GPIO_2_9 IOMUX_PAD(0x474, 0x194, 1, 0x0, 0, NO_PAD_CTRL)
594#define MX50_PAD_DISP_D9__NANDF_ALE IOMUX_PAD(0x474, 0x194, 2, 0x0, 0, NO_PAD_CTRL)
595#define MX50_PAD_DISP_D9__SD2_LCTL IOMUX_PAD(0x474, 0x194, 3, 0x0, 0, MX50_SD_PAD_CTRL)
596#define MX50_PAD_DISP_D9__SD4_CLK IOMUX_PAD(0x474, 0x194, 4, 0x748, 2, MX50_SD_PAD_CTRL)
597#define MX50_PAD_DISP_D9__KEY_ROW4 IOMUX_PAD(0x474, 0x194, 5, 0x7a0, 1, NO_PAD_CTRL)
598#define MX50_PAD_DISP_D9__FEC_RX_ER IOMUX_PAD(0x474, 0x194, 6, 0x788, 1, NO_PAD_CTRL)
599
600#define MX50_PAD_DISP_D10__DISP_D10 IOMUX_PAD(0x478, 0x198, 0, 0x724, 0, MX50_ELCDIF_PAD_CTRL)
601#define MX50_PAD_DISP_D10__GPIO_2_10 IOMUX_PAD(0x478, 0x198, 1, 0x0, 0, NO_PAD_CTRL)
602#define MX50_PAD_DISP_D10__NANDF_CEN0 IOMUX_PAD(0x478, 0x198, 2, 0x0, 0, NO_PAD_CTRL)
603#define MX50_PAD_DISP_D10__SD3_LCTL IOMUX_PAD(0x478, 0x198, 3, 0x0, 0, MX50_SD_PAD_CTRL)
604#define MX50_PAD_DISP_D10__SD4_D0 IOMUX_PAD(0x478, 0x198, 4, 0x750, 1, MX50_SD_PAD_CTRL)
605#define MX50_PAD_DISP_D10__KEY_COL5 IOMUX_PAD(0x478, 0x198, 5, 0x794, 1, NO_PAD_CTRL)
606#define MX50_PAD_DISP_D10__FEC_RX_DV IOMUX_PAD(0x478, 0x198, 6, 0x784, 1, NO_PAD_CTRL)
607
608#define MX50_PAD_DISP_D11__DISP_D11 IOMUX_PAD(0x47C, 0x19C, 0, 0x728, 0, MX50_ELCDIF_PAD_CTRL)
609#define MX50_PAD_DISP_D11__GPIO_2_11 IOMUX_PAD(0x47C, 0x19C, 1, 0x0, 0, NO_PAD_CTRL)
610#define MX50_PAD_DISP_D11__NANDF_CEN1 IOMUX_PAD(0x47C, 0x19C, 2, 0x0, 0, NO_PAD_CTRL)
611#define MX50_PAD_DISP_D11__SD4_D1 IOMUX_PAD(0x47C, 0x19C, 4, 0x754, 1, MX50_SD_PAD_CTRL)
612#define MX50_PAD_DISP_D11__KEY_ROW5 IOMUX_PAD(0x47C, 0x19C, 5, 0x7a4, 1, NO_PAD_CTRL)
613#define MX50_PAD_DISP_D11__FEC_RDAT1 IOMUX_PAD(0x47C, 0x19C, 6, 0x77c, 1, NO_PAD_CTRL)
614
615#define MX50_PAD_DISP_D12__DISP_D12 IOMUX_PAD(0x480, 0x1A0, 0, 0x72c, 0, MX50_ELCDIF_PAD_CTRL)
616#define MX50_PAD_DISP_D12__GPIO_2_12 IOMUX_PAD(0x480, 0x1A0, 1, 0x0, 0, NO_PAD_CTRL)
617#define MX50_PAD_DISP_D12__NANDF_CEN2 IOMUX_PAD(0x480, 0x1A0, 2, 0x0, 0, NO_PAD_CTRL)
618#define MX50_PAD_DISP_D12__SD1_CD IOMUX_PAD(0x480, 0x1A0, 3, 0x0, 0, MX50_SD_PAD_CTRL)
619#define MX50_PAD_DISP_D12__SD4_D2 IOMUX_PAD(0x480, 0x1A0, 4, 0x758, 1, MX50_SD_PAD_CTRL)
620#define MX50_PAD_DISP_D12__KEY_COL6 IOMUX_PAD(0x480, 0x1A0, 5, 0x798, 1, NO_PAD_CTRL)
621#define MX50_PAD_DISP_D12__FEC_RDAT0 IOMUX_PAD(0x480, 0x1A0, 6, 0x778, 1, NO_PAD_CTRL)
622
623#define MX50_PAD_DISP_D13__DISP_D13 IOMUX_PAD(0x484, 0x1A4, 0, 0x730, 0, MX50_ELCDIF_PAD_CTRL)
624#define MX50_PAD_DISP_D13__GPIO_2_13 IOMUX_PAD(0x484, 0x1A4, 1, 0x0, 0, NO_PAD_CTRL)
625#define MX50_PAD_DISP_D13__NANDF_CEN3 IOMUX_PAD(0x484, 0x1A4, 2, 0x0, 0, NO_PAD_CTRL)
626#define MX50_PAD_DISP_D13__SD3_CD IOMUX_PAD(0x484, 0x1A4, 3, 0x0, 0, MX50_SD_PAD_CTRL)
627#define MX50_PAD_DISP_D13__SD4_D3 IOMUX_PAD(0x484, 0x1A4, 4, 0x75c, 1, MX50_SD_PAD_CTRL)
628#define MX50_PAD_DISP_D13__KEY_ROW6 IOMUX_PAD(0x484, 0x1A4, 5, 0x7a8, 1, NO_PAD_CTRL)
629#define MX50_PAD_DISP_D13__FEC_TX_EN IOMUX_PAD(0x484, 0x1A4, 6, 0x0, 0, NO_PAD_CTRL)
630
631#define MX50_PAD_DISP_D14__DISP_D14 IOMUX_PAD(0x488, 0x1A8, 0, 0x734, 0, MX50_ELCDIF_PAD_CTRL)
632#define MX50_PAD_DISP_D14__GPIO_2_14 IOMUX_PAD(0x488, 0x1A8, 1, 0x0, 0, NO_PAD_CTRL)
633#define MX50_PAD_DISP_D14__NANDF_RDY0 IOMUX_PAD(0x488, 0x1A8, 2, 0x7b4, 1, NO_PAD_CTRL)
634#define MX50_PAD_DISP_D14__SD1_WP IOMUX_PAD(0x488, 0x1A8, 3, 0x0, 0, MX50_SD_PAD_CTRL)
635#define MX50_PAD_DISP_D14__SD4_WP IOMUX_PAD(0x488, 0x1A8, 4, 0x0, 0, MX50_SD_PAD_CTRL)
636#define MX50_PAD_DISP_D14__KEY_COL7 IOMUX_PAD(0x488, 0x1A8, 5, 0x79c, 1, NO_PAD_CTRL)
637#define MX50_PAD_DISP_D14__FEC_TDAT1 IOMUX_PAD(0x488, 0x1A8, 6, 0x0, 0, NO_PAD_CTRL)
638
639#define MX50_PAD_DISP_D15__DISP_D15 IOMUX_PAD(0x48C, 0x1AC, 0, 0x738, 0, MX50_ELCDIF_PAD_CTRL)
640#define MX50_PAD_DISP_D15__GPIO_2_15 IOMUX_PAD(0x48C, 0x1AC, 1, 0x0, 0, NO_PAD_CTRL)
641#define MX50_PAD_DISP_D15__NANDF_DQS IOMUX_PAD(0x48C, 0x1AC, 2, 0x7b0, 1, NO_PAD_CTRL)
642#define MX50_PAD_DISP_D15__SD3_RST IOMUX_PAD(0x48C, 0x1AC, 3, 0x0, 0, MX50_SD_PAD_CTRL)
643#define MX50_PAD_DISP_D15__SD4_CD IOMUX_PAD(0x48C, 0x1AC, 4, 0x0, 0, MX50_SD_PAD_CTRL)
644#define MX50_PAD_DISP_D15__KEY_ROW7 IOMUX_PAD(0x48C, 0x1AC, 5, 0x7ac, 1, NO_PAD_CTRL)
645#define MX50_PAD_DISP_D15__FEC_TDAT0 IOMUX_PAD(0x48C, 0x1AC, 6, 0x0, 0, NO_PAD_CTRL)
646
647#define MX50_PAD_EPDC_D0__EPDC_D0 IOMUX_PAD(0x54C, 0x1B0, 0, 0x0, 0, NO_PAD_CTRL)
648#define MX50_PAD_EPDC_D0__GPIO_3_0 IOMUX_PAD(0x54C, 0x1B0, 1, 0x0, 0, NO_PAD_CTRL)
649#define MX50_PAD_EPDC_D0__WEIM_D0 IOMUX_PAD(0x54C, 0x1B0, 2, 0x7ec, 1, NO_PAD_CTRL)
650#define MX50_PAD_EPDC_D0__ELCDIF_RS IOMUX_PAD(0x54C, 0x1B0, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
651#define MX50_PAD_EPDC_D0__ELCDIF_PIXCLK IOMUX_PAD(0x54C, 0x1B0, 4, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
652
653#define MX50_PAD_EPDC_D1__EPDC_D1 IOMUX_PAD(0x550, 0x1B4, 0, 0x0, 0, NO_PAD_CTRL)
654#define MX50_PAD_EPDC_D1__GPIO_3_1 IOMUX_PAD(0x550, 0x1B4, 1, 0x0, 0, NO_PAD_CTRL)
655#define MX50_PAD_EPDC_D1__WEIM_D1 IOMUX_PAD(0x550, 0x1B4, 2, 0x7f0, 1, NO_PAD_CTRL)
656#define MX50_PAD_EPDC_D1__ELCDIF_CS IOMUX_PAD(0x550, 0x1B4, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
657#define MX50_PAD_EPDC_D1__ELCDIF_EN IOMUX_PAD(0x550, 0x1B4, 4, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
658
659#define MX50_PAD_EPDC_D2__EPDC_D2 IOMUX_PAD(0x554, 0x1B8, 0, 0x0, 0, NO_PAD_CTRL)
660#define MX50_PAD_EPDC_D2__GPIO_3_2 IOMUX_PAD(0x554, 0x1B8, 1, 0x0, 0, NO_PAD_CTRL)
661#define MX50_PAD_EPDC_D2__WEIM_D2 IOMUX_PAD(0x554, 0x1B8, 2, 0x7f4, 1, NO_PAD_CTRL)
662#define MX50_PAD_EPDC_D2__ELCDIF_WR IOMUX_PAD(0x554, 0x1B8, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
663#define MX50_PAD_EPDC_D2__ELCDIF_VSYNC IOMUX_PAD(0x554, 0x1B8, 4, 0x73c, 2, MX50_ELCDIF_PAD_CTRL)
664
665#define MX50_PAD_EPDC_D3__EPDC_D3 IOMUX_PAD(0x558, 0x1BC, 0, 0x0, 0, NO_PAD_CTRL)
666#define MX50_PAD_EPDC_D3__GPIO_3_3 IOMUX_PAD(0x558, 0x1BC, 1, 0x0, 0, NO_PAD_CTRL)
667#define MX50_PAD_EPDC_D3__WEIM_D3 IOMUX_PAD(0x558, 0x1BC, 2, 0x7f8, 1, NO_PAD_CTRL)
668#define MX50_PAD_EPDC_D3__ELCDIF_RD IOMUX_PAD(0x558, 0x1BC, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
669#define MX50_PAD_EPDC_D3__ELCDIF_HSYNC IOMUX_PAD(0x558, 0x1BC, 4, 0x6f8, 3, MX50_ELCDIF_PAD_CTRL)
670
671#define MX50_PAD_EPDC_D4__EPDC_D4 IOMUX_PAD(0x55C, 0x1C0, 0, 0x0, 0, NO_PAD_CTRL)
672#define MX50_PAD_EPDC_D4__GPIO_3_4 IOMUX_PAD(0x55C, 0x1C0, 1, 0x0, 0, NO_PAD_CTRL)
673#define MX50_PAD_EPDC_D4__WEIM_D4 IOMUX_PAD(0x55C, 0x1C0, 2, 0x7fc, 1, NO_PAD_CTRL)
674
675#define MX50_PAD_EPDC_D5__EPDC_D5 IOMUX_PAD(0x560, 0x1C4, 0, 0x0, 0, NO_PAD_CTRL)
676#define MX50_PAD_EPDC_D5__GPIO_3_5 IOMUX_PAD(0x560, 0x1C4, 1, 0x0, 0, NO_PAD_CTRL)
677#define MX50_PAD_EPDC_D5__WEIM_D5 IOMUX_PAD(0x560, 0x1C4, 2, 0x800, 1, NO_PAD_CTRL)
678
679#define MX50_PAD_EPDC_D6__EPDC_D6 IOMUX_PAD(0x564, 0x1C8, 0, 0x0, 0, NO_PAD_CTRL)
680#define MX50_PAD_EPDC_D6__GPIO_3_6 IOMUX_PAD(0x564, 0x1C8, 1, 0x0, 0, NO_PAD_CTRL)
681#define MX50_PAD_EPDC_D6__WEIM_D6 IOMUX_PAD(0x564, 0x1C8, 2, 0x804, 1, NO_PAD_CTRL)
682
683#define MX50_PAD_EPDC_D7__EPDC_D7 IOMUX_PAD(0x568, 0x1CC, 0, 0x0, 0, NO_PAD_CTRL)
684#define MX50_PAD_EPDC_D7__GPIO_3_7 IOMUX_PAD(0x568, 0x1CC, 1, 0x0, 0, NO_PAD_CTRL)
685#define MX50_PAD_EPDC_D7__WEIM_D7 IOMUX_PAD(0x568, 0x1CC, 2, 0x808, 1, NO_PAD_CTRL)
686
687#define MX50_PAD_EPDC_D8__EPDC_D8 IOMUX_PAD(0x56C, 0x1D0, 0, 0x0, 0, NO_PAD_CTRL)
688#define MX50_PAD_EPDC_D8__GPIO_3_8 IOMUX_PAD(0x56C, 0x1D0, 1, 0x0, 0, NO_PAD_CTRL)
689#define MX50_PAD_EPDC_D8__WEIM_D8 IOMUX_PAD(0x56C, 0x1D0, 2, 0x80c, 2, NO_PAD_CTRL)
690#define MX50_PAD_EPDC_D8__ELCDIF_D24 IOMUX_PAD(0x56C, 0x1D0, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
691
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)
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, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
696
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)
699#define MX50_PAD_EPDC_D10__WEIM_D10 IOMUX_PAD(0x574, 0x1D8, 2, 0x814, 2, NO_PAD_CTRL)
700#define MX50_PAD_EPDC_D10__ELCDIF_D26 IOMUX_PAD(0x574, 0x1D8, 3, 0x0, 0, NO_PAD_CTRL)
701
702#define MX50_PAD_EPDC_D11__EPDC_D11 IOMUX_PAD(0x578, 0x1DC, 0, 0x0, 0, NO_PAD_CTRL)
703#define MX50_PAD_EPDC_D11__GPIO_3_11 IOMUX_PAD(0x578, 0x1DC, 1, 0x0, 0, NO_PAD_CTRL)
704#define MX50_PAD_EPDC_D11__WEIM_D11 IOMUX_PAD(0x578, 0x1DC, 2, 0x818, 2, NO_PAD_CTRL)
705#define MX50_PAD_EPDC_D11__ELCDIF_D27 IOMUX_PAD(0x578, 0x1DC, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
706
707#define MX50_PAD_EPDC_D12__EPDC_D12 IOMUX_PAD(0x57C, 0x1E0, 0, 0x0, 0, NO_PAD_CTRL)
708#define MX50_PAD_EPDC_D12__GPIO_3_12 IOMUX_PAD(0x57C, 0x1E0, 1, 0x0, 0, NO_PAD_CTRL)
709#define MX50_PAD_EPDC_D12__WEIM_D12 IOMUX_PAD(0x57C, 0x1E0, 2, 0x81c, 1, NO_PAD_CTRL)
710#define MX50_PAD_EPDC_D12__ELCDIF_D28 IOMUX_PAD(0x57C, 0x1E0, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
711
712#define MX50_PAD_EPDC_D13__EPDC_D13 IOMUX_PAD(0x580, 0x1E4, 0, 0x0, 0, NO_PAD_CTRL)
713#define MX50_PAD_EPDC_D13__GPIO_3_13 IOMUX_PAD(0x580, 0x1E4, 1, 0x0, 0, NO_PAD_CTRL)
714#define MX50_PAD_EPDC_D13__WEIM_D13 IOMUX_PAD(0x580, 0x1E4, 2, 0x820, 1, NO_PAD_CTRL)
715#define MX50_PAD_EPDC_D13__ELCDIF_D29 IOMUX_PAD(0x580, 0x1E4, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
716
717#define MX50_PAD_EPDC_D14__EPDC_D14 IOMUX_PAD(0x584, 0x1E8, 0, 0x0, 0, NO_PAD_CTRL)
718#define MX50_PAD_EPDC_D14__GPIO_3_14 IOMUX_PAD(0x584, 0x1E8, 1, 0x0, 0, NO_PAD_CTRL)
719#define MX50_PAD_EPDC_D14__WEIM_D14 IOMUX_PAD(0x584, 0x1E8, 2, 0x824, 1, NO_PAD_CTRL)
720#define MX50_PAD_EPDC_D14__ELCDIF_D30 IOMUX_PAD(0x584, 0x1E8, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
721#define MX50_PAD_EPDC_D14__AUD6_TXD IOMUX_PAD(0x584, 0x1E8, 4, 0x0, 0, NO_PAD_CTRL)
722
723#define MX50_PAD_EPDC_D15__EPDC_D15 IOMUX_PAD(0x588, 0x1EC, 0, 0x0, 0, NO_PAD_CTRL)
724#define MX50_PAD_EPDC_D15__GPIO_3_15 IOMUX_PAD(0x588, 0x1EC, 1, 0x0, 0, NO_PAD_CTRL)
725#define MX50_PAD_EPDC_D15__WEIM_D15 IOMUX_PAD(0x588, 0x1EC, 2, 0x828, 1, NO_PAD_CTRL)
726#define MX50_PAD_EPDC_D15__ELCDIF_D31 IOMUX_PAD(0x588, 0x1EC, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
727#define MX50_PAD_EPDC_D15__AUD6_TXC IOMUX_PAD(0x588, 0x1EC, 4, 0x0, 0, NO_PAD_CTRL)
728
729#define MX50_PAD_EPDC_GDCLK__EPDC_GDCLK IOMUX_PAD(0x58C, 0x1F0, 0, 0x0, 0, NO_PAD_CTRL)
730#define MX50_PAD_EPDC_GDCLK__GPIO_3_16 IOMUX_PAD(0x58C, 0x1F0, 1, 0x0, 0, NO_PAD_CTRL)
731#define MX50_PAD_EPDC_GDCLK__WEIM_D16 IOMUX_PAD(0x58C, 0x1F0, 2, 0x0, 0, NO_PAD_CTRL)
732#define MX50_PAD_EPDC_GDCLK__ELCDIF_D16 IOMUX_PAD(0x58C, 0x1F0, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
733#define MX50_PAD_EPDC_GDCLK__AUD6_TXFS IOMUX_PAD(0x58C, 0x1F0, 4, 0x0, 0, NO_PAD_CTRL)
734
735#define MX50_PAD_EPDC_GDSP__EPDC_GDSP IOMUX_PAD(0x590, 0x1F4, 0, 0x0, 0, NO_PAD_CTRL)
736#define MX50_PAD_EPDC_GDSP__GPIO_3_17 IOMUX_PAD(0x590, 0x1F4, 1, 0x0, 0, NO_PAD_CTRL)
737#define MX50_PAD_EPDC_GDSP__WEIM_D17 IOMUX_PAD(0x590, 0x1F4, 2, 0x0, 0, NO_PAD_CTRL)
738#define MX50_PAD_EPDC_GDSP__ELCDIF_D17 IOMUX_PAD(0x590, 0x1F4, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
739#define MX50_PAD_EPDC_GDSP__AUD6_RXD IOMUX_PAD(0x590, 0x1F4, 4, 0x0, 0, NO_PAD_CTRL)
740
741#define MX50_PAD_EPDC_GDOE__EPDC_GDOE IOMUX_PAD(0x594, 0x1F8, 0, 0x0, 0, NO_PAD_CTRL)
742#define MX50_PAD_EPDC_GDOE__GPIO_3_18 IOMUX_PAD(0x594, 0x1F8, 1, 0x0, 0, NO_PAD_CTRL)
743#define MX50_PAD_EPDC_GDOE__WEIM_D18 IOMUX_PAD(0x594, 0x1F8, 2, 0x0, 0, NO_PAD_CTRL)
744#define MX50_PAD_EPDC_GDOE__ELCDIF_D18 IOMUX_PAD(0x594, 0x1F8, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
745#define MX50_PAD_EPDC_GDOE__AUD6_RXC IOMUX_PAD(0x594, 0x1F8, 4, 0x0, 0, NO_PAD_CTRL)
746
747#define MX50_PAD_EPDC_GDRL__EPDC_GDRL IOMUX_PAD(0x598, 0x1FC, 0, 0x0, 0, NO_PAD_CTRL)
748#define MX50_PAD_EPDC_GDRL__GPIO_3_19 IOMUX_PAD(0x598, 0x1FC, 1, 0x0, 0, NO_PAD_CTRL)
749#define MX50_PAD_EPDC_GDRL__WEIM_D19 IOMUX_PAD(0x598, 0x1FC, 2, 0x0, 0, NO_PAD_CTRL)
750#define MX50_PAD_EPDC_GDRL__ELCDIF_D19 IOMUX_PAD(0x598, 0x1FC, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
751#define MX50_PAD_EPDC_GDRL__AUD6_RXFS IOMUX_PAD(0x598, 0x1FC, 4, 0x0, 0, NO_PAD_CTRL)
752
753#define MX50_PAD_EPDC_SDCLK__EPDC_SDCLK IOMUX_PAD(0x59C, 0x200, 0, 0x0, 0, NO_PAD_CTRL)
754#define MX50_PAD_EPDC_SDCLK__GPIO_3_20 IOMUX_PAD(0x59C, 0x200, 1, 0x0, 0, NO_PAD_CTRL)
755#define MX50_PAD_EPDC_SDCLK__WEIM_D20 IOMUX_PAD(0x59C, 0x200, 2, 0x0, 0, NO_PAD_CTRL)
756#define MX50_PAD_EPDC_SDCLK__ELCDIF_D20 IOMUX_PAD(0x59C, 0x200, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
757#define MX50_PAD_EPDC_SDCLK__AUD5_TXD IOMUX_PAD(0x59C, 0x200, 4, 0x0, 0, NO_PAD_CTRL)
758
759#define MX50_PAD_EPDC_SDOEZ__EPDC_SDOEZ IOMUX_PAD(0x5A0, 0x204, 0, 0x0, 0, NO_PAD_CTRL)
760#define MX50_PAD_EPDC_SDOEZ__GPIO_3_21 IOMUX_PAD(0x5A0, 0x204, 1, 0x0, 0, NO_PAD_CTRL)
761#define MX50_PAD_EPDC_SDOEZ__WEIM_D21 IOMUX_PAD(0x5A0, 0x204, 2, 0x0, 0, NO_PAD_CTRL)
762#define MX50_PAD_EPDC_SDOEZ__ELCDIF_D21 IOMUX_PAD(0x5A0, 0x204, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
763#define MX50_PAD_EPDC_SDOEZ__AUD5_TXC IOMUX_PAD(0x5A0, 0x204, 4, 0x0, 0, NO_PAD_CTRL)
764
765#define MX50_PAD_EPDC_SDOED__EPDC_SDOED IOMUX_PAD(0x5A4, 0x208, 0, 0x0, 0, NO_PAD_CTRL)
766#define MX50_PAD_EPDC_SDOED__GPIO_3_22 IOMUX_PAD(0x5A4, 0x208, 1, 0x0, 0, NO_PAD_CTRL)
767#define MX50_PAD_EPDC_SDOED__WEIM_D22 IOMUX_PAD(0x5A4, 0x208, 2, 0x0, 0, NO_PAD_CTRL)
768#define MX50_PAD_EPDC_SDOED__ELCDIF_D22 IOMUX_PAD(0x5A4, 0x208, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
769#define MX50_PAD_EPDC_SDOED__AUD5_TXFS IOMUX_PAD(0x5A4, 0x208, 4, 0x0, 0, NO_PAD_CTRL)
770
771#define MX50_PAD_EPDC_SDOE__EPDC_SDOE IOMUX_PAD(0x5A8, 0x20C, 0, 0x0, 0, NO_PAD_CTRL)
772#define MX50_PAD_EPDC_SDOE__GPIO_3_23 IOMUX_PAD(0x5A8, 0x20C, 1, 0x0, 0, NO_PAD_CTRL)
773#define MX50_PAD_EPDC_SDOE__WEIM_D23 IOMUX_PAD(0x5A8, 0x20C, 2, 0x0, 0, NO_PAD_CTRL)
774#define MX50_PAD_EPDC_SDOE__ELCDIF_D23 IOMUX_PAD(0x5A8, 0x20C, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
775#define MX50_PAD_EPDC_SDOE__AUD5_RXD IOMUX_PAD(0x5A8, 0x20C, 4, 0x0, 0, NO_PAD_CTRL)
776
777#define MX50_PAD_EPDC_SDLE__EPDC_SDLE IOMUX_PAD(0x5AC, 0x210, 0, 0x0, 0, NO_PAD_CTRL)
778#define MX50_PAD_EPDC_SDLE__GPIO_3_24 IOMUX_PAD(0x5AC, 0x210, 1, 0x0, 0, NO_PAD_CTRL)
779#define MX50_PAD_EPDC_SDLE__WEIM_D24 IOMUX_PAD(0x5AC, 0x210, 2, 0x0, 0, NO_PAD_CTRL)
780#define MX50_PAD_EPDC_SDLE__ELCDIF_D8 IOMUX_PAD(0x5AC, 0x210, 3, 0x71c, 1, MX50_ELCDIF_PAD_CTRL)
781#define MX50_PAD_EPDC_SDLE__AUD5_RXC IOMUX_PAD(0x5AC, 0x210, 4, 0x0, 0, NO_PAD_CTRL)
782
783#define MX50_PAD_EPDC_SDCLKN__EPDC_SDCLKN IOMUX_PAD(0x5B0, 0x214, 0, 0x0, 0, NO_PAD_CTRL)
784#define MX50_PAD_EPDC_SDCLKN__GPIO_3_25 IOMUX_PAD(0x5B0, 0x214, 1, 0x0, 0, NO_PAD_CTRL)
785#define MX50_PAD_EPDC_SDCLKN__WEIM_D25 IOMUX_PAD(0x5B0, 0x214, 2, 0x0, 0, NO_PAD_CTRL)
786#define MX50_PAD_EPDC_SDCLKN__ELCDIF_D9 IOMUX_PAD(0x5B0, 0x214, 3, 0x720, 1, MX50_ELCDIF_PAD_CTRL)
787#define MX50_PAD_EPDC_SDCLKN__AUD5_RXFS IOMUX_PAD(0x5B0, 0x214, 4, 0x0, 0, NO_PAD_CTRL)
788
789#define MX50_PAD_EPDC_SDSHR__EPDC_SDSHR IOMUX_PAD(0x5B4, 0x218, 0, 0x0, 0, NO_PAD_CTRL)
790#define MX50_PAD_EPDC_SDSHR__GPIO_3_26 IOMUX_PAD(0x5B4, 0x218, 1, 0x0, 0, NO_PAD_CTRL)
791#define MX50_PAD_EPDC_SDSHR__WEIM_D26 IOMUX_PAD(0x5B4, 0x218, 2, 0x0, 0, NO_PAD_CTRL)
792#define MX50_PAD_EPDC_SDSHR__ELCDIF_D10 IOMUX_PAD(0x5B4, 0x218, 3, 0x724, 1, MX50_ELCDIF_PAD_CTRL)
793#define MX50_PAD_EPDC_SDSHR__AUD4_TXD IOMUX_PAD(0x5B4, 0x218, 4, 0x6c8, 1, NO_PAD_CTRL)
794
795#define MX50_PAD_EPDC_PWRCOM__EPDC_PWRCOM IOMUX_PAD(0x5B8, 0x21C, 0, 0x0, 0, NO_PAD_CTRL)
796#define MX50_PAD_EPDC_PWRCOM__GPIO_3_27 IOMUX_PAD(0x5B8, 0x21C, 1, 0x0, 0, NO_PAD_CTRL)
797#define MX50_PAD_EPDC_PWRCOM__WEIM_D27 IOMUX_PAD(0x5B8, 0x21C, 2, 0x0, 0, NO_PAD_CTRL)
798#define MX50_PAD_EPDC_PWRCOM__ELCDIF_D11 IOMUX_PAD(0x5B8, 0x21C, 3, 0x728, 1, MX50_ELCDIF_PAD_CTRL)
799#define MX50_PAD_EPDC_PWRCOM__AUD4_TXC IOMUX_PAD(0x5B8, 0x21C, 4, 0x6d4, 1, NO_PAD_CTRL)
800
801#define MX50_PAD_EPDC_PWRSTAT__EPDC_PWRSTAT IOMUX_PAD(0x5BC, 0x220, 0, 0x0, 0, NO_PAD_CTRL)
802#define MX50_PAD_EPDC_PWRSTAT__GPIO_3_28 IOMUX_PAD(0x5BC, 0x220, 1, 0x0, 0, NO_PAD_CTRL)
803#define MX50_PAD_EPDC_PWRSTAT__WEIM_D28 IOMUX_PAD(0x5BC, 0x220, 2, 0x0, 0, NO_PAD_CTRL)
804#define MX50_PAD_EPDC_PWRSTAT__ELCDIF_D12 IOMUX_PAD(0x5BC, 0x220, 3, 0x72c, 1, MX50_ELCDIF_PAD_CTRL)
805#define MX50_PAD_EPDC_PWRSTAT__AUD4_TXFS IOMUX_PAD(0x5BC, 0x220, 4, 0x6d8, 1, NO_PAD_CTRL)
806
807#define MX50_PAD_EPDC_PWRCTRL0__EPDC_PWRCTRL0 IOMUX_PAD(0x5C0, 0x224, 0, 0x0, 0, NO_PAD_CTRL)
808#define MX50_PAD_EPDC_PWRCTRL0__GPIO_3_29 IOMUX_PAD(0x5C0, 0x224, 1, 0x0, 0, NO_PAD_CTRL)
809#define MX50_PAD_EPDC_PWRCTRL0__WEIM_D29 IOMUX_PAD(0x5C0, 0x224, 2, 0x0, 0, NO_PAD_CTRL)
810#define MX50_PAD_EPDC_PWRCTRL0__ELCDIF_D13 IOMUX_PAD(0x5C0, 0x224, 3, 0x730, 1, MX50_ELCDIF_PAD_CTRL)
811#define MX50_PAD_EPDC_PWRCTRL0__AUD4_RXD IOMUX_PAD(0x5C0, 0x224, 4, 0x6c4, 1, NO_PAD_CTRL)
812
813#define MX50_PAD_EPDC_PWRCTRL1__EPDC_PWRCTRL1 IOMUX_PAD(0x5C4, 0x228, 0, 0x0, 0, NO_PAD_CTRL)
814#define MX50_PAD_EPDC_PWRCTRL1__GPIO_3_30 IOMUX_PAD(0x5C4, 0x228, 1, 0x0, 0, NO_PAD_CTRL)
815#define MX50_PAD_EPDC_PWRCTRL1__WEIM_D30 IOMUX_PAD(0x5C4, 0x228, 2, 0x0, 0, NO_PAD_CTRL)
816#define MX50_PAD_EPDC_PWRCTRL1__ELCDIF_D14 IOMUX_PAD(0x5C4, 0x228, 3, 0x734, 1, MX50_ELCDIF_PAD_CTRL)
817#define MX50_PAD_EPDC_PWRCTRL1__AUD4_RXC IOMUX_PAD(0x5C4, 0x228, 4, 0x6cc, 1, NO_PAD_CTRL)
818
819#define MX50_PAD_EPDC_PWRCTRL2__EPDC_PWRCTRL2 IOMUX_PAD(0x5C8, 0x22C, 0, 0x0, 0, NO_PAD_CTRL)
820#define MX50_PAD_EPDC_PWRCTRL2__GPIO_3_31 IOMUX_PAD(0x5C8, 0x22C, 1, 0x0, 0, NO_PAD_CTRL)
821#define MX50_PAD_EPDC_PWRCTRL2__WEIM_D31 IOMUX_PAD(0x5C8, 0x22C, 2, 0x0, 0, NO_PAD_CTRL)
822#define MX50_PAD_EPDC_PWRCTRL2__ELCDIF_D15 IOMUX_PAD(0x5C8, 0x22C, 3, 0x738, 1, MX50_ELCDIF_PAD_CTRL)
823#define MX50_PAD_EPDC_PWRCTRL2__AUD4_RXFS IOMUX_PAD(0x5C8, 0x22C, 4, 0x6d0, 1, NO_PAD_CTRL)
824#define MX50_PAD_EPDC_PWRCTRL2__SDMA_EXT0 IOMUX_PAD(0x5C8, 0x22C, 6, 0x7b8, 1, NO_PAD_CTRL)
825
826#define MX50_PAD_EPDC_PWRCTRL3__PWRCTRL3 IOMUX_PAD(0x5CC, 0x230, 0, 0x0, 0, NO_PAD_CTRL)
827#define MX50_PAD_EPDC_PWRCTRL3__GPIO_4_20 IOMUX_PAD(0x5CC, 0x230, 1, 0x0, 0, NO_PAD_CTRL)
828#define MX50_PAD_EPDC_PWRCTRL3__WEIM_EB2 IOMUX_PAD(0x5CC, 0x230, 2, 0x0, 0, NO_PAD_CTRL)
829#define MX50_PAD_EPDC_PWRCTRL3__SDMA_EXT1 IOMUX_PAD(0x5CC, 0x230, 6, 0x7bc, 1, NO_PAD_CTRL)
830
831#define MX50_PAD_EPDC_VCOM0__EPDC_VCOM0 IOMUX_PAD(0x5D0, 0x234, 0, 0x0, 0, NO_PAD_CTRL)
832#define MX50_PAD_EPDC_VCOM0__GPIO_4_21 IOMUX_PAD(0x5D0, 0x234, 1, 0x0, 0, NO_PAD_CTRL)
833#define MX50_PAD_EPDC_VCOM0__WEIM_EB3 IOMUX_PAD(0x5D0, 0x234, 2, 0x0, 0, NO_PAD_CTRL)
834
835#define MX50_PAD_EPDC_VCOM1__EPDC_VCOM1 IOMUX_PAD(0x5D4, 0x238, 0, 0x0, 0, NO_PAD_CTRL)
836#define MX50_PAD_EPDC_VCOM1__GPIO_4_22 IOMUX_PAD(0x5D4, 0x238, 1, 0x0, 0, NO_PAD_CTRL)
837#define MX50_PAD_EPDC_VCOM1__WEIM_CS3 IOMUX_PAD(0x5D4, 0x238, 2, 0x0, 0, NO_PAD_CTRL)
838
839#define MX50_PAD_EPDC_BDR0__EPDC_BDR0 IOMUX_PAD(0x5D8, 0x23C, 0, 0x0, 0, NO_PAD_CTRL)
840#define MX50_PAD_EPDC_BDR0__GPIO_4_23 IOMUX_PAD(0x5D8, 0x23C, 1, 0x0, 0, NO_PAD_CTRL)
841#define MX50_PAD_EPDC_BDR0__ELCDIF_D7 IOMUX_PAD(0x5D8, 0x23C, 3, 0x718, 1, MX50_ELCDIF_PAD_CTRL)
842
843#define MX50_PAD_EPDC_BDR1__EPDC_BDR1 IOMUX_PAD(0x5DC, 0x240, 0, 0x0, 0, NO_PAD_CTRL)
844#define MX50_PAD_EPDC_BDR1__GPIO_4_24 IOMUX_PAD(0x5DC, 0x240, 1, 0x0, 0, NO_PAD_CTRL)
845#define MX50_PAD_EPDC_BDR1__ELCDIF_D6 IOMUX_PAD(0x5DC, 0x240, 3, 0x714, 1, MX50_ELCDIF_PAD_CTRL)
846
847#define MX50_PAD_EPDC_SDCE0__EPDC_SDCE0 IOMUX_PAD(0x5E0, 0x244, 0, 0x0, 0, NO_PAD_CTRL)
848#define MX50_PAD_EPDC_SDCE0__GPIO_4_25 IOMUX_PAD(0x5E0, 0x244, 1, 0x0, 0, NO_PAD_CTRL)
849#define MX50_PAD_EPDC_SDCE0__ELCDIF_D5 IOMUX_PAD(0x5E0, 0x244, 3, 0x710, 1, MX50_ELCDIF_PAD_CTRL)
850
851#define MX50_PAD_EPDC_SDCE1__EPDC_SDCE1 IOMUX_PAD(0x5E4, 0x248, 0, 0x0, 0, NO_PAD_CTRL)
852#define MX50_PAD_EPDC_SDCE1__GPIO_4_26 IOMUX_PAD(0x5E4, 0x248, 1, 0x0, 0, NO_PAD_CTRL)
853#define MX50_PAD_EPDC_SDCE1__ELCDIF_D4 IOMUX_PAD(0x5E4, 0x248, 2, 0x70c, 1, MX50_ELCDIF_PAD_CTRL)
854
855#define MX50_PAD_EPDC_SDCE2__EPDC_SDCE2 IOMUX_PAD(0x5E8, 0x24C, 0, 0x0, 0, NO_PAD_CTRL)
856#define MX50_PAD_EPDC_SDCE2__GPIO_4_27 IOMUX_PAD(0x5E8, 0x24C, 1, 0x0, 0, NO_PAD_CTRL)
857#define MX50_PAD_EPDC_SDCE2__ELCDIF_DAT3 IOMUX_PAD(0x5E8, 0x24C, 3, 0x708, 1, MX50_ELCDIF_PAD_CTRL)
858
859#define MX50_PAD_EPDC_SDCE3__EPDC_SDCE3 IOMUX_PAD(0x5EC, 0x250, 0, 0x0, 0, NO_PAD_CTRL)
860#define MX50_PAD_EPDC_SDCE3__GPIO_4_28 IOMUX_PAD(0x5EC, 0x250, 1, 0x0, 0, NO_PAD_CTRL)
861#define MX50_PAD_EPDC_SDCE3__ELCDIF_D2 IOMUX_PAD(0x5EC, 0x250, 3, 0x704, 1, MX50_ELCDIF_PAD_CTRL)
862
863#define MX50_PAD_EPDC_SDCE4__EPDC_SDCE4 IOMUX_PAD(0x5F0, 0x254, 0, 0x0, 0, NO_PAD_CTRL)
864#define MX50_PAD_EPDC_SDCE4__GPIO_4_29 IOMUX_PAD(0x5F0, 0x254, 1, 0x0, 0, NO_PAD_CTRL)
865#define MX50_PAD_EPDC_SDCE4__ELCDIF_D1 IOMUX_PAD(0x5F0, 0x254, 3, 0x700, 1, MX50_ELCDIF_PAD_CTRL)
866
867#define MX50_PAD_EPDC_SDCE5__EPDC_SDCE5 IOMUX_PAD(0x5F4, 0x258, 0, 0x0, 0, NO_PAD_CTRL)
868#define MX50_PAD_EPDC_SDCE5__GPIO_4_30 IOMUX_PAD(0x5F4, 0x258, 1, 0x0, 0, NO_PAD_CTRL)
869#define MX50_PAD_EPDC_SDCE5__ELCDIF_D0 IOMUX_PAD(0x5F4, 0x258, 3, 0x6fc, 1, MX50_ELCDIF_PAD_CTRL)
870
871#define MX50_PAD_EIM_DA0__WEIM_A0 IOMUX_PAD(0x5F8, 0x25C, 0, 0x0, 0, NO_PAD_CTRL)
872#define MX50_PAD_EIM_DA0__GPIO_1_0 IOMUX_PAD(0x5F8, 0x25C, 1, 0x0, 0, NO_PAD_CTRL)
873#define MX50_PAD_EIM_DA0__KEY_COL4 IOMUX_PAD(0x5f8, 0x25C, 3, 0x790, 2, NO_PAD_CTRL)
874
875#define MX50_PAD_EIM_DA1__WEIM_A1 IOMUX_PAD(0x5FC, 0x260, 0, 0x0, 0, NO_PAD_CTRL)
876#define MX50_PAD_EIM_DA1__GPIO_1_1 IOMUX_PAD(0x5FC, 0x260, 1, 0x0, 0, NO_PAD_CTRL)
877#define MX50_PAD_EIM_DA1__KEY_ROW4 IOMUX_PAD(0x5fc, 0x260, 3, 0x7a0, 2, MX50_KEYPAD_CTRL)
878
879#define MX50_PAD_EIM_DA2__WEIM_A2 IOMUX_PAD(0x600, 0x264, 0, 0x0, 0, NO_PAD_CTRL)
880#define MX50_PAD_EIM_DA2__GPIO_1_2 IOMUX_PAD(0x600, 0x264, 1, 0x0, 0, NO_PAD_CTRL)
881#define MX50_PAD_EIM_DA2__KEY_COL5 IOMUX_PAD(0x600, 0x264, 3, 0x794, 2, NO_PAD_CTRL)
882
883#define MX50_PAD_EIM_DA3__WEIM_A3 IOMUX_PAD(0x604, 0x268, 0, 0x0, 0, NO_PAD_CTRL)
884#define MX50_PAD_EIM_DA3__GPIO_1_3 IOMUX_PAD(0x604, 0x268, 1, 0x0, 0, NO_PAD_CTRL)
885#define MX50_PAD_EIM_DA3__KEY_ROW5 IOMUX_PAD(0x604, 0x268, 3, 0x7a4, 2, MX50_KEYPAD_CTRL)
886
887#define MX50_PAD_EIM_DA4__WEIM_A4 IOMUX_PAD(0x608, 0x26C, 0, 0x0, 0, NO_PAD_CTRL)
888#define MX50_PAD_EIM_DA4__GPIO_1_4 IOMUX_PAD(0x608, 0x26C, 1, 0x0, 0, NO_PAD_CTRL)
889#define MX50_PAD_EIM_DA4__KEY_COL6 IOMUX_PAD(0x608, 0x26C, 3, 0x798, 2, NO_PAD_CTRL)
890
891#define MX50_PAD_EIM_DA5__WEIM_A5 IOMUX_PAD(0x60C, 0x270, 0, 0x0, 0, NO_PAD_CTRL)
892#define MX50_PAD_EIM_DA5__GPIO_1_5 IOMUX_PAD(0x60C, 0x270, 1, 0x0, 0, NO_PAD_CTRL)
893#define MX50_PAD_EIM_DA5__KEY_ROW6 IOMUX_PAD(0x60C, 0x270, 3, 0x7a8, 2, MX50_KEYPAD_CTRL)
894
895#define MX50_PAD_EIM_DA6__WEIM_A6 IOMUX_PAD(0x610, 0x274, 0, 0x0, 0, NO_PAD_CTRL)
896#define MX50_PAD_EIM_DA6__GPIO_1_6 IOMUX_PAD(0x610, 0x274, 1, 0x0, 0, NO_PAD_CTRL)
897#define MX50_PAD_EIM_DA6__KEY_COL7 IOMUX_PAD(0x610, 0x274, 3, 0x79c, 2, NO_PAD_CTRL)
898
899#define MX50_PAD_EIM_DA7__WEIM_A7 IOMUX_PAD(0x614, 0x278, 0, 0x0, 0, NO_PAD_CTRL)
900#define MX50_PAD_EIM_DA7__GPIO_1_7 IOMUX_PAD(0x614, 0x278, 1, 0x0, 0, NO_PAD_CTRL)
901#define MX50_PAD_EIM_DA7__KEY_ROW7 IOMUX_PAD(0x614, 0x278, 3, 0x7ac, 2, MX50_KEYPAD_CTRL)
902
903#define MX50_PAD_EIM_DA8__WEIM_A8 IOMUX_PAD(0x618, 0x27C, 0, 0x0, 0, NO_PAD_CTRL)
904#define MX50_PAD_EIM_DA8__GPIO_1_8 IOMUX_PAD(0x618, 0x27C, 1, 0x0, 0, NO_PAD_CTRL)
905#define MX50_PIN_EIM_DA8__NANDF_CLE IOMUX_PAD(0x618, 0x27C, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
906
907#define MX50_PAD_EIM_DA9__WEIM_A9 IOMUX_PAD(0x61C, 0x280, 0, 0x0, 0, NO_PAD_CTRL)
908#define MX50_PAD_EIM_DA9__GPIO_1_9 IOMUX_PAD(0x61C, 0x280, 1, 0x0, 0, NO_PAD_CTRL)
909#define MX50_PIN_EIM_DA9__NANDF_ALE IOMUX_PAD(0x61C, 0x280, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
910
911#define MX50_PAD_EIM_DA10__WEIM_A10 IOMUX_PAD(0x620, 0x284, 0, 0x0, 0, NO_PAD_CTRL)
912#define MX50_PAD_EIM_DA10__GPIO_1_10 IOMUX_PAD(0x620, 0x284, 1, 0x0, 0, NO_PAD_CTRL)
913#define MX50_PIN_EIM_DA10__NANDF_CE0 IOMUX_PAD(0x620, 0x284, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
914
915#define MX50_PAD_EIM_DA11__WEIM_A11 IOMUX_PAD(0x624, 0x288, 0, 0x0, 0, NO_PAD_CTRL)
916#define MX50_PAD_EIM_DA11__GPIO_1_11 IOMUX_PAD(0x624, 0x288, 1, 0x0, 0, NO_PAD_CTRL)
917#define MX50_PIN_EIM_DA11__NANDF_CE1 IOMUX_PAD(0x624, 0x288, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
918
919#define MX50_PAD_EIM_DA12__WEIM_A12 IOMUX_PAD(0x628, 0x28C, 0, 0x0, 0, NO_PAD_CTRL)
920#define MX50_PAD_EIM_DA12__GPIO_1_12 IOMUX_PAD(0x628, 0x28C, 1, 0x0, 0, NO_PAD_CTRL)
921#define MX50_PIN_EIM_DA12__NANDF_CE2 IOMUX_PAD(0x628, 0x28C, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
922#define MX50_PAD_EIM_DA12__EPDC_SDCE6 IOMUX_PAD(0x628, 0x28C, 3, 0x0, 0, NO_PAD_CTRL)
923
924#define MX50_PAD_EIM_DA13__WEIM_A13 IOMUX_PAD(0x62C, 0x290, 0, 0x0, 0, NO_PAD_CTRL)
925#define MX50_PAD_EIM_DA13__GPIO_1_13 IOMUX_PAD(0x62C, 0x290, 1, 0x0, 0, NO_PAD_CTRL)
926#define MX50_PIN_EIM_DA13__NANDF_CE3 IOMUX_PAD(0x62C, 0x290, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
927#define MX50_PIN_EIM_DA13__EPDC_SDCE7 IOMUX_PAD(0x62C, 0x290, 3, 0x0, 0, NO_PAD_CTRL)
928
929#define MX50_PAD_EIM_DA14__WEIM_A14 IOMUX_PAD(0x630, 0x294, 0, 0x0, 0, NO_PAD_CTRL)
930#define MX50_PAD_EIM_DA14__GPIO_1_14 IOMUX_PAD(0x630, 0x294, 1, 0x0, 0, NO_PAD_CTRL)
931#define MX50_PAD_EIM_DA14__NANDF_READY IOMUX_PAD(0x630, 0x294, 2, 0x7B4, 2, PAD_CTL_PKE | \
932 PAD_CTL_PUE | PAD_CTL_PUS_100K_UP)
933#define MX50_PAD_EIM_DA14__EPDC_SDCE8 IOMUX_PAD(0x630, 0x294, 3, 0x0, 0, NO_PAD_CTRL)
934
935#define MX50_PAD_EIM_DA15__WEIM_A15 IOMUX_PAD(0x634, 0x298, 0, 0x0, 0, NO_PAD_CTRL)
936#define MX50_PAD_EIM_DA15__GPIO_1_15 IOMUX_PAD(0x634, 0x298, 1, 0x0, 0, NO_PAD_CTRL)
937#define MX50_PIN_EIM_DA15__NANDF_DQS IOMUX_PAD(0x634, 0x298, 2, 0x7B0, 2, PAD_CTL_DSE_HIGH)
938#define MX50_PAD_EIM_DA15__EPDC_SDCE9 IOMUX_PAD(0x634, 0x298, 3, 0x0, 0, NO_PAD_CTRL)
939
940#define MX50_PAD_EIM_CS2__WEIM_CS2 IOMUX_PAD(0x638, 0x29C, 0, 0x0, 0, NO_PAD_CTRL)
941#define MX50_PAD_EIM_CS2__GPIO_1_16 IOMUX_PAD(0x638, 0x29C, 1, 0x0, 0, NO_PAD_CTRL)
942#define MX50_PAD_EIM_CS2__WEIM_A27 IOMUX_PAD(0x638, 0x29C, 2, 0x0, 0, NO_PAD_CTRL)
943
944#define MX50_PAD_EIM_CS1__WEIM_CS1 IOMUX_PAD(0x63C, 0x2A0, 0, 0x0, 0, NO_PAD_CTRL)
945#define MX50_PAD_EIM_CS1__GPIO_1_17 IOMUX_PAD(0x63C, 0x2A0, 1, 0x0, 0, NO_PAD_CTRL)
946
947#define MX50_PAD_EIM_CS0__WEIM_CS0 IOMUX_PAD(0x640, 0x2A4, 0, 0x0, 0, NO_PAD_CTRL)
948#define MX50_PAD_EIM_CS0__GPIO_1_18 IOMUX_PAD(0x640, 0x2A4, 1, 0x0, 0, NO_PAD_CTRL)
949
950#define MX50_PAD_EIM_EB0__WEIM_EB0 IOMUX_PAD(0x644, 0x2A8, 0, 0x0, 0, NO_PAD_CTRL)
951#define MX50_PAD_EIM_EB0__GPIO_1_19 IOMUX_PAD(0x644, 0x2A8, 1, 0x0, 0, NO_PAD_CTRL)
952
953#define MX50_PAD_EIM_EB1__WEIM_EB1 IOMUX_PAD(0x648, 0x2AC, 0, 0x0, 0, NO_PAD_CTRL)
954#define MX50_PAD_EIM_EB1__GPIO_1_20 IOMUX_PAD(0x648, 0x2AC, 1, 0x0, 0, NO_PAD_CTRL)
955
956#define MX50_PAD_EIM_WAIT__WEIM_WAIT IOMUX_PAD(0x64C, 0x2B0, 0, 0x0, 0, NO_PAD_CTRL)
957#define MX50_PAD_EIM_WAIT__GPIO_1_21 IOMUX_PAD(0x64C, 0x2B0, 1, 0x0, 0, NO_PAD_CTRL)
958
959#define MX50_PAD_EIM_BCLK__WEIM_BCLK IOMUX_PAD(0x650, 0x2B4, 0, 0x0, 0, NO_PAD_CTRL)
960#define MX50_PAD_EIM_BCLK__GPIO_1_22 IOMUX_PAD(0x650, 0x2B4, 1, 0x0, 0, NO_PAD_CTRL)
961
962#define MX50_PAD_EIM_RDY__WEIM_RDY IOMUX_PAD(0x654, 0x2B8, 0, 0x0, 0, NO_PAD_CTRL)
963#define MX50_PAD_EIM_RDY__GPIO_1_23 IOMUX_PAD(0x654, 0x2B8, 1, 0x0, 0, NO_PAD_CTRL)
964
965#define MX50_PAD_EIM_OE__WEIM_OE IOMUX_PAD(0x658, 0x2BC, 0, 0x0, 0, NO_PAD_CTRL)
966#define MX50_PAD_EIM_OE__GPIO_1_24 IOMUX_PAD(0x658, 0x2BC, 1, 0x0, 0, NO_PAD_CTRL)
967
968#define MX50_PAD_EIM_RW__WEIM_RW IOMUX_PAD(0x65C, 0x2C0, 0, 0x0, 0, NO_PAD_CTRL)
969#define MX50_PAD_EIM_RW__GPIO_1_25 IOMUX_PAD(0x65C, 0x2C0, 1, 0x0, 0, NO_PAD_CTRL)
970
971#define MX50_PAD_EIM_LBA__WEIM_LBA IOMUX_PAD(0x660, 0x2C4, 0, 0x0, 0, NO_PAD_CTRL)
972#define MX50_PAD_EIM_LBA__GPIO_1_26 IOMUX_PAD(0x660, 0x2C4, 1, 0x0, 0, NO_PAD_CTRL)
973
974#define MX50_PAD_EIM_CRE__WEIM_CRE IOMUX_PAD(0x664, 0x2C8, 0, 0x0, 0, NO_PAD_CTRL)
975#define MX50_PAD_EIM_CRE__GPIO_1_27 IOMUX_PAD(0x664, 0x2C8, 1, 0x0, 0, NO_PAD_CTRL)
976
977#endif /* __MACH_IOMUX_MX50_H__ */
diff --git a/arch/arm/mach-imx/lluart.c b/arch/arm/mach-imx/lluart.c
deleted file mode 100644
index 2fdc9bf2fb5e..000000000000
--- a/arch/arm/mach-imx/lluart.c
+++ /dev/null
@@ -1,47 +0,0 @@
1/*
2 * Copyright 2011 Freescale Semiconductor, Inc.
3 * Copyright 2011 Linaro Ltd.
4 *
5 * The code contained herein is licensed under the GNU General Public
6 * License. You may obtain a copy of the GNU General Public License
7 * Version 2 or later at the following locations:
8 *
9 * http://www.opensource.org/licenses/gpl-license.html
10 * http://www.gnu.org/copyleft/gpl.html
11 */
12
13#include <linux/init.h>
14#include <asm/page.h>
15#include <asm/sizes.h>
16#include <asm/mach/map.h>
17
18#include "hardware.h"
19
20#define IMX6Q_UART1_BASE_ADDR 0x02020000
21#define IMX6Q_UART2_BASE_ADDR 0x021e8000
22#define IMX6Q_UART3_BASE_ADDR 0x021ec000
23#define IMX6Q_UART4_BASE_ADDR 0x021f0000
24#define IMX6Q_UART5_BASE_ADDR 0x021f4000
25
26/*
27 * IMX6Q_UART_BASE_ADDR is put in the middle to force the expansion
28 * of IMX6Q_UART##n##_BASE_ADDR.
29 */
30#define IMX6Q_UART_BASE_ADDR(n) IMX6Q_UART##n##_BASE_ADDR
31#define IMX6Q_UART_BASE(n) IMX6Q_UART_BASE_ADDR(n)
32#define IMX6Q_DEBUG_UART_BASE IMX6Q_UART_BASE(CONFIG_DEBUG_IMX6Q_UART_PORT)
33
34static struct map_desc imx_lluart_desc = {
35#ifdef CONFIG_DEBUG_IMX6Q_UART
36 .virtual = IMX_IO_P2V(IMX6Q_DEBUG_UART_BASE),
37 .pfn = __phys_to_pfn(IMX6Q_DEBUG_UART_BASE),
38 .length = 0x4000,
39 .type = MT_DEVICE,
40#endif
41};
42
43void __init imx_lluart_map_io(void)
44{
45 if (imx_lluart_desc.virtual)
46 iotable_init(&imx_lluart_desc, 1);
47}
diff --git a/arch/arm/mach-imx/mach-apf9328.c b/arch/arm/mach-imx/mach-apf9328.c
index 5c9bd2c66e6d..067580b2969b 100644
--- a/arch/arm/mach-imx/mach-apf9328.c
+++ b/arch/arm/mach-imx/mach-apf9328.c
@@ -137,17 +137,13 @@ static void __init apf9328_timer_init(void)
137 mx1_clocks_init(32768); 137 mx1_clocks_init(32768);
138} 138}
139 139
140static struct sys_timer apf9328_timer = {
141 .init = apf9328_timer_init,
142};
143
144MACHINE_START(APF9328, "Armadeus APF9328") 140MACHINE_START(APF9328, "Armadeus APF9328")
145 /* Maintainer: Gwenhael Goavec-Merou, ARMadeus Systems */ 141 /* Maintainer: Gwenhael Goavec-Merou, ARMadeus Systems */
146 .map_io = mx1_map_io, 142 .map_io = mx1_map_io,
147 .init_early = imx1_init_early, 143 .init_early = imx1_init_early,
148 .init_irq = mx1_init_irq, 144 .init_irq = mx1_init_irq,
149 .handle_irq = imx1_handle_irq, 145 .handle_irq = imx1_handle_irq,
150 .timer = &apf9328_timer, 146 .init_time = apf9328_timer_init,
151 .init_machine = apf9328_init, 147 .init_machine = apf9328_init,
152 .restart = mxc_restart, 148 .restart = mxc_restart,
153MACHINE_END 149MACHINE_END
diff --git a/arch/arm/mach-imx/mach-armadillo5x0.c b/arch/arm/mach-imx/mach-armadillo5x0.c
index 59bd6b06a6b5..368a6e3f5926 100644
--- a/arch/arm/mach-imx/mach-armadillo5x0.c
+++ b/arch/arm/mach-imx/mach-armadillo5x0.c
@@ -557,10 +557,6 @@ static void __init armadillo5x0_timer_init(void)
557 mx31_clocks_init(26000000); 557 mx31_clocks_init(26000000);
558} 558}
559 559
560static struct sys_timer armadillo5x0_timer = {
561 .init = armadillo5x0_timer_init,
562};
563
564MACHINE_START(ARMADILLO5X0, "Armadillo-500") 560MACHINE_START(ARMADILLO5X0, "Armadillo-500")
565 /* Maintainer: Alberto Panizzo */ 561 /* Maintainer: Alberto Panizzo */
566 .atag_offset = 0x100, 562 .atag_offset = 0x100,
@@ -568,7 +564,7 @@ MACHINE_START(ARMADILLO5X0, "Armadillo-500")
568 .init_early = imx31_init_early, 564 .init_early = imx31_init_early,
569 .init_irq = mx31_init_irq, 565 .init_irq = mx31_init_irq,
570 .handle_irq = imx31_handle_irq, 566 .handle_irq = imx31_handle_irq,
571 .timer = &armadillo5x0_timer, 567 .init_time = armadillo5x0_timer_init,
572 .init_machine = armadillo5x0_init, 568 .init_machine = armadillo5x0_init,
573 .restart = mxc_restart, 569 .restart = mxc_restart,
574MACHINE_END 570MACHINE_END
diff --git a/arch/arm/mach-imx/mach-bug.c b/arch/arm/mach-imx/mach-bug.c
index 3a39d5aec07a..2d00476f7d2c 100644
--- a/arch/arm/mach-imx/mach-bug.c
+++ b/arch/arm/mach-imx/mach-bug.c
@@ -53,16 +53,12 @@ static void __init bug_timer_init(void)
53 mx31_clocks_init(26000000); 53 mx31_clocks_init(26000000);
54} 54}
55 55
56static struct sys_timer bug_timer = {
57 .init = bug_timer_init,
58};
59
60MACHINE_START(BUG, "BugLabs BUGBase") 56MACHINE_START(BUG, "BugLabs BUGBase")
61 .map_io = mx31_map_io, 57 .map_io = mx31_map_io,
62 .init_early = imx31_init_early, 58 .init_early = imx31_init_early,
63 .init_irq = mx31_init_irq, 59 .init_irq = mx31_init_irq,
64 .handle_irq = imx31_handle_irq, 60 .handle_irq = imx31_handle_irq,
65 .timer = &bug_timer, 61 .init_time = bug_timer_init,
66 .init_machine = bug_board_init, 62 .init_machine = bug_board_init,
67 .restart = mxc_restart, 63 .restart = mxc_restart,
68MACHINE_END 64MACHINE_END
diff --git a/arch/arm/mach-imx/mach-cpuimx27.c b/arch/arm/mach-imx/mach-cpuimx27.c
index 12a370646b45..146559311bd2 100644
--- a/arch/arm/mach-imx/mach-cpuimx27.c
+++ b/arch/arm/mach-imx/mach-cpuimx27.c
@@ -309,17 +309,13 @@ static void __init eukrea_cpuimx27_timer_init(void)
309 mx27_clocks_init(26000000); 309 mx27_clocks_init(26000000);
310} 310}
311 311
312static struct sys_timer eukrea_cpuimx27_timer = {
313 .init = eukrea_cpuimx27_timer_init,
314};
315
316MACHINE_START(EUKREA_CPUIMX27, "EUKREA CPUIMX27") 312MACHINE_START(EUKREA_CPUIMX27, "EUKREA CPUIMX27")
317 .atag_offset = 0x100, 313 .atag_offset = 0x100,
318 .map_io = mx27_map_io, 314 .map_io = mx27_map_io,
319 .init_early = imx27_init_early, 315 .init_early = imx27_init_early,
320 .init_irq = mx27_init_irq, 316 .init_irq = mx27_init_irq,
321 .handle_irq = imx27_handle_irq, 317 .handle_irq = imx27_handle_irq,
322 .timer = &eukrea_cpuimx27_timer, 318 .init_time = eukrea_cpuimx27_timer_init,
323 .init_machine = eukrea_cpuimx27_init, 319 .init_machine = eukrea_cpuimx27_init,
324 .restart = mxc_restart, 320 .restart = mxc_restart,
325MACHINE_END 321MACHINE_END
diff --git a/arch/arm/mach-imx/mach-cpuimx35.c b/arch/arm/mach-imx/mach-cpuimx35.c
index 5a31bf8c8f4c..771362d1fbee 100644
--- a/arch/arm/mach-imx/mach-cpuimx35.c
+++ b/arch/arm/mach-imx/mach-cpuimx35.c
@@ -193,10 +193,6 @@ static void __init eukrea_cpuimx35_timer_init(void)
193 mx35_clocks_init(); 193 mx35_clocks_init();
194} 194}
195 195
196static struct sys_timer eukrea_cpuimx35_timer = {
197 .init = eukrea_cpuimx35_timer_init,
198};
199
200MACHINE_START(EUKREA_CPUIMX35SD, "Eukrea CPUIMX35") 196MACHINE_START(EUKREA_CPUIMX35SD, "Eukrea CPUIMX35")
201 /* Maintainer: Eukrea Electromatique */ 197 /* Maintainer: Eukrea Electromatique */
202 .atag_offset = 0x100, 198 .atag_offset = 0x100,
@@ -204,7 +200,7 @@ MACHINE_START(EUKREA_CPUIMX35SD, "Eukrea CPUIMX35")
204 .init_early = imx35_init_early, 200 .init_early = imx35_init_early,
205 .init_irq = mx35_init_irq, 201 .init_irq = mx35_init_irq,
206 .handle_irq = imx35_handle_irq, 202 .handle_irq = imx35_handle_irq,
207 .timer = &eukrea_cpuimx35_timer, 203 .init_time = eukrea_cpuimx35_timer_init,
208 .init_machine = eukrea_cpuimx35_init, 204 .init_machine = eukrea_cpuimx35_init,
209 .restart = mxc_restart, 205 .restart = mxc_restart,
210MACHINE_END 206MACHINE_END
diff --git a/arch/arm/mach-imx/mach-cpuimx51sd.c b/arch/arm/mach-imx/mach-cpuimx51sd.c
index b727de029c8f..9b7393234f6f 100644
--- a/arch/arm/mach-imx/mach-cpuimx51sd.c
+++ b/arch/arm/mach-imx/mach-cpuimx51sd.c
@@ -355,10 +355,6 @@ static void __init eukrea_cpuimx51sd_timer_init(void)
355 mx51_clocks_init(32768, 24000000, 22579200, 0); 355 mx51_clocks_init(32768, 24000000, 22579200, 0);
356} 356}
357 357
358static struct sys_timer mxc_timer = {
359 .init = eukrea_cpuimx51sd_timer_init,
360};
361
362MACHINE_START(EUKREA_CPUIMX51SD, "Eukrea CPUIMX51SD") 358MACHINE_START(EUKREA_CPUIMX51SD, "Eukrea CPUIMX51SD")
363 /* Maintainer: Eric Bénard <eric@eukrea.com> */ 359 /* Maintainer: Eric Bénard <eric@eukrea.com> */
364 .atag_offset = 0x100, 360 .atag_offset = 0x100,
@@ -366,7 +362,7 @@ MACHINE_START(EUKREA_CPUIMX51SD, "Eukrea CPUIMX51SD")
366 .init_early = imx51_init_early, 362 .init_early = imx51_init_early,
367 .init_irq = mx51_init_irq, 363 .init_irq = mx51_init_irq,
368 .handle_irq = imx51_handle_irq, 364 .handle_irq = imx51_handle_irq,
369 .timer = &mxc_timer, 365 .init_time = eukrea_cpuimx51sd_timer_init,
370 .init_machine = eukrea_cpuimx51sd_init, 366 .init_machine = eukrea_cpuimx51sd_init,
371 .init_late = imx51_init_late, 367 .init_late = imx51_init_late,
372 .restart = mxc_restart, 368 .restart = mxc_restart,
diff --git a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
index 75027a5ad8b7..4bf454424249 100644
--- a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
+++ b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
@@ -159,10 +159,6 @@ static void __init eukrea_cpuimx25_timer_init(void)
159 mx25_clocks_init(); 159 mx25_clocks_init();
160} 160}
161 161
162static struct sys_timer eukrea_cpuimx25_timer = {
163 .init = eukrea_cpuimx25_timer_init,
164};
165
166MACHINE_START(EUKREA_CPUIMX25SD, "Eukrea CPUIMX25") 162MACHINE_START(EUKREA_CPUIMX25SD, "Eukrea CPUIMX25")
167 /* Maintainer: Eukrea Electromatique */ 163 /* Maintainer: Eukrea Electromatique */
168 .atag_offset = 0x100, 164 .atag_offset = 0x100,
@@ -170,7 +166,7 @@ MACHINE_START(EUKREA_CPUIMX25SD, "Eukrea CPUIMX25")
170 .init_early = imx25_init_early, 166 .init_early = imx25_init_early,
171 .init_irq = mx25_init_irq, 167 .init_irq = mx25_init_irq,
172 .handle_irq = imx25_handle_irq, 168 .handle_irq = imx25_handle_irq,
173 .timer = &eukrea_cpuimx25_timer, 169 .init_time = eukrea_cpuimx25_timer_init,
174 .init_machine = eukrea_cpuimx25_init, 170 .init_machine = eukrea_cpuimx25_init,
175 .restart = mxc_restart, 171 .restart = mxc_restart,
176MACHINE_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 318bd8df7fcc..29ac8ee651d2 100644
--- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
+++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
@@ -598,10 +598,6 @@ static void __init visstrim_m10_timer_init(void)
598 mx27_clocks_init((unsigned long)25000000); 598 mx27_clocks_init((unsigned long)25000000);
599} 599}
600 600
601static struct sys_timer visstrim_m10_timer = {
602 .init = visstrim_m10_timer_init,
603};
604
605MACHINE_START(IMX27_VISSTRIM_M10, "Vista Silicon Visstrim_M10") 601MACHINE_START(IMX27_VISSTRIM_M10, "Vista Silicon Visstrim_M10")
606 .atag_offset = 0x100, 602 .atag_offset = 0x100,
607 .reserve = visstrim_reserve, 603 .reserve = visstrim_reserve,
@@ -609,7 +605,7 @@ MACHINE_START(IMX27_VISSTRIM_M10, "Vista Silicon Visstrim_M10")
609 .init_early = imx27_init_early, 605 .init_early = imx27_init_early,
610 .init_irq = mx27_init_irq, 606 .init_irq = mx27_init_irq,
611 .handle_irq = imx27_handle_irq, 607 .handle_irq = imx27_handle_irq,
612 .timer = &visstrim_m10_timer, 608 .init_time = visstrim_m10_timer_init,
613 .init_machine = visstrim_m10_board_init, 609 .init_machine = visstrim_m10_board_init,
614 .restart = mxc_restart, 610 .restart = mxc_restart,
615MACHINE_END 611MACHINE_END
diff --git a/arch/arm/mach-imx/mach-imx27ipcam.c b/arch/arm/mach-imx/mach-imx27ipcam.c
index 53a860112938..1a851aea6832 100644
--- a/arch/arm/mach-imx/mach-imx27ipcam.c
+++ b/arch/arm/mach-imx/mach-imx27ipcam.c
@@ -65,10 +65,6 @@ static void __init mx27ipcam_timer_init(void)
65 mx27_clocks_init(25000000); 65 mx27_clocks_init(25000000);
66} 66}
67 67
68static struct sys_timer mx27ipcam_timer = {
69 .init = mx27ipcam_timer_init,
70};
71
72MACHINE_START(IMX27IPCAM, "Freescale IMX27IPCAM") 68MACHINE_START(IMX27IPCAM, "Freescale IMX27IPCAM")
73 /* maintainer: Freescale Semiconductor, Inc. */ 69 /* maintainer: Freescale Semiconductor, Inc. */
74 .atag_offset = 0x100, 70 .atag_offset = 0x100,
@@ -76,7 +72,7 @@ MACHINE_START(IMX27IPCAM, "Freescale IMX27IPCAM")
76 .init_early = imx27_init_early, 72 .init_early = imx27_init_early,
77 .init_irq = mx27_init_irq, 73 .init_irq = mx27_init_irq,
78 .handle_irq = imx27_handle_irq, 74 .handle_irq = imx27_handle_irq,
79 .timer = &mx27ipcam_timer, 75 .init_time = mx27ipcam_timer_init,
80 .init_machine = mx27ipcam_init, 76 .init_machine = mx27ipcam_init,
81 .restart = mxc_restart, 77 .restart = mxc_restart,
82MACHINE_END 78MACHINE_END
diff --git a/arch/arm/mach-imx/mach-imx27lite.c b/arch/arm/mach-imx/mach-imx27lite.c
index fc8dce931378..3da2e3e44ce9 100644
--- a/arch/arm/mach-imx/mach-imx27lite.c
+++ b/arch/arm/mach-imx/mach-imx27lite.c
@@ -72,17 +72,13 @@ static void __init mx27lite_timer_init(void)
72 mx27_clocks_init(26000000); 72 mx27_clocks_init(26000000);
73} 73}
74 74
75static struct sys_timer mx27lite_timer = {
76 .init = mx27lite_timer_init,
77};
78
79MACHINE_START(IMX27LITE, "LogicPD i.MX27LITE") 75MACHINE_START(IMX27LITE, "LogicPD i.MX27LITE")
80 .atag_offset = 0x100, 76 .atag_offset = 0x100,
81 .map_io = mx27_map_io, 77 .map_io = mx27_map_io,
82 .init_early = imx27_init_early, 78 .init_early = imx27_init_early,
83 .init_irq = mx27_init_irq, 79 .init_irq = mx27_init_irq,
84 .handle_irq = imx27_handle_irq, 80 .handle_irq = imx27_handle_irq,
85 .timer = &mx27lite_timer, 81 .init_time = mx27lite_timer_init,
86 .init_machine = mx27lite_init, 82 .init_machine = mx27lite_init,
87 .restart = mxc_restart, 83 .restart = mxc_restart,
88MACHINE_END 84MACHINE_END
diff --git a/arch/arm/mach-imx/mach-imx53.c b/arch/arm/mach-imx/mach-imx53.c
index 860284dea0e7..f579c616feed 100644
--- a/arch/arm/mach-imx/mach-imx53.c
+++ b/arch/arm/mach-imx/mach-imx53.c
@@ -44,26 +44,22 @@ static void __init imx53_dt_init(void)
44 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 44 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
45} 45}
46 46
47static void __init imx53_timer_init(void)
48{
49 mx53_clocks_init_dt();
50}
51
52static struct sys_timer imx53_timer = {
53 .init = imx53_timer_init,
54};
55
56static const char *imx53_dt_board_compat[] __initdata = { 47static const char *imx53_dt_board_compat[] __initdata = {
57 "fsl,imx53", 48 "fsl,imx53",
58 NULL 49 NULL
59}; 50};
60 51
52static void __init imx53_timer_init(void)
53{
54 mx53_clocks_init_dt();
55}
56
61DT_MACHINE_START(IMX53_DT, "Freescale i.MX53 (Device Tree Support)") 57DT_MACHINE_START(IMX53_DT, "Freescale i.MX53 (Device Tree Support)")
62 .map_io = mx53_map_io, 58 .map_io = mx53_map_io,
63 .init_early = imx53_init_early, 59 .init_early = imx53_init_early,
64 .init_irq = mx53_init_irq, 60 .init_irq = mx53_init_irq,
65 .handle_irq = imx53_handle_irq, 61 .handle_irq = imx53_handle_irq,
66 .timer = &imx53_timer, 62 .init_time = imx53_timer_init,
67 .init_machine = imx53_dt_init, 63 .init_machine = imx53_dt_init,
68 .init_late = imx53_init_late, 64 .init_late = imx53_init_late,
69 .dt_compat = imx53_dt_board_compat, 65 .dt_compat = imx53_dt_board_compat,
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 4eb1b3ac794c..9ffd103b27e4 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -12,25 +12,26 @@
12 12
13#include <linux/clk.h> 13#include <linux/clk.h>
14#include <linux/clkdev.h> 14#include <linux/clkdev.h>
15#include <linux/cpuidle.h> 15#include <linux/cpu.h>
16#include <linux/delay.h> 16#include <linux/delay.h>
17#include <linux/export.h> 17#include <linux/export.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/irq.h> 20#include <linux/irq.h>
21#include <linux/irqchip.h>
21#include <linux/of.h> 22#include <linux/of.h>
22#include <linux/of_address.h> 23#include <linux/of_address.h>
23#include <linux/of_irq.h> 24#include <linux/of_irq.h>
24#include <linux/of_platform.h> 25#include <linux/of_platform.h>
26#include <linux/opp.h>
25#include <linux/phy.h> 27#include <linux/phy.h>
26#include <linux/regmap.h> 28#include <linux/regmap.h>
27#include <linux/micrel_phy.h> 29#include <linux/micrel_phy.h>
28#include <linux/mfd/syscon.h> 30#include <linux/mfd/syscon.h>
29#include <asm/cpuidle.h>
30#include <asm/smp_twd.h> 31#include <asm/smp_twd.h>
31#include <asm/hardware/cache-l2x0.h> 32#include <asm/hardware/cache-l2x0.h>
32#include <asm/hardware/gic.h>
33#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
34#include <asm/mach/map.h>
34#include <asm/mach/time.h> 35#include <asm/mach/time.h>
35#include <asm/system_misc.h> 36#include <asm/system_misc.h>
36 37
@@ -201,37 +202,91 @@ static void __init imx6q_init_machine(void)
201 imx6q_1588_init(); 202 imx6q_1588_init();
202} 203}
203 204
204static struct cpuidle_driver imx6q_cpuidle_driver = { 205#define OCOTP_CFG3 0x440
205 .name = "imx6q_cpuidle", 206#define OCOTP_CFG3_SPEED_SHIFT 16
206 .owner = THIS_MODULE, 207#define OCOTP_CFG3_SPEED_1P2GHZ 0x3
207 .en_core_tk_irqen = 1, 208
208 .states[0] = ARM_CPUIDLE_WFI_STATE, 209static void __init imx6q_opp_check_1p2ghz(struct device *cpu_dev)
209 .state_count = 1, 210{
211 struct device_node *np;
212 void __iomem *base;
213 u32 val;
214
215 np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-ocotp");
216 if (!np) {
217 pr_warn("failed to find ocotp node\n");
218 return;
219 }
220
221 base = of_iomap(np, 0);
222 if (!base) {
223 pr_warn("failed to map ocotp\n");
224 goto put_node;
225 }
226
227 val = readl_relaxed(base + OCOTP_CFG3);
228 val >>= OCOTP_CFG3_SPEED_SHIFT;
229 if ((val & 0x3) != OCOTP_CFG3_SPEED_1P2GHZ)
230 if (opp_disable(cpu_dev, 1200000000))
231 pr_warn("failed to disable 1.2 GHz OPP\n");
232
233put_node:
234 of_node_put(np);
235}
236
237static void __init imx6q_opp_init(struct device *cpu_dev)
238{
239 struct device_node *np;
240
241 np = of_find_node_by_path("/cpus/cpu@0");
242 if (!np) {
243 pr_warn("failed to find cpu0 node\n");
244 return;
245 }
246
247 cpu_dev->of_node = np;
248 if (of_init_opp_table(cpu_dev)) {
249 pr_warn("failed to init OPP table\n");
250 goto put_node;
251 }
252
253 imx6q_opp_check_1p2ghz(cpu_dev);
254
255put_node:
256 of_node_put(np);
257}
258
259struct platform_device imx6q_cpufreq_pdev = {
260 .name = "imx6q-cpufreq",
210}; 261};
211 262
212static void __init imx6q_init_late(void) 263static void __init imx6q_init_late(void)
213{ 264{
214 imx_cpuidle_init(&imx6q_cpuidle_driver); 265 /*
266 * WAIT mode is broken on TO 1.0 and 1.1, so there is no point
267 * to run cpuidle on them.
268 */
269 if (imx6q_revision() > IMX_CHIP_REVISION_1_1)
270 imx6q_cpuidle_init();
271
272 if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) {
273 imx6q_opp_init(&imx6q_cpufreq_pdev.dev);
274 platform_device_register(&imx6q_cpufreq_pdev);
275 }
215} 276}
216 277
217static void __init imx6q_map_io(void) 278static void __init imx6q_map_io(void)
218{ 279{
219 imx_lluart_map_io(); 280 debug_ll_io_init();
220 imx_scu_map_io(); 281 imx_scu_map_io();
221 imx6q_clock_map_io();
222} 282}
223 283
224static const struct of_device_id imx6q_irq_match[] __initconst = {
225 { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
226 { /* sentinel */ }
227};
228
229static void __init imx6q_init_irq(void) 284static void __init imx6q_init_irq(void)
230{ 285{
231 l2x0_of_init(0, ~0UL); 286 l2x0_of_init(0, ~0UL);
232 imx_src_init(); 287 imx_src_init();
233 imx_gpc_init(); 288 imx_gpc_init();
234 of_irq_init(imx6q_irq_match); 289 irqchip_init();
235} 290}
236 291
237static void __init imx6q_timer_init(void) 292static void __init imx6q_timer_init(void)
@@ -241,10 +296,6 @@ static void __init imx6q_timer_init(void)
241 imx_print_silicon_rev("i.MX6Q", imx6q_revision()); 296 imx_print_silicon_rev("i.MX6Q", imx6q_revision());
242} 297}
243 298
244static struct sys_timer imx6q_timer = {
245 .init = imx6q_timer_init,
246};
247
248static const char *imx6q_dt_compat[] __initdata = { 299static const char *imx6q_dt_compat[] __initdata = {
249 "fsl,imx6q", 300 "fsl,imx6q",
250 NULL, 301 NULL,
@@ -254,8 +305,7 @@ DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad (Device Tree)")
254 .smp = smp_ops(imx_smp_ops), 305 .smp = smp_ops(imx_smp_ops),
255 .map_io = imx6q_map_io, 306 .map_io = imx6q_map_io,
256 .init_irq = imx6q_init_irq, 307 .init_irq = imx6q_init_irq,
257 .handle_irq = imx6q_handle_irq, 308 .init_time = imx6q_timer_init,
258 .timer = &imx6q_timer,
259 .init_machine = imx6q_init_machine, 309 .init_machine = imx6q_init_machine,
260 .init_late = imx6q_init_late, 310 .init_late = imx6q_init_late,
261 .dt_compat = imx6q_dt_compat, 311 .dt_compat = imx6q_dt_compat,
diff --git a/arch/arm/mach-imx/mach-kzm_arm11_01.c b/arch/arm/mach-imx/mach-kzm_arm11_01.c
index 2e536ea53444..c7bc41d6b468 100644
--- a/arch/arm/mach-imx/mach-kzm_arm11_01.c
+++ b/arch/arm/mach-imx/mach-kzm_arm11_01.c
@@ -284,17 +284,13 @@ static void __init kzm_timer_init(void)
284 mx31_clocks_init(26000000); 284 mx31_clocks_init(26000000);
285} 285}
286 286
287static struct sys_timer kzm_timer = {
288 .init = kzm_timer_init,
289};
290
291MACHINE_START(KZM_ARM11_01, "Kyoto Microcomputer Co., Ltd. KZM-ARM11-01") 287MACHINE_START(KZM_ARM11_01, "Kyoto Microcomputer Co., Ltd. KZM-ARM11-01")
292 .atag_offset = 0x100, 288 .atag_offset = 0x100,
293 .map_io = kzm_map_io, 289 .map_io = kzm_map_io,
294 .init_early = imx31_init_early, 290 .init_early = imx31_init_early,
295 .init_irq = mx31_init_irq, 291 .init_irq = mx31_init_irq,
296 .handle_irq = imx31_handle_irq, 292 .handle_irq = imx31_handle_irq,
297 .timer = &kzm_timer, 293 .init_time = kzm_timer_init,
298 .init_machine = kzm_board_init, 294 .init_machine = kzm_board_init,
299 .restart = mxc_restart, 295 .restart = mxc_restart,
300MACHINE_END 296MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx1ads.c b/arch/arm/mach-imx/mach-mx1ads.c
index 06b483783e68..9f883e4d6fc9 100644
--- a/arch/arm/mach-imx/mach-mx1ads.c
+++ b/arch/arm/mach-imx/mach-mx1ads.c
@@ -132,10 +132,6 @@ static void __init mx1ads_timer_init(void)
132 mx1_clocks_init(32000); 132 mx1_clocks_init(32000);
133} 133}
134 134
135static struct sys_timer mx1ads_timer = {
136 .init = mx1ads_timer_init,
137};
138
139MACHINE_START(MX1ADS, "Freescale MX1ADS") 135MACHINE_START(MX1ADS, "Freescale MX1ADS")
140 /* Maintainer: Sascha Hauer, Pengutronix */ 136 /* Maintainer: Sascha Hauer, Pengutronix */
141 .atag_offset = 0x100, 137 .atag_offset = 0x100,
@@ -143,7 +139,7 @@ MACHINE_START(MX1ADS, "Freescale MX1ADS")
143 .init_early = imx1_init_early, 139 .init_early = imx1_init_early,
144 .init_irq = mx1_init_irq, 140 .init_irq = mx1_init_irq,
145 .handle_irq = imx1_handle_irq, 141 .handle_irq = imx1_handle_irq,
146 .timer = &mx1ads_timer, 142 .init_time = mx1ads_timer_init,
147 .init_machine = mx1ads_init, 143 .init_machine = mx1ads_init,
148 .restart = mxc_restart, 144 .restart = mxc_restart,
149MACHINE_END 145MACHINE_END
@@ -154,7 +150,7 @@ MACHINE_START(MXLADS, "Freescale MXLADS")
154 .init_early = imx1_init_early, 150 .init_early = imx1_init_early,
155 .init_irq = mx1_init_irq, 151 .init_irq = mx1_init_irq,
156 .handle_irq = imx1_handle_irq, 152 .handle_irq = imx1_handle_irq,
157 .timer = &mx1ads_timer, 153 .init_time = mx1ads_timer_init,
158 .init_machine = mx1ads_init, 154 .init_machine = mx1ads_init,
159 .restart = mxc_restart, 155 .restart = mxc_restart,
160MACHINE_END 156MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx21ads.c b/arch/arm/mach-imx/mach-mx21ads.c
index 6adb3136bb08..a06aa4dc37fc 100644
--- a/arch/arm/mach-imx/mach-mx21ads.c
+++ b/arch/arm/mach-imx/mach-mx21ads.c
@@ -318,10 +318,6 @@ static void __init mx21ads_timer_init(void)
318 mx21_clocks_init(32768, 26000000); 318 mx21_clocks_init(32768, 26000000);
319} 319}
320 320
321static struct sys_timer mx21ads_timer = {
322 .init = mx21ads_timer_init,
323};
324
325MACHINE_START(MX21ADS, "Freescale i.MX21ADS") 321MACHINE_START(MX21ADS, "Freescale i.MX21ADS")
326 /* maintainer: Freescale Semiconductor, Inc. */ 322 /* maintainer: Freescale Semiconductor, Inc. */
327 .atag_offset = 0x100, 323 .atag_offset = 0x100,
@@ -329,7 +325,7 @@ MACHINE_START(MX21ADS, "Freescale i.MX21ADS")
329 .init_early = imx21_init_early, 325 .init_early = imx21_init_early,
330 .init_irq = mx21_init_irq, 326 .init_irq = mx21_init_irq,
331 .handle_irq = imx21_handle_irq, 327 .handle_irq = imx21_handle_irq,
332 .timer = &mx21ads_timer, 328 .init_time = mx21ads_timer_init,
333 .init_machine = mx21ads_board_init, 329 .init_machine = mx21ads_board_init,
334 .restart = mxc_restart, 330 .restart = mxc_restart,
335MACHINE_END 331MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx25_3ds.c b/arch/arm/mach-imx/mach-mx25_3ds.c
index b1b03aa55bb8..8bcda688a006 100644
--- a/arch/arm/mach-imx/mach-mx25_3ds.c
+++ b/arch/arm/mach-imx/mach-mx25_3ds.c
@@ -257,10 +257,6 @@ static void __init mx25pdk_timer_init(void)
257 mx25_clocks_init(); 257 mx25_clocks_init();
258} 258}
259 259
260static struct sys_timer mx25pdk_timer = {
261 .init = mx25pdk_timer_init,
262};
263
264MACHINE_START(MX25_3DS, "Freescale MX25PDK (3DS)") 260MACHINE_START(MX25_3DS, "Freescale MX25PDK (3DS)")
265 /* Maintainer: Freescale Semiconductor, Inc. */ 261 /* Maintainer: Freescale Semiconductor, Inc. */
266 .atag_offset = 0x100, 262 .atag_offset = 0x100,
@@ -268,7 +264,7 @@ MACHINE_START(MX25_3DS, "Freescale MX25PDK (3DS)")
268 .init_early = imx25_init_early, 264 .init_early = imx25_init_early,
269 .init_irq = mx25_init_irq, 265 .init_irq = mx25_init_irq,
270 .handle_irq = imx25_handle_irq, 266 .handle_irq = imx25_handle_irq,
271 .timer = &mx25pdk_timer, 267 .init_time = mx25pdk_timer_init,
272 .init_machine = mx25pdk_init, 268 .init_machine = mx25pdk_init,
273 .restart = mxc_restart, 269 .restart = mxc_restart,
274MACHINE_END 270MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index d0e547fa925f..25b3e4c9bc0a 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -538,10 +538,6 @@ static void __init mx27pdk_timer_init(void)
538 mx27_clocks_init(26000000); 538 mx27_clocks_init(26000000);
539} 539}
540 540
541static struct sys_timer mx27pdk_timer = {
542 .init = mx27pdk_timer_init,
543};
544
545MACHINE_START(MX27_3DS, "Freescale MX27PDK") 541MACHINE_START(MX27_3DS, "Freescale MX27PDK")
546 /* maintainer: Freescale Semiconductor, Inc. */ 542 /* maintainer: Freescale Semiconductor, Inc. */
547 .atag_offset = 0x100, 543 .atag_offset = 0x100,
@@ -549,7 +545,7 @@ MACHINE_START(MX27_3DS, "Freescale MX27PDK")
549 .init_early = imx27_init_early, 545 .init_early = imx27_init_early,
550 .init_irq = mx27_init_irq, 546 .init_irq = mx27_init_irq,
551 .handle_irq = imx27_handle_irq, 547 .handle_irq = imx27_handle_irq,
552 .timer = &mx27pdk_timer, 548 .init_time = mx27pdk_timer_init,
553 .init_machine = mx27pdk_init, 549 .init_machine = mx27pdk_init,
554 .restart = mxc_restart, 550 .restart = mxc_restart,
555MACHINE_END 551MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c
index 3d036f57f0e6..9821b824dcaf 100644
--- a/arch/arm/mach-imx/mach-mx27ads.c
+++ b/arch/arm/mach-imx/mach-mx27ads.c
@@ -323,10 +323,6 @@ static void __init mx27ads_timer_init(void)
323 mx27_clocks_init(fref); 323 mx27_clocks_init(fref);
324} 324}
325 325
326static struct sys_timer mx27ads_timer = {
327 .init = mx27ads_timer_init,
328};
329
330static struct map_desc mx27ads_io_desc[] __initdata = { 326static struct map_desc mx27ads_io_desc[] __initdata = {
331 { 327 {
332 .virtual = PBC_BASE_ADDRESS, 328 .virtual = PBC_BASE_ADDRESS,
@@ -349,7 +345,7 @@ MACHINE_START(MX27ADS, "Freescale i.MX27ADS")
349 .init_early = imx27_init_early, 345 .init_early = imx27_init_early,
350 .init_irq = mx27_init_irq, 346 .init_irq = mx27_init_irq,
351 .handle_irq = imx27_handle_irq, 347 .handle_irq = imx27_handle_irq,
352 .timer = &mx27ads_timer, 348 .init_time = mx27ads_timer_init,
353 .init_machine = mx27ads_board_init, 349 .init_machine = mx27ads_board_init,
354 .restart = mxc_restart, 350 .restart = mxc_restart,
355MACHINE_END 351MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx31_3ds.c b/arch/arm/mach-imx/mach-mx31_3ds.c
index bc301befdd06..1ed916175d41 100644
--- a/arch/arm/mach-imx/mach-mx31_3ds.c
+++ b/arch/arm/mach-imx/mach-mx31_3ds.c
@@ -762,10 +762,6 @@ static void __init mx31_3ds_timer_init(void)
762 mx31_clocks_init(26000000); 762 mx31_clocks_init(26000000);
763} 763}
764 764
765static struct sys_timer mx31_3ds_timer = {
766 .init = mx31_3ds_timer_init,
767};
768
769static void __init mx31_3ds_reserve(void) 765static void __init mx31_3ds_reserve(void)
770{ 766{
771 /* reserve MX31_3DS_CAMERA_BUF_SIZE bytes for mx3-camera */ 767 /* reserve MX31_3DS_CAMERA_BUF_SIZE bytes for mx3-camera */
@@ -780,7 +776,7 @@ MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)")
780 .init_early = imx31_init_early, 776 .init_early = imx31_init_early,
781 .init_irq = mx31_init_irq, 777 .init_irq = mx31_init_irq,
782 .handle_irq = imx31_handle_irq, 778 .handle_irq = imx31_handle_irq,
783 .timer = &mx31_3ds_timer, 779 .init_time = mx31_3ds_timer_init,
784 .init_machine = mx31_3ds_init, 780 .init_machine = mx31_3ds_init,
785 .reserve = mx31_3ds_reserve, 781 .reserve = mx31_3ds_reserve,
786 .restart = mxc_restart, 782 .restart = mxc_restart,
diff --git a/arch/arm/mach-imx/mach-mx31ads.c b/arch/arm/mach-imx/mach-mx31ads.c
index 8b56f8883f32..daf8889125cc 100644
--- a/arch/arm/mach-imx/mach-mx31ads.c
+++ b/arch/arm/mach-imx/mach-mx31ads.c
@@ -576,10 +576,6 @@ static void __init mx31ads_timer_init(void)
576 mx31_clocks_init(26000000); 576 mx31_clocks_init(26000000);
577} 577}
578 578
579static struct sys_timer mx31ads_timer = {
580 .init = mx31ads_timer_init,
581};
582
583MACHINE_START(MX31ADS, "Freescale MX31ADS") 579MACHINE_START(MX31ADS, "Freescale MX31ADS")
584 /* Maintainer: Freescale Semiconductor, Inc. */ 580 /* Maintainer: Freescale Semiconductor, Inc. */
585 .atag_offset = 0x100, 581 .atag_offset = 0x100,
@@ -587,7 +583,7 @@ MACHINE_START(MX31ADS, "Freescale MX31ADS")
587 .init_early = imx31_init_early, 583 .init_early = imx31_init_early,
588 .init_irq = mx31ads_init_irq, 584 .init_irq = mx31ads_init_irq,
589 .handle_irq = imx31_handle_irq, 585 .handle_irq = imx31_handle_irq,
590 .timer = &mx31ads_timer, 586 .init_time = mx31ads_timer_init,
591 .init_machine = mx31ads_init, 587 .init_machine = mx31ads_init,
592 .restart = mxc_restart, 588 .restart = mxc_restart,
593MACHINE_END 589MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx31lilly.c b/arch/arm/mach-imx/mach-mx31lilly.c
index 08b9965c8b36..832b1e2f964e 100644
--- a/arch/arm/mach-imx/mach-mx31lilly.c
+++ b/arch/arm/mach-imx/mach-mx31lilly.c
@@ -303,17 +303,13 @@ static void __init mx31lilly_timer_init(void)
303 mx31_clocks_init(26000000); 303 mx31_clocks_init(26000000);
304} 304}
305 305
306static struct sys_timer mx31lilly_timer = {
307 .init = mx31lilly_timer_init,
308};
309
310MACHINE_START(LILLY1131, "INCO startec LILLY-1131") 306MACHINE_START(LILLY1131, "INCO startec LILLY-1131")
311 .atag_offset = 0x100, 307 .atag_offset = 0x100,
312 .map_io = mx31_map_io, 308 .map_io = mx31_map_io,
313 .init_early = imx31_init_early, 309 .init_early = imx31_init_early,
314 .init_irq = mx31_init_irq, 310 .init_irq = mx31_init_irq,
315 .handle_irq = imx31_handle_irq, 311 .handle_irq = imx31_handle_irq,
316 .timer = &mx31lilly_timer, 312 .init_time = mx31lilly_timer_init,
317 .init_machine = mx31lilly_board_init, 313 .init_machine = mx31lilly_board_init,
318 .restart = mxc_restart, 314 .restart = mxc_restart,
319MACHINE_END 315MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx31lite.c b/arch/arm/mach-imx/mach-mx31lite.c
index bdcd92e59518..bea07299b61a 100644
--- a/arch/arm/mach-imx/mach-mx31lite.c
+++ b/arch/arm/mach-imx/mach-mx31lite.c
@@ -285,10 +285,6 @@ static void __init mx31lite_timer_init(void)
285 mx31_clocks_init(26000000); 285 mx31_clocks_init(26000000);
286} 286}
287 287
288static struct sys_timer mx31lite_timer = {
289 .init = mx31lite_timer_init,
290};
291
292MACHINE_START(MX31LITE, "LogicPD i.MX31 SOM") 288MACHINE_START(MX31LITE, "LogicPD i.MX31 SOM")
293 /* Maintainer: Freescale Semiconductor, Inc. */ 289 /* Maintainer: Freescale Semiconductor, Inc. */
294 .atag_offset = 0x100, 290 .atag_offset = 0x100,
@@ -296,7 +292,7 @@ MACHINE_START(MX31LITE, "LogicPD i.MX31 SOM")
296 .init_early = imx31_init_early, 292 .init_early = imx31_init_early,
297 .init_irq = mx31_init_irq, 293 .init_irq = mx31_init_irq,
298 .handle_irq = imx31_handle_irq, 294 .handle_irq = imx31_handle_irq,
299 .timer = &mx31lite_timer, 295 .init_time = mx31lite_timer_init,
300 .init_machine = mx31lite_init, 296 .init_machine = mx31lite_init,
301 .restart = mxc_restart, 297 .restart = mxc_restart,
302MACHINE_END 298MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c
index 2517cfa9f26b..dae4cd7be040 100644
--- a/arch/arm/mach-imx/mach-mx31moboard.c
+++ b/arch/arm/mach-imx/mach-mx31moboard.c
@@ -596,10 +596,6 @@ static void __init mx31moboard_timer_init(void)
596 mx31_clocks_init(26000000); 596 mx31_clocks_init(26000000);
597} 597}
598 598
599static struct sys_timer mx31moboard_timer = {
600 .init = mx31moboard_timer_init,
601};
602
603static void __init mx31moboard_reserve(void) 599static void __init mx31moboard_reserve(void)
604{ 600{
605 /* reserve 4 MiB for mx3-camera */ 601 /* reserve 4 MiB for mx3-camera */
@@ -615,7 +611,7 @@ MACHINE_START(MX31MOBOARD, "EPFL Mobots mx31moboard")
615 .init_early = imx31_init_early, 611 .init_early = imx31_init_early,
616 .init_irq = mx31_init_irq, 612 .init_irq = mx31_init_irq,
617 .handle_irq = imx31_handle_irq, 613 .handle_irq = imx31_handle_irq,
618 .timer = &mx31moboard_timer, 614 .init_time = mx31moboard_timer_init,
619 .init_machine = mx31moboard_init, 615 .init_machine = mx31moboard_init,
620 .restart = mxc_restart, 616 .restart = mxc_restart,
621MACHINE_END 617MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx35_3ds.c b/arch/arm/mach-imx/mach-mx35_3ds.c
index 5277da45d60c..a42f4f07051f 100644
--- a/arch/arm/mach-imx/mach-mx35_3ds.c
+++ b/arch/arm/mach-imx/mach-mx35_3ds.c
@@ -602,10 +602,6 @@ static void __init mx35pdk_timer_init(void)
602 mx35_clocks_init(); 602 mx35_clocks_init();
603} 603}
604 604
605static struct sys_timer mx35pdk_timer = {
606 .init = mx35pdk_timer_init,
607};
608
609static void __init mx35_3ds_reserve(void) 605static void __init mx35_3ds_reserve(void)
610{ 606{
611 /* reserve MX35_3DS_CAMERA_BUF_SIZE bytes for mx3-camera */ 607 /* reserve MX35_3DS_CAMERA_BUF_SIZE bytes for mx3-camera */
@@ -620,7 +616,7 @@ MACHINE_START(MX35_3DS, "Freescale MX35PDK")
620 .init_early = imx35_init_early, 616 .init_early = imx35_init_early,
621 .init_irq = mx35_init_irq, 617 .init_irq = mx35_init_irq,
622 .handle_irq = imx35_handle_irq, 618 .handle_irq = imx35_handle_irq,
623 .timer = &mx35pdk_timer, 619 .init_time = mx35pdk_timer_init,
624 .init_machine = mx35_3ds_init, 620 .init_machine = mx35_3ds_init,
625 .reserve = mx35_3ds_reserve, 621 .reserve = mx35_3ds_reserve,
626 .restart = mxc_restart, 622 .restart = mxc_restart,
diff --git a/arch/arm/mach-imx/mach-mx50_rdp.c b/arch/arm/mach-imx/mach-mx50_rdp.c
deleted file mode 100644
index 0c1f88a80bdc..000000000000
--- a/arch/arm/mach-imx/mach-mx50_rdp.c
+++ /dev/null
@@ -1,225 +0,0 @@
1/*
2 * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
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 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#include <linux/init.h>
22#include <linux/platform_device.h>
23#include <linux/gpio.h>
24#include <linux/delay.h>
25#include <linux/io.h>
26
27#include <asm/irq.h>
28#include <asm/setup.h>
29#include <asm/mach-types.h>
30#include <asm/mach/arch.h>
31#include <asm/mach/time.h>
32
33#include "common.h"
34#include "devices-imx50.h"
35#include "hardware.h"
36#include "iomux-mx50.h"
37
38#define FEC_EN IMX_GPIO_NR(6, 23)
39#define FEC_RESET_B IMX_GPIO_NR(4, 12)
40
41static iomux_v3_cfg_t mx50_rdp_pads[] __initdata = {
42 /* SD1 */
43 MX50_PAD_ECSPI2_SS0__GPIO_4_19,
44 MX50_PAD_EIM_CRE__GPIO_1_27,
45 MX50_PAD_SD1_CMD__SD1_CMD,
46
47 MX50_PAD_SD1_CLK__SD1_CLK,
48 MX50_PAD_SD1_D0__SD1_D0,
49 MX50_PAD_SD1_D1__SD1_D1,
50 MX50_PAD_SD1_D2__SD1_D2,
51 MX50_PAD_SD1_D3__SD1_D3,
52
53 /* SD2 */
54 MX50_PAD_SD2_CD__GPIO_5_17,
55 MX50_PAD_SD2_WP__GPIO_5_16,
56 MX50_PAD_SD2_CMD__SD2_CMD,
57 MX50_PAD_SD2_CLK__SD2_CLK,
58 MX50_PAD_SD2_D0__SD2_D0,
59 MX50_PAD_SD2_D1__SD2_D1,
60 MX50_PAD_SD2_D2__SD2_D2,
61 MX50_PAD_SD2_D3__SD2_D3,
62 MX50_PAD_SD2_D4__SD2_D4,
63 MX50_PAD_SD2_D5__SD2_D5,
64 MX50_PAD_SD2_D6__SD2_D6,
65 MX50_PAD_SD2_D7__SD2_D7,
66
67 /* SD3 */
68 MX50_PAD_SD3_CMD__SD3_CMD,
69 MX50_PAD_SD3_CLK__SD3_CLK,
70 MX50_PAD_SD3_D0__SD3_D0,
71 MX50_PAD_SD3_D1__SD3_D1,
72 MX50_PAD_SD3_D2__SD3_D2,
73 MX50_PAD_SD3_D3__SD3_D3,
74 MX50_PAD_SD3_D4__SD3_D4,
75 MX50_PAD_SD3_D5__SD3_D5,
76 MX50_PAD_SD3_D6__SD3_D6,
77 MX50_PAD_SD3_D7__SD3_D7,
78
79 /* PWR_INT */
80 MX50_PAD_ECSPI2_MISO__GPIO_4_18,
81
82 /* UART pad setting */
83 MX50_PAD_UART1_TXD__UART1_TXD,
84 MX50_PAD_UART1_RXD__UART1_RXD,
85 MX50_PAD_UART1_RTS__UART1_RTS,
86 MX50_PAD_UART2_TXD__UART2_TXD,
87 MX50_PAD_UART2_RXD__UART2_RXD,
88 MX50_PAD_UART2_CTS__UART2_CTS,
89 MX50_PAD_UART2_RTS__UART2_RTS,
90
91 MX50_PAD_I2C1_SCL__I2C1_SCL,
92 MX50_PAD_I2C1_SDA__I2C1_SDA,
93 MX50_PAD_I2C2_SCL__I2C2_SCL,
94 MX50_PAD_I2C2_SDA__I2C2_SDA,
95
96 MX50_PAD_EPITO__USBH1_PWR,
97 /* Need to comment below line if
98 * one needs to debug owire.
99 */
100 MX50_PAD_OWIRE__USBH1_OC,
101 /* using gpio to control otg pwr */
102 MX50_PAD_PWM2__GPIO_6_25,
103 MX50_PAD_I2C3_SCL__USBOTG_OC,
104
105 MX50_PAD_SSI_RXC__FEC_MDIO,
106 MX50_PAD_SSI_RXFS__FEC_MDC,
107 MX50_PAD_DISP_D0__FEC_TXCLK,
108 MX50_PAD_DISP_D1__FEC_RX_ER,
109 MX50_PAD_DISP_D2__FEC_RX_DV,
110 MX50_PAD_DISP_D3__FEC_RXD1,
111 MX50_PAD_DISP_D4__FEC_RXD0,
112 MX50_PAD_DISP_D5__FEC_TX_EN,
113 MX50_PAD_DISP_D6__FEC_TXD1,
114 MX50_PAD_DISP_D7__FEC_TXD0,
115 MX50_PAD_I2C3_SDA__GPIO_6_23,
116 MX50_PAD_ECSPI1_SCLK__GPIO_4_12,
117
118 MX50_PAD_CSPI_SS0__CSPI_SS0,
119 MX50_PAD_ECSPI1_MOSI__CSPI_SS1,
120 MX50_PAD_CSPI_MOSI__CSPI_MOSI,
121 MX50_PAD_CSPI_MISO__CSPI_MISO,
122
123 /* SGTL500_OSC_EN */
124 MX50_PAD_UART1_CTS__GPIO_6_8,
125
126 /* SGTL_AMP_SHDN */
127 MX50_PAD_UART3_RXD__GPIO_6_15,
128
129 /* Keypad */
130 MX50_PAD_KEY_COL0__KEY_COL0,
131 MX50_PAD_KEY_ROW0__KEY_ROW0,
132 MX50_PAD_KEY_COL1__KEY_COL1,
133 MX50_PAD_KEY_ROW1__KEY_ROW1,
134 MX50_PAD_KEY_COL2__KEY_COL2,
135 MX50_PAD_KEY_ROW2__KEY_ROW2,
136 MX50_PAD_KEY_COL3__KEY_COL3,
137 MX50_PAD_KEY_ROW3__KEY_ROW3,
138 MX50_PAD_EIM_DA0__KEY_COL4,
139 MX50_PAD_EIM_DA1__KEY_ROW4,
140 MX50_PAD_EIM_DA2__KEY_COL5,
141 MX50_PAD_EIM_DA3__KEY_ROW5,
142 MX50_PAD_EIM_DA4__KEY_COL6,
143 MX50_PAD_EIM_DA5__KEY_ROW6,
144 MX50_PAD_EIM_DA6__KEY_COL7,
145 MX50_PAD_EIM_DA7__KEY_ROW7,
146 /*EIM pads */
147 MX50_PAD_EIM_DA8__GPIO_1_8,
148 MX50_PAD_EIM_DA9__GPIO_1_9,
149 MX50_PAD_EIM_DA10__GPIO_1_10,
150 MX50_PAD_EIM_DA11__GPIO_1_11,
151 MX50_PAD_EIM_DA12__GPIO_1_12,
152 MX50_PAD_EIM_DA13__GPIO_1_13,
153 MX50_PAD_EIM_DA14__GPIO_1_14,
154 MX50_PAD_EIM_DA15__GPIO_1_15,
155 MX50_PAD_EIM_CS2__GPIO_1_16,
156 MX50_PAD_EIM_CS1__GPIO_1_17,
157 MX50_PAD_EIM_CS0__GPIO_1_18,
158 MX50_PAD_EIM_EB0__GPIO_1_19,
159 MX50_PAD_EIM_EB1__GPIO_1_20,
160 MX50_PAD_EIM_WAIT__GPIO_1_21,
161 MX50_PAD_EIM_BCLK__GPIO_1_22,
162 MX50_PAD_EIM_RDY__GPIO_1_23,
163 MX50_PAD_EIM_OE__GPIO_1_24,
164};
165
166/* Serial ports */
167static const struct imxuart_platform_data uart_pdata __initconst = {
168 .flags = IMXUART_HAVE_RTSCTS,
169};
170
171static const struct fec_platform_data fec_data __initconst = {
172 .phy = PHY_INTERFACE_MODE_RMII,
173};
174
175static inline void mx50_rdp_fec_reset(void)
176{
177 gpio_request(FEC_EN, "fec-en");
178 gpio_direction_output(FEC_EN, 0);
179 gpio_request(FEC_RESET_B, "fec-reset_b");
180 gpio_direction_output(FEC_RESET_B, 0);
181 msleep(1);
182 gpio_set_value(FEC_RESET_B, 1);
183}
184
185static const struct imxi2c_platform_data i2c_data __initconst = {
186 .bitrate = 100000,
187};
188
189/*
190 * Board specific initialization.
191 */
192static void __init mx50_rdp_board_init(void)
193{
194 imx50_soc_init();
195
196 mxc_iomux_v3_setup_multiple_pads(mx50_rdp_pads,
197 ARRAY_SIZE(mx50_rdp_pads));
198
199 imx50_add_imx_uart(0, &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);
206}
207
208static void __init mx50_rdp_timer_init(void)
209{
210 mx50_clocks_init(32768, 24000000, 22579200);
211}
212
213static struct sys_timer mx50_rdp_timer = {
214 .init = mx50_rdp_timer_init,
215};
216
217MACHINE_START(MX50_RDP, "Freescale MX50 Reference Design Platform")
218 .map_io = mx50_map_io,
219 .init_early = imx50_init_early,
220 .init_irq = mx50_init_irq,
221 .handle_irq = imx50_handle_irq,
222 .timer = &mx50_rdp_timer,
223 .init_machine = mx50_rdp_board_init,
224 .restart = mxc_restart,
225MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx51_3ds.c b/arch/arm/mach-imx/mach-mx51_3ds.c
deleted file mode 100644
index abc25bd1107b..000000000000
--- a/arch/arm/mach-imx/mach-mx51_3ds.c
+++ /dev/null
@@ -1,178 +0,0 @@
1/*
2 * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright (C) 2010 Jason Wang <jason77.wang@gmail.com>
4 *
5 * The code contained herein is licensed under the GNU General Public
6 * License. You may obtain a copy of the GNU General Public License
7 * Version 2 or later at the following locations:
8 *
9 * http://www.opensource.org/licenses/gpl-license.html
10 * http://www.gnu.org/copyleft/gpl.html
11 */
12
13#include <linux/irq.h>
14#include <linux/platform_device.h>
15#include <linux/spi/spi.h>
16#include <linux/gpio.h>
17
18#include <asm/mach-types.h>
19#include <asm/mach/arch.h>
20#include <asm/mach/time.h>
21
22#include "3ds_debugboard.h"
23#include "common.h"
24#include "devices-imx51.h"
25#include "hardware.h"
26#include "iomux-mx51.h"
27
28#define MX51_3DS_ECSPI2_CS (GPIO_PORTC + 28)
29
30static iomux_v3_cfg_t mx51_3ds_pads[] = {
31 /* UART1 */
32 MX51_PAD_UART1_RXD__UART1_RXD,
33 MX51_PAD_UART1_TXD__UART1_TXD,
34 MX51_PAD_UART1_RTS__UART1_RTS,
35 MX51_PAD_UART1_CTS__UART1_CTS,
36
37 /* UART2 */
38 MX51_PAD_UART2_RXD__UART2_RXD,
39 MX51_PAD_UART2_TXD__UART2_TXD,
40 MX51_PAD_EIM_D25__UART2_CTS,
41 MX51_PAD_EIM_D26__UART2_RTS,
42
43 /* UART3 */
44 MX51_PAD_UART3_RXD__UART3_RXD,
45 MX51_PAD_UART3_TXD__UART3_TXD,
46 MX51_PAD_EIM_D24__UART3_CTS,
47 MX51_PAD_EIM_D27__UART3_RTS,
48
49 /* CPLD PARENT IRQ PIN */
50 MX51_PAD_GPIO1_6__GPIO1_6,
51
52 /* KPP */
53 MX51_PAD_KEY_ROW0__KEY_ROW0,
54 MX51_PAD_KEY_ROW1__KEY_ROW1,
55 MX51_PAD_KEY_ROW2__KEY_ROW2,
56 MX51_PAD_KEY_ROW3__KEY_ROW3,
57 MX51_PAD_KEY_COL0__KEY_COL0,
58 MX51_PAD_KEY_COL1__KEY_COL1,
59 MX51_PAD_KEY_COL2__KEY_COL2,
60 MX51_PAD_KEY_COL3__KEY_COL3,
61 MX51_PAD_KEY_COL4__KEY_COL4,
62 MX51_PAD_KEY_COL5__KEY_COL5,
63
64 /* eCSPI2 */
65 MX51_PAD_NANDF_RB2__ECSPI2_SCLK,
66 MX51_PAD_NANDF_RB3__ECSPI2_MISO,
67 MX51_PAD_NANDF_D15__ECSPI2_MOSI,
68 MX51_PAD_NANDF_D12__GPIO3_28,
69};
70
71/* Serial ports */
72static const struct imxuart_platform_data uart_pdata __initconst = {
73 .flags = IMXUART_HAVE_RTSCTS,
74};
75
76static int mx51_3ds_board_keymap[] = {
77 KEY(0, 0, KEY_1),
78 KEY(0, 1, KEY_2),
79 KEY(0, 2, KEY_3),
80 KEY(0, 3, KEY_F1),
81 KEY(0, 4, KEY_UP),
82 KEY(0, 5, KEY_F2),
83
84 KEY(1, 0, KEY_4),
85 KEY(1, 1, KEY_5),
86 KEY(1, 2, KEY_6),
87 KEY(1, 3, KEY_LEFT),
88 KEY(1, 4, KEY_SELECT),
89 KEY(1, 5, KEY_RIGHT),
90
91 KEY(2, 0, KEY_7),
92 KEY(2, 1, KEY_8),
93 KEY(2, 2, KEY_9),
94 KEY(2, 3, KEY_F3),
95 KEY(2, 4, KEY_DOWN),
96 KEY(2, 5, KEY_F4),
97
98 KEY(3, 0, KEY_0),
99 KEY(3, 1, KEY_OK),
100 KEY(3, 2, KEY_ESC),
101 KEY(3, 3, KEY_ENTER),
102 KEY(3, 4, KEY_MENU),
103 KEY(3, 5, KEY_BACK)
104};
105
106static const struct matrix_keymap_data mx51_3ds_map_data __initconst = {
107 .keymap = mx51_3ds_board_keymap,
108 .keymap_size = ARRAY_SIZE(mx51_3ds_board_keymap),
109};
110
111static int mx51_3ds_spi2_cs[] = {
112 MXC_SPI_CS(0),
113 MX51_3DS_ECSPI2_CS,
114};
115
116static const struct spi_imx_master mx51_3ds_ecspi2_pdata __initconst = {
117 .chipselect = mx51_3ds_spi2_cs,
118 .num_chipselect = ARRAY_SIZE(mx51_3ds_spi2_cs),
119};
120
121static struct spi_board_info mx51_3ds_spi_nor_device[] = {
122 {
123 .modalias = "m25p80",
124 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
125 .bus_num = 1,
126 .chip_select = 1,
127 .mode = SPI_MODE_0,
128 .platform_data = NULL,},
129};
130
131/*
132 * Board specific initialization.
133 */
134static void __init mx51_3ds_init(void)
135{
136 imx51_soc_init();
137
138 mxc_iomux_v3_setup_multiple_pads(mx51_3ds_pads,
139 ARRAY_SIZE(mx51_3ds_pads));
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);
144
145 imx51_add_ecspi(1, &mx51_3ds_ecspi2_pdata);
146 spi_register_board_info(mx51_3ds_spi_nor_device,
147 ARRAY_SIZE(mx51_3ds_spi_nor_device));
148
149 if (mxc_expio_init(MX51_CS5_BASE_ADDR, IMX_GPIO_NR(1, 6)))
150 printk(KERN_WARNING "Init of the debugboard failed, all "
151 "devices on the board are unusable.\n");
152
153 imx51_add_sdhci_esdhc_imx(0, NULL);
154 imx51_add_imx_keypad(&mx51_3ds_map_data);
155 imx51_add_imx2_wdt(0);
156}
157
158static void __init mx51_3ds_timer_init(void)
159{
160 mx51_clocks_init(32768, 24000000, 22579200, 0);
161}
162
163static struct sys_timer mx51_3ds_timer = {
164 .init = mx51_3ds_timer_init,
165};
166
167MACHINE_START(MX51_3DS, "Freescale MX51 3-Stack Board")
168 /* Maintainer: Freescale Semiconductor, Inc. */
169 .atag_offset = 0x100,
170 .map_io = mx51_map_io,
171 .init_early = imx51_init_early,
172 .init_irq = mx51_init_irq,
173 .handle_irq = imx51_handle_irq,
174 .timer = &mx51_3ds_timer,
175 .init_machine = mx51_3ds_init,
176 .init_late = imx51_init_late,
177 .restart = mxc_restart,
178MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx51_babbage.c b/arch/arm/mach-imx/mach-mx51_babbage.c
index d9a84ca2199a..6c4d7feb4520 100644
--- a/arch/arm/mach-imx/mach-mx51_babbage.c
+++ b/arch/arm/mach-imx/mach-mx51_babbage.c
@@ -418,10 +418,6 @@ static void __init mx51_babbage_timer_init(void)
418 mx51_clocks_init(32768, 24000000, 22579200, 0); 418 mx51_clocks_init(32768, 24000000, 22579200, 0);
419} 419}
420 420
421static struct sys_timer mx51_babbage_timer = {
422 .init = mx51_babbage_timer_init,
423};
424
425MACHINE_START(MX51_BABBAGE, "Freescale MX51 Babbage Board") 421MACHINE_START(MX51_BABBAGE, "Freescale MX51 Babbage Board")
426 /* Maintainer: Amit Kucheria <amit.kucheria@canonical.com> */ 422 /* Maintainer: Amit Kucheria <amit.kucheria@canonical.com> */
427 .atag_offset = 0x100, 423 .atag_offset = 0x100,
@@ -429,7 +425,7 @@ MACHINE_START(MX51_BABBAGE, "Freescale MX51 Babbage Board")
429 .init_early = imx51_init_early, 425 .init_early = imx51_init_early,
430 .init_irq = mx51_init_irq, 426 .init_irq = mx51_init_irq,
431 .handle_irq = imx51_handle_irq, 427 .handle_irq = imx51_handle_irq,
432 .timer = &mx51_babbage_timer, 428 .init_time = mx51_babbage_timer_init,
433 .init_machine = mx51_babbage_init, 429 .init_machine = mx51_babbage_init,
434 .init_late = imx51_init_late, 430 .init_late = imx51_init_late,
435 .restart = mxc_restart, 431 .restart = mxc_restart,
diff --git a/arch/arm/mach-imx/mach-mxt_td60.c b/arch/arm/mach-imx/mach-mxt_td60.c
index f4a8c7e108e1..a27faaba98ec 100644
--- a/arch/arm/mach-imx/mach-mxt_td60.c
+++ b/arch/arm/mach-imx/mach-mxt_td60.c
@@ -261,10 +261,6 @@ static void __init mxt_td60_timer_init(void)
261 mx27_clocks_init(26000000); 261 mx27_clocks_init(26000000);
262} 262}
263 263
264static struct sys_timer mxt_td60_timer = {
265 .init = mxt_td60_timer_init,
266};
267
268MACHINE_START(MXT_TD60, "Maxtrack i-MXT TD60") 264MACHINE_START(MXT_TD60, "Maxtrack i-MXT TD60")
269 /* maintainer: Maxtrack Industrial */ 265 /* maintainer: Maxtrack Industrial */
270 .atag_offset = 0x100, 266 .atag_offset = 0x100,
@@ -272,7 +268,7 @@ MACHINE_START(MXT_TD60, "Maxtrack i-MXT TD60")
272 .init_early = imx27_init_early, 268 .init_early = imx27_init_early,
273 .init_irq = mx27_init_irq, 269 .init_irq = mx27_init_irq,
274 .handle_irq = imx27_handle_irq, 270 .handle_irq = imx27_handle_irq,
275 .timer = &mxt_td60_timer, 271 .init_time = mxt_td60_timer_init,
276 .init_machine = mxt_td60_board_init, 272 .init_machine = mxt_td60_board_init,
277 .restart = mxc_restart, 273 .restart = mxc_restart,
278MACHINE_END 274MACHINE_END
diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c
index eee369fa94a2..b8b15bb1ffdf 100644
--- a/arch/arm/mach-imx/mach-pca100.c
+++ b/arch/arm/mach-imx/mach-pca100.c
@@ -416,10 +416,6 @@ static void __init pca100_timer_init(void)
416 mx27_clocks_init(26000000); 416 mx27_clocks_init(26000000);
417} 417}
418 418
419static struct sys_timer pca100_timer = {
420 .init = pca100_timer_init,
421};
422
423MACHINE_START(PCA100, "phyCARD-i.MX27") 419MACHINE_START(PCA100, "phyCARD-i.MX27")
424 .atag_offset = 0x100, 420 .atag_offset = 0x100,
425 .map_io = mx27_map_io, 421 .map_io = mx27_map_io,
@@ -427,6 +423,6 @@ MACHINE_START(PCA100, "phyCARD-i.MX27")
427 .init_irq = mx27_init_irq, 423 .init_irq = mx27_init_irq,
428 .handle_irq = imx27_handle_irq, 424 .handle_irq = imx27_handle_irq,
429 .init_machine = pca100_init, 425 .init_machine = pca100_init,
430 .timer = &pca100_timer, 426 .init_time = pca100_timer_init,
431 .restart = mxc_restart, 427 .restart = mxc_restart,
432MACHINE_END 428MACHINE_END
diff --git a/arch/arm/mach-imx/mach-pcm037.c b/arch/arm/mach-imx/mach-pcm037.c
index 547fef133f65..bc0261e99d39 100644
--- a/arch/arm/mach-imx/mach-pcm037.c
+++ b/arch/arm/mach-imx/mach-pcm037.c
@@ -685,10 +685,6 @@ static void __init pcm037_timer_init(void)
685 mx31_clocks_init(26000000); 685 mx31_clocks_init(26000000);
686} 686}
687 687
688static struct sys_timer pcm037_timer = {
689 .init = pcm037_timer_init,
690};
691
692static void __init pcm037_reserve(void) 688static void __init pcm037_reserve(void)
693{ 689{
694 /* reserve 4 MiB for mx3-camera */ 690 /* reserve 4 MiB for mx3-camera */
@@ -709,7 +705,7 @@ MACHINE_START(PCM037, "Phytec Phycore pcm037")
709 .init_early = imx31_init_early, 705 .init_early = imx31_init_early,
710 .init_irq = mx31_init_irq, 706 .init_irq = mx31_init_irq,
711 .handle_irq = imx31_handle_irq, 707 .handle_irq = imx31_handle_irq,
712 .timer = &pcm037_timer, 708 .init_time = pcm037_timer_init,
713 .init_machine = pcm037_init, 709 .init_machine = pcm037_init,
714 .init_late = pcm037_init_late, 710 .init_late = pcm037_init_late,
715 .restart = mxc_restart, 711 .restart = mxc_restart,
diff --git a/arch/arm/mach-imx/mach-pcm038.c b/arch/arm/mach-imx/mach-pcm038.c
index 4aa0d0798605..e805ac273e9c 100644
--- a/arch/arm/mach-imx/mach-pcm038.c
+++ b/arch/arm/mach-imx/mach-pcm038.c
@@ -346,17 +346,13 @@ static void __init pcm038_timer_init(void)
346 mx27_clocks_init(26000000); 346 mx27_clocks_init(26000000);
347} 347}
348 348
349static struct sys_timer pcm038_timer = {
350 .init = pcm038_timer_init,
351};
352
353MACHINE_START(PCM038, "phyCORE-i.MX27") 349MACHINE_START(PCM038, "phyCORE-i.MX27")
354 .atag_offset = 0x100, 350 .atag_offset = 0x100,
355 .map_io = mx27_map_io, 351 .map_io = mx27_map_io,
356 .init_early = imx27_init_early, 352 .init_early = imx27_init_early,
357 .init_irq = mx27_init_irq, 353 .init_irq = mx27_init_irq,
358 .handle_irq = imx27_handle_irq, 354 .handle_irq = imx27_handle_irq,
359 .timer = &pcm038_timer, 355 .init_time = pcm038_timer_init,
360 .init_machine = pcm038_init, 356 .init_machine = pcm038_init,
361 .restart = mxc_restart, 357 .restart = mxc_restart,
362MACHINE_END 358MACHINE_END
diff --git a/arch/arm/mach-imx/mach-pcm043.c b/arch/arm/mach-imx/mach-pcm043.c
index 92445440221e..8ed533f0f8ca 100644
--- a/arch/arm/mach-imx/mach-pcm043.c
+++ b/arch/arm/mach-imx/mach-pcm043.c
@@ -394,10 +394,6 @@ static void __init pcm043_timer_init(void)
394 mx35_clocks_init(); 394 mx35_clocks_init();
395} 395}
396 396
397static struct sys_timer pcm043_timer = {
398 .init = pcm043_timer_init,
399};
400
401MACHINE_START(PCM043, "Phytec Phycore pcm043") 397MACHINE_START(PCM043, "Phytec Phycore pcm043")
402 /* Maintainer: Pengutronix */ 398 /* Maintainer: Pengutronix */
403 .atag_offset = 0x100, 399 .atag_offset = 0x100,
@@ -405,7 +401,7 @@ MACHINE_START(PCM043, "Phytec Phycore pcm043")
405 .init_early = imx35_init_early, 401 .init_early = imx35_init_early,
406 .init_irq = mx35_init_irq, 402 .init_irq = mx35_init_irq,
407 .handle_irq = imx35_handle_irq, 403 .handle_irq = imx35_handle_irq,
408 .timer = &pcm043_timer, 404 .init_time = pcm043_timer_init,
409 .init_machine = pcm043_init, 405 .init_machine = pcm043_init,
410 .restart = mxc_restart, 406 .restart = mxc_restart,
411MACHINE_END 407MACHINE_END
diff --git a/arch/arm/mach-imx/mach-qong.c b/arch/arm/mach-imx/mach-qong.c
index 96d9a91f8a3b..22af27ed457e 100644
--- a/arch/arm/mach-imx/mach-qong.c
+++ b/arch/arm/mach-imx/mach-qong.c
@@ -260,10 +260,6 @@ static void __init qong_timer_init(void)
260 mx31_clocks_init(26000000); 260 mx31_clocks_init(26000000);
261} 261}
262 262
263static struct sys_timer qong_timer = {
264 .init = qong_timer_init,
265};
266
267MACHINE_START(QONG, "Dave/DENX QongEVB-LITE") 263MACHINE_START(QONG, "Dave/DENX QongEVB-LITE")
268 /* Maintainer: DENX Software Engineering GmbH */ 264 /* Maintainer: DENX Software Engineering GmbH */
269 .atag_offset = 0x100, 265 .atag_offset = 0x100,
@@ -271,7 +267,7 @@ MACHINE_START(QONG, "Dave/DENX QongEVB-LITE")
271 .init_early = imx31_init_early, 267 .init_early = imx31_init_early,
272 .init_irq = mx31_init_irq, 268 .init_irq = mx31_init_irq,
273 .handle_irq = imx31_handle_irq, 269 .handle_irq = imx31_handle_irq,
274 .timer = &qong_timer, 270 .init_time = qong_timer_init,
275 .init_machine = qong_init, 271 .init_machine = qong_init,
276 .restart = mxc_restart, 272 .restart = mxc_restart,
277MACHINE_END 273MACHINE_END
diff --git a/arch/arm/mach-imx/mach-scb9328.c b/arch/arm/mach-imx/mach-scb9328.c
index fc970409dbaf..b0fa10dd79fe 100644
--- a/arch/arm/mach-imx/mach-scb9328.c
+++ b/arch/arm/mach-imx/mach-scb9328.c
@@ -131,10 +131,6 @@ static void __init scb9328_timer_init(void)
131 mx1_clocks_init(32000); 131 mx1_clocks_init(32000);
132} 132}
133 133
134static struct sys_timer scb9328_timer = {
135 .init = scb9328_timer_init,
136};
137
138MACHINE_START(SCB9328, "Synertronixx scb9328") 134MACHINE_START(SCB9328, "Synertronixx scb9328")
139 /* Sascha Hauer */ 135 /* Sascha Hauer */
140 .atag_offset = 100, 136 .atag_offset = 100,
@@ -142,7 +138,7 @@ MACHINE_START(SCB9328, "Synertronixx scb9328")
142 .init_early = imx1_init_early, 138 .init_early = imx1_init_early,
143 .init_irq = mx1_init_irq, 139 .init_irq = mx1_init_irq,
144 .handle_irq = imx1_handle_irq, 140 .handle_irq = imx1_handle_irq,
145 .timer = &scb9328_timer, 141 .init_time = scb9328_timer_init,
146 .init_machine = scb9328_init, 142 .init_machine = scb9328_init,
147 .restart = mxc_restart, 143 .restart = mxc_restart,
148MACHINE_END 144MACHINE_END
diff --git a/arch/arm/mach-imx/mach-vpr200.c b/arch/arm/mach-imx/mach-vpr200.c
index 3aecf91e4289..0910761e8280 100644
--- a/arch/arm/mach-imx/mach-vpr200.c
+++ b/arch/arm/mach-imx/mach-vpr200.c
@@ -305,17 +305,13 @@ static void __init vpr200_timer_init(void)
305 mx35_clocks_init(); 305 mx35_clocks_init();
306} 306}
307 307
308static struct sys_timer vpr200_timer = {
309 .init = vpr200_timer_init,
310};
311
312MACHINE_START(VPR200, "VPR200") 308MACHINE_START(VPR200, "VPR200")
313 /* Maintainer: Creative Product Design */ 309 /* Maintainer: Creative Product Design */
314 .map_io = mx35_map_io, 310 .map_io = mx35_map_io,
315 .init_early = imx35_init_early, 311 .init_early = imx35_init_early,
316 .init_irq = mx35_init_irq, 312 .init_irq = mx35_init_irq,
317 .handle_irq = imx35_handle_irq, 313 .handle_irq = imx35_handle_irq,
318 .timer = &vpr200_timer, 314 .init_time = vpr200_timer_init,
319 .init_machine = vpr200_board_init, 315 .init_machine = vpr200_board_init,
320 .restart = mxc_restart, 316 .restart = mxc_restart,
321MACHINE_END 317MACHINE_END
diff --git a/arch/arm/mach-imx/mm-imx5.c b/arch/arm/mach-imx/mm-imx5.c
index 79d71cf23a1d..cf34994cfe28 100644
--- a/arch/arm/mach-imx/mm-imx5.c
+++ b/arch/arm/mach-imx/mm-imx5.c
@@ -24,16 +24,6 @@
24#include "iomux-v3.h" 24#include "iomux-v3.h"
25 25
26/* 26/*
27 * Define the MX50 memory map.
28 */
29static struct map_desc mx50_io_desc[] __initdata = {
30 imx_map_entry(MX50, TZIC, MT_DEVICE),
31 imx_map_entry(MX50, SPBA0, MT_DEVICE),
32 imx_map_entry(MX50, AIPS1, MT_DEVICE),
33 imx_map_entry(MX50, AIPS2, MT_DEVICE),
34};
35
36/*
37 * Define the MX51 memory map. 27 * Define the MX51 memory map.
38 */ 28 */
39static struct map_desc mx51_io_desc[] __initdata = { 29static struct map_desc mx51_io_desc[] __initdata = {
@@ -59,11 +49,6 @@ static struct map_desc mx53_io_desc[] __initdata = {
59 * system startup to create static physical to virtual memory mappings 49 * system startup to create static physical to virtual memory mappings
60 * for the IO modules. 50 * for the IO modules.
61 */ 51 */
62void __init mx50_map_io(void)
63{
64 iotable_init(mx50_io_desc, ARRAY_SIZE(mx50_io_desc));
65}
66
67void __init mx51_map_io(void) 52void __init mx51_map_io(void)
68{ 53{
69 iotable_init(mx51_io_desc, ARRAY_SIZE(mx51_io_desc)); 54 iotable_init(mx51_io_desc, ARRAY_SIZE(mx51_io_desc));
@@ -74,13 +59,6 @@ void __init mx53_map_io(void)
74 iotable_init(mx53_io_desc, ARRAY_SIZE(mx53_io_desc)); 59 iotable_init(mx53_io_desc, ARRAY_SIZE(mx53_io_desc));
75} 60}
76 61
77void __init imx50_init_early(void)
78{
79 mxc_set_cpu_type(MXC_CPU_MX50);
80 mxc_iomux_v3_init(MX50_IO_ADDRESS(MX50_IOMUXC_BASE_ADDR));
81 mxc_arch_reset_init(MX50_IO_ADDRESS(MX50_WDOG_BASE_ADDR));
82}
83
84/* 62/*
85 * The MIPI HSC unit has been removed from the i.MX51 Reference Manual by 63 * The MIPI HSC unit has been removed from the i.MX51 Reference Manual by
86 * the Freescale marketing division. However this did not remove the 64 * the Freescale marketing division. However this did not remove the
@@ -115,11 +93,6 @@ void __init imx53_init_early(void)
115 mxc_arch_reset_init(MX53_IO_ADDRESS(MX53_WDOG1_BASE_ADDR)); 93 mxc_arch_reset_init(MX53_IO_ADDRESS(MX53_WDOG1_BASE_ADDR));
116} 94}
117 95
118void __init mx50_init_irq(void)
119{
120 tzic_init_irq(MX50_IO_ADDRESS(MX50_TZIC_BASE_ADDR));
121}
122
123void __init mx51_init_irq(void) 96void __init mx51_init_irq(void)
124{ 97{
125 tzic_init_irq(MX51_IO_ADDRESS(MX51_TZIC_BASE_ADDR)); 98 tzic_init_irq(MX51_IO_ADDRESS(MX51_TZIC_BASE_ADDR));
@@ -148,31 +121,10 @@ static struct sdma_platform_data imx51_sdma_pdata __initdata = {
148 .script_addrs = &imx51_sdma_script, 121 .script_addrs = &imx51_sdma_script,
149}; 122};
150 123
151static const struct resource imx50_audmux_res[] __initconst = {
152 DEFINE_RES_MEM(MX50_AUDMUX_BASE_ADDR, SZ_16K),
153};
154
155static const struct resource imx51_audmux_res[] __initconst = { 124static const struct resource imx51_audmux_res[] __initconst = {
156 DEFINE_RES_MEM(MX51_AUDMUX_BASE_ADDR, SZ_16K), 125 DEFINE_RES_MEM(MX51_AUDMUX_BASE_ADDR, SZ_16K),
157}; 126};
158 127
159void __init imx50_soc_init(void)
160{
161 mxc_device_init();
162
163 /* i.mx50 has the i.mx35 type gpio */
164 mxc_register_gpio("imx35-gpio", 0, MX50_GPIO1_BASE_ADDR, SZ_16K, MX50_INT_GPIO1_LOW, MX50_INT_GPIO1_HIGH);
165 mxc_register_gpio("imx35-gpio", 1, MX50_GPIO2_BASE_ADDR, SZ_16K, MX50_INT_GPIO2_LOW, MX50_INT_GPIO2_HIGH);
166 mxc_register_gpio("imx35-gpio", 2, MX50_GPIO3_BASE_ADDR, SZ_16K, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH);
167 mxc_register_gpio("imx35-gpio", 3, MX50_GPIO4_BASE_ADDR, SZ_16K, MX50_INT_GPIO4_LOW, MX50_INT_GPIO4_HIGH);
168 mxc_register_gpio("imx35-gpio", 4, MX50_GPIO5_BASE_ADDR, SZ_16K, MX50_INT_GPIO5_LOW, MX50_INT_GPIO5_HIGH);
169 mxc_register_gpio("imx35-gpio", 5, MX50_GPIO6_BASE_ADDR, SZ_16K, MX50_INT_GPIO6_LOW, MX50_INT_GPIO6_HIGH);
170
171 /* i.mx50 has the i.mx31 type audmux */
172 platform_device_register_simple("imx31-audmux", 0, imx50_audmux_res,
173 ARRAY_SIZE(imx50_audmux_res));
174}
175
176void __init imx51_soc_init(void) 128void __init imx51_soc_init(void)
177{ 129{
178 mxc_device_init(); 130 mxc_device_init();
diff --git a/arch/arm/mach-imx/mx50.h b/arch/arm/mach-imx/mx50.h
deleted file mode 100644
index 09ac19c1570c..000000000000
--- a/arch/arm/mach-imx/mx50.h
+++ /dev/null
@@ -1,290 +0,0 @@
1#ifndef __MACH_MX50_H__
2#define __MACH_MX50_H__
3
4/*
5 * IROM
6 */
7#define MX50_IROM_BASE_ADDR 0x0
8#define MX50_IROM_SIZE SZ_64K
9
10/* TZIC */
11#define MX50_TZIC_BASE_ADDR 0x0fffc000
12#define MX50_TZIC_SIZE SZ_16K
13
14/*
15 * IRAM
16 */
17#define MX50_IRAM_BASE_ADDR 0xf8000000 /* internal ram */
18#define MX50_IRAM_PARTITIONS 16
19#define MX50_IRAM_SIZE (MX50_IRAM_PARTITIONS * SZ_8K) /* 128KB */
20
21/*
22 * Databahn
23 */
24#define MX50_DATABAHN_BASE_ADDR 0x14000000
25
26/*
27 * Graphics Memory of GPU
28 */
29#define MX50_GPU2D_BASE_ADDR 0x20000000
30
31#define MX50_DEBUG_BASE_ADDR 0x40000000
32#define MX50_DEBUG_SIZE SZ_1M
33#define MX50_ETB_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x00001000)
34#define MX50_ETM_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x00002000)
35#define MX50_TPIU_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x00003000)
36#define MX50_CTI0_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x00004000)
37#define MX50_CTI1_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x00005000)
38#define MX50_CTI2_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x00006000)
39#define MX50_CTI3_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x00007000)
40#define MX50_CORTEX_DBG_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x00008000)
41
42#define MX50_APBHDMA_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x01000000)
43#define MX50_OCOTP_CTRL_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x01002000)
44#define MX50_DIGCTL_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x01004000)
45#define MX50_GPMI_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x01006000)
46#define MX50_BCH_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x01008000)
47#define MX50_ELCDIF_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x0100a000)
48#define MX50_EPXP_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x0100c000)
49#define MX50_DCP_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x0100e000)
50#define MX50_EPDC_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x01010000)
51#define MX50_QOSC_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x01012000)
52#define MX50_PERFMON_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x01014000)
53#define MX50_SSP_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x01016000)
54#define MX50_ANATOP_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x01018000)
55#define MX50_NIC_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x08000000)
56
57/*
58 * SPBA global module enabled #0
59 */
60#define MX50_SPBA0_BASE_ADDR 0x50000000
61#define MX50_SPBA0_SIZE SZ_1M
62
63#define MX50_MMC_SDHC1_BASE_ADDR (MX50_SPBA0_BASE_ADDR + 0x00004000)
64#define MX50_MMC_SDHC2_BASE_ADDR (MX50_SPBA0_BASE_ADDR + 0x00008000)
65#define MX50_UART3_BASE_ADDR (MX50_SPBA0_BASE_ADDR + 0x0000c000)
66#define MX50_CSPI1_BASE_ADDR (MX50_SPBA0_BASE_ADDR + 0x00010000)
67#define MX50_SSI2_BASE_ADDR (MX50_SPBA0_BASE_ADDR + 0x00014000)
68#define MX50_MMC_SDHC3_BASE_ADDR (MX50_SPBA0_BASE_ADDR + 0x00020000)
69#define MX50_MMC_SDHC4_BASE_ADDR (MX50_SPBA0_BASE_ADDR + 0x00024000)
70
71/*
72 * AIPS 1
73 */
74#define MX50_AIPS1_BASE_ADDR 0x53f00000
75#define MX50_AIPS1_SIZE SZ_1M
76
77#define MX50_OTG_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x00080000)
78#define MX50_GPIO1_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x00084000)
79#define MX50_GPIO2_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x00088000)
80#define MX50_GPIO3_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x0008c000)
81#define MX50_GPIO4_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x00090000)
82#define MX50_KPP_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x00094000)
83#define MX50_WDOG_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x00098000)
84#define MX50_GPT1_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000a0000)
85#define MX50_SRTC_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000a4000)
86#define MX50_IOMUXC_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000a8000)
87#define MX50_EPIT1_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000ac000)
88#define MX50_PWM1_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000b4000)
89#define MX50_PWM2_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000b8000)
90#define MX50_UART1_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000bc000)
91#define MX50_UART2_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000c0000)
92#define MX50_SRC_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000d0000)
93#define MX50_CCM_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000d4000)
94#define MX50_GPC_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000d8000)
95#define MX50_GPIO5_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000dc000)
96#define MX50_GPIO6_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000e0000)
97#define MX50_I2C3_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000ec000)
98#define MX50_UART4_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000f0000)
99
100#define MX50_MSHC_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000f4000)
101#define MX50_RNGB_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000f8000)
102
103/*
104 * AIPS 2
105 */
106#define MX50_AIPS2_BASE_ADDR 0x63f00000
107#define MX50_AIPS2_SIZE SZ_1M
108
109#define MX50_PLL1_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x00080000)
110#define MX50_PLL2_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x00084000)
111#define MX50_PLL3_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x00088000)
112#define MX50_UART5_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x00090000)
113#define MX50_AHBMAX_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x00094000)
114#define MX50_ARM_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000a0000)
115#define MX50_OWIRE_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000a4000)
116#define MX50_CSPI2_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000ac000)
117#define MX50_SDMA_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000b0000)
118#define MX50_ROMCP_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000b8000)
119#define MX50_CSPI3_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000c0000)
120#define MX50_I2C2_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000c4000)
121#define MX50_I2C1_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000c8000)
122#define MX50_SSI1_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000cc000)
123#define MX50_AUDMUX_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000d0000)
124#define MX50_WEIM_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000d8000)
125#define MX50_FEC_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000ec000)
126
127/*
128 * Memory regions and CS
129 */
130#define MX50_CSD0_BASE_ADDR 0x70000000
131#define MX50_CSD1_BASE_ADDR 0xb0000000
132#define MX50_CS0_BASE_ADDR 0xf0000000
133
134#define MX50_IO_P2V(x) IMX_IO_P2V(x)
135#define MX50_IO_ADDRESS(x) IOMEM(MX50_IO_P2V(x))
136
137/*
138 * defines for SPBA modules
139 */
140#define MX50_SPBA_SDHC1 0x04
141#define MX50_SPBA_SDHC2 0x08
142#define MX50_SPBA_UART3 0x0c
143#define MX50_SPBA_CSPI1 0x10
144#define MX50_SPBA_SSI2 0x14
145#define MX50_SPBA_SDHC3 0x20
146#define MX50_SPBA_SDHC4 0x24
147#define MX50_SPBA_SPDIF 0x28
148#define MX50_SPBA_ATA 0x30
149#define MX50_SPBA_SLIM 0x34
150#define MX50_SPBA_HSI2C 0x38
151#define MX50_SPBA_CTRL 0x3c
152
153/*
154 * DMA request assignments
155 */
156#define MX50_DMA_REQ_GPC 1
157#define MX50_DMA_REQ_ATA_UART4_RX 2
158#define MX50_DMA_REQ_ATA_UART4_TX 3
159#define MX50_DMA_REQ_CSPI1_RX 6
160#define MX50_DMA_REQ_CSPI1_TX 7
161#define MX50_DMA_REQ_CSPI2_RX 8
162#define MX50_DMA_REQ_CSPI2_TX 9
163#define MX50_DMA_REQ_I2C3_SDHC3 10
164#define MX50_DMA_REQ_SDHC4 11
165#define MX50_DMA_REQ_UART2_FIRI_RX 12
166#define MX50_DMA_REQ_UART2_FIRI_TX 13
167#define MX50_DMA_REQ_EXT0 14
168#define MX50_DMA_REQ_EXT1 15
169#define MX50_DMA_REQ_UART5_RX 16
170#define MX50_DMA_REQ_UART5_TX 17
171#define MX50_DMA_REQ_UART1_RX 18
172#define MX50_DMA_REQ_UART1_TX 19
173#define MX50_DMA_REQ_I2C1_SDHC1 20
174#define MX50_DMA_REQ_I2C2_SDHC2 21
175#define MX50_DMA_REQ_SSI2_RX2 22
176#define MX50_DMA_REQ_SSI2_TX2 23
177#define MX50_DMA_REQ_SSI2_RX1 24
178#define MX50_DMA_REQ_SSI2_TX1 25
179#define MX50_DMA_REQ_SSI1_RX2 26
180#define MX50_DMA_REQ_SSI1_TX2 27
181#define MX50_DMA_REQ_SSI1_RX1 28
182#define MX50_DMA_REQ_SSI1_TX1 29
183#define MX50_DMA_REQ_CSPI_RX 38
184#define MX50_DMA_REQ_CSPI_TX 39
185#define MX50_DMA_REQ_UART3_RX 42
186#define MX50_DMA_REQ_UART3_TX 43
187
188/*
189 * Interrupt numbers
190 */
191#include <asm/irq.h>
192#define MX50_INT_MMC_SDHC1 (NR_IRQS_LEGACY + 1)
193#define MX50_INT_MMC_SDHC2 (NR_IRQS_LEGACY + 2)
194#define MX50_INT_MMC_SDHC3 (NR_IRQS_LEGACY + 3)
195#define MX50_INT_MMC_SDHC4 (NR_IRQS_LEGACY + 4)
196#define MX50_INT_DAP (NR_IRQS_LEGACY + 5)
197#define MX50_INT_SDMA (NR_IRQS_LEGACY + 6)
198#define MX50_INT_IOMUX (NR_IRQS_LEGACY + 7)
199#define MX50_INT_UART4 (NR_IRQS_LEGACY + 13)
200#define MX50_INT_USB_H1 (NR_IRQS_LEGACY + 14)
201#define MX50_INT_USB_OTG (NR_IRQS_LEGACY + 18)
202#define MX50_INT_DATABAHN (NR_IRQS_LEGACY + 19)
203#define MX50_INT_ELCDIF (NR_IRQS_LEGACY + 20)
204#define MX50_INT_EPXP (NR_IRQS_LEGACY + 21)
205#define MX50_INT_SRTC_NTZ (NR_IRQS_LEGACY + 24)
206#define MX50_INT_SRTC_TZ (NR_IRQS_LEGACY + 25)
207#define MX50_INT_EPDC (NR_IRQS_LEGACY + 27)
208#define MX50_INT_NIC (NR_IRQS_LEGACY + 28)
209#define MX50_INT_SSI1 (NR_IRQS_LEGACY + 29)
210#define MX50_INT_SSI2 (NR_IRQS_LEGACY + 30)
211#define MX50_INT_UART1 (NR_IRQS_LEGACY + 31)
212#define MX50_INT_UART2 (NR_IRQS_LEGACY + 32)
213#define MX50_INT_UART3 (NR_IRQS_LEGACY + 33)
214#define MX50_INT_RESV34 (NR_IRQS_LEGACY + 34)
215#define MX50_INT_RESV35 (NR_IRQS_LEGACY + 35)
216#define MX50_INT_CSPI1 (NR_IRQS_LEGACY + 36)
217#define MX50_INT_CSPI2 (NR_IRQS_LEGACY + 37)
218#define MX50_INT_CSPI (NR_IRQS_LEGACY + 38)
219#define MX50_INT_GPT (NR_IRQS_LEGACY + 39)
220#define MX50_INT_EPIT1 (NR_IRQS_LEGACY + 40)
221#define MX50_INT_GPIO1_INT7 (NR_IRQS_LEGACY + 42)
222#define MX50_INT_GPIO1_INT6 (NR_IRQS_LEGACY + 43)
223#define MX50_INT_GPIO1_INT5 (NR_IRQS_LEGACY + 44)
224#define MX50_INT_GPIO1_INT4 (NR_IRQS_LEGACY + 45)
225#define MX50_INT_GPIO1_INT3 (NR_IRQS_LEGACY + 46)
226#define MX50_INT_GPIO1_INT2 (NR_IRQS_LEGACY + 47)
227#define MX50_INT_GPIO1_INT1 (NR_IRQS_LEGACY + 48)
228#define MX50_INT_GPIO1_INT0 (NR_IRQS_LEGACY + 49)
229#define MX50_INT_GPIO1_LOW (NR_IRQS_LEGACY + 50)
230#define MX50_INT_GPIO1_HIGH (NR_IRQS_LEGACY + 51)
231#define MX50_INT_GPIO2_LOW (NR_IRQS_LEGACY + 52)
232#define MX50_INT_GPIO2_HIGH (NR_IRQS_LEGACY + 53)
233#define MX50_INT_GPIO3_LOW (NR_IRQS_LEGACY + 54)
234#define MX50_INT_GPIO3_HIGH (NR_IRQS_LEGACY + 55)
235#define MX50_INT_GPIO4_LOW (NR_IRQS_LEGACY + 56)
236#define MX50_INT_GPIO4_HIGH (NR_IRQS_LEGACY + 57)
237#define MX50_INT_WDOG1 (NR_IRQS_LEGACY + 58)
238#define MX50_INT_KPP (NR_IRQS_LEGACY + 60)
239#define MX50_INT_PWM1 (NR_IRQS_LEGACY + 61)
240#define MX50_INT_I2C1 (NR_IRQS_LEGACY + 62)
241#define MX50_INT_I2C2 (NR_IRQS_LEGACY + 63)
242#define MX50_INT_I2C3 (NR_IRQS_LEGACY + 64)
243#define MX50_INT_RESV65 (NR_IRQS_LEGACY + 65)
244#define MX50_INT_DCDC (NR_IRQS_LEGACY + 66)
245#define MX50_INT_THERMAL_ALARM (NR_IRQS_LEGACY + 67)
246#define MX50_INT_ANA3 (NR_IRQS_LEGACY + 68)
247#define MX50_INT_ANA4 (NR_IRQS_LEGACY + 69)
248#define MX50_INT_CCM1 (NR_IRQS_LEGACY + 71)
249#define MX50_INT_CCM2 (NR_IRQS_LEGACY + 72)
250#define MX50_INT_GPC1 (NR_IRQS_LEGACY + 73)
251#define MX50_INT_GPC2 (NR_IRQS_LEGACY + 74)
252#define MX50_INT_SRC (NR_IRQS_LEGACY + 75)
253#define MX50_INT_NM (NR_IRQS_LEGACY + 76)
254#define MX50_INT_PMU (NR_IRQS_LEGACY + 77)
255#define MX50_INT_CTI_IRQ (NR_IRQS_LEGACY + 78)
256#define MX50_INT_CTI1_TG0 (NR_IRQS_LEGACY + 79)
257#define MX50_INT_CTI1_TG1 (NR_IRQS_LEGACY + 80)
258#define MX50_INT_GPU2_IRQ (NR_IRQS_LEGACY + 84)
259#define MX50_INT_GPU2_BUSY (NR_IRQS_LEGACY + 85)
260#define MX50_INT_UART5 (NR_IRQS_LEGACY + 86)
261#define MX50_INT_FEC (NR_IRQS_LEGACY + 87)
262#define MX50_INT_OWIRE (NR_IRQS_LEGACY + 88)
263#define MX50_INT_CTI1_TG2 (NR_IRQS_LEGACY + 89)
264#define MX50_INT_SJC (NR_IRQS_LEGACY + 90)
265#define MX50_INT_DCP_CHAN1_3 (NR_IRQS_LEGACY + 91)
266#define MX50_INT_DCP_CHAN0 (NR_IRQS_LEGACY + 92)
267#define MX50_INT_PWM2 (NR_IRQS_LEGACY + 94)
268#define MX50_INT_RNGB (NR_IRQS_LEGACY + 97)
269#define MX50_INT_CTI1_TG3 (NR_IRQS_LEGACY + 98)
270#define MX50_INT_RAWNAND_BCH (NR_IRQS_LEGACY + 100)
271#define MX50_INT_RAWNAND_GPMI (NR_IRQS_LEGACY + 102)
272#define MX50_INT_GPIO5_LOW (NR_IRQS_LEGACY + 103)
273#define MX50_INT_GPIO5_HIGH (NR_IRQS_LEGACY + 104)
274#define MX50_INT_GPIO6_LOW (NR_IRQS_LEGACY + 105)
275#define MX50_INT_GPIO6_HIGH (NR_IRQS_LEGACY + 106)
276#define MX50_INT_MSHC (NR_IRQS_LEGACY + 109)
277#define MX50_INT_APBHDMA_CHAN0 (NR_IRQS_LEGACY + 110)
278#define MX50_INT_APBHDMA_CHAN1 (NR_IRQS_LEGACY + 111)
279#define MX50_INT_APBHDMA_CHAN2 (NR_IRQS_LEGACY + 112)
280#define MX50_INT_APBHDMA_CHAN3 (NR_IRQS_LEGACY + 113)
281#define MX50_INT_APBHDMA_CHAN4 (NR_IRQS_LEGACY + 114)
282#define MX50_INT_APBHDMA_CHAN5 (NR_IRQS_LEGACY + 115)
283#define MX50_INT_APBHDMA_CHAN6 (NR_IRQS_LEGACY + 116)
284#define MX50_INT_APBHDMA_CHAN7 (NR_IRQS_LEGACY + 117)
285
286#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS)
287extern int mx50_revision(void);
288#endif
289
290#endif /* ifndef __MACH_MX50_H__ */
diff --git a/arch/arm/mach-imx/mxc.h b/arch/arm/mach-imx/mxc.h
index d78298366a91..7dce17a9fe6c 100644
--- a/arch/arm/mach-imx/mxc.h
+++ b/arch/arm/mach-imx/mxc.h
@@ -32,7 +32,6 @@
32#define MXC_CPU_MX27 27 32#define MXC_CPU_MX27 27
33#define MXC_CPU_MX31 31 33#define MXC_CPU_MX31 31
34#define MXC_CPU_MX35 35 34#define MXC_CPU_MX35 35
35#define MXC_CPU_MX50 50
36#define MXC_CPU_MX51 51 35#define MXC_CPU_MX51 51
37#define MXC_CPU_MX53 53 36#define MXC_CPU_MX53 53
38 37
@@ -126,18 +125,6 @@ extern unsigned int __mxc_cpu_type;
126# define cpu_is_mx35() (0) 125# define cpu_is_mx35() (0)
127#endif 126#endif
128 127
129#ifdef CONFIG_SOC_IMX50
130# ifdef mxc_cpu_type
131# undef mxc_cpu_type
132# define mxc_cpu_type __mxc_cpu_type
133# else
134# define mxc_cpu_type MXC_CPU_MX50
135# endif
136# define cpu_is_mx50() (mxc_cpu_type == MXC_CPU_MX50)
137#else
138# define cpu_is_mx50() (0)
139#endif
140
141#ifdef CONFIG_SOC_IMX51 128#ifdef CONFIG_SOC_IMX51
142# ifdef mxc_cpu_type 129# ifdef mxc_cpu_type
143# undef mxc_cpu_type 130# undef mxc_cpu_type
diff --git a/arch/arm/mach-imx/platsmp.c b/arch/arm/mach-imx/platsmp.c
index 66fae885c842..7c0b03f67b05 100644
--- a/arch/arm/mach-imx/platsmp.c
+++ b/arch/arm/mach-imx/platsmp.c
@@ -12,14 +12,16 @@
12 12
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/smp.h> 14#include <linux/smp.h>
15#include <linux/irqchip/arm-gic.h>
15#include <asm/page.h> 16#include <asm/page.h>
16#include <asm/smp_scu.h> 17#include <asm/smp_scu.h>
17#include <asm/hardware/gic.h>
18#include <asm/mach/map.h> 18#include <asm/mach/map.h>
19 19
20#include "common.h" 20#include "common.h"
21#include "hardware.h" 21#include "hardware.h"
22 22
23#define SCU_STANDBY_ENABLE (1 << 5)
24
23static void __iomem *scu_base; 25static void __iomem *scu_base;
24 26
25static struct map_desc scu_io_desc __initdata = { 27static struct map_desc scu_io_desc __initdata = {
@@ -42,6 +44,14 @@ void __init imx_scu_map_io(void)
42 scu_base = IMX_IO_ADDRESS(base); 44 scu_base = IMX_IO_ADDRESS(base);
43} 45}
44 46
47void imx_scu_standby_enable(void)
48{
49 u32 val = readl_relaxed(scu_base);
50
51 val |= SCU_STANDBY_ENABLE;
52 writel_relaxed(val, scu_base);
53}
54
45static void __cpuinit imx_secondary_init(unsigned int cpu) 55static void __cpuinit imx_secondary_init(unsigned int cpu)
46{ 56{
47 /* 57 /*
@@ -71,8 +81,6 @@ static void __init imx_smp_init_cpus(void)
71 81
72 for (i = 0; i < ncores; i++) 82 for (i = 0; i < ncores; i++)
73 set_cpu_possible(i, true); 83 set_cpu_possible(i, true);
74
75 set_smp_cross_call(gic_raise_softirq);
76} 84}
77 85
78void imx_smp_prepare(void) 86void imx_smp_prepare(void)
diff --git a/arch/arm/mach-imx/pm-imx5.c b/arch/arm/mach-imx/pm-imx5.c
index 2e063c2deb9e..f67fd7ee8127 100644
--- a/arch/arm/mach-imx/pm-imx5.c
+++ b/arch/arm/mach-imx/pm-imx5.c
@@ -34,7 +34,7 @@
34 34
35/* 35/*
36 * set cpu low power mode before WFI instruction. This function is called 36 * set cpu low power mode before WFI instruction. This function is called
37 * mx5 because it can be used for mx50, mx51, and mx53. 37 * mx5 because it can be used for mx51, and mx53.
38 */ 38 */
39static void mx5_cpu_lp_set(enum mxc_cpu_pwr_mode mode) 39static void mx5_cpu_lp_set(enum mxc_cpu_pwr_mode mode)
40{ 40{
@@ -85,10 +85,7 @@ static void mx5_cpu_lp_set(enum mxc_cpu_pwr_mode mode)
85 __raw_writel(plat_lpc, MXC_CORTEXA8_PLAT_LPC); 85 __raw_writel(plat_lpc, MXC_CORTEXA8_PLAT_LPC);
86 __raw_writel(ccm_clpcr, MXC_CCM_CLPCR); 86 __raw_writel(ccm_clpcr, MXC_CCM_CLPCR);
87 __raw_writel(arm_srpgcr, MXC_SRPG_ARM_SRPGCR); 87 __raw_writel(arm_srpgcr, MXC_SRPG_ARM_SRPGCR);
88 88 __raw_writel(arm_srpgcr, MXC_SRPG_NEON_SRPGCR);
89 /* Enable NEON SRPG for all but MX50TO1.0. */
90 if (mx50_revision() != IMX_CHIP_REVISION_1_0)
91 __raw_writel(arm_srpgcr, MXC_SRPG_NEON_SRPGCR);
92 89
93 if (stop_mode) { 90 if (stop_mode) {
94 empgc0 |= MXC_SRPGCR_PCR; 91 empgc0 |= MXC_SRPGCR_PCR;
diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
index f017302f6d09..fea91313678b 100644
--- a/arch/arm/mach-imx/time.c
+++ b/arch/arm/mach-imx/time.c
@@ -152,7 +152,8 @@ static int v2_set_next_event(unsigned long evt,
152 152
153 __raw_writel(tcmp, timer_base + V2_TCMP); 153 __raw_writel(tcmp, timer_base + V2_TCMP);
154 154
155 return (int)(tcmp - __raw_readl(timer_base + V2_TCN)) < 0 ? 155 return evt < 0x7fffffff &&
156 (int)(tcmp - __raw_readl(timer_base + V2_TCN)) < 0 ?
156 -ETIME : 0; 157 -ETIME : 0;
157} 158}
158 159
@@ -256,7 +257,6 @@ static struct irqaction mxc_timer_irq = {
256static struct clock_event_device clockevent_mxc = { 257static struct clock_event_device clockevent_mxc = {
257 .name = "mxc_timer1", 258 .name = "mxc_timer1",
258 .features = CLOCK_EVT_FEAT_ONESHOT, 259 .features = CLOCK_EVT_FEAT_ONESHOT,
259 .shift = 32,
260 .set_mode = mxc_set_mode, 260 .set_mode = mxc_set_mode,
261 .set_next_event = mx1_2_set_next_event, 261 .set_next_event = mx1_2_set_next_event,
262 .rating = 200, 262 .rating = 200,
@@ -264,21 +264,13 @@ static struct clock_event_device clockevent_mxc = {
264 264
265static int __init mxc_clockevent_init(struct clk *timer_clk) 265static int __init mxc_clockevent_init(struct clk *timer_clk)
266{ 266{
267 unsigned int c = clk_get_rate(timer_clk);
268
269 if (timer_is_v2()) 267 if (timer_is_v2())
270 clockevent_mxc.set_next_event = v2_set_next_event; 268 clockevent_mxc.set_next_event = v2_set_next_event;
271 269
272 clockevent_mxc.mult = div_sc(c, NSEC_PER_SEC,
273 clockevent_mxc.shift);
274 clockevent_mxc.max_delta_ns =
275 clockevent_delta2ns(0xfffffffe, &clockevent_mxc);
276 clockevent_mxc.min_delta_ns =
277 clockevent_delta2ns(0xff, &clockevent_mxc);
278
279 clockevent_mxc.cpumask = cpumask_of(0); 270 clockevent_mxc.cpumask = cpumask_of(0);
280 271 clockevents_config_and_register(&clockevent_mxc,
281 clockevents_register_device(&clockevent_mxc); 272 clk_get_rate(timer_clk),
273 0xff, 0xfffffffe);
282 274
283 return 0; 275 return 0;
284} 276}
diff --git a/arch/arm/mach-integrator/common.h b/arch/arm/mach-integrator/common.h
index 79197d8b34aa..72516658be1e 100644
--- a/arch/arm/mach-integrator/common.h
+++ b/arch/arm/mach-integrator/common.h
@@ -1,10 +1,5 @@
1#include <linux/amba/serial.h> 1#include <linux/amba/serial.h>
2#ifdef CONFIG_ARCH_INTEGRATOR_AP
3extern struct amba_pl010_data ap_uart_data; 2extern struct amba_pl010_data ap_uart_data;
4#else
5/* Not used without Integrator/AP support anyway */
6struct amba_pl010_data ap_uart_data {};
7#endif
8void integrator_init_early(void); 3void integrator_init_early(void);
9int integrator_init(bool is_cp); 4int integrator_init(bool is_cp);
10void integrator_reserve(void); 5void integrator_reserve(void);
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
index 39c060f75e47..81461d218717 100644
--- a/arch/arm/mach-integrator/core.c
+++ b/arch/arm/mach-integrator/core.c
@@ -71,7 +71,7 @@ int __init integrator_init(bool is_cp)
71 * hard-code them. The Integator/CP and forward have proper cell IDs. 71 * hard-code them. The Integator/CP and forward have proper cell IDs.
72 * Else we leave them undefined to the bus driver can autoprobe them. 72 * Else we leave them undefined to the bus driver can autoprobe them.
73 */ 73 */
74 if (!is_cp) { 74 if (!is_cp && IS_ENABLED(CONFIG_ARCH_INTEGRATOR_AP)) {
75 rtc_device.periphid = 0x00041030; 75 rtc_device.periphid = 0x00041030;
76 uart0_device.periphid = 0x00041010; 76 uart0_device.periphid = 0x00041010;
77 uart1_device.periphid = 0x00041010; 77 uart1_device.periphid = 0x00041010;
diff --git a/arch/arm/mach-integrator/include/mach/uncompress.h b/arch/arm/mach-integrator/include/mach/uncompress.h
index 30452f00a164..8f3cc9954c16 100644
--- a/arch/arm/mach-integrator/include/mach/uncompress.h
+++ b/arch/arm/mach-integrator/include/mach/uncompress.h
@@ -46,5 +46,3 @@ static inline void flush(void)
46 * nothing to do 46 * nothing to do
47 */ 47 */
48#define arch_decomp_setup() 48#define arch_decomp_setup()
49
50#define arch_decomp_wdog()
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index 11e2a4145807..ea961445e0e9 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -94,7 +94,7 @@ void __iomem *ap_syscon_base;
94 * f1b00000 1b000000 GPIO 94 * f1b00000 1b000000 GPIO
95 */ 95 */
96 96
97static struct map_desc ap_io_desc[] __initdata = { 97static struct map_desc ap_io_desc[] __initdata __maybe_unused = {
98 { 98 {
99 .virtual = IO_ADDRESS(INTEGRATOR_HDR_BASE), 99 .virtual = IO_ADDRESS(INTEGRATOR_HDR_BASE),
100 .pfn = __phys_to_pfn(INTEGRATOR_HDR_BASE), 100 .pfn = __phys_to_pfn(INTEGRATOR_HDR_BASE),
@@ -425,7 +425,7 @@ void __init ap_init_early(void)
425 425
426#ifdef CONFIG_OF 426#ifdef CONFIG_OF
427 427
428static void __init ap_init_timer_of(void) 428static void __init ap_of_timer_init(void)
429{ 429{
430 struct device_node *node; 430 struct device_node *node;
431 const char *path; 431 const char *path;
@@ -464,10 +464,6 @@ static void __init ap_init_timer_of(void)
464 integrator_clockevent_init(rate, base, irq); 464 integrator_clockevent_init(rate, base, irq);
465} 465}
466 466
467static struct sys_timer ap_of_timer = {
468 .init = ap_init_timer_of,
469};
470
471static const struct of_device_id fpga_irq_of_match[] __initconst = { 467static const struct of_device_id fpga_irq_of_match[] __initconst = {
472 { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, }, 468 { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, },
473 { /* Sentinel */ } 469 { /* Sentinel */ }
@@ -586,7 +582,7 @@ DT_MACHINE_START(INTEGRATOR_AP_DT, "ARM Integrator/AP (Device Tree)")
586 .init_early = ap_init_early, 582 .init_early = ap_init_early,
587 .init_irq = ap_init_irq_of, 583 .init_irq = ap_init_irq_of,
588 .handle_irq = fpga_handle_irq, 584 .handle_irq = fpga_handle_irq,
589 .timer = &ap_of_timer, 585 .init_time = ap_of_timer_init,
590 .init_machine = ap_init_of, 586 .init_machine = ap_init_of,
591 .restart = integrator_restart, 587 .restart = integrator_restart,
592 .dt_compat = ap_dt_board_compat, 588 .dt_compat = ap_dt_board_compat,
@@ -613,7 +609,6 @@ static struct map_desc ap_io_desc_atag[] __initdata = {
613static void __init ap_map_io_atag(void) 609static void __init ap_map_io_atag(void)
614{ 610{
615 iotable_init(ap_io_desc_atag, ARRAY_SIZE(ap_io_desc_atag)); 611 iotable_init(ap_io_desc_atag, ARRAY_SIZE(ap_io_desc_atag));
616 ap_syscon_base = __io_address(INTEGRATOR_SC_BASE);
617 ap_map_io(); 612 ap_map_io();
618} 613}
619 614
@@ -638,7 +633,7 @@ static struct platform_device cfi_flash_device = {
638 .resource = &cfi_flash_resource, 633 .resource = &cfi_flash_resource,
639}; 634};
640 635
641static void __init ap_init_timer(void) 636static void __init ap_timer_init(void)
642{ 637{
643 struct clk *clk; 638 struct clk *clk;
644 unsigned long rate; 639 unsigned long rate;
@@ -657,10 +652,6 @@ static void __init ap_init_timer(void)
657 IRQ_TIMERINT1); 652 IRQ_TIMERINT1);
658} 653}
659 654
660static struct sys_timer ap_timer = {
661 .init = ap_init_timer,
662};
663
664#define INTEGRATOR_SC_VALID_INT 0x003fffff 655#define INTEGRATOR_SC_VALID_INT 0x003fffff
665 656
666static void __init ap_init_irq(void) 657static void __init ap_init_irq(void)
@@ -685,6 +676,7 @@ static void __init ap_init(void)
685 676
686 platform_device_register(&cfi_flash_device); 677 platform_device_register(&cfi_flash_device);
687 678
679 ap_syscon_base = __io_address(INTEGRATOR_SC_BASE);
688 sc_dec = readl(ap_syscon_base + INTEGRATOR_SC_DEC_OFFSET); 680 sc_dec = readl(ap_syscon_base + INTEGRATOR_SC_DEC_OFFSET);
689 for (i = 0; i < 4; i++) { 681 for (i = 0; i < 4; i++) {
690 struct lm_device *lmdev; 682 struct lm_device *lmdev;
@@ -716,7 +708,7 @@ MACHINE_START(INTEGRATOR, "ARM-Integrator")
716 .init_early = ap_init_early, 708 .init_early = ap_init_early,
717 .init_irq = ap_init_irq, 709 .init_irq = ap_init_irq,
718 .handle_irq = fpga_handle_irq, 710 .handle_irq = fpga_handle_irq,
719 .timer = &ap_timer, 711 .init_time = ap_timer_init,
720 .init_machine = ap_init, 712 .init_machine = ap_init,
721 .restart = integrator_restart, 713 .restart = integrator_restart,
722MACHINE_END 714MACHINE_END
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 7322838c0447..2b0db82a5381 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -78,7 +78,7 @@ static void __iomem *intcp_con_base;
78 * fcb00000 cb000000 CP system control 78 * fcb00000 cb000000 CP system control
79 */ 79 */
80 80
81static struct map_desc intcp_io_desc[] __initdata = { 81static struct map_desc intcp_io_desc[] __initdata __maybe_unused = {
82 { 82 {
83 .virtual = IO_ADDRESS(INTEGRATOR_HDR_BASE), 83 .virtual = IO_ADDRESS(INTEGRATOR_HDR_BASE),
84 .pfn = __phys_to_pfn(INTEGRATOR_HDR_BASE), 84 .pfn = __phys_to_pfn(INTEGRATOR_HDR_BASE),
@@ -251,7 +251,7 @@ static void __init intcp_init_early(void)
251 251
252#ifdef CONFIG_OF 252#ifdef CONFIG_OF
253 253
254static void __init intcp_timer_init_of(void) 254static void __init cp_of_timer_init(void)
255{ 255{
256 struct device_node *node; 256 struct device_node *node;
257 const char *path; 257 const char *path;
@@ -283,10 +283,6 @@ static void __init intcp_timer_init_of(void)
283 sp804_clockevents_init(base, irq, node->name); 283 sp804_clockevents_init(base, irq, node->name);
284} 284}
285 285
286static struct sys_timer cp_of_timer = {
287 .init = intcp_timer_init_of,
288};
289
290static const struct of_device_id fpga_irq_of_match[] __initconst = { 286static const struct of_device_id fpga_irq_of_match[] __initconst = {
291 { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, }, 287 { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, },
292 { /* Sentinel */ } 288 { /* Sentinel */ }
@@ -390,7 +386,7 @@ DT_MACHINE_START(INTEGRATOR_CP_DT, "ARM Integrator/CP (Device Tree)")
390 .init_early = intcp_init_early, 386 .init_early = intcp_init_early,
391 .init_irq = intcp_init_irq_of, 387 .init_irq = intcp_init_irq_of,
392 .handle_irq = fpga_handle_irq, 388 .handle_irq = fpga_handle_irq,
393 .timer = &cp_of_timer, 389 .init_time = cp_of_timer_init,
394 .init_machine = intcp_init_of, 390 .init_machine = intcp_init_of,
395 .restart = integrator_restart, 391 .restart = integrator_restart,
396 .dt_compat = intcp_dt_board_compat, 392 .dt_compat = intcp_dt_board_compat,
@@ -512,7 +508,7 @@ static void __init intcp_init_irq(void)
512#define TIMER1_VA_BASE __io_address(INTEGRATOR_TIMER1_BASE) 508#define TIMER1_VA_BASE __io_address(INTEGRATOR_TIMER1_BASE)
513#define TIMER2_VA_BASE __io_address(INTEGRATOR_TIMER2_BASE) 509#define TIMER2_VA_BASE __io_address(INTEGRATOR_TIMER2_BASE)
514 510
515static void __init intcp_timer_init(void) 511static void __init cp_timer_init(void)
516{ 512{
517 writel(0, TIMER0_VA_BASE + TIMER_CTRL); 513 writel(0, TIMER0_VA_BASE + TIMER_CTRL);
518 writel(0, TIMER1_VA_BASE + TIMER_CTRL); 514 writel(0, TIMER1_VA_BASE + TIMER_CTRL);
@@ -522,10 +518,6 @@ static void __init intcp_timer_init(void)
522 sp804_clockevents_init(TIMER1_VA_BASE, IRQ_TIMERINT1, "timer1"); 518 sp804_clockevents_init(TIMER1_VA_BASE, IRQ_TIMERINT1, "timer1");
523} 519}
524 520
525static struct sys_timer cp_timer = {
526 .init = intcp_timer_init,
527};
528
529#define INTEGRATOR_CP_MMC_IRQS { IRQ_CP_MMCIINT0, IRQ_CP_MMCIINT1 } 521#define INTEGRATOR_CP_MMC_IRQS { IRQ_CP_MMCIINT0, IRQ_CP_MMCIINT1 }
530#define INTEGRATOR_CP_AACI_IRQS { IRQ_CP_AACIINT } 522#define INTEGRATOR_CP_AACI_IRQS { IRQ_CP_AACIINT }
531 523
@@ -565,7 +557,7 @@ MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP")
565 .init_early = intcp_init_early, 557 .init_early = intcp_init_early,
566 .init_irq = intcp_init_irq, 558 .init_irq = intcp_init_irq,
567 .handle_irq = fpga_handle_irq, 559 .handle_irq = fpga_handle_irq,
568 .timer = &cp_timer, 560 .init_time = cp_timer_init,
569 .init_machine = intcp_init, 561 .init_machine = intcp_init,
570 .restart = integrator_restart, 562 .restart = integrator_restart,
571MACHINE_END 563MACHINE_END
diff --git a/arch/arm/mach-iop13xx/include/mach/uncompress.h b/arch/arm/mach-iop13xx/include/mach/uncompress.h
index fa4f80522fad..d3791ece2772 100644
--- a/arch/arm/mach-iop13xx/include/mach/uncompress.h
+++ b/arch/arm/mach-iop13xx/include/mach/uncompress.h
@@ -20,4 +20,3 @@ static inline void flush(void)
20 * nothing to do 20 * nothing to do
21 */ 21 */
22#define arch_decomp_setup() 22#define arch_decomp_setup()
23#define arch_decomp_wdog()
diff --git a/arch/arm/mach-iop13xx/iq81340mc.c b/arch/arm/mach-iop13xx/iq81340mc.c
index e3f3e7daa79e..02a8228ac2d3 100644
--- a/arch/arm/mach-iop13xx/iq81340mc.c
+++ b/arch/arm/mach-iop13xx/iq81340mc.c
@@ -84,17 +84,13 @@ static void __init iq81340mc_timer_init(void)
84 iop_init_time(bus_freq); 84 iop_init_time(bus_freq);
85} 85}
86 86
87static struct sys_timer iq81340mc_timer = {
88 .init = iq81340mc_timer_init,
89};
90
91MACHINE_START(IQ81340MC, "Intel IQ81340MC") 87MACHINE_START(IQ81340MC, "Intel IQ81340MC")
92 /* Maintainer: Dan Williams <dan.j.williams@intel.com> */ 88 /* Maintainer: Dan Williams <dan.j.williams@intel.com> */
93 .atag_offset = 0x100, 89 .atag_offset = 0x100,
94 .init_early = iop13xx_init_early, 90 .init_early = iop13xx_init_early,
95 .map_io = iop13xx_map_io, 91 .map_io = iop13xx_map_io,
96 .init_irq = iop13xx_init_irq, 92 .init_irq = iop13xx_init_irq,
97 .timer = &iq81340mc_timer, 93 .init_time = iq81340mc_timer_init,
98 .init_machine = iq81340mc_init, 94 .init_machine = iq81340mc_init,
99 .restart = iop13xx_restart, 95 .restart = iop13xx_restart,
100MACHINE_END 96MACHINE_END
diff --git a/arch/arm/mach-iop13xx/iq81340sc.c b/arch/arm/mach-iop13xx/iq81340sc.c
index e94744111634..1b80f10722b3 100644
--- a/arch/arm/mach-iop13xx/iq81340sc.c
+++ b/arch/arm/mach-iop13xx/iq81340sc.c
@@ -86,17 +86,13 @@ static void __init iq81340sc_timer_init(void)
86 iop_init_time(bus_freq); 86 iop_init_time(bus_freq);
87} 87}
88 88
89static struct sys_timer iq81340sc_timer = {
90 .init = iq81340sc_timer_init,
91};
92
93MACHINE_START(IQ81340SC, "Intel IQ81340SC") 89MACHINE_START(IQ81340SC, "Intel IQ81340SC")
94 /* Maintainer: Dan Williams <dan.j.williams@intel.com> */ 90 /* Maintainer: Dan Williams <dan.j.williams@intel.com> */
95 .atag_offset = 0x100, 91 .atag_offset = 0x100,
96 .init_early = iop13xx_init_early, 92 .init_early = iop13xx_init_early,
97 .map_io = iop13xx_map_io, 93 .map_io = iop13xx_map_io,
98 .init_irq = iop13xx_init_irq, 94 .init_irq = iop13xx_init_irq,
99 .timer = &iq81340sc_timer, 95 .init_time = iq81340sc_timer_init,
100 .init_machine = iq81340sc_init, 96 .init_machine = iq81340sc_init,
101 .restart = iop13xx_restart, 97 .restart = iop13xx_restart,
102MACHINE_END 98MACHINE_END
diff --git a/arch/arm/mach-iop32x/em7210.c b/arch/arm/mach-iop32x/em7210.c
index 9f369f09c29d..31fbb6c61b25 100644
--- a/arch/arm/mach-iop32x/em7210.c
+++ b/arch/arm/mach-iop32x/em7210.c
@@ -40,10 +40,6 @@ static void __init em7210_timer_init(void)
40 iop_init_time(200000000); 40 iop_init_time(200000000);
41} 41}
42 42
43static struct sys_timer em7210_timer = {
44 .init = em7210_timer_init,
45};
46
47/* 43/*
48 * EM7210 RTC 44 * EM7210 RTC
49 */ 45 */
@@ -205,7 +201,7 @@ MACHINE_START(EM7210, "Lanner EM7210")
205 .atag_offset = 0x100, 201 .atag_offset = 0x100,
206 .map_io = em7210_map_io, 202 .map_io = em7210_map_io,
207 .init_irq = iop32x_init_irq, 203 .init_irq = iop32x_init_irq,
208 .timer = &em7210_timer, 204 .init_time = em7210_timer_init,
209 .init_machine = em7210_init_machine, 205 .init_machine = em7210_init_machine,
210 .restart = iop3xx_restart, 206 .restart = iop3xx_restart,
211MACHINE_END 207MACHINE_END
diff --git a/arch/arm/mach-iop32x/glantank.c b/arch/arm/mach-iop32x/glantank.c
index 02e20c3912ba..ac304705fe68 100644
--- a/arch/arm/mach-iop32x/glantank.c
+++ b/arch/arm/mach-iop32x/glantank.c
@@ -44,10 +44,6 @@ static void __init glantank_timer_init(void)
44 iop_init_time(200000000); 44 iop_init_time(200000000);
45} 45}
46 46
47static struct sys_timer glantank_timer = {
48 .init = glantank_timer_init,
49};
50
51 47
52/* 48/*
53 * GLAN Tank I/O. 49 * GLAN Tank I/O.
@@ -209,7 +205,7 @@ MACHINE_START(GLANTANK, "GLAN Tank")
209 .atag_offset = 0x100, 205 .atag_offset = 0x100,
210 .map_io = glantank_map_io, 206 .map_io = glantank_map_io,
211 .init_irq = iop32x_init_irq, 207 .init_irq = iop32x_init_irq,
212 .timer = &glantank_timer, 208 .init_time = glantank_timer_init,
213 .init_machine = glantank_init_machine, 209 .init_machine = glantank_init_machine,
214 .restart = iop3xx_restart, 210 .restart = iop3xx_restart,
215MACHINE_END 211MACHINE_END
diff --git a/arch/arm/mach-iop32x/include/mach/uncompress.h b/arch/arm/mach-iop32x/include/mach/uncompress.h
index 4fd715496f45..b3d45fd365e7 100644
--- a/arch/arm/mach-iop32x/include/mach/uncompress.h
+++ b/arch/arm/mach-iop32x/include/mach/uncompress.h
@@ -36,4 +36,3 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
36 * nothing to do 36 * nothing to do
37 */ 37 */
38#define arch_decomp_setup() __arch_decomp_setup(arch_id) 38#define arch_decomp_setup() __arch_decomp_setup(arch_id)
39#define arch_decomp_wdog()
diff --git a/arch/arm/mach-iop32x/iq31244.c b/arch/arm/mach-iop32x/iq31244.c
index ddd1c7ecfe57..f2cd2966212d 100644
--- a/arch/arm/mach-iop32x/iq31244.c
+++ b/arch/arm/mach-iop32x/iq31244.c
@@ -75,10 +75,6 @@ static void __init iq31244_timer_init(void)
75 } 75 }
76} 76}
77 77
78static struct sys_timer iq31244_timer = {
79 .init = iq31244_timer_init,
80};
81
82 78
83/* 79/*
84 * IQ31244 I/O. 80 * IQ31244 I/O.
@@ -314,7 +310,7 @@ MACHINE_START(IQ31244, "Intel IQ31244")
314 .atag_offset = 0x100, 310 .atag_offset = 0x100,
315 .map_io = iq31244_map_io, 311 .map_io = iq31244_map_io,
316 .init_irq = iop32x_init_irq, 312 .init_irq = iop32x_init_irq,
317 .timer = &iq31244_timer, 313 .init_time = iq31244_timer_init,
318 .init_machine = iq31244_init_machine, 314 .init_machine = iq31244_init_machine,
319 .restart = iop3xx_restart, 315 .restart = iop3xx_restart,
320MACHINE_END 316MACHINE_END
@@ -329,7 +325,7 @@ MACHINE_START(EP80219, "Intel EP80219")
329 .atag_offset = 0x100, 325 .atag_offset = 0x100,
330 .map_io = iq31244_map_io, 326 .map_io = iq31244_map_io,
331 .init_irq = iop32x_init_irq, 327 .init_irq = iop32x_init_irq,
332 .timer = &iq31244_timer, 328 .init_time = iq31244_timer_init,
333 .init_machine = iq31244_init_machine, 329 .init_machine = iq31244_init_machine,
334 .restart = iop3xx_restart, 330 .restart = iop3xx_restart,
335MACHINE_END 331MACHINE_END
diff --git a/arch/arm/mach-iop32x/iq80321.c b/arch/arm/mach-iop32x/iq80321.c
index bf155e6a3b45..015435de90dd 100644
--- a/arch/arm/mach-iop32x/iq80321.c
+++ b/arch/arm/mach-iop32x/iq80321.c
@@ -43,10 +43,6 @@ static void __init iq80321_timer_init(void)
43 iop_init_time(200000000); 43 iop_init_time(200000000);
44} 44}
45 45
46static struct sys_timer iq80321_timer = {
47 .init = iq80321_timer_init,
48};
49
50 46
51/* 47/*
52 * IQ80321 I/O. 48 * IQ80321 I/O.
@@ -188,7 +184,7 @@ MACHINE_START(IQ80321, "Intel IQ80321")
188 .atag_offset = 0x100, 184 .atag_offset = 0x100,
189 .map_io = iq80321_map_io, 185 .map_io = iq80321_map_io,
190 .init_irq = iop32x_init_irq, 186 .init_irq = iop32x_init_irq,
191 .timer = &iq80321_timer, 187 .init_time = iq80321_timer_init,
192 .init_machine = iq80321_init_machine, 188 .init_machine = iq80321_init_machine,
193 .restart = iop3xx_restart, 189 .restart = iop3xx_restart,
194MACHINE_END 190MACHINE_END
diff --git a/arch/arm/mach-iop32x/n2100.c b/arch/arm/mach-iop32x/n2100.c
index 5a7ae91e8849..ea0984a7449e 100644
--- a/arch/arm/mach-iop32x/n2100.c
+++ b/arch/arm/mach-iop32x/n2100.c
@@ -50,10 +50,6 @@ static void __init n2100_timer_init(void)
50 iop_init_time(198000000); 50 iop_init_time(198000000);
51} 51}
52 52
53static struct sys_timer n2100_timer = {
54 .init = n2100_timer_init,
55};
56
57 53
58/* 54/*
59 * N2100 I/O. 55 * N2100 I/O.
@@ -337,7 +333,7 @@ MACHINE_START(N2100, "Thecus N2100")
337 .atag_offset = 0x100, 333 .atag_offset = 0x100,
338 .map_io = n2100_map_io, 334 .map_io = n2100_map_io,
339 .init_irq = iop32x_init_irq, 335 .init_irq = iop32x_init_irq,
340 .timer = &n2100_timer, 336 .init_time = n2100_timer_init,
341 .init_machine = n2100_init_machine, 337 .init_machine = n2100_init_machine,
342 .restart = n2100_restart, 338 .restart = n2100_restart,
343MACHINE_END 339MACHINE_END
diff --git a/arch/arm/mach-iop33x/include/mach/uncompress.h b/arch/arm/mach-iop33x/include/mach/uncompress.h
index f99bb848c5a1..ed282e14176d 100644
--- a/arch/arm/mach-iop33x/include/mach/uncompress.h
+++ b/arch/arm/mach-iop33x/include/mach/uncompress.h
@@ -34,4 +34,3 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
34 * nothing to do 34 * nothing to do
35 */ 35 */
36#define arch_decomp_setup() __arch_decomp_setup(arch_id) 36#define arch_decomp_setup() __arch_decomp_setup(arch_id)
37#define arch_decomp_wdog()
diff --git a/arch/arm/mach-iop33x/iq80331.c b/arch/arm/mach-iop33x/iq80331.c
index e74a7debe793..c43304a10fa7 100644
--- a/arch/arm/mach-iop33x/iq80331.c
+++ b/arch/arm/mach-iop33x/iq80331.c
@@ -45,10 +45,6 @@ static void __init iq80331_timer_init(void)
45 iop_init_time(266000000); 45 iop_init_time(266000000);
46} 46}
47 47
48static struct sys_timer iq80331_timer = {
49 .init = iq80331_timer_init,
50};
51
52 48
53/* 49/*
54 * IQ80331 PCI. 50 * IQ80331 PCI.
@@ -143,7 +139,7 @@ MACHINE_START(IQ80331, "Intel IQ80331")
143 .atag_offset = 0x100, 139 .atag_offset = 0x100,
144 .map_io = iop3xx_map_io, 140 .map_io = iop3xx_map_io,
145 .init_irq = iop33x_init_irq, 141 .init_irq = iop33x_init_irq,
146 .timer = &iq80331_timer, 142 .init_time = iq80331_timer_init,
147 .init_machine = iq80331_init_machine, 143 .init_machine = iq80331_init_machine,
148 .restart = iop3xx_restart, 144 .restart = iop3xx_restart,
149MACHINE_END 145MACHINE_END
diff --git a/arch/arm/mach-iop33x/iq80332.c b/arch/arm/mach-iop33x/iq80332.c
index e2f5beece6e8..8192987e78e5 100644
--- a/arch/arm/mach-iop33x/iq80332.c
+++ b/arch/arm/mach-iop33x/iq80332.c
@@ -45,10 +45,6 @@ static void __init iq80332_timer_init(void)
45 iop_init_time(266000000); 45 iop_init_time(266000000);
46} 46}
47 47
48static struct sys_timer iq80332_timer = {
49 .init = iq80332_timer_init,
50};
51
52 48
53/* 49/*
54 * IQ80332 PCI. 50 * IQ80332 PCI.
@@ -143,7 +139,7 @@ MACHINE_START(IQ80332, "Intel IQ80332")
143 .atag_offset = 0x100, 139 .atag_offset = 0x100,
144 .map_io = iop3xx_map_io, 140 .map_io = iop3xx_map_io,
145 .init_irq = iop33x_init_irq, 141 .init_irq = iop33x_init_irq,
146 .timer = &iq80332_timer, 142 .init_time = iq80332_timer_init,
147 .init_machine = iq80332_init_machine, 143 .init_machine = iq80332_init_machine,
148 .restart = iop3xx_restart, 144 .restart = iop3xx_restart,
149MACHINE_END 145MACHINE_END
diff --git a/arch/arm/mach-ixp4xx/avila-setup.c b/arch/arm/mach-ixp4xx/avila-setup.c
index 90e42e9982cb..6beec150c060 100644
--- a/arch/arm/mach-ixp4xx/avila-setup.c
+++ b/arch/arm/mach-ixp4xx/avila-setup.c
@@ -167,7 +167,7 @@ MACHINE_START(AVILA, "Gateworks Avila Network Platform")
167 .map_io = ixp4xx_map_io, 167 .map_io = ixp4xx_map_io,
168 .init_early = ixp4xx_init_early, 168 .init_early = ixp4xx_init_early,
169 .init_irq = ixp4xx_init_irq, 169 .init_irq = ixp4xx_init_irq,
170 .timer = &ixp4xx_timer, 170 .init_time = ixp4xx_timer_init,
171 .atag_offset = 0x100, 171 .atag_offset = 0x100,
172 .init_machine = avila_init, 172 .init_machine = avila_init,
173#if defined(CONFIG_PCI) 173#if defined(CONFIG_PCI)
@@ -187,7 +187,7 @@ MACHINE_START(LOFT, "Giant Shoulder Inc Loft board")
187 .map_io = ixp4xx_map_io, 187 .map_io = ixp4xx_map_io,
188 .init_early = ixp4xx_init_early, 188 .init_early = ixp4xx_init_early,
189 .init_irq = ixp4xx_init_irq, 189 .init_irq = ixp4xx_init_irq,
190 .timer = &ixp4xx_timer, 190 .init_time = ixp4xx_timer_init,
191 .atag_offset = 0x100, 191 .atag_offset = 0x100,
192 .init_machine = avila_init, 192 .init_machine = avila_init,
193#if defined(CONFIG_PCI) 193#if defined(CONFIG_PCI)
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 8c0c0e2d0727..1dbeb7c99d58 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -307,10 +307,6 @@ void __init ixp4xx_timer_init(void)
307 ixp4xx_clockevent_init(); 307 ixp4xx_clockevent_init();
308} 308}
309 309
310struct sys_timer ixp4xx_timer = {
311 .init = ixp4xx_timer_init,
312};
313
314static struct pxa2xx_udc_mach_info ixp4xx_udc_info; 310static struct pxa2xx_udc_mach_info ixp4xx_udc_info;
315 311
316void __init ixp4xx_set_udc_info(struct pxa2xx_udc_mach_info *info) 312void __init ixp4xx_set_udc_info(struct pxa2xx_udc_mach_info *info)
@@ -523,22 +519,15 @@ static struct clock_event_device clockevent_ixp4xx = {
523 .name = "ixp4xx timer1", 519 .name = "ixp4xx timer1",
524 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 520 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
525 .rating = 200, 521 .rating = 200,
526 .shift = 24,
527 .set_mode = ixp4xx_set_mode, 522 .set_mode = ixp4xx_set_mode,
528 .set_next_event = ixp4xx_set_next_event, 523 .set_next_event = ixp4xx_set_next_event,
529}; 524};
530 525
531static void __init ixp4xx_clockevent_init(void) 526static void __init ixp4xx_clockevent_init(void)
532{ 527{
533 clockevent_ixp4xx.mult = div_sc(IXP4XX_TIMER_FREQ, NSEC_PER_SEC,
534 clockevent_ixp4xx.shift);
535 clockevent_ixp4xx.max_delta_ns =
536 clockevent_delta2ns(0xfffffffe, &clockevent_ixp4xx);
537 clockevent_ixp4xx.min_delta_ns =
538 clockevent_delta2ns(0xf, &clockevent_ixp4xx);
539 clockevent_ixp4xx.cpumask = cpumask_of(0); 528 clockevent_ixp4xx.cpumask = cpumask_of(0);
540 529 clockevents_config_and_register(&clockevent_ixp4xx, IXP4XX_TIMER_FREQ,
541 clockevents_register_device(&clockevent_ixp4xx); 530 0xf, 0xfffffffe);
542} 531}
543 532
544void ixp4xx_restart(char mode, const char *cmd) 533void ixp4xx_restart(char mode, const char *cmd)
diff --git a/arch/arm/mach-ixp4xx/coyote-setup.c b/arch/arm/mach-ixp4xx/coyote-setup.c
index 1b83110028d6..820cae8608fc 100644
--- a/arch/arm/mach-ixp4xx/coyote-setup.c
+++ b/arch/arm/mach-ixp4xx/coyote-setup.c
@@ -112,7 +112,7 @@ MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote")
112 .map_io = ixp4xx_map_io, 112 .map_io = ixp4xx_map_io,
113 .init_early = ixp4xx_init_early, 113 .init_early = ixp4xx_init_early,
114 .init_irq = ixp4xx_init_irq, 114 .init_irq = ixp4xx_init_irq,
115 .timer = &ixp4xx_timer, 115 .init_time = ixp4xx_timer_init,
116 .atag_offset = 0x100, 116 .atag_offset = 0x100,
117 .init_machine = coyote_init, 117 .init_machine = coyote_init,
118#if defined(CONFIG_PCI) 118#if defined(CONFIG_PCI)
@@ -132,7 +132,7 @@ MACHINE_START(IXDPG425, "Intel IXDPG425")
132 .map_io = ixp4xx_map_io, 132 .map_io = ixp4xx_map_io,
133 .init_early = ixp4xx_init_early, 133 .init_early = ixp4xx_init_early,
134 .init_irq = ixp4xx_init_irq, 134 .init_irq = ixp4xx_init_irq,
135 .timer = &ixp4xx_timer, 135 .init_time = ixp4xx_timer_init,
136 .atag_offset = 0x100, 136 .atag_offset = 0x100,
137 .init_machine = coyote_init, 137 .init_machine = coyote_init,
138 .restart = ixp4xx_restart, 138 .restart = ixp4xx_restart,
diff --git a/arch/arm/mach-ixp4xx/dsmg600-setup.c b/arch/arm/mach-ixp4xx/dsmg600-setup.c
index 97a0af8f1955..5d413f8c5700 100644
--- a/arch/arm/mach-ixp4xx/dsmg600-setup.c
+++ b/arch/arm/mach-ixp4xx/dsmg600-setup.c
@@ -226,10 +226,6 @@ static void __init dsmg600_timer_init(void)
226 ixp4xx_timer_init(); 226 ixp4xx_timer_init();
227} 227}
228 228
229static struct sys_timer dsmg600_timer = {
230 .init = dsmg600_timer_init,
231};
232
233static void __init dsmg600_init(void) 229static void __init dsmg600_init(void)
234{ 230{
235 ixp4xx_sys_init(); 231 ixp4xx_sys_init();
@@ -282,7 +278,7 @@ MACHINE_START(DSMG600, "D-Link DSM-G600 RevA")
282 .map_io = ixp4xx_map_io, 278 .map_io = ixp4xx_map_io,
283 .init_early = ixp4xx_init_early, 279 .init_early = ixp4xx_init_early,
284 .init_irq = ixp4xx_init_irq, 280 .init_irq = ixp4xx_init_irq,
285 .timer = &dsmg600_timer, 281 .init_time = dsmg600_timer_init,
286 .init_machine = dsmg600_init, 282 .init_machine = dsmg600_init,
287#if defined(CONFIG_PCI) 283#if defined(CONFIG_PCI)
288 .dma_zone_size = SZ_64M, 284 .dma_zone_size = SZ_64M,
diff --git a/arch/arm/mach-ixp4xx/fsg-setup.c b/arch/arm/mach-ixp4xx/fsg-setup.c
index 9175a25a7511..429966b756ed 100644
--- a/arch/arm/mach-ixp4xx/fsg-setup.c
+++ b/arch/arm/mach-ixp4xx/fsg-setup.c
@@ -272,7 +272,7 @@ MACHINE_START(FSG, "Freecom FSG-3")
272 .map_io = ixp4xx_map_io, 272 .map_io = ixp4xx_map_io,
273 .init_early = ixp4xx_init_early, 273 .init_early = ixp4xx_init_early,
274 .init_irq = ixp4xx_init_irq, 274 .init_irq = ixp4xx_init_irq,
275 .timer = &ixp4xx_timer, 275 .init_time = ixp4xx_timer_init,
276 .atag_offset = 0x100, 276 .atag_offset = 0x100,
277 .init_machine = fsg_init, 277 .init_machine = fsg_init,
278#if defined(CONFIG_PCI) 278#if defined(CONFIG_PCI)
diff --git a/arch/arm/mach-ixp4xx/gateway7001-setup.c b/arch/arm/mach-ixp4xx/gateway7001-setup.c
index 033c71758953..3d24b3fcee87 100644
--- a/arch/arm/mach-ixp4xx/gateway7001-setup.c
+++ b/arch/arm/mach-ixp4xx/gateway7001-setup.c
@@ -99,7 +99,7 @@ MACHINE_START(GATEWAY7001, "Gateway 7001 AP")
99 .map_io = ixp4xx_map_io, 99 .map_io = ixp4xx_map_io,
100 .init_early = ixp4xx_init_early, 100 .init_early = ixp4xx_init_early,
101 .init_irq = ixp4xx_init_irq, 101 .init_irq = ixp4xx_init_irq,
102 .timer = &ixp4xx_timer, 102 .init_time = ixp4xx_timer_init,
103 .atag_offset = 0x100, 103 .atag_offset = 0x100,
104 .init_machine = gateway7001_init, 104 .init_machine = gateway7001_init,
105#if defined(CONFIG_PCI) 105#if defined(CONFIG_PCI)
diff --git a/arch/arm/mach-ixp4xx/goramo_mlr.c b/arch/arm/mach-ixp4xx/goramo_mlr.c
index 53b8348dfcc2..e54ff491c105 100644
--- a/arch/arm/mach-ixp4xx/goramo_mlr.c
+++ b/arch/arm/mach-ixp4xx/goramo_mlr.c
@@ -498,7 +498,7 @@ MACHINE_START(GORAMO_MLR, "MultiLink")
498 .map_io = ixp4xx_map_io, 498 .map_io = ixp4xx_map_io,
499 .init_early = ixp4xx_init_early, 499 .init_early = ixp4xx_init_early,
500 .init_irq = ixp4xx_init_irq, 500 .init_irq = ixp4xx_init_irq,
501 .timer = &ixp4xx_timer, 501 .init_time = ixp4xx_timer_init,
502 .atag_offset = 0x100, 502 .atag_offset = 0x100,
503 .init_machine = gmlr_init, 503 .init_machine = gmlr_init,
504#if defined(CONFIG_PCI) 504#if defined(CONFIG_PCI)
diff --git a/arch/arm/mach-ixp4xx/gtwx5715-setup.c b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
index 18ebc6be7969..16a12994fb53 100644
--- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c
+++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
@@ -167,7 +167,7 @@ MACHINE_START(GTWX5715, "Gemtek GTWX5715 (Linksys WRV54G)")
167 .map_io = ixp4xx_map_io, 167 .map_io = ixp4xx_map_io,
168 .init_early = ixp4xx_init_early, 168 .init_early = ixp4xx_init_early,
169 .init_irq = ixp4xx_init_irq, 169 .init_irq = ixp4xx_init_irq,
170 .timer = &ixp4xx_timer, 170 .init_time = ixp4xx_timer_init,
171 .atag_offset = 0x100, 171 .atag_offset = 0x100,
172 .init_machine = gtwx5715_init, 172 .init_machine = gtwx5715_init,
173#if defined(CONFIG_PCI) 173#if defined(CONFIG_PCI)
diff --git a/arch/arm/mach-ixp4xx/include/mach/platform.h b/arch/arm/mach-ixp4xx/include/mach/platform.h
index 5bce94aacca9..db5afb69c123 100644
--- a/arch/arm/mach-ixp4xx/include/mach/platform.h
+++ b/arch/arm/mach-ixp4xx/include/mach/platform.h
@@ -89,8 +89,6 @@ struct ixp4xx_pata_data {
89 void __iomem *cs1; 89 void __iomem *cs1;
90}; 90};
91 91
92struct sys_timer;
93
94#define IXP4XX_ETH_NPEA 0x00 92#define IXP4XX_ETH_NPEA 0x00
95#define IXP4XX_ETH_NPEB 0x10 93#define IXP4XX_ETH_NPEB 0x10
96#define IXP4XX_ETH_NPEC 0x20 94#define IXP4XX_ETH_NPEC 0x20
@@ -125,7 +123,6 @@ extern void ixp4xx_init_early(void);
125extern void ixp4xx_init_irq(void); 123extern void ixp4xx_init_irq(void);
126extern void ixp4xx_sys_init(void); 124extern void ixp4xx_sys_init(void);
127extern void ixp4xx_timer_init(void); 125extern void ixp4xx_timer_init(void);
128extern struct sys_timer ixp4xx_timer;
129extern void ixp4xx_restart(char, const char *); 126extern void ixp4xx_restart(char, const char *);
130extern void ixp4xx_pci_preinit(void); 127extern void ixp4xx_pci_preinit(void);
131struct pci_sys_data; 128struct pci_sys_data;
diff --git a/arch/arm/mach-ixp4xx/include/mach/uncompress.h b/arch/arm/mach-ixp4xx/include/mach/uncompress.h
index eb945a926d07..7b25c0225e46 100644
--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h
+++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h
@@ -53,6 +53,4 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
53 */ 53 */
54#define arch_decomp_setup() __arch_decomp_setup(arch_id) 54#define arch_decomp_setup() __arch_decomp_setup(arch_id)
55 55
56#define arch_decomp_wdog()
57
58#endif 56#endif
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c
index 108a9d3f382d..22d688b7d513 100644
--- a/arch/arm/mach-ixp4xx/ixdp425-setup.c
+++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c
@@ -252,7 +252,7 @@ MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
252 .map_io = ixp4xx_map_io, 252 .map_io = ixp4xx_map_io,
253 .init_early = ixp4xx_init_early, 253 .init_early = ixp4xx_init_early,
254 .init_irq = ixp4xx_init_irq, 254 .init_irq = ixp4xx_init_irq,
255 .timer = &ixp4xx_timer, 255 .init_time = ixp4xx_timer_init,
256 .atag_offset = 0x100, 256 .atag_offset = 0x100,
257 .init_machine = ixdp425_init, 257 .init_machine = ixdp425_init,
258#if defined(CONFIG_PCI) 258#if defined(CONFIG_PCI)
@@ -268,7 +268,7 @@ MACHINE_START(IXDP465, "Intel IXDP465 Development Platform")
268 .map_io = ixp4xx_map_io, 268 .map_io = ixp4xx_map_io,
269 .init_early = ixp4xx_init_early, 269 .init_early = ixp4xx_init_early,
270 .init_irq = ixp4xx_init_irq, 270 .init_irq = ixp4xx_init_irq,
271 .timer = &ixp4xx_timer, 271 .init_time = ixp4xx_timer_init,
272 .atag_offset = 0x100, 272 .atag_offset = 0x100,
273 .init_machine = ixdp425_init, 273 .init_machine = ixdp425_init,
274#if defined(CONFIG_PCI) 274#if defined(CONFIG_PCI)
@@ -283,7 +283,7 @@ MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
283 .map_io = ixp4xx_map_io, 283 .map_io = ixp4xx_map_io,
284 .init_early = ixp4xx_init_early, 284 .init_early = ixp4xx_init_early,
285 .init_irq = ixp4xx_init_irq, 285 .init_irq = ixp4xx_init_irq,
286 .timer = &ixp4xx_timer, 286 .init_time = ixp4xx_timer_init,
287 .atag_offset = 0x100, 287 .atag_offset = 0x100,
288 .init_machine = ixdp425_init, 288 .init_machine = ixdp425_init,
289#if defined(CONFIG_PCI) 289#if defined(CONFIG_PCI)
@@ -298,7 +298,7 @@ MACHINE_START(KIXRP435, "Intel KIXRP435 Reference Platform")
298 .map_io = ixp4xx_map_io, 298 .map_io = ixp4xx_map_io,
299 .init_early = ixp4xx_init_early, 299 .init_early = ixp4xx_init_early,
300 .init_irq = ixp4xx_init_irq, 300 .init_irq = ixp4xx_init_irq,
301 .timer = &ixp4xx_timer, 301 .init_time = ixp4xx_timer_init,
302 .atag_offset = 0x100, 302 .atag_offset = 0x100,
303 .init_machine = ixdp425_init, 303 .init_machine = ixdp425_init,
304#if defined(CONFIG_PCI) 304#if defined(CONFIG_PCI)
diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c
index 33cb0955b6bf..ed667ce9f576 100644
--- a/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ b/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -317,7 +317,7 @@ MACHINE_START(NAS100D, "Iomega NAS 100d")
317 .map_io = ixp4xx_map_io, 317 .map_io = ixp4xx_map_io,
318 .init_early = ixp4xx_init_early, 318 .init_early = ixp4xx_init_early,
319 .init_irq = ixp4xx_init_irq, 319 .init_irq = ixp4xx_init_irq,
320 .timer = &ixp4xx_timer, 320 .init_time = ixp4xx_timer_init,
321 .init_machine = nas100d_init, 321 .init_machine = nas100d_init,
322#if defined(CONFIG_PCI) 322#if defined(CONFIG_PCI)
323 .dma_zone_size = SZ_64M, 323 .dma_zone_size = SZ_64M,
diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c
index e2903faaebb3..7e55236c26ea 100644
--- a/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ b/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -232,10 +232,6 @@ static void __init nslu2_timer_init(void)
232 ixp4xx_timer_init(); 232 ixp4xx_timer_init();
233} 233}
234 234
235static struct sys_timer nslu2_timer = {
236 .init = nslu2_timer_init,
237};
238
239static void __init nslu2_init(void) 235static void __init nslu2_init(void)
240{ 236{
241 uint8_t __iomem *f; 237 uint8_t __iomem *f;
@@ -303,7 +299,7 @@ MACHINE_START(NSLU2, "Linksys NSLU2")
303 .map_io = ixp4xx_map_io, 299 .map_io = ixp4xx_map_io,
304 .init_early = ixp4xx_init_early, 300 .init_early = ixp4xx_init_early,
305 .init_irq = ixp4xx_init_irq, 301 .init_irq = ixp4xx_init_irq,
306 .timer = &nslu2_timer, 302 .init_time = nslu2_timer_init,
307 .init_machine = nslu2_init, 303 .init_machine = nslu2_init,
308#if defined(CONFIG_PCI) 304#if defined(CONFIG_PCI)
309 .dma_zone_size = SZ_64M, 305 .dma_zone_size = SZ_64M,
diff --git a/arch/arm/mach-ixp4xx/omixp-setup.c b/arch/arm/mach-ixp4xx/omixp-setup.c
index 158ddb79821d..46a89f5e8269 100644
--- a/arch/arm/mach-ixp4xx/omixp-setup.c
+++ b/arch/arm/mach-ixp4xx/omixp-setup.c
@@ -245,7 +245,7 @@ MACHINE_START(DEVIXP, "Omicron DEVIXP")
245 .map_io = ixp4xx_map_io, 245 .map_io = ixp4xx_map_io,
246 .init_early = ixp4xx_init_early, 246 .init_early = ixp4xx_init_early,
247 .init_irq = ixp4xx_init_irq, 247 .init_irq = ixp4xx_init_irq,
248 .timer = &ixp4xx_timer, 248 .init_time = ixp4xx_timer_init,
249 .init_machine = omixp_init, 249 .init_machine = omixp_init,
250 .restart = ixp4xx_restart, 250 .restart = ixp4xx_restart,
251MACHINE_END 251MACHINE_END
@@ -257,7 +257,7 @@ MACHINE_START(MICCPT, "Omicron MICCPT")
257 .map_io = ixp4xx_map_io, 257 .map_io = ixp4xx_map_io,
258 .init_early = ixp4xx_init_early, 258 .init_early = ixp4xx_init_early,
259 .init_irq = ixp4xx_init_irq, 259 .init_irq = ixp4xx_init_irq,
260 .timer = &ixp4xx_timer, 260 .init_time = ixp4xx_timer_init,
261 .init_machine = omixp_init, 261 .init_machine = omixp_init,
262#if defined(CONFIG_PCI) 262#if defined(CONFIG_PCI)
263 .dma_zone_size = SZ_64M, 263 .dma_zone_size = SZ_64M,
@@ -272,7 +272,7 @@ MACHINE_START(MIC256, "Omicron MIC256")
272 .map_io = ixp4xx_map_io, 272 .map_io = ixp4xx_map_io,
273 .init_early = ixp4xx_init_early, 273 .init_early = ixp4xx_init_early,
274 .init_irq = ixp4xx_init_irq, 274 .init_irq = ixp4xx_init_irq,
275 .timer = &ixp4xx_timer, 275 .init_time = ixp4xx_timer_init,
276 .init_machine = omixp_init, 276 .init_machine = omixp_init,
277 .restart = ixp4xx_restart, 277 .restart = ixp4xx_restart,
278MACHINE_END 278MACHINE_END
diff --git a/arch/arm/mach-ixp4xx/vulcan-setup.c b/arch/arm/mach-ixp4xx/vulcan-setup.c
index 2798f435aaf4..d42730a1d4ab 100644
--- a/arch/arm/mach-ixp4xx/vulcan-setup.c
+++ b/arch/arm/mach-ixp4xx/vulcan-setup.c
@@ -239,7 +239,7 @@ MACHINE_START(ARCOM_VULCAN, "Arcom/Eurotech Vulcan")
239 .map_io = ixp4xx_map_io, 239 .map_io = ixp4xx_map_io,
240 .init_early = ixp4xx_init_early, 240 .init_early = ixp4xx_init_early,
241 .init_irq = ixp4xx_init_irq, 241 .init_irq = ixp4xx_init_irq,
242 .timer = &ixp4xx_timer, 242 .init_time = ixp4xx_timer_init,
243 .atag_offset = 0x100, 243 .atag_offset = 0x100,
244 .init_machine = vulcan_init, 244 .init_machine = vulcan_init,
245#if defined(CONFIG_PCI) 245#if defined(CONFIG_PCI)
diff --git a/arch/arm/mach-ixp4xx/wg302v2-setup.c b/arch/arm/mach-ixp4xx/wg302v2-setup.c
index a785175b115b..8f9ea2f3a9a5 100644
--- a/arch/arm/mach-ixp4xx/wg302v2-setup.c
+++ b/arch/arm/mach-ixp4xx/wg302v2-setup.c
@@ -100,7 +100,7 @@ MACHINE_START(WG302V2, "Netgear WG302 v2 / WAG302 v2")
100 .map_io = ixp4xx_map_io, 100 .map_io = ixp4xx_map_io,
101 .init_early = ixp4xx_init_early, 101 .init_early = ixp4xx_init_early,
102 .init_irq = ixp4xx_init_irq, 102 .init_irq = ixp4xx_init_irq,
103 .timer = &ixp4xx_timer, 103 .init_time = ixp4xx_timer_init,
104 .atag_offset = 0x100, 104 .atag_offset = 0x100,
105 .init_machine = wg302v2_init, 105 .init_machine = wg302v2_init,
106#if defined(CONFIG_PCI) 106#if defined(CONFIG_PCI)
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index f91cdff5a3e4..7b6a64bc5f40 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -58,6 +58,13 @@ config ARCH_KIRKWOOD_DT
58 Say 'Y' here if you want your kernel to support the 58 Say 'Y' here if you want your kernel to support the
59 Marvell Kirkwood using flattened device tree. 59 Marvell Kirkwood using flattened device tree.
60 60
61config MACH_GURUPLUG_DT
62 bool "Marvell GuruPlug Reference Board (Flattened Device Tree)"
63 select ARCH_KIRKWOOD_DT
64 help
65 Say 'Y' here if you want your kernel to support the
66 Marvell GuruPlug Reference Board (Flattened Device Tree).
67
61config MACH_DREAMPLUG_DT 68config MACH_DREAMPLUG_DT
62 bool "Marvell DreamPlug (Flattened Device Tree)" 69 bool "Marvell DreamPlug (Flattened Device Tree)"
63 select ARCH_KIRKWOOD_DT 70 select ARCH_KIRKWOOD_DT
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 8d2e5a96247c..4cc4bee4d0cf 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -19,9 +19,9 @@ obj-$(CONFIG_MACH_NET2BIG_V2) += netxbig_v2-setup.o lacie_v2-common.o
19obj-$(CONFIG_MACH_NET5BIG_V2) += netxbig_v2-setup.o lacie_v2-common.o 19obj-$(CONFIG_MACH_NET5BIG_V2) += netxbig_v2-setup.o lacie_v2-common.o
20obj-$(CONFIG_MACH_T5325) += t5325-setup.o 20obj-$(CONFIG_MACH_T5325) += t5325-setup.o
21 21
22obj-$(CONFIG_CPU_IDLE) += cpuidle.o
23obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o 22obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o
24obj-$(CONFIG_MACH_DREAMPLUG_DT) += board-dreamplug.o 23obj-$(CONFIG_MACH_DREAMPLUG_DT) += board-dreamplug.o
24obj-$(CONFIG_MACH_GURUPLUG_DT) += board-guruplug.o
25obj-$(CONFIG_MACH_ICONNECT_DT) += board-iconnect.o 25obj-$(CONFIG_MACH_ICONNECT_DT) += board-iconnect.o
26obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += board-dnskw.o 26obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += board-dnskw.o
27obj-$(CONFIG_MACH_IB62X0_DT) += board-ib62x0.o 27obj-$(CONFIG_MACH_IB62X0_DT) += board-ib62x0.o
diff --git a/arch/arm/mach-kirkwood/board-dreamplug.c b/arch/arm/mach-kirkwood/board-dreamplug.c
index 08248e24ffcd..0903242c00dc 100644
--- a/arch/arm/mach-kirkwood/board-dreamplug.c
+++ b/arch/arm/mach-kirkwood/board-dreamplug.c
@@ -15,7 +15,6 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/mv643xx_eth.h> 16#include <linux/mv643xx_eth.h>
17#include <linux/gpio.h> 17#include <linux/gpio.h>
18#include <linux/platform_data/mmc-mvsdio.h>
19#include "common.h" 18#include "common.h"
20 19
21static struct mv643xx_eth_platform_data dreamplug_ge00_data = { 20static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
@@ -26,10 +25,6 @@ static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
26 .phy_addr = MV643XX_ETH_PHY_ADDR(1), 25 .phy_addr = MV643XX_ETH_PHY_ADDR(1),
27}; 26};
28 27
29static struct mvsdio_platform_data dreamplug_mvsdio_data = {
30 /* unfortunately the CD signal has not been connected */
31};
32
33void __init dreamplug_init(void) 28void __init dreamplug_init(void)
34{ 29{
35 /* 30 /*
@@ -37,5 +32,4 @@ void __init dreamplug_init(void)
37 */ 32 */
38 kirkwood_ge00_init(&dreamplug_ge00_data); 33 kirkwood_ge00_init(&dreamplug_ge00_data);
39 kirkwood_ge01_init(&dreamplug_ge01_data); 34 kirkwood_ge01_init(&dreamplug_ge01_data);
40 kirkwood_sdio_init(&dreamplug_mvsdio_data);
41} 35}
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index de4fd2bb1e27..2e73e9d53f70 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -55,10 +55,6 @@ static void __init kirkwood_legacy_clk_init(void)
55 orion_clkdev_add("0", "pcie", 55 orion_clkdev_add("0", "pcie",
56 of_clk_get_from_provider(&clkspec)); 56 of_clk_get_from_provider(&clkspec));
57 57
58 clkspec.args[0] = CGC_BIT_USB0;
59 orion_clkdev_add(NULL, "orion-ehci.0",
60 of_clk_get_from_provider(&clkspec));
61
62 clkspec.args[0] = CGC_BIT_PEX1; 58 clkspec.args[0] = CGC_BIT_PEX1;
63 orion_clkdev_add("1", "pcie", 59 orion_clkdev_add("1", "pcie",
64 of_clk_get_from_provider(&clkspec)); 60 of_clk_get_from_provider(&clkspec));
@@ -66,11 +62,6 @@ static void __init kirkwood_legacy_clk_init(void)
66 clkspec.args[0] = CGC_BIT_GE1; 62 clkspec.args[0] = CGC_BIT_GE1;
67 orion_clkdev_add(NULL, "mv643xx_eth_port.1", 63 orion_clkdev_add(NULL, "mv643xx_eth_port.1",
68 of_clk_get_from_provider(&clkspec)); 64 of_clk_get_from_provider(&clkspec));
69
70 clkspec.args[0] = CGC_BIT_SDIO;
71 orion_clkdev_add(NULL, "mvsdio",
72 of_clk_get_from_provider(&clkspec));
73
74} 65}
75 66
76static void __init kirkwood_of_clk_init(void) 67static void __init kirkwood_of_clk_init(void)
@@ -98,6 +89,8 @@ static void __init kirkwood_dt_init(void)
98 /* Setup root of clk tree */ 89 /* Setup root of clk tree */
99 kirkwood_of_clk_init(); 90 kirkwood_of_clk_init();
100 91
92 kirkwood_cpuidle_init();
93
101#ifdef CONFIG_KEXEC 94#ifdef CONFIG_KEXEC
102 kexec_reinit = kirkwood_enable_pcie; 95 kexec_reinit = kirkwood_enable_pcie;
103#endif 96#endif
@@ -105,6 +98,9 @@ static void __init kirkwood_dt_init(void)
105 if (of_machine_is_compatible("globalscale,dreamplug")) 98 if (of_machine_is_compatible("globalscale,dreamplug"))
106 dreamplug_init(); 99 dreamplug_init();
107 100
101 if (of_machine_is_compatible("globalscale,guruplug"))
102 guruplug_dt_init();
103
108 if (of_machine_is_compatible("dlink,dns-kirkwood")) 104 if (of_machine_is_compatible("dlink,dns-kirkwood"))
109 dnskw_init(); 105 dnskw_init();
110 106
@@ -148,14 +144,12 @@ static void __init kirkwood_dt_init(void)
148 if (of_machine_is_compatible("usi,topkick")) 144 if (of_machine_is_compatible("usi,topkick"))
149 usi_topkick_init(); 145 usi_topkick_init();
150 146
151 if (of_machine_is_compatible("zyxel,nsa310"))
152 nsa310_init();
153
154 of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL); 147 of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
155} 148}
156 149
157static const char * const kirkwood_dt_board_compat[] = { 150static const char * const kirkwood_dt_board_compat[] = {
158 "globalscale,dreamplug", 151 "globalscale,dreamplug",
152 "globalscale,guruplug",
159 "dlink,dns-320", 153 "dlink,dns-320",
160 "dlink,dns-325", 154 "dlink,dns-325",
161 "iom,iconnect", 155 "iom,iconnect",
@@ -183,7 +177,7 @@ DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
183 .map_io = kirkwood_map_io, 177 .map_io = kirkwood_map_io,
184 .init_early = kirkwood_init_early, 178 .init_early = kirkwood_init_early,
185 .init_irq = orion_dt_init_irq, 179 .init_irq = orion_dt_init_irq,
186 .timer = &kirkwood_timer, 180 .init_time = kirkwood_timer_init,
187 .init_machine = kirkwood_dt_init, 181 .init_machine = kirkwood_dt_init,
188 .restart = kirkwood_restart, 182 .restart = kirkwood_restart,
189 .dt_compat = kirkwood_dt_board_compat, 183 .dt_compat = kirkwood_dt_board_compat,
diff --git a/arch/arm/mach-kirkwood/board-guruplug.c b/arch/arm/mach-kirkwood/board-guruplug.c
new file mode 100644
index 000000000000..0a0df4554d8b
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-guruplug.c
@@ -0,0 +1,39 @@
1/*
2 * arch/arm/mach-kirkwood/board-guruplug.c
3 *
4 * Marvell Guruplug Reference Board Init for drivers not converted to
5 * flattened device tree yet.
6 *
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
9 * warranty of any kind, whether express or implied.
10 */
11
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/mv643xx_eth.h>
15#include <linux/gpio.h>
16#include <linux/platform_data/mmc-mvsdio.h>
17#include "common.h"
18
19static struct mv643xx_eth_platform_data guruplug_ge00_data = {
20 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
21};
22
23static struct mv643xx_eth_platform_data guruplug_ge01_data = {
24 .phy_addr = MV643XX_ETH_PHY_ADDR(1),
25};
26
27static struct mvsdio_platform_data guruplug_mvsdio_data = {
28 /* unfortunately the CD signal has not been connected */
29};
30
31void __init guruplug_dt_init(void)
32{
33 /*
34 * Basic setup. Needs to be called early.
35 */
36 kirkwood_ge00_init(&guruplug_ge00_data);
37 kirkwood_ge01_init(&guruplug_ge01_data);
38 kirkwood_sdio_init(&guruplug_mvsdio_data);
39}
diff --git a/arch/arm/mach-kirkwood/board-ib62x0.c b/arch/arm/mach-kirkwood/board-ib62x0.c
index 9f6f496380d8..9a857ae83984 100644
--- a/arch/arm/mach-kirkwood/board-ib62x0.c
+++ b/arch/arm/mach-kirkwood/board-ib62x0.c
@@ -14,7 +14,6 @@
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/mv643xx_eth.h> 16#include <linux/mv643xx_eth.h>
17#include <linux/input.h>
18#include "common.h" 17#include "common.h"
19 18
20static struct mv643xx_eth_platform_data ib62x0_ge00_data = { 19static struct mv643xx_eth_platform_data ib62x0_ge00_data = {
diff --git a/arch/arm/mach-kirkwood/board-mplcec4.c b/arch/arm/mach-kirkwood/board-mplcec4.c
index 56bfe5a1605a..7d6dc669e17f 100644
--- a/arch/arm/mach-kirkwood/board-mplcec4.c
+++ b/arch/arm/mach-kirkwood/board-mplcec4.c
@@ -12,9 +12,7 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/mv643xx_eth.h> 14#include <linux/mv643xx_eth.h>
15#include <linux/platform_data/mmc-mvsdio.h>
16#include "common.h" 15#include "common.h"
17#include "mpp.h"
18 16
19static struct mv643xx_eth_platform_data mplcec4_ge00_data = { 17static struct mv643xx_eth_platform_data mplcec4_ge00_data = {
20 .phy_addr = MV643XX_ETH_PHY_ADDR(1), 18 .phy_addr = MV643XX_ETH_PHY_ADDR(1),
@@ -24,11 +22,6 @@ static struct mv643xx_eth_platform_data mplcec4_ge01_data = {
24 .phy_addr = MV643XX_ETH_PHY_ADDR(2), 22 .phy_addr = MV643XX_ETH_PHY_ADDR(2),
25}; 23};
26 24
27static struct mvsdio_platform_data mplcec4_mvsdio_data = {
28 .gpio_card_detect = 47, /* MPP47 used as SD card detect */
29};
30
31
32void __init mplcec4_init(void) 25void __init mplcec4_init(void)
33{ 26{
34 /* 27 /*
@@ -36,7 +29,6 @@ void __init mplcec4_init(void)
36 */ 29 */
37 kirkwood_ge00_init(&mplcec4_ge00_data); 30 kirkwood_ge00_init(&mplcec4_ge00_data);
38 kirkwood_ge01_init(&mplcec4_ge01_data); 31 kirkwood_ge01_init(&mplcec4_ge01_data);
39 kirkwood_sdio_init(&mplcec4_mvsdio_data);
40 kirkwood_pcie_init(KW_PCIE0); 32 kirkwood_pcie_init(KW_PCIE0);
41} 33}
42 34
diff --git a/arch/arm/mach-kirkwood/board-ns2.c b/arch/arm/mach-kirkwood/board-ns2.c
index f4632a809f68..f2ea3b7ad726 100644
--- a/arch/arm/mach-kirkwood/board-ns2.c
+++ b/arch/arm/mach-kirkwood/board-ns2.c
@@ -15,7 +15,6 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/mv643xx_eth.h> 17#include <linux/mv643xx_eth.h>
18#include <linux/gpio.h>
19#include <linux/of.h> 18#include <linux/of.h>
20#include "common.h" 19#include "common.h"
21 20
@@ -23,13 +22,6 @@ static struct mv643xx_eth_platform_data ns2_ge00_data = {
23 .phy_addr = MV643XX_ETH_PHY_ADDR(8), 22 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
24}; 23};
25 24
26#define NS2_GPIO_POWER_OFF 31
27
28static void ns2_power_off(void)
29{
30 gpio_set_value(NS2_GPIO_POWER_OFF, 1);
31}
32
33void __init ns2_init(void) 25void __init ns2_init(void)
34{ 26{
35 /* 27 /*
@@ -39,10 +31,4 @@ void __init ns2_init(void)
39 of_machine_is_compatible("lacie,netspace_mini_v2")) 31 of_machine_is_compatible("lacie,netspace_mini_v2"))
40 ns2_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0); 32 ns2_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
41 kirkwood_ge00_init(&ns2_ge00_data); 33 kirkwood_ge00_init(&ns2_ge00_data);
42
43 if (gpio_request(NS2_GPIO_POWER_OFF, "power-off") == 0 &&
44 gpio_direction_output(NS2_GPIO_POWER_OFF, 0) == 0)
45 pm_power_off = ns2_power_off;
46 else
47 pr_err("ns2: failed to configure power-off GPIO\n");
48} 34}
diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
index f58d2e1a4042..55ade93b93bf 100644
--- a/arch/arm/mach-kirkwood/board-nsa310.c
+++ b/arch/arm/mach-kirkwood/board-nsa310.c
@@ -10,85 +10,9 @@
10 10
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/i2c.h>
14#include <linux/gpio.h>
15
16#include <asm/mach-types.h>
17#include <asm/mach/arch.h>
18#include <mach/kirkwood.h> 13#include <mach/kirkwood.h>
14#include <linux/of.h>
19#include "common.h" 15#include "common.h"
20#include "mpp.h"
21
22#define NSA310_GPIO_USB_POWER_OFF 21
23#define NSA310_GPIO_POWER_OFF 48
24
25static unsigned int nsa310_mpp_config[] __initdata = {
26 MPP12_GPIO, /* led esata green */
27 MPP13_GPIO, /* led esata red */
28 MPP15_GPIO, /* led usb green */
29 MPP16_GPIO, /* led usb red */
30 MPP21_GPIO, /* control usb power off */
31 MPP28_GPIO, /* led sys green */
32 MPP29_GPIO, /* led sys red */
33 MPP36_GPIO, /* key reset */
34 MPP37_GPIO, /* key copy */
35 MPP39_GPIO, /* led copy green */
36 MPP40_GPIO, /* led copy red */
37 MPP41_GPIO, /* led hdd green */
38 MPP42_GPIO, /* led hdd red */
39 MPP44_GPIO, /* ?? */
40 MPP46_GPIO, /* key power */
41 MPP48_GPIO, /* control power off */
42 0
43};
44
45static struct i2c_board_info __initdata nsa310_i2c_info[] = {
46 { I2C_BOARD_INFO("adt7476", 0x2e) },
47};
48
49static void nsa310_power_off(void)
50{
51 gpio_set_value(NSA310_GPIO_POWER_OFF, 1);
52}
53
54static int __init nsa310_gpio_request(unsigned int gpio, unsigned long flags,
55 const char *label)
56{
57 int err;
58
59 err = gpio_request_one(gpio, flags, label);
60 if (err)
61 pr_err("NSA-310: can't setup GPIO%u (%s), err=%d\n",
62 gpio, label, err);
63
64 return err;
65}
66
67static void __init nsa310_gpio_init(void)
68{
69 int err;
70
71 err = nsa310_gpio_request(NSA310_GPIO_POWER_OFF, GPIOF_OUT_INIT_LOW,
72 "Power Off");
73 if (!err)
74 pm_power_off = nsa310_power_off;
75
76 nsa310_gpio_request(NSA310_GPIO_USB_POWER_OFF, GPIOF_OUT_INIT_LOW,
77 "USB Power Off");
78}
79
80void __init nsa310_init(void)
81{
82 u32 dev, rev;
83
84 kirkwood_mpp_conf(nsa310_mpp_config);
85
86 nsa310_gpio_init();
87
88 kirkwood_pcie_id(&dev, &rev);
89
90 i2c_register_board_info(0, ARRAY_AND_SIZE(nsa310_i2c_info));
91}
92 16
93static int __init nsa310_pci_init(void) 17static int __init nsa310_pci_init(void)
94{ 18{
diff --git a/arch/arm/mach-kirkwood/board-openblocks_a6.c b/arch/arm/mach-kirkwood/board-openblocks_a6.c
index 815fc6451d52..b11d8fdeca93 100644
--- a/arch/arm/mach-kirkwood/board-openblocks_a6.c
+++ b/arch/arm/mach-kirkwood/board-openblocks_a6.c
@@ -11,60 +11,16 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/mv643xx_eth.h> 13#include <linux/mv643xx_eth.h>
14#include <linux/clk.h>
15#include <linux/clk-private.h>
16#include "common.h" 14#include "common.h"
17#include "mpp.h"
18 15
19static struct mv643xx_eth_platform_data openblocks_ge00_data = { 16static struct mv643xx_eth_platform_data openblocks_ge00_data = {
20 .phy_addr = MV643XX_ETH_PHY_ADDR(0), 17 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
21}; 18};
22 19
23static unsigned int openblocks_a6_mpp_config[] __initdata = {
24 MPP0_NF_IO2,
25 MPP1_NF_IO3,
26 MPP2_NF_IO4,
27 MPP3_NF_IO5,
28 MPP4_NF_IO6,
29 MPP5_NF_IO7,
30 MPP6_SYSRST_OUTn,
31 MPP8_UART1_RTS,
32 MPP9_UART1_CTS,
33 MPP10_UART0_TXD,
34 MPP11_UART0_RXD,
35 MPP13_UART1_TXD,
36 MPP14_UART1_RXD,
37 MPP15_UART0_RTS,
38 MPP16_UART0_CTS,
39 MPP18_NF_IO0,
40 MPP19_NF_IO1,
41 MPP20_GPIO, /* DIP SW0 */
42 MPP21_GPIO, /* DIP SW1 */
43 MPP22_GPIO, /* DIP SW2 */
44 MPP23_GPIO, /* DIP SW3 */
45 MPP24_GPIO, /* GPIO 0 */
46 MPP25_GPIO, /* GPIO 1 */
47 MPP26_GPIO, /* GPIO 2 */
48 MPP27_GPIO, /* GPIO 3 */
49 MPP28_GPIO, /* GPIO 4 */
50 MPP29_GPIO, /* GPIO 5 */
51 MPP30_GPIO, /* GPIO 6 */
52 MPP31_GPIO, /* GPIO 7 */
53 MPP36_TW1_SDA,
54 MPP37_TW1_SCK,
55 MPP38_GPIO, /* INIT */
56 MPP39_GPIO, /* USB OC */
57 MPP41_GPIO, /* LED: Red */
58 MPP42_GPIO, /* LED: Green */
59 MPP43_GPIO, /* LED: Yellow */
60 0,
61};
62
63void __init openblocks_a6_init(void) 20void __init openblocks_a6_init(void)
64{ 21{
65 /* 22 /*
66 * Basic setup. Needs to be called early. 23 * Basic setup. Needs to be called early.
67 */ 24 */
68 kirkwood_mpp_conf(openblocks_a6_mpp_config);
69 kirkwood_ge00_init(&openblocks_ge00_data); 25 kirkwood_ge00_init(&openblocks_ge00_data);
70} 26}
diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c
index 23d2dd1b1b1e..1cc04ec33f0b 100644
--- a/arch/arm/mach-kirkwood/board-usi_topkick.c
+++ b/arch/arm/mach-kirkwood/board-usi_topkick.c
@@ -14,64 +14,16 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/mv643xx_eth.h> 15#include <linux/mv643xx_eth.h>
16#include <linux/gpio.h> 16#include <linux/gpio.h>
17#include <linux/platform_data/mmc-mvsdio.h>
18#include "common.h" 17#include "common.h"
19#include "mpp.h"
20 18
21static struct mv643xx_eth_platform_data topkick_ge00_data = { 19static struct mv643xx_eth_platform_data topkick_ge00_data = {
22 .phy_addr = MV643XX_ETH_PHY_ADDR(0), 20 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
23}; 21};
24 22
25static struct mvsdio_platform_data topkick_mvsdio_data = {
26 /* unfortunately the CD signal has not been connected */
27};
28
29/*
30 * GPIO LED layout
31 *
32 * /-SYS_LED(2)
33 * |
34 * | /-DISK_LED
35 * | |
36 * | | /-WLAN_LED(2)
37 * | | |
38 * [SW] [*] [*] [*]
39 */
40
41/*
42 * Switch positions
43 *
44 * /-SW_LEFT
45 * |
46 * | /-SW_IDLE
47 * | |
48 * | | /-SW_RIGHT
49 * | | |
50 * PS [L] [I] [R] LEDS
51 */
52
53static unsigned int topkick_mpp_config[] __initdata = {
54 MPP21_GPIO, /* DISK_LED (low active) - yellow */
55 MPP36_GPIO, /* SATA0 power enable (high active) */
56 MPP37_GPIO, /* SYS_LED2 (low active) - red */
57 MPP38_GPIO, /* SYS_LED (low active) - blue */
58 MPP39_GPIO, /* WLAN_LED (low active) - green */
59 MPP43_GPIO, /* SW_LEFT (low active) */
60 MPP44_GPIO, /* SW_RIGHT (low active) */
61 MPP45_GPIO, /* SW_IDLE (low active) */
62 MPP46_GPIO, /* SW_LEFT (low active) */
63 MPP48_GPIO, /* WLAN_LED2 (low active) - yellow */
64 0
65};
66
67void __init usi_topkick_init(void) 23void __init usi_topkick_init(void)
68{ 24{
69 /* 25 /*
70 * Basic setup. Needs to be called early. 26 * Basic setup. Needs to be called early.
71 */ 27 */
72 kirkwood_mpp_conf(topkick_mpp_config);
73
74
75 kirkwood_ge00_init(&topkick_ge00_data); 28 kirkwood_ge00_init(&topkick_ge00_data);
76 kirkwood_sdio_init(&topkick_mvsdio_data);
77} 29}
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index bac21a554c91..49792a0cd2d3 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -499,6 +499,28 @@ void __init kirkwood_wdt_init(void)
499 orion_wdt_init(); 499 orion_wdt_init();
500} 500}
501 501
502/*****************************************************************************
503 * CPU idle
504 ****************************************************************************/
505static struct resource kirkwood_cpuidle_resource[] = {
506 {
507 .flags = IORESOURCE_MEM,
508 .start = DDR_OPERATION_BASE,
509 .end = DDR_OPERATION_BASE + 3,
510 },
511};
512
513static struct platform_device kirkwood_cpuidle = {
514 .name = "kirkwood_cpuidle",
515 .id = -1,
516 .resource = kirkwood_cpuidle_resource,
517 .num_resources = 1,
518};
519
520void __init kirkwood_cpuidle_init(void)
521{
522 platform_device_register(&kirkwood_cpuidle);
523}
502 524
503/***************************************************************************** 525/*****************************************************************************
504 * Time handling 526 * Time handling
@@ -530,7 +552,7 @@ static int __init kirkwood_find_tclk(void)
530 return 166666667; 552 return 166666667;
531} 553}
532 554
533static void __init kirkwood_timer_init(void) 555void __init kirkwood_timer_init(void)
534{ 556{
535 kirkwood_tclk = kirkwood_find_tclk(); 557 kirkwood_tclk = kirkwood_find_tclk();
536 558
@@ -538,10 +560,6 @@ static void __init kirkwood_timer_init(void)
538 IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk); 560 IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk);
539} 561}
540 562
541struct sys_timer kirkwood_timer = {
542 .init = kirkwood_timer_init,
543};
544
545/***************************************************************************** 563/*****************************************************************************
546 * Audio 564 * Audio
547 ****************************************************************************/ 565 ****************************************************************************/
@@ -671,6 +689,7 @@ void __init kirkwood_init(void)
671 kirkwood_xor1_init(); 689 kirkwood_xor1_init();
672 kirkwood_crypto_init(); 690 kirkwood_crypto_init();
673 691
692 kirkwood_cpuidle_init();
674#ifdef CONFIG_KEXEC 693#ifdef CONFIG_KEXEC
675 kexec_reinit = kirkwood_enable_pcie; 694 kexec_reinit = kirkwood_enable_pcie;
676#endif 695#endif
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 5ffa57f08c80..5ed70565c843 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -50,6 +50,7 @@ void kirkwood_nand_init(struct mtd_partition *parts, int nr_parts, int delay);
50void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, 50void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
51 int (*dev_ready)(struct mtd_info *)); 51 int (*dev_ready)(struct mtd_info *));
52void kirkwood_audio_init(void); 52void kirkwood_audio_init(void);
53void kirkwood_cpuidle_init(void);
53void kirkwood_restart(char, const char *); 54void kirkwood_restart(char, const char *);
54void kirkwood_clk_init(void); 55void kirkwood_clk_init(void);
55 56
@@ -59,6 +60,11 @@ void dreamplug_init(void);
59#else 60#else
60static inline void dreamplug_init(void) {}; 61static inline void dreamplug_init(void) {};
61#endif 62#endif
63#ifdef CONFIG_MACH_GURUPLUG_DT
64void guruplug_dt_init(void);
65#else
66static inline void guruplug_dt_init(void) {};
67#endif
62#ifdef CONFIG_MACH_TS219_DT 68#ifdef CONFIG_MACH_TS219_DT
63void qnap_dt_ts219_init(void); 69void qnap_dt_ts219_init(void);
64#else 70#else
@@ -129,12 +135,6 @@ void ns2_init(void);
129static inline void ns2_init(void) {}; 135static inline void ns2_init(void) {};
130#endif 136#endif
131 137
132#ifdef CONFIG_MACH_NSA310_DT
133void nsa310_init(void);
134#else
135static inline void nsa310_init(void) {};
136#endif
137
138#ifdef CONFIG_MACH_OPENBLOCKS_A6_DT 138#ifdef CONFIG_MACH_OPENBLOCKS_A6_DT
139void openblocks_a6_init(void); 139void openblocks_a6_init(void);
140#else 140#else
@@ -156,7 +156,7 @@ void kirkwood_xor1_init(void);
156void kirkwood_crypto_init(void); 156void kirkwood_crypto_init(void);
157 157
158extern int kirkwood_tclk; 158extern int kirkwood_tclk;
159extern struct sys_timer kirkwood_timer; 159extern void kirkwood_timer_init(void);
160 160
161#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) 161#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
162 162
diff --git a/arch/arm/mach-kirkwood/cpuidle.c b/arch/arm/mach-kirkwood/cpuidle.c
deleted file mode 100644
index f7304670f2f8..000000000000
--- a/arch/arm/mach-kirkwood/cpuidle.c
+++ /dev/null
@@ -1,73 +0,0 @@
1/*
2 * arch/arm/mach-kirkwood/cpuidle.c
3 *
4 * CPU idle Marvell Kirkwood SoCs
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 * The cpu idle uses wait-for-interrupt and DDR self refresh in order
11 * to implement two idle states -
12 * #1 wait-for-interrupt
13 * #2 wait-for-interrupt and DDR self refresh
14 */
15
16#include <linux/kernel.h>
17#include <linux/init.h>
18#include <linux/platform_device.h>
19#include <linux/cpuidle.h>
20#include <linux/io.h>
21#include <linux/export.h>
22#include <asm/proc-fns.h>
23#include <asm/cpuidle.h>
24#include <mach/kirkwood.h>
25
26#define KIRKWOOD_MAX_STATES 2
27
28/* Actual code that puts the SoC in different idle states */
29static int kirkwood_enter_idle(struct cpuidle_device *dev,
30 struct cpuidle_driver *drv,
31 int index)
32{
33 writel(0x7, DDR_OPERATION_BASE);
34 cpu_do_idle();
35
36 return index;
37}
38
39static struct cpuidle_driver kirkwood_idle_driver = {
40 .name = "kirkwood_idle",
41 .owner = THIS_MODULE,
42 .en_core_tk_irqen = 1,
43 .states[0] = ARM_CPUIDLE_WFI_STATE,
44 .states[1] = {
45 .enter = kirkwood_enter_idle,
46 .exit_latency = 10,
47 .target_residency = 100000,
48 .flags = CPUIDLE_FLAG_TIME_VALID,
49 .name = "DDR SR",
50 .desc = "WFI and DDR Self Refresh",
51 },
52 .state_count = KIRKWOOD_MAX_STATES,
53};
54
55static DEFINE_PER_CPU(struct cpuidle_device, kirkwood_cpuidle_device);
56
57/* Initialize CPU idle by registering the idle states */
58static int kirkwood_init_cpuidle(void)
59{
60 struct cpuidle_device *device;
61
62 device = &per_cpu(kirkwood_cpuidle_device, smp_processor_id());
63 device->state_count = KIRKWOOD_MAX_STATES;
64
65 cpuidle_register_driver(&kirkwood_idle_driver);
66 if (cpuidle_register_device(device)) {
67 pr_err("kirkwood_init_cpuidle: Failed registering\n");
68 return -EIO;
69 }
70 return 0;
71}
72
73device_initcall(kirkwood_init_cpuidle);
diff --git a/arch/arm/mach-kirkwood/d2net_v2-setup.c b/arch/arm/mach-kirkwood/d2net_v2-setup.c
index 2c1a453df201..453418063c1e 100644
--- a/arch/arm/mach-kirkwood/d2net_v2-setup.c
+++ b/arch/arm/mach-kirkwood/d2net_v2-setup.c
@@ -226,6 +226,6 @@ MACHINE_START(D2NET_V2, "LaCie d2 Network v2")
226 .map_io = kirkwood_map_io, 226 .map_io = kirkwood_map_io,
227 .init_early = kirkwood_init_early, 227 .init_early = kirkwood_init_early,
228 .init_irq = kirkwood_init_irq, 228 .init_irq = kirkwood_init_irq,
229 .timer = &kirkwood_timer, 229 .init_time = kirkwood_timer_init,
230 .restart = kirkwood_restart, 230 .restart = kirkwood_restart,
231MACHINE_END 231MACHINE_END
diff --git a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
index c49b177c1523..5a369fe74754 100644
--- a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
+++ b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
@@ -103,6 +103,6 @@ MACHINE_START(DB88F6281_BP, "Marvell DB-88F6281-BP Development Board")
103 .map_io = kirkwood_map_io, 103 .map_io = kirkwood_map_io,
104 .init_early = kirkwood_init_early, 104 .init_early = kirkwood_init_early,
105 .init_irq = kirkwood_init_irq, 105 .init_irq = kirkwood_init_irq,
106 .timer = &kirkwood_timer, 106 .init_time = kirkwood_timer_init,
107 .restart = kirkwood_restart, 107 .restart = kirkwood_restart,
108MACHINE_END 108MACHINE_END
diff --git a/arch/arm/mach-kirkwood/dockstar-setup.c b/arch/arm/mach-kirkwood/dockstar-setup.c
index 791a98fafa29..060ccf9cb63f 100644
--- a/arch/arm/mach-kirkwood/dockstar-setup.c
+++ b/arch/arm/mach-kirkwood/dockstar-setup.c
@@ -19,7 +19,6 @@
19#include <asm/mach-types.h> 19#include <asm/mach-types.h>
20#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
21#include <mach/kirkwood.h> 21#include <mach/kirkwood.h>
22#include <linux/platform_data/mmc-mvsdio.h>
23#include "common.h" 22#include "common.h"
24#include "mpp.h" 23#include "mpp.h"
25 24
@@ -107,6 +106,6 @@ MACHINE_START(DOCKSTAR, "Seagate FreeAgent DockStar")
107 .map_io = kirkwood_map_io, 106 .map_io = kirkwood_map_io,
108 .init_early = kirkwood_init_early, 107 .init_early = kirkwood_init_early,
109 .init_irq = kirkwood_init_irq, 108 .init_irq = kirkwood_init_irq,
110 .timer = &kirkwood_timer, 109 .init_time = kirkwood_timer_init,
111 .restart = kirkwood_restart, 110 .restart = kirkwood_restart,
112MACHINE_END 111MACHINE_END
diff --git a/arch/arm/mach-kirkwood/guruplug-setup.c b/arch/arm/mach-kirkwood/guruplug-setup.c
index 7cb55f982243..1c6e736cbbf8 100644
--- a/arch/arm/mach-kirkwood/guruplug-setup.c
+++ b/arch/arm/mach-kirkwood/guruplug-setup.c
@@ -126,6 +126,6 @@ MACHINE_START(GURUPLUG, "Marvell GuruPlug Reference Board")
126 .map_io = kirkwood_map_io, 126 .map_io = kirkwood_map_io,
127 .init_early = kirkwood_init_early, 127 .init_early = kirkwood_init_early,
128 .init_irq = kirkwood_init_irq, 128 .init_irq = kirkwood_init_irq,
129 .timer = &kirkwood_timer, 129 .init_time = kirkwood_timer_init,
130 .restart = kirkwood_restart, 130 .restart = kirkwood_restart,
131MACHINE_END 131MACHINE_END
diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
index 041653a04a9c..a05563a31c95 100644
--- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h
+++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
@@ -60,8 +60,9 @@
60 * Register Map 60 * Register Map
61 */ 61 */
62#define DDR_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x00000) 62#define DDR_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x00000)
63#define DDR_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x00000)
63#define DDR_WINDOW_CPU_BASE (DDR_VIRT_BASE + 0x1500) 64#define DDR_WINDOW_CPU_BASE (DDR_VIRT_BASE + 0x1500)
64#define DDR_OPERATION_BASE (DDR_VIRT_BASE + 0x1418) 65#define DDR_OPERATION_BASE (DDR_PHYS_BASE + 0x1418)
65 66
66#define DEV_BUS_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x10000) 67#define DEV_BUS_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x10000)
67#define DEV_BUS_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x10000) 68#define DEV_BUS_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x10000)
diff --git a/arch/arm/mach-kirkwood/include/mach/uncompress.h b/arch/arm/mach-kirkwood/include/mach/uncompress.h
index 75d5497df3a8..5bca5534021f 100644
--- a/arch/arm/mach-kirkwood/include/mach/uncompress.h
+++ b/arch/arm/mach-kirkwood/include/mach/uncompress.h
@@ -44,4 +44,3 @@ static void flush(void)
44 * nothing to do 44 * nothing to do
45 */ 45 */
46#define arch_decomp_setup() 46#define arch_decomp_setup()
47#define arch_decomp_wdog()
diff --git a/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c b/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
index 6d8364a97810..ba384b992bef 100644
--- a/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
+++ b/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
@@ -167,6 +167,6 @@ MACHINE_START(MV88F6281GTW_GE, "Marvell 88F6281 GTW GE Board")
167 .map_io = kirkwood_map_io, 167 .map_io = kirkwood_map_io,
168 .init_early = kirkwood_init_early, 168 .init_early = kirkwood_init_early,
169 .init_irq = kirkwood_init_irq, 169 .init_irq = kirkwood_init_irq,
170 .timer = &kirkwood_timer, 170 .init_time = kirkwood_timer_init,
171 .restart = kirkwood_restart, 171 .restart = kirkwood_restart,
172MACHINE_END 172MACHINE_END
diff --git a/arch/arm/mach-kirkwood/netspace_v2-setup.c b/arch/arm/mach-kirkwood/netspace_v2-setup.c
index 728e86d33f0c..3b706611da8e 100644
--- a/arch/arm/mach-kirkwood/netspace_v2-setup.c
+++ b/arch/arm/mach-kirkwood/netspace_v2-setup.c
@@ -263,7 +263,7 @@ MACHINE_START(NETSPACE_V2, "LaCie Network Space v2")
263 .map_io = kirkwood_map_io, 263 .map_io = kirkwood_map_io,
264 .init_early = kirkwood_init_early, 264 .init_early = kirkwood_init_early,
265 .init_irq = kirkwood_init_irq, 265 .init_irq = kirkwood_init_irq,
266 .timer = &kirkwood_timer, 266 .init_time = kirkwood_timer_init,
267 .restart = kirkwood_restart, 267 .restart = kirkwood_restart,
268MACHINE_END 268MACHINE_END
269#endif 269#endif
@@ -275,7 +275,7 @@ MACHINE_START(INETSPACE_V2, "LaCie Internet Space v2")
275 .map_io = kirkwood_map_io, 275 .map_io = kirkwood_map_io,
276 .init_early = kirkwood_init_early, 276 .init_early = kirkwood_init_early,
277 .init_irq = kirkwood_init_irq, 277 .init_irq = kirkwood_init_irq,
278 .timer = &kirkwood_timer, 278 .init_time = kirkwood_timer_init,
279 .restart = kirkwood_restart, 279 .restart = kirkwood_restart,
280MACHINE_END 280MACHINE_END
281#endif 281#endif
@@ -287,7 +287,7 @@ MACHINE_START(NETSPACE_MAX_V2, "LaCie Network Space Max v2")
287 .map_io = kirkwood_map_io, 287 .map_io = kirkwood_map_io,
288 .init_early = kirkwood_init_early, 288 .init_early = kirkwood_init_early,
289 .init_irq = kirkwood_init_irq, 289 .init_irq = kirkwood_init_irq,
290 .timer = &kirkwood_timer, 290 .init_time = kirkwood_timer_init,
291 .restart = kirkwood_restart, 291 .restart = kirkwood_restart,
292MACHINE_END 292MACHINE_END
293#endif 293#endif
diff --git a/arch/arm/mach-kirkwood/netxbig_v2-setup.c b/arch/arm/mach-kirkwood/netxbig_v2-setup.c
index a3b091470b8a..913d032cdb19 100644
--- a/arch/arm/mach-kirkwood/netxbig_v2-setup.c
+++ b/arch/arm/mach-kirkwood/netxbig_v2-setup.c
@@ -404,7 +404,7 @@ MACHINE_START(NET2BIG_V2, "LaCie 2Big Network v2")
404 .map_io = kirkwood_map_io, 404 .map_io = kirkwood_map_io,
405 .init_early = kirkwood_init_early, 405 .init_early = kirkwood_init_early,
406 .init_irq = kirkwood_init_irq, 406 .init_irq = kirkwood_init_irq,
407 .timer = &kirkwood_timer, 407 .init_time = kirkwood_timer_init,
408 .restart = kirkwood_restart, 408 .restart = kirkwood_restart,
409MACHINE_END 409MACHINE_END
410#endif 410#endif
@@ -416,7 +416,7 @@ MACHINE_START(NET5BIG_V2, "LaCie 5Big Network v2")
416 .map_io = kirkwood_map_io, 416 .map_io = kirkwood_map_io,
417 .init_early = kirkwood_init_early, 417 .init_early = kirkwood_init_early,
418 .init_irq = kirkwood_init_irq, 418 .init_irq = kirkwood_init_irq,
419 .timer = &kirkwood_timer, 419 .init_time = kirkwood_timer_init,
420 .restart = kirkwood_restart, 420 .restart = kirkwood_restart,
421MACHINE_END 421MACHINE_END
422#endif 422#endif
diff --git a/arch/arm/mach-kirkwood/openrd-setup.c b/arch/arm/mach-kirkwood/openrd-setup.c
index 7e81e9b586bf..8ddd69fdc937 100644
--- a/arch/arm/mach-kirkwood/openrd-setup.c
+++ b/arch/arm/mach-kirkwood/openrd-setup.c
@@ -221,7 +221,7 @@ MACHINE_START(OPENRD_BASE, "Marvell OpenRD Base Board")
221 .map_io = kirkwood_map_io, 221 .map_io = kirkwood_map_io,
222 .init_early = kirkwood_init_early, 222 .init_early = kirkwood_init_early,
223 .init_irq = kirkwood_init_irq, 223 .init_irq = kirkwood_init_irq,
224 .timer = &kirkwood_timer, 224 .init_time = kirkwood_timer_init,
225 .restart = kirkwood_restart, 225 .restart = kirkwood_restart,
226MACHINE_END 226MACHINE_END
227#endif 227#endif
@@ -234,7 +234,7 @@ MACHINE_START(OPENRD_CLIENT, "Marvell OpenRD Client Board")
234 .map_io = kirkwood_map_io, 234 .map_io = kirkwood_map_io,
235 .init_early = kirkwood_init_early, 235 .init_early = kirkwood_init_early,
236 .init_irq = kirkwood_init_irq, 236 .init_irq = kirkwood_init_irq,
237 .timer = &kirkwood_timer, 237 .init_time = kirkwood_timer_init,
238 .restart = kirkwood_restart, 238 .restart = kirkwood_restart,
239MACHINE_END 239MACHINE_END
240#endif 240#endif
@@ -247,7 +247,7 @@ MACHINE_START(OPENRD_ULTIMATE, "Marvell OpenRD Ultimate Board")
247 .map_io = kirkwood_map_io, 247 .map_io = kirkwood_map_io,
248 .init_early = kirkwood_init_early, 248 .init_early = kirkwood_init_early,
249 .init_irq = kirkwood_init_irq, 249 .init_irq = kirkwood_init_irq,
250 .timer = &kirkwood_timer, 250 .init_time = kirkwood_timer_init,
251 .restart = kirkwood_restart, 251 .restart = kirkwood_restart,
252MACHINE_END 252MACHINE_END
253#endif 253#endif
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c
index a1c3ab6fc809..d96ad4c09972 100644
--- a/arch/arm/mach-kirkwood/pcie.c
+++ b/arch/arm/mach-kirkwood/pcie.c
@@ -247,13 +247,9 @@ static struct hw_pci kirkwood_pci __initdata = {
247 247
248static void __init add_pcie_port(int index, void __iomem *base) 248static void __init add_pcie_port(int index, void __iomem *base)
249{ 249{
250 pr_info("Kirkwood PCIe port %d: ", index); 250 pcie_port_map[num_pcie_ports++] = index;
251 251 pr_info("Kirkwood PCIe port %d: link %s\n", index,
252 if (orion_pcie_link_up(base)) { 252 orion_pcie_link_up(base) ? "up" : "down");
253 pr_info("link up\n");
254 pcie_port_map[num_pcie_ports++] = index;
255 } else
256 pr_info("link down, ignoring\n");
257} 253}
258 254
259void __init kirkwood_pcie_init(unsigned int portmask) 255void __init kirkwood_pcie_init(unsigned int portmask)
diff --git a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
index 19072c84008f..e4fd3129d36f 100644
--- a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
+++ b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
@@ -84,6 +84,6 @@ MACHINE_START(RD88F6192_NAS, "Marvell RD-88F6192-NAS Development Board")
84 .map_io = kirkwood_map_io, 84 .map_io = kirkwood_map_io,
85 .init_early = kirkwood_init_early, 85 .init_early = kirkwood_init_early,
86 .init_irq = kirkwood_init_irq, 86 .init_irq = kirkwood_init_irq,
87 .timer = &kirkwood_timer, 87 .init_time = kirkwood_timer_init,
88 .restart = kirkwood_restart, 88 .restart = kirkwood_restart,
89MACHINE_END 89MACHINE_END
diff --git a/arch/arm/mach-kirkwood/rd88f6281-setup.c b/arch/arm/mach-kirkwood/rd88f6281-setup.c
index 9717101a7437..c7d93b48926b 100644
--- a/arch/arm/mach-kirkwood/rd88f6281-setup.c
+++ b/arch/arm/mach-kirkwood/rd88f6281-setup.c
@@ -120,6 +120,6 @@ MACHINE_START(RD88F6281, "Marvell RD-88F6281 Reference Board")
120 .map_io = kirkwood_map_io, 120 .map_io = kirkwood_map_io,
121 .init_early = kirkwood_init_early, 121 .init_early = kirkwood_init_early,
122 .init_irq = kirkwood_init_irq, 122 .init_irq = kirkwood_init_irq,
123 .timer = &kirkwood_timer, 123 .init_time = kirkwood_timer_init,
124 .restart = kirkwood_restart, 124 .restart = kirkwood_restart,
125MACHINE_END 125MACHINE_END
diff --git a/arch/arm/mach-kirkwood/sheevaplug-setup.c b/arch/arm/mach-kirkwood/sheevaplug-setup.c
index 8a175948b28d..55b68fa39f45 100644
--- a/arch/arm/mach-kirkwood/sheevaplug-setup.c
+++ b/arch/arm/mach-kirkwood/sheevaplug-setup.c
@@ -143,7 +143,7 @@ MACHINE_START(SHEEVAPLUG, "Marvell SheevaPlug Reference Board")
143 .map_io = kirkwood_map_io, 143 .map_io = kirkwood_map_io,
144 .init_early = kirkwood_init_early, 144 .init_early = kirkwood_init_early,
145 .init_irq = kirkwood_init_irq, 145 .init_irq = kirkwood_init_irq,
146 .timer = &kirkwood_timer, 146 .init_time = kirkwood_timer_init,
147 .restart = kirkwood_restart, 147 .restart = kirkwood_restart,
148MACHINE_END 148MACHINE_END
149#endif 149#endif
@@ -155,7 +155,7 @@ MACHINE_START(ESATA_SHEEVAPLUG, "Marvell eSATA SheevaPlug Reference Board")
155 .map_io = kirkwood_map_io, 155 .map_io = kirkwood_map_io,
156 .init_early = kirkwood_init_early, 156 .init_early = kirkwood_init_early,
157 .init_irq = kirkwood_init_irq, 157 .init_irq = kirkwood_init_irq,
158 .timer = &kirkwood_timer, 158 .init_time = kirkwood_timer_init,
159 .restart = kirkwood_restart, 159 .restart = kirkwood_restart,
160MACHINE_END 160MACHINE_END
161#endif 161#endif
diff --git a/arch/arm/mach-kirkwood/t5325-setup.c b/arch/arm/mach-kirkwood/t5325-setup.c
index f2daf711e72e..8736f8c97518 100644
--- a/arch/arm/mach-kirkwood/t5325-setup.c
+++ b/arch/arm/mach-kirkwood/t5325-setup.c
@@ -211,6 +211,6 @@ MACHINE_START(T5325, "HP t5325 Thin Client")
211 .map_io = kirkwood_map_io, 211 .map_io = kirkwood_map_io,
212 .init_early = kirkwood_init_early, 212 .init_early = kirkwood_init_early,
213 .init_irq = kirkwood_init_irq, 213 .init_irq = kirkwood_init_irq,
214 .timer = &kirkwood_timer, 214 .init_time = kirkwood_timer_init,
215 .restart = kirkwood_restart, 215 .restart = kirkwood_restart,
216MACHINE_END 216MACHINE_END
diff --git a/arch/arm/mach-kirkwood/ts219-setup.c b/arch/arm/mach-kirkwood/ts219-setup.c
index 73e2b6ca9564..283abff90228 100644
--- a/arch/arm/mach-kirkwood/ts219-setup.c
+++ b/arch/arm/mach-kirkwood/ts219-setup.c
@@ -137,6 +137,6 @@ MACHINE_START(TS219, "QNAP TS-119/TS-219")
137 .map_io = kirkwood_map_io, 137 .map_io = kirkwood_map_io,
138 .init_early = kirkwood_init_early, 138 .init_early = kirkwood_init_early,
139 .init_irq = kirkwood_init_irq, 139 .init_irq = kirkwood_init_irq,
140 .timer = &kirkwood_timer, 140 .init_time = kirkwood_timer_init,
141 .restart = kirkwood_restart, 141 .restart = kirkwood_restart,
142MACHINE_END 142MACHINE_END
diff --git a/arch/arm/mach-kirkwood/ts41x-setup.c b/arch/arm/mach-kirkwood/ts41x-setup.c
index e4c61279ea86..81d585806b2f 100644
--- a/arch/arm/mach-kirkwood/ts41x-setup.c
+++ b/arch/arm/mach-kirkwood/ts41x-setup.c
@@ -181,6 +181,6 @@ MACHINE_START(TS41X, "QNAP TS-41x")
181 .map_io = kirkwood_map_io, 181 .map_io = kirkwood_map_io,
182 .init_early = kirkwood_init_early, 182 .init_early = kirkwood_init_early,
183 .init_irq = kirkwood_init_irq, 183 .init_irq = kirkwood_init_irq,
184 .timer = &kirkwood_timer, 184 .init_time = kirkwood_timer_init,
185 .restart = kirkwood_restart, 185 .restart = kirkwood_restart,
186MACHINE_END 186MACHINE_END
diff --git a/arch/arm/mach-ks8695/board-acs5k.c b/arch/arm/mach-ks8695/board-acs5k.c
index b0c306ccbc6e..456d6386edf8 100644
--- a/arch/arm/mach-ks8695/board-acs5k.c
+++ b/arch/arm/mach-ks8695/board-acs5k.c
@@ -227,6 +227,6 @@ MACHINE_START(ACS5K, "Brivo Systems LLC ACS-5000 Master board")
227 .map_io = ks8695_map_io, 227 .map_io = ks8695_map_io,
228 .init_irq = ks8695_init_irq, 228 .init_irq = ks8695_init_irq,
229 .init_machine = acs5k_init, 229 .init_machine = acs5k_init,
230 .timer = &ks8695_timer, 230 .init_time = ks8695_timer_init,
231 .restart = ks8695_restart, 231 .restart = ks8695_restart,
232MACHINE_END 232MACHINE_END
diff --git a/arch/arm/mach-ks8695/board-dsm320.c b/arch/arm/mach-ks8695/board-dsm320.c
index e0d36cef2c56..d37c218c3584 100644
--- a/arch/arm/mach-ks8695/board-dsm320.c
+++ b/arch/arm/mach-ks8695/board-dsm320.c
@@ -125,6 +125,6 @@ MACHINE_START(DSM320, "D-Link DSM-320 Wireless Media Player")
125 .map_io = ks8695_map_io, 125 .map_io = ks8695_map_io,
126 .init_irq = ks8695_init_irq, 126 .init_irq = ks8695_init_irq,
127 .init_machine = dsm320_init, 127 .init_machine = dsm320_init,
128 .timer = &ks8695_timer, 128 .init_time = ks8695_timer_init,
129 .restart = ks8695_restart, 129 .restart = ks8695_restart,
130MACHINE_END 130MACHINE_END
diff --git a/arch/arm/mach-ks8695/board-micrel.c b/arch/arm/mach-ks8695/board-micrel.c
index a8270725b76d..3acbdfd31391 100644
--- a/arch/arm/mach-ks8695/board-micrel.c
+++ b/arch/arm/mach-ks8695/board-micrel.c
@@ -57,6 +57,6 @@ MACHINE_START(KS8695, "KS8695 Centaur Development Board")
57 .map_io = ks8695_map_io, 57 .map_io = ks8695_map_io,
58 .init_irq = ks8695_init_irq, 58 .init_irq = ks8695_init_irq,
59 .init_machine = micrel_init, 59 .init_machine = micrel_init,
60 .timer = &ks8695_timer, 60 .init_time = ks8695_timer_init,
61 .restart = ks8695_restart, 61 .restart = ks8695_restart,
62MACHINE_END 62MACHINE_END
diff --git a/arch/arm/mach-ks8695/board-og.c b/arch/arm/mach-ks8695/board-og.c
index 1623ba461e47..002bc619bb68 100644
--- a/arch/arm/mach-ks8695/board-og.c
+++ b/arch/arm/mach-ks8695/board-og.c
@@ -145,7 +145,7 @@ MACHINE_START(CM4002, "OpenGear/CM4002")
145 .map_io = ks8695_map_io, 145 .map_io = ks8695_map_io,
146 .init_irq = ks8695_init_irq, 146 .init_irq = ks8695_init_irq,
147 .init_machine = og_init, 147 .init_machine = og_init,
148 .timer = &ks8695_timer, 148 .init_time = ks8695_timer_init,
149 .restart = ks8695_restart, 149 .restart = ks8695_restart,
150MACHINE_END 150MACHINE_END
151#endif 151#endif
@@ -157,7 +157,7 @@ MACHINE_START(CM4008, "OpenGear/CM4008")
157 .map_io = ks8695_map_io, 157 .map_io = ks8695_map_io,
158 .init_irq = ks8695_init_irq, 158 .init_irq = ks8695_init_irq,
159 .init_machine = og_init, 159 .init_machine = og_init,
160 .timer = &ks8695_timer, 160 .init_time = ks8695_timer_init,
161 .restart = ks8695_restart, 161 .restart = ks8695_restart,
162MACHINE_END 162MACHINE_END
163#endif 163#endif
@@ -169,7 +169,7 @@ MACHINE_START(CM41XX, "OpenGear/CM41xx")
169 .map_io = ks8695_map_io, 169 .map_io = ks8695_map_io,
170 .init_irq = ks8695_init_irq, 170 .init_irq = ks8695_init_irq,
171 .init_machine = og_init, 171 .init_machine = og_init,
172 .timer = &ks8695_timer, 172 .init_time = ks8695_timer_init,
173 .restart = ks8695_restart, 173 .restart = ks8695_restart,
174MACHINE_END 174MACHINE_END
175#endif 175#endif
@@ -181,7 +181,7 @@ MACHINE_START(IM4004, "OpenGear/IM4004")
181 .map_io = ks8695_map_io, 181 .map_io = ks8695_map_io,
182 .init_irq = ks8695_init_irq, 182 .init_irq = ks8695_init_irq,
183 .init_machine = og_init, 183 .init_machine = og_init,
184 .timer = &ks8695_timer, 184 .init_time = ks8695_timer_init,
185 .restart = ks8695_restart, 185 .restart = ks8695_restart,
186MACHINE_END 186MACHINE_END
187#endif 187#endif
@@ -193,7 +193,7 @@ MACHINE_START(IM42XX, "OpenGear/IM42xx")
193 .map_io = ks8695_map_io, 193 .map_io = ks8695_map_io,
194 .init_irq = ks8695_init_irq, 194 .init_irq = ks8695_init_irq,
195 .init_machine = og_init, 195 .init_machine = og_init,
196 .timer = &ks8695_timer, 196 .init_time = ks8695_timer_init,
197 .restart = ks8695_restart, 197 .restart = ks8695_restart,
198MACHINE_END 198MACHINE_END
199#endif 199#endif
diff --git a/arch/arm/mach-ks8695/board-sg.c b/arch/arm/mach-ks8695/board-sg.c
index f35b98b5bf37..fdf2352d2cf8 100644
--- a/arch/arm/mach-ks8695/board-sg.c
+++ b/arch/arm/mach-ks8695/board-sg.c
@@ -91,7 +91,7 @@ MACHINE_START(LITE300, "SecureComputing/SG300")
91 .map_io = ks8695_map_io, 91 .map_io = ks8695_map_io,
92 .init_irq = ks8695_init_irq, 92 .init_irq = ks8695_init_irq,
93 .init_machine = sg_init, 93 .init_machine = sg_init,
94 .timer = &ks8695_timer, 94 .init_time = ks8695_timer_init,
95 .restart = ks8695_restart, 95 .restart = ks8695_restart,
96MACHINE_END 96MACHINE_END
97#endif 97#endif
@@ -103,7 +103,7 @@ MACHINE_START(SG310, "McAfee/SG310")
103 .map_io = ks8695_map_io, 103 .map_io = ks8695_map_io,
104 .init_irq = ks8695_init_irq, 104 .init_irq = ks8695_init_irq,
105 .init_machine = sg_init, 105 .init_machine = sg_init,
106 .timer = &ks8695_timer, 106 .init_time = ks8695_timer_init,
107 .restart = ks8695_restart, 107 .restart = ks8695_restart,
108MACHINE_END 108MACHINE_END
109#endif 109#endif
@@ -115,7 +115,7 @@ MACHINE_START(SE4200, "SecureComputing/SE4200")
115 .map_io = ks8695_map_io, 115 .map_io = ks8695_map_io,
116 .init_irq = ks8695_init_irq, 116 .init_irq = ks8695_init_irq,
117 .init_machine = sg_init, 117 .init_machine = sg_init,
118 .timer = &ks8695_timer, 118 .init_time = ks8695_timer_init,
119 .restart = ks8695_restart, 119 .restart = ks8695_restart,
120MACHINE_END 120MACHINE_END
121#endif 121#endif
diff --git a/arch/arm/mach-ks8695/generic.h b/arch/arm/mach-ks8695/generic.h
index f8bdb11a9c33..6e97ce462d73 100644
--- a/arch/arm/mach-ks8695/generic.h
+++ b/arch/arm/mach-ks8695/generic.h
@@ -13,4 +13,4 @@
13extern __init void ks8695_map_io(void); 13extern __init void ks8695_map_io(void);
14extern __init void ks8695_init_irq(void); 14extern __init void ks8695_init_irq(void);
15extern void ks8695_restart(char, const char *); 15extern void ks8695_restart(char, const char *);
16extern struct sys_timer ks8695_timer; 16extern void ks8695_timer_init(void);
diff --git a/arch/arm/mach-ks8695/include/mach/uncompress.h b/arch/arm/mach-ks8695/include/mach/uncompress.h
index 8879d610308a..c089a1aea674 100644
--- a/arch/arm/mach-ks8695/include/mach/uncompress.h
+++ b/arch/arm/mach-ks8695/include/mach/uncompress.h
@@ -32,6 +32,5 @@ static inline void flush(void)
32} 32}
33 33
34#define arch_decomp_setup() 34#define arch_decomp_setup()
35#define arch_decomp_wdog()
36 35
37#endif 36#endif
diff --git a/arch/arm/mach-ks8695/time.c b/arch/arm/mach-ks8695/time.c
index 46c84bc7792c..c272a3863d5f 100644
--- a/arch/arm/mach-ks8695/time.c
+++ b/arch/arm/mach-ks8695/time.c
@@ -146,7 +146,7 @@ static void ks8695_timer_setup(void)
146 0xFFFFFFFFU); 146 0xFFFFFFFFU);
147} 147}
148 148
149static void __init ks8695_timer_init (void) 149void __init ks8695_timer_init(void)
150{ 150{
151 ks8695_timer_setup(); 151 ks8695_timer_setup();
152 152
@@ -154,10 +154,6 @@ static void __init ks8695_timer_init (void)
154 setup_irq(KS8695_IRQ_TIMER1, &ks8695_timer_irq); 154 setup_irq(KS8695_IRQ_TIMER1, &ks8695_timer_irq);
155} 155}
156 156
157struct sys_timer ks8695_timer = {
158 .init = ks8695_timer_init,
159};
160
161void ks8695_restart(char mode, const char *cmd) 157void ks8695_restart(char mode, const char *cmd)
162{ 158{
163 unsigned int reg; 159 unsigned int reg;
diff --git a/arch/arm/mach-lpc32xx/common.h b/arch/arm/mach-lpc32xx/common.h
index afeac3b1fae6..e0b26062a272 100644
--- a/arch/arm/mach-lpc32xx/common.h
+++ b/arch/arm/mach-lpc32xx/common.h
@@ -25,7 +25,7 @@
25/* 25/*
26 * Other arch specific structures and functions 26 * Other arch specific structures and functions
27 */ 27 */
28extern struct sys_timer lpc32xx_timer; 28extern void lpc32xx_timer_init(void);
29extern void __init lpc32xx_init_irq(void); 29extern void __init lpc32xx_init_irq(void);
30extern void __init lpc32xx_map_io(void); 30extern void __init lpc32xx_map_io(void);
31extern void __init lpc32xx_serial_init(void); 31extern void __init lpc32xx_serial_init(void);
diff --git a/arch/arm/mach-lpc32xx/include/mach/uncompress.h b/arch/arm/mach-lpc32xx/include/mach/uncompress.h
index c142487d299a..1198a89183cd 100644
--- a/arch/arm/mach-lpc32xx/include/mach/uncompress.h
+++ b/arch/arm/mach-lpc32xx/include/mach/uncompress.h
@@ -55,6 +55,5 @@ static inline void flush(void)
55 55
56/* NULL functions; we don't presently need them */ 56/* NULL functions; we don't presently need them */
57#define arch_decomp_setup() 57#define arch_decomp_setup()
58#define arch_decomp_wdog()
59 58
60#endif 59#endif
diff --git a/arch/arm/mach-lpc32xx/phy3250.c b/arch/arm/mach-lpc32xx/phy3250.c
index e8ff4c3f0566..c1cd5a943ab1 100644
--- a/arch/arm/mach-lpc32xx/phy3250.c
+++ b/arch/arm/mach-lpc32xx/phy3250.c
@@ -263,7 +263,7 @@ DT_MACHINE_START(LPC32XX_DT, "LPC32XX SoC (Flattened Device Tree)")
263 .atag_offset = 0x100, 263 .atag_offset = 0x100,
264 .map_io = lpc32xx_map_io, 264 .map_io = lpc32xx_map_io,
265 .init_irq = lpc32xx_init_irq, 265 .init_irq = lpc32xx_init_irq,
266 .timer = &lpc32xx_timer, 266 .init_time = lpc32xx_timer_init,
267 .init_machine = lpc3250_machine_init, 267 .init_machine = lpc3250_machine_init,
268 .dt_compat = lpc32xx_dt_compat, 268 .dt_compat = lpc32xx_dt_compat,
269 .restart = lpc23xx_restart, 269 .restart = lpc23xx_restart,
diff --git a/arch/arm/mach-lpc32xx/timer.c b/arch/arm/mach-lpc32xx/timer.c
index c40667c33161..20eab63d10ba 100644
--- a/arch/arm/mach-lpc32xx/timer.c
+++ b/arch/arm/mach-lpc32xx/timer.c
@@ -70,7 +70,6 @@ static void lpc32xx_clkevt_mode(enum clock_event_mode mode,
70static struct clock_event_device lpc32xx_clkevt = { 70static struct clock_event_device lpc32xx_clkevt = {
71 .name = "lpc32xx_clkevt", 71 .name = "lpc32xx_clkevt",
72 .features = CLOCK_EVT_FEAT_ONESHOT, 72 .features = CLOCK_EVT_FEAT_ONESHOT,
73 .shift = 32,
74 .rating = 300, 73 .rating = 300,
75 .set_next_event = lpc32xx_clkevt_next_event, 74 .set_next_event = lpc32xx_clkevt_next_event,
76 .set_mode = lpc32xx_clkevt_mode, 75 .set_mode = lpc32xx_clkevt_mode,
@@ -100,7 +99,7 @@ static struct irqaction lpc32xx_timer_irq = {
100 * clocks need to be enabled here manually and then tagged as used in 99 * clocks need to be enabled here manually and then tagged as used in
101 * the clock driver initialization 100 * the clock driver initialization
102 */ 101 */
103static void __init lpc32xx_timer_init(void) 102void __init lpc32xx_timer_init(void)
104{ 103{
105 u32 clkrate, pllreg; 104 u32 clkrate, pllreg;
106 105
@@ -141,14 +140,8 @@ static void __init lpc32xx_timer_init(void)
141 setup_irq(IRQ_LPC32XX_TIMER0, &lpc32xx_timer_irq); 140 setup_irq(IRQ_LPC32XX_TIMER0, &lpc32xx_timer_irq);
142 141
143 /* Setup the clockevent structure. */ 142 /* Setup the clockevent structure. */
144 lpc32xx_clkevt.mult = div_sc(clkrate, NSEC_PER_SEC,
145 lpc32xx_clkevt.shift);
146 lpc32xx_clkevt.max_delta_ns = clockevent_delta2ns(-1,
147 &lpc32xx_clkevt);
148 lpc32xx_clkevt.min_delta_ns = clockevent_delta2ns(1,
149 &lpc32xx_clkevt) + 1;
150 lpc32xx_clkevt.cpumask = cpumask_of(0); 143 lpc32xx_clkevt.cpumask = cpumask_of(0);
151 clockevents_register_device(&lpc32xx_clkevt); 144 clockevents_config_and_register(&lpc32xx_clkevt, clkrate, 1, -1);
152 145
153 /* Use timer1 as clock source. */ 146 /* Use timer1 as clock source. */
154 __raw_writel(LPC32XX_TIMER_CNTR_TCR_RESET, 147 __raw_writel(LPC32XX_TIMER_CNTR_TCR_RESET,
@@ -161,8 +154,3 @@ static void __init lpc32xx_timer_init(void)
161 clocksource_mmio_init(LPC32XX_TIMER_TC(LPC32XX_TIMER1_BASE), 154 clocksource_mmio_init(LPC32XX_TIMER_TC(LPC32XX_TIMER1_BASE),
162 "lpc32xx_clksrc", clkrate, 300, 32, clocksource_mmio_readl_up); 155 "lpc32xx_clksrc", clkrate, 300, 32, clocksource_mmio_readl_up);
163} 156}
164
165struct sys_timer lpc32xx_timer = {
166 .init = &lpc32xx_timer_init,
167};
168
diff --git a/arch/arm/mach-mmp/aspenite.c b/arch/arm/mach-mmp/aspenite.c
index e5dba9c5dc54..9f64d5632e07 100644
--- a/arch/arm/mach-mmp/aspenite.c
+++ b/arch/arm/mach-mmp/aspenite.c
@@ -262,7 +262,7 @@ MACHINE_START(ASPENITE, "PXA168-based Aspenite Development Platform")
262 .map_io = mmp_map_io, 262 .map_io = mmp_map_io,
263 .nr_irqs = MMP_NR_IRQS, 263 .nr_irqs = MMP_NR_IRQS,
264 .init_irq = pxa168_init_irq, 264 .init_irq = pxa168_init_irq,
265 .timer = &pxa168_timer, 265 .init_time = pxa168_timer_init,
266 .init_machine = common_init, 266 .init_machine = common_init,
267 .restart = pxa168_restart, 267 .restart = pxa168_restart,
268MACHINE_END 268MACHINE_END
@@ -271,7 +271,7 @@ MACHINE_START(ZYLONITE2, "PXA168-based Zylonite2 Development Platform")
271 .map_io = mmp_map_io, 271 .map_io = mmp_map_io,
272 .nr_irqs = MMP_NR_IRQS, 272 .nr_irqs = MMP_NR_IRQS,
273 .init_irq = pxa168_init_irq, 273 .init_irq = pxa168_init_irq,
274 .timer = &pxa168_timer, 274 .init_time = pxa168_timer_init,
275 .init_machine = common_init, 275 .init_machine = common_init,
276 .restart = pxa168_restart, 276 .restart = pxa168_restart,
277MACHINE_END 277MACHINE_END
diff --git a/arch/arm/mach-mmp/avengers_lite.c b/arch/arm/mach-mmp/avengers_lite.c
index 603542ae6fbd..1f94957b56ae 100644
--- a/arch/arm/mach-mmp/avengers_lite.c
+++ b/arch/arm/mach-mmp/avengers_lite.c
@@ -45,7 +45,7 @@ MACHINE_START(AVENGERS_LITE, "PXA168 Avengers lite Development Platform")
45 .map_io = mmp_map_io, 45 .map_io = mmp_map_io,
46 .nr_irqs = MMP_NR_IRQS, 46 .nr_irqs = MMP_NR_IRQS,
47 .init_irq = pxa168_init_irq, 47 .init_irq = pxa168_init_irq,
48 .timer = &pxa168_timer, 48 .init_time = pxa168_timer_init,
49 .init_machine = avengers_lite_init, 49 .init_machine = avengers_lite_init,
50 .restart = pxa168_restart, 50 .restart = pxa168_restart,
51MACHINE_END 51MACHINE_END
diff --git a/arch/arm/mach-mmp/brownstone.c b/arch/arm/mach-mmp/brownstone.c
index 5cb769cd26d9..2358011c7d8e 100644
--- a/arch/arm/mach-mmp/brownstone.c
+++ b/arch/arm/mach-mmp/brownstone.c
@@ -218,7 +218,7 @@ MACHINE_START(BROWNSTONE, "Brownstone Development Platform")
218 .map_io = mmp_map_io, 218 .map_io = mmp_map_io,
219 .nr_irqs = BROWNSTONE_NR_IRQS, 219 .nr_irqs = BROWNSTONE_NR_IRQS,
220 .init_irq = mmp2_init_irq, 220 .init_irq = mmp2_init_irq,
221 .timer = &mmp2_timer, 221 .init_time = mmp2_timer_init,
222 .init_machine = brownstone_init, 222 .init_machine = brownstone_init,
223 .restart = mmp_restart, 223 .restart = mmp_restart,
224MACHINE_END 224MACHINE_END
diff --git a/arch/arm/mach-mmp/common.h b/arch/arm/mach-mmp/common.h
index bd453274fca2..0bdc50b134ce 100644
--- a/arch/arm/mach-mmp/common.h
+++ b/arch/arm/mach-mmp/common.h
@@ -1,7 +1,5 @@
1#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) 1#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
2 2
3struct sys_timer;
4
5extern void timer_init(int irq); 3extern void timer_init(int irq);
6 4
7extern void __init icu_init_irq(void); 5extern void __init icu_init_irq(void);
diff --git a/arch/arm/mach-mmp/flint.c b/arch/arm/mach-mmp/flint.c
index 8059cc0905c6..754c352dd02b 100644
--- a/arch/arm/mach-mmp/flint.c
+++ b/arch/arm/mach-mmp/flint.c
@@ -121,7 +121,7 @@ MACHINE_START(FLINT, "Flint Development Platform")
121 .map_io = mmp_map_io, 121 .map_io = mmp_map_io,
122 .nr_irqs = FLINT_NR_IRQS, 122 .nr_irqs = FLINT_NR_IRQS,
123 .init_irq = mmp2_init_irq, 123 .init_irq = mmp2_init_irq,
124 .timer = &mmp2_timer, 124 .init_time = mmp2_timer_init,
125 .init_machine = flint_init, 125 .init_machine = flint_init,
126 .restart = mmp_restart, 126 .restart = mmp_restart,
127MACHINE_END 127MACHINE_END
diff --git a/arch/arm/mach-mmp/gplugd.c b/arch/arm/mach-mmp/gplugd.c
index 5c3d61ee729a..d1e2d595e79c 100644
--- a/arch/arm/mach-mmp/gplugd.c
+++ b/arch/arm/mach-mmp/gplugd.c
@@ -194,7 +194,7 @@ MACHINE_START(GPLUGD, "PXA168-based GuruPlug Display (gplugD) Platform")
194 .map_io = mmp_map_io, 194 .map_io = mmp_map_io,
195 .nr_irqs = MMP_NR_IRQS, 195 .nr_irqs = MMP_NR_IRQS,
196 .init_irq = pxa168_init_irq, 196 .init_irq = pxa168_init_irq,
197 .timer = &pxa168_timer, 197 .init_time = pxa168_timer_init,
198 .init_machine = gplugd_init, 198 .init_machine = gplugd_init,
199 .restart = pxa168_restart, 199 .restart = pxa168_restart,
200MACHINE_END 200MACHINE_END
diff --git a/arch/arm/mach-mmp/include/mach/mmp2.h b/arch/arm/mach-mmp/include/mach/mmp2.h
index c4ca4d17194a..0764f4ecec82 100644
--- a/arch/arm/mach-mmp/include/mach/mmp2.h
+++ b/arch/arm/mach-mmp/include/mach/mmp2.h
@@ -3,9 +3,7 @@
3 3
4#include <linux/platform_data/pxa_sdhci.h> 4#include <linux/platform_data/pxa_sdhci.h>
5 5
6struct sys_timer; 6extern void mmp2_timer_init(void);
7
8extern struct sys_timer mmp2_timer;
9extern void __init mmp2_init_icu(void); 7extern void __init mmp2_init_icu(void);
10extern void __init mmp2_init_irq(void); 8extern void __init mmp2_init_irq(void);
11extern void mmp2_clear_pmic_int(void); 9extern void mmp2_clear_pmic_int(void);
diff --git a/arch/arm/mach-mmp/include/mach/pxa168.h b/arch/arm/mach-mmp/include/mach/pxa168.h
index 37632d964d50..7ed1df21ea1c 100644
--- a/arch/arm/mach-mmp/include/mach/pxa168.h
+++ b/arch/arm/mach-mmp/include/mach/pxa168.h
@@ -1,9 +1,7 @@
1#ifndef __ASM_MACH_PXA168_H 1#ifndef __ASM_MACH_PXA168_H
2#define __ASM_MACH_PXA168_H 2#define __ASM_MACH_PXA168_H
3 3
4struct sys_timer; 4extern void pxa168_timer_init(void);
5
6extern struct sys_timer pxa168_timer;
7extern void __init pxa168_init_irq(void); 5extern void __init pxa168_init_irq(void);
8extern void pxa168_restart(char, const char *); 6extern void pxa168_restart(char, const char *);
9extern void pxa168_clear_keypad_wakeup(void); 7extern void pxa168_clear_keypad_wakeup(void);
diff --git a/arch/arm/mach-mmp/include/mach/pxa910.h b/arch/arm/mach-mmp/include/mach/pxa910.h
index 3b58a3b2d7df..b914afa1fcdc 100644
--- a/arch/arm/mach-mmp/include/mach/pxa910.h
+++ b/arch/arm/mach-mmp/include/mach/pxa910.h
@@ -1,15 +1,14 @@
1#ifndef __ASM_MACH_PXA910_H 1#ifndef __ASM_MACH_PXA910_H
2#define __ASM_MACH_PXA910_H 2#define __ASM_MACH_PXA910_H
3 3
4struct sys_timer; 4extern void pxa910_timer_init(void);
5
6extern struct sys_timer pxa910_timer;
7extern void __init pxa910_init_irq(void); 5extern void __init pxa910_init_irq(void);
8 6
9#include <linux/i2c.h> 7#include <linux/i2c.h>
10#include <linux/i2c/pxa-i2c.h> 8#include <linux/i2c/pxa-i2c.h>
11#include <mach/devices.h> 9#include <mach/devices.h>
12#include <linux/platform_data/mtd-nand-pxa3xx.h> 10#include <linux/platform_data/mtd-nand-pxa3xx.h>
11#include <video/mmp_disp.h>
13 12
14extern struct pxa_device_desc pxa910_device_uart1; 13extern struct pxa_device_desc pxa910_device_uart1;
15extern struct pxa_device_desc pxa910_device_uart2; 14extern struct pxa_device_desc pxa910_device_uart2;
@@ -23,7 +22,9 @@ extern struct pxa_device_desc pxa910_device_nand;
23extern struct platform_device pxa168_device_u2o; 22extern struct platform_device pxa168_device_u2o;
24extern struct platform_device pxa168_device_u2ootg; 23extern struct platform_device pxa168_device_u2ootg;
25extern struct platform_device pxa168_device_u2oehci; 24extern struct platform_device pxa168_device_u2oehci;
26 25extern struct pxa_device_desc pxa910_device_disp;
26extern struct pxa_device_desc pxa910_device_fb;
27extern struct pxa_device_desc pxa910_device_panel;
27extern struct platform_device pxa910_device_gpio; 28extern struct platform_device pxa910_device_gpio;
28extern struct platform_device pxa910_device_rtc; 29extern struct platform_device pxa910_device_rtc;
29 30
diff --git a/arch/arm/mach-mmp/include/mach/uncompress.h b/arch/arm/mach-mmp/include/mach/uncompress.h
index d6daeb7e4ef1..8890fa8fa771 100644
--- a/arch/arm/mach-mmp/include/mach/uncompress.h
+++ b/arch/arm/mach-mmp/include/mach/uncompress.h
@@ -43,9 +43,3 @@ static inline void arch_decomp_setup(void)
43 if (machine_is_avengers_lite()) 43 if (machine_is_avengers_lite())
44 UART = (unsigned long *)UART3_BASE; 44 UART = (unsigned long *)UART3_BASE;
45} 45}
46
47/*
48 * nothing to do
49 */
50
51#define arch_decomp_wdog()
diff --git a/arch/arm/mach-mmp/jasper.c b/arch/arm/mach-mmp/jasper.c
index ff73249884d0..66634fd0ecb0 100644
--- a/arch/arm/mach-mmp/jasper.c
+++ b/arch/arm/mach-mmp/jasper.c
@@ -174,7 +174,7 @@ MACHINE_START(MARVELL_JASPER, "Jasper Development Platform")
174 .map_io = mmp_map_io, 174 .map_io = mmp_map_io,
175 .nr_irqs = JASPER_NR_IRQS, 175 .nr_irqs = JASPER_NR_IRQS,
176 .init_irq = mmp2_init_irq, 176 .init_irq = mmp2_init_irq,
177 .timer = &mmp2_timer, 177 .init_time = mmp2_timer_init,
178 .init_machine = jasper_init, 178 .init_machine = jasper_init,
179 .restart = mmp_restart, 179 .restart = mmp_restart,
180MACHINE_END 180MACHINE_END
diff --git a/arch/arm/mach-mmp/mmp-dt.c b/arch/arm/mach-mmp/mmp-dt.c
index 033cc31b3c72..d063efa0a4f1 100644
--- a/arch/arm/mach-mmp/mmp-dt.c
+++ b/arch/arm/mach-mmp/mmp-dt.c
@@ -22,10 +22,6 @@
22extern void __init mmp_dt_irq_init(void); 22extern void __init mmp_dt_irq_init(void);
23extern void __init mmp_dt_init_timer(void); 23extern void __init mmp_dt_init_timer(void);
24 24
25static struct sys_timer mmp_dt_timer = {
26 .init = mmp_dt_init_timer,
27};
28
29static const struct of_dev_auxdata pxa168_auxdata_lookup[] __initconst = { 25static const struct of_dev_auxdata pxa168_auxdata_lookup[] __initconst = {
30 OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.0", NULL), 26 OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.0", NULL),
31 OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4018000, "pxa2xx-uart.1", NULL), 27 OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4018000, "pxa2xx-uart.1", NULL),
@@ -69,7 +65,7 @@ static const char *mmp_dt_board_compat[] __initdata = {
69DT_MACHINE_START(PXA168_DT, "Marvell PXA168 (Device Tree Support)") 65DT_MACHINE_START(PXA168_DT, "Marvell PXA168 (Device Tree Support)")
70 .map_io = mmp_map_io, 66 .map_io = mmp_map_io,
71 .init_irq = mmp_dt_irq_init, 67 .init_irq = mmp_dt_irq_init,
72 .timer = &mmp_dt_timer, 68 .init_time = mmp_dt_init_timer,
73 .init_machine = pxa168_dt_init, 69 .init_machine = pxa168_dt_init,
74 .dt_compat = mmp_dt_board_compat, 70 .dt_compat = mmp_dt_board_compat,
75MACHINE_END 71MACHINE_END
@@ -77,7 +73,7 @@ MACHINE_END
77DT_MACHINE_START(PXA910_DT, "Marvell PXA910 (Device Tree Support)") 73DT_MACHINE_START(PXA910_DT, "Marvell PXA910 (Device Tree Support)")
78 .map_io = mmp_map_io, 74 .map_io = mmp_map_io,
79 .init_irq = mmp_dt_irq_init, 75 .init_irq = mmp_dt_irq_init,
80 .timer = &mmp_dt_timer, 76 .init_time = mmp_dt_init_timer,
81 .init_machine = pxa910_dt_init, 77 .init_machine = pxa910_dt_init,
82 .dt_compat = mmp_dt_board_compat, 78 .dt_compat = mmp_dt_board_compat,
83MACHINE_END 79MACHINE_END
diff --git a/arch/arm/mach-mmp/mmp2-dt.c b/arch/arm/mach-mmp/mmp2-dt.c
index 535a5ed5977b..fad431aa6e09 100644
--- a/arch/arm/mach-mmp/mmp2-dt.c
+++ b/arch/arm/mach-mmp/mmp2-dt.c
@@ -24,10 +24,6 @@
24extern void __init mmp_dt_irq_init(void); 24extern void __init mmp_dt_irq_init(void);
25extern void __init mmp_dt_init_timer(void); 25extern void __init mmp_dt_init_timer(void);
26 26
27static struct sys_timer mmp_dt_timer = {
28 .init = mmp_dt_init_timer,
29};
30
31static const struct of_dev_auxdata mmp2_auxdata_lookup[] __initconst = { 27static const struct of_dev_auxdata mmp2_auxdata_lookup[] __initconst = {
32 OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4030000, "pxa2xx-uart.0", NULL), 28 OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4030000, "pxa2xx-uart.0", NULL),
33 OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.1", NULL), 29 OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.1", NULL),
@@ -54,7 +50,7 @@ static const char *mmp2_dt_board_compat[] __initdata = {
54DT_MACHINE_START(MMP2_DT, "Marvell MMP2 (Device Tree Support)") 50DT_MACHINE_START(MMP2_DT, "Marvell MMP2 (Device Tree Support)")
55 .map_io = mmp_map_io, 51 .map_io = mmp_map_io,
56 .init_irq = mmp_dt_irq_init, 52 .init_irq = mmp_dt_irq_init,
57 .timer = &mmp_dt_timer, 53 .init_time = mmp_dt_init_timer,
58 .init_machine = mmp2_dt_init, 54 .init_machine = mmp2_dt_init,
59 .dt_compat = mmp2_dt_board_compat, 55 .dt_compat = mmp2_dt_board_compat,
60MACHINE_END 56MACHINE_END
diff --git a/arch/arm/mach-mmp/mmp2.c b/arch/arm/mach-mmp/mmp2.c
index 3a3768c7a191..d94d114eef7b 100644
--- a/arch/arm/mach-mmp/mmp2.c
+++ b/arch/arm/mach-mmp/mmp2.c
@@ -114,7 +114,7 @@ postcore_initcall(mmp2_init);
114 114
115#define APBC_TIMERS APBC_REG(0x024) 115#define APBC_TIMERS APBC_REG(0x024)
116 116
117static void __init mmp2_timer_init(void) 117void __init mmp2_timer_init(void)
118{ 118{
119 unsigned long clk_rst; 119 unsigned long clk_rst;
120 120
@@ -130,10 +130,6 @@ static void __init mmp2_timer_init(void)
130 timer_init(IRQ_MMP2_TIMER1); 130 timer_init(IRQ_MMP2_TIMER1);
131} 131}
132 132
133struct sys_timer mmp2_timer = {
134 .init = mmp2_timer_init,
135};
136
137/* on-chip devices */ 133/* on-chip devices */
138MMP2_DEVICE(uart1, "pxa2xx-uart", 0, UART1, 0xd4030000, 0x30, 4, 5); 134MMP2_DEVICE(uart1, "pxa2xx-uart", 0, UART1, 0xd4030000, 0x30, 4, 5);
139MMP2_DEVICE(uart2, "pxa2xx-uart", 1, UART2, 0xd4017000, 0x30, 20, 21); 135MMP2_DEVICE(uart2, "pxa2xx-uart", 1, UART2, 0xd4017000, 0x30, 20, 21);
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c
index b7f074f15498..9bc7b86a86a7 100644
--- a/arch/arm/mach-mmp/pxa168.c
+++ b/arch/arm/mach-mmp/pxa168.c
@@ -67,7 +67,7 @@ postcore_initcall(pxa168_init);
67#define TIMER_CLK_RST (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(3)) 67#define TIMER_CLK_RST (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(3))
68#define APBC_TIMERS APBC_REG(0x34) 68#define APBC_TIMERS APBC_REG(0x34)
69 69
70static void __init pxa168_timer_init(void) 70void __init pxa168_timer_init(void)
71{ 71{
72 /* this is early, we have to initialize the CCU registers by 72 /* this is early, we have to initialize the CCU registers by
73 * ourselves instead of using clk_* API. Clock rate is defined 73 * ourselves instead of using clk_* API. Clock rate is defined
@@ -81,10 +81,6 @@ static void __init pxa168_timer_init(void)
81 timer_init(IRQ_PXA168_TIMER1); 81 timer_init(IRQ_PXA168_TIMER1);
82} 82}
83 83
84struct sys_timer pxa168_timer = {
85 .init = pxa168_timer_init,
86};
87
88void pxa168_clear_keypad_wakeup(void) 84void pxa168_clear_keypad_wakeup(void)
89{ 85{
90 uint32_t val; 86 uint32_t val;
diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c
index 8b1e16fbb7a5..36cb321a3d70 100644
--- a/arch/arm/mach-mmp/pxa910.c
+++ b/arch/arm/mach-mmp/pxa910.c
@@ -101,7 +101,7 @@ postcore_initcall(pxa910_init);
101#define TIMER_CLK_RST (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(3)) 101#define TIMER_CLK_RST (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(3))
102#define APBC_TIMERS APBC_REG(0x34) 102#define APBC_TIMERS APBC_REG(0x34)
103 103
104static void __init pxa910_timer_init(void) 104void __init pxa910_timer_init(void)
105{ 105{
106 /* reset and configure */ 106 /* reset and configure */
107 __raw_writel(APBC_APBCLK | APBC_RST, APBC_TIMERS); 107 __raw_writel(APBC_APBCLK | APBC_RST, APBC_TIMERS);
@@ -110,10 +110,6 @@ static void __init pxa910_timer_init(void)
110 timer_init(IRQ_PXA910_AP1_TIMER1); 110 timer_init(IRQ_PXA910_AP1_TIMER1);
111} 111}
112 112
113struct sys_timer pxa910_timer = {
114 .init = pxa910_timer_init,
115};
116
117/* on-chip devices */ 113/* on-chip devices */
118 114
119/* NOTE: there are totally 3 UARTs on PXA910: 115/* NOTE: there are totally 3 UARTs on PXA910:
@@ -138,6 +134,9 @@ PXA910_DEVICE(pwm2, "pxa910-pwm", 1, NONE, 0xd401a400, 0x10);
138PXA910_DEVICE(pwm3, "pxa910-pwm", 2, NONE, 0xd401a800, 0x10); 134PXA910_DEVICE(pwm3, "pxa910-pwm", 2, NONE, 0xd401a800, 0x10);
139PXA910_DEVICE(pwm4, "pxa910-pwm", 3, NONE, 0xd401ac00, 0x10); 135PXA910_DEVICE(pwm4, "pxa910-pwm", 3, NONE, 0xd401ac00, 0x10);
140PXA910_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x80, 97, 99); 136PXA910_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x80, 97, 99);
137PXA910_DEVICE(disp, "mmp-disp", 0, LCD, 0xd420b000, 0x1ec);
138PXA910_DEVICE(fb, "mmp-fb", -1, NONE, 0, 0);
139PXA910_DEVICE(panel, "tpo-hvga", -1, NONE, 0, 0);
141 140
142struct resource pxa910_resource_gpio[] = { 141struct resource pxa910_resource_gpio[] = {
143 { 142 {
diff --git a/arch/arm/mach-mmp/tavorevb.c b/arch/arm/mach-mmp/tavorevb.c
index b28f9084dfff..4c127d23955d 100644
--- a/arch/arm/mach-mmp/tavorevb.c
+++ b/arch/arm/mach-mmp/tavorevb.c
@@ -103,7 +103,7 @@ MACHINE_START(TAVOREVB, "PXA910 Evaluation Board (aka TavorEVB)")
103 .map_io = mmp_map_io, 103 .map_io = mmp_map_io,
104 .nr_irqs = MMP_NR_IRQS, 104 .nr_irqs = MMP_NR_IRQS,
105 .init_irq = pxa910_init_irq, 105 .init_irq = pxa910_init_irq,
106 .timer = &pxa910_timer, 106 .init_time = pxa910_timer_init,
107 .init_machine = tavorevb_init, 107 .init_machine = tavorevb_init,
108 .restart = mmp_restart, 108 .restart = mmp_restart,
109MACHINE_END 109MACHINE_END
diff --git a/arch/arm/mach-mmp/teton_bga.c b/arch/arm/mach-mmp/teton_bga.c
index dd30ea74785c..8609967975ed 100644
--- a/arch/arm/mach-mmp/teton_bga.c
+++ b/arch/arm/mach-mmp/teton_bga.c
@@ -86,7 +86,7 @@ MACHINE_START(TETON_BGA, "PXA168-based Teton BGA Development Platform")
86 .map_io = mmp_map_io, 86 .map_io = mmp_map_io,
87 .nr_irqs = MMP_NR_IRQS, 87 .nr_irqs = MMP_NR_IRQS,
88 .init_irq = pxa168_init_irq, 88 .init_irq = pxa168_init_irq,
89 .timer = &pxa168_timer, 89 .init_time = pxa168_timer_init,
90 .init_machine = teton_bga_init, 90 .init_machine = teton_bga_init,
91 .restart = pxa168_restart, 91 .restart = pxa168_restart,
92MACHINE_END 92MACHINE_END
diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c
index 936447c70977..86a18b3d252e 100644
--- a/arch/arm/mach-mmp/time.c
+++ b/arch/arm/mach-mmp/time.c
@@ -141,7 +141,6 @@ static void timer_set_mode(enum clock_event_mode mode,
141static struct clock_event_device ckevt = { 141static struct clock_event_device ckevt = {
142 .name = "clockevent", 142 .name = "clockevent",
143 .features = CLOCK_EVT_FEAT_ONESHOT, 143 .features = CLOCK_EVT_FEAT_ONESHOT,
144 .shift = 32,
145 .rating = 200, 144 .rating = 200,
146 .set_next_event = timer_set_next_event, 145 .set_next_event = timer_set_next_event,
147 .set_mode = timer_set_mode, 146 .set_mode = timer_set_mode,
@@ -198,15 +197,13 @@ void __init timer_init(int irq)
198 197
199 setup_sched_clock(mmp_read_sched_clock, 32, CLOCK_TICK_RATE); 198 setup_sched_clock(mmp_read_sched_clock, 32, CLOCK_TICK_RATE);
200 199
201 ckevt.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, ckevt.shift);
202 ckevt.max_delta_ns = clockevent_delta2ns(MAX_DELTA, &ckevt);
203 ckevt.min_delta_ns = clockevent_delta2ns(MIN_DELTA, &ckevt);
204 ckevt.cpumask = cpumask_of(0); 200 ckevt.cpumask = cpumask_of(0);
205 201
206 setup_irq(irq, &timer_irq); 202 setup_irq(irq, &timer_irq);
207 203
208 clocksource_register_hz(&cksrc, CLOCK_TICK_RATE); 204 clocksource_register_hz(&cksrc, CLOCK_TICK_RATE);
209 clockevents_register_device(&ckevt); 205 clockevents_config_and_register(&ckevt, CLOCK_TICK_RATE,
206 MIN_DELTA, MAX_DELTA);
210} 207}
211 208
212#ifdef CONFIG_OF 209#ifdef CONFIG_OF
diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c
index ce55fd8821c4..22a9058f9f4d 100644
--- a/arch/arm/mach-mmp/ttc_dkb.c
+++ b/arch/arm/mach-mmp/ttc_dkb.c
@@ -19,6 +19,8 @@
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/mfd/88pm860x.h> 20#include <linux/mfd/88pm860x.h>
21#include <linux/platform_data/mv_usb.h> 21#include <linux/platform_data/mv_usb.h>
22#include <linux/spi/spi.h>
23#include <linux/delay.h>
22 24
23#include <asm/mach-types.h> 25#include <asm/mach-types.h>
24#include <asm/mach/arch.h> 26#include <asm/mach/arch.h>
@@ -184,6 +186,92 @@ static struct pxa3xx_nand_platform_data dkb_nand_info = {
184}; 186};
185#endif 187#endif
186 188
189#ifdef CONFIG_MMP_DISP
190/* path config */
191#define CFG_IOPADMODE(iopad) (iopad) /* 0x0 ~ 0xd */
192#define SCLK_SOURCE_SELECT(x) (x << 30) /* 0x0 ~ 0x3 */
193/* link config */
194#define CFG_DUMBMODE(mode) (mode << 28) /* 0x0 ~ 0x6*/
195#define CFG_GRA_SWAPRB(x) (x << 0) /* 1: rbswap enabled */
196static struct mmp_mach_path_config dkb_disp_config[] = {
197 [0] = {
198 .name = "mmp-parallel",
199 .overlay_num = 2,
200 .output_type = PATH_OUT_PARALLEL,
201 .path_config = CFG_IOPADMODE(0x1)
202 | SCLK_SOURCE_SELECT(0x1),
203 .link_config = CFG_DUMBMODE(0x2)
204 | CFG_GRA_SWAPRB(0x1),
205 },
206};
207
208static struct mmp_mach_plat_info dkb_disp_info = {
209 .name = "mmp-disp",
210 .clk_name = "disp0",
211 .path_num = 1,
212 .paths = dkb_disp_config,
213};
214
215static struct mmp_buffer_driver_mach_info dkb_fb_info = {
216 .name = "mmp-fb",
217 .path_name = "mmp-parallel",
218 .overlay_id = 0,
219 .dmafetch_id = 1,
220 .default_pixfmt = PIXFMT_RGB565,
221};
222
223static void dkb_tpo_panel_power(int on)
224{
225 int err;
226 u32 spi_reset = mfp_to_gpio(MFP_PIN_GPIO106);
227
228 if (on) {
229 err = gpio_request(spi_reset, "TPO_LCD_SPI_RESET");
230 if (err) {
231 pr_err("failed to request GPIO for TPO LCD RESET\n");
232 return;
233 }
234 gpio_direction_output(spi_reset, 0);
235 udelay(100);
236 gpio_set_value(spi_reset, 1);
237 gpio_free(spi_reset);
238 } else {
239 err = gpio_request(spi_reset, "TPO_LCD_SPI_RESET");
240 if (err) {
241 pr_err("failed to request LCD RESET gpio\n");
242 return;
243 }
244 gpio_set_value(spi_reset, 0);
245 gpio_free(spi_reset);
246 }
247}
248
249static struct mmp_mach_panel_info dkb_tpo_panel_info = {
250 .name = "tpo-hvga",
251 .plat_path_name = "mmp-parallel",
252 .plat_set_onoff = dkb_tpo_panel_power,
253};
254
255static struct spi_board_info spi_board_info[] __initdata = {
256 {
257 .modalias = "tpo-hvga",
258 .platform_data = &dkb_tpo_panel_info,
259 .bus_num = 5,
260 }
261};
262
263static void __init add_disp(void)
264{
265 pxa_register_device(&pxa910_device_disp,
266 &dkb_disp_info, sizeof(dkb_disp_info));
267 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
268 pxa_register_device(&pxa910_device_fb,
269 &dkb_fb_info, sizeof(dkb_fb_info));
270 pxa_register_device(&pxa910_device_panel,
271 &dkb_tpo_panel_info, sizeof(dkb_tpo_panel_info));
272}
273#endif
274
187static void __init ttc_dkb_init(void) 275static void __init ttc_dkb_init(void)
188{ 276{
189 mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config)); 277 mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config));
@@ -212,13 +300,17 @@ static void __init ttc_dkb_init(void)
212 pxa168_device_u2ootg.dev.platform_data = &ttc_usb_pdata; 300 pxa168_device_u2ootg.dev.platform_data = &ttc_usb_pdata;
213 platform_device_register(&pxa168_device_u2ootg); 301 platform_device_register(&pxa168_device_u2ootg);
214#endif 302#endif
303
304#ifdef CONFIG_MMP_DISP
305 add_disp();
306#endif
215} 307}
216 308
217MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform") 309MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform")
218 .map_io = mmp_map_io, 310 .map_io = mmp_map_io,
219 .nr_irqs = TTCDKB_NR_IRQS, 311 .nr_irqs = TTCDKB_NR_IRQS,
220 .init_irq = pxa910_init_irq, 312 .init_irq = pxa910_init_irq,
221 .timer = &pxa910_timer, 313 .init_time = pxa910_timer_init,
222 .init_machine = ttc_dkb_init, 314 .init_machine = ttc_dkb_init,
223 .restart = mmp_restart, 315 .restart = mmp_restart,
224MACHINE_END 316MACHINE_END
diff --git a/arch/arm/mach-msm/board-dt-8660.c b/arch/arm/mach-msm/board-dt-8660.c
index b5b4de2cdf9e..7dcfc5300bbd 100644
--- a/arch/arm/mach-msm/board-dt-8660.c
+++ b/arch/arm/mach-msm/board-dt-8660.c
@@ -11,26 +11,15 @@
11 */ 11 */
12 12
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/irqchip.h>
14#include <linux/of.h> 15#include <linux/of.h>
15#include <linux/of_irq.h>
16#include <linux/of_platform.h> 16#include <linux/of_platform.h>
17 17
18#include <asm/mach/arch.h> 18#include <asm/mach/arch.h>
19#include <asm/hardware/gic.h>
20 19
21#include <mach/board.h> 20#include <mach/board.h>
22#include "common.h" 21#include "common.h"
23 22
24static const struct of_device_id msm_dt_gic_match[] __initconst = {
25 { .compatible = "qcom,msm-8660-qgic", .data = gic_of_init },
26 {}
27};
28
29static void __init msm8x60_init_irq(void)
30{
31 of_irq_init(msm_dt_gic_match);
32}
33
34static void __init msm8x60_init_late(void) 23static void __init msm8x60_init_late(void)
35{ 24{
36 smd_debugfs_init(); 25 smd_debugfs_init();
@@ -55,10 +44,9 @@ static const char *msm8x60_fluid_match[] __initdata = {
55DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)") 44DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)")
56 .smp = smp_ops(msm_smp_ops), 45 .smp = smp_ops(msm_smp_ops),
57 .map_io = msm_map_msm8x60_io, 46 .map_io = msm_map_msm8x60_io,
58 .init_irq = msm8x60_init_irq, 47 .init_irq = irqchip_init,
59 .handle_irq = gic_handle_irq,
60 .init_machine = msm8x60_dt_init, 48 .init_machine = msm8x60_dt_init,
61 .init_late = msm8x60_init_late, 49 .init_late = msm8x60_init_late,
62 .timer = &msm_dt_timer, 50 .init_time = msm_dt_timer_init,
63 .dt_compat = msm8x60_fluid_match, 51 .dt_compat = msm8x60_fluid_match,
64MACHINE_END 52MACHINE_END
diff --git a/arch/arm/mach-msm/board-dt-8960.c b/arch/arm/mach-msm/board-dt-8960.c
index 4490edb71c17..73019363ffa4 100644
--- a/arch/arm/mach-msm/board-dt-8960.c
+++ b/arch/arm/mach-msm/board-dt-8960.c
@@ -11,24 +11,13 @@
11 */ 11 */
12 12
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/of_irq.h> 14#include <linux/irqchip.h>
15#include <linux/of_platform.h> 15#include <linux/of_platform.h>
16 16
17#include <asm/hardware/gic.h>
18#include <asm/mach/arch.h> 17#include <asm/mach/arch.h>
19 18
20#include "common.h" 19#include "common.h"
21 20
22static const struct of_device_id msm_dt_gic_match[] __initconst = {
23 { .compatible = "qcom,msm-qgic2", .data = gic_of_init },
24 { }
25};
26
27static void __init msm_dt_init_irq(void)
28{
29 of_irq_init(msm_dt_gic_match);
30}
31
32static void __init msm_dt_init(void) 21static void __init msm_dt_init(void)
33{ 22{
34 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 23 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
@@ -42,9 +31,8 @@ static const char * const msm8960_dt_match[] __initconst = {
42DT_MACHINE_START(MSM8960_DT, "Qualcomm MSM (Flattened Device Tree)") 31DT_MACHINE_START(MSM8960_DT, "Qualcomm MSM (Flattened Device Tree)")
43 .smp = smp_ops(msm_smp_ops), 32 .smp = smp_ops(msm_smp_ops),
44 .map_io = msm_map_msm8960_io, 33 .map_io = msm_map_msm8960_io,
45 .init_irq = msm_dt_init_irq, 34 .init_irq = irqchip_init,
46 .timer = &msm_dt_timer, 35 .init_time = msm_dt_timer_init,
47 .init_machine = msm_dt_init, 36 .init_machine = msm_dt_init,
48 .dt_compat = msm8960_dt_match, 37 .dt_compat = msm8960_dt_match,
49 .handle_irq = gic_handle_irq,
50MACHINE_END 38MACHINE_END
diff --git a/arch/arm/mach-msm/board-halibut.c b/arch/arm/mach-msm/board-halibut.c
index 6ce542e2e21c..84d720af34ab 100644
--- a/arch/arm/mach-msm/board-halibut.c
+++ b/arch/arm/mach-msm/board-halibut.c
@@ -106,5 +106,5 @@ MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)")
106 .init_irq = halibut_init_irq, 106 .init_irq = halibut_init_irq,
107 .init_machine = halibut_init, 107 .init_machine = halibut_init,
108 .init_late = halibut_init_late, 108 .init_late = halibut_init_late,
109 .timer = &msm7x01_timer, 109 .init_time = msm7x01_timer_init,
110MACHINE_END 110MACHINE_END
diff --git a/arch/arm/mach-msm/board-mahimahi.c b/arch/arm/mach-msm/board-mahimahi.c
index df00bc03ce74..30c3496db593 100644
--- a/arch/arm/mach-msm/board-mahimahi.c
+++ b/arch/arm/mach-msm/board-mahimahi.c
@@ -75,7 +75,7 @@ static void __init mahimahi_init_late(void)
75 smd_debugfs_init(); 75 smd_debugfs_init();
76} 76}
77 77
78extern struct sys_timer msm_timer; 78void msm_timer_init(void);
79 79
80MACHINE_START(MAHIMAHI, "mahimahi") 80MACHINE_START(MAHIMAHI, "mahimahi")
81 .atag_offset = 0x100, 81 .atag_offset = 0x100,
@@ -84,5 +84,5 @@ MACHINE_START(MAHIMAHI, "mahimahi")
84 .init_irq = msm_init_irq, 84 .init_irq = msm_init_irq,
85 .init_machine = mahimahi_init, 85 .init_machine = mahimahi_init,
86 .init_late = mahimahi_init_late, 86 .init_late = mahimahi_init_late,
87 .timer = &msm_timer, 87 .init_time = msm_timer_init,
88MACHINE_END 88MACHINE_END
diff --git a/arch/arm/mach-msm/board-msm7x30.c b/arch/arm/mach-msm/board-msm7x30.c
index effa6f4336c7..7bc3f82e3ec9 100644
--- a/arch/arm/mach-msm/board-msm7x30.c
+++ b/arch/arm/mach-msm/board-msm7x30.c
@@ -131,7 +131,7 @@ MACHINE_START(MSM7X30_SURF, "QCT MSM7X30 SURF")
131 .init_irq = msm7x30_init_irq, 131 .init_irq = msm7x30_init_irq,
132 .init_machine = msm7x30_init, 132 .init_machine = msm7x30_init,
133 .init_late = msm7x30_init_late, 133 .init_late = msm7x30_init_late,
134 .timer = &msm7x30_timer, 134 .init_time = msm7x30_timer_init,
135MACHINE_END 135MACHINE_END
136 136
137MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA") 137MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA")
@@ -142,7 +142,7 @@ MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA")
142 .init_irq = msm7x30_init_irq, 142 .init_irq = msm7x30_init_irq,
143 .init_machine = msm7x30_init, 143 .init_machine = msm7x30_init,
144 .init_late = msm7x30_init_late, 144 .init_late = msm7x30_init_late,
145 .timer = &msm7x30_timer, 145 .init_time = msm7x30_timer_init,
146MACHINE_END 146MACHINE_END
147 147
148MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID") 148MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID")
@@ -153,5 +153,5 @@ MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID")
153 .init_irq = msm7x30_init_irq, 153 .init_irq = msm7x30_init_irq,
154 .init_machine = msm7x30_init, 154 .init_machine = msm7x30_init,
155 .init_late = msm7x30_init_late, 155 .init_late = msm7x30_init_late,
156 .timer = &msm7x30_timer, 156 .init_time = msm7x30_timer_init,
157MACHINE_END 157MACHINE_END
diff --git a/arch/arm/mach-msm/board-qsd8x50.c b/arch/arm/mach-msm/board-qsd8x50.c
index 2448fcf09eb1..686e7949a73a 100644
--- a/arch/arm/mach-msm/board-qsd8x50.c
+++ b/arch/arm/mach-msm/board-qsd8x50.c
@@ -200,7 +200,7 @@ MACHINE_START(QSD8X50_SURF, "QCT QSD8X50 SURF")
200 .init_irq = qsd8x50_init_irq, 200 .init_irq = qsd8x50_init_irq,
201 .init_machine = qsd8x50_init, 201 .init_machine = qsd8x50_init,
202 .init_late = qsd8x50_init_late, 202 .init_late = qsd8x50_init_late,
203 .timer = &qsd8x50_timer, 203 .init_time = qsd8x50_timer_init,
204MACHINE_END 204MACHINE_END
205 205
206MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5") 206MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5")
@@ -209,5 +209,5 @@ MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5")
209 .init_irq = qsd8x50_init_irq, 209 .init_irq = qsd8x50_init_irq,
210 .init_machine = qsd8x50_init, 210 .init_machine = qsd8x50_init,
211 .init_late = qsd8x50_init_late, 211 .init_late = qsd8x50_init_late,
212 .timer = &qsd8x50_timer, 212 .init_time = qsd8x50_timer_init,
213MACHINE_END 213MACHINE_END
diff --git a/arch/arm/mach-msm/board-sapphire.c b/arch/arm/mach-msm/board-sapphire.c
index b7b0fc7e3278..70730111b37c 100644
--- a/arch/arm/mach-msm/board-sapphire.c
+++ b/arch/arm/mach-msm/board-sapphire.c
@@ -53,7 +53,7 @@ static struct platform_device *devices[] __initdata = {
53 &msm_device_uart3, 53 &msm_device_uart3,
54}; 54};
55 55
56extern struct sys_timer msm_timer; 56void msm_timer_init(void);
57 57
58static void __init sapphire_init_irq(void) 58static void __init sapphire_init_irq(void)
59{ 59{
@@ -113,5 +113,5 @@ MACHINE_START(SAPPHIRE, "sapphire")
113 .init_irq = sapphire_init_irq, 113 .init_irq = sapphire_init_irq,
114 .init_machine = sapphire_init, 114 .init_machine = sapphire_init,
115 .init_late = sapphire_init_late, 115 .init_late = sapphire_init_late,
116 .timer = &msm_timer, 116 .init_time = msm_timer_init,
117MACHINE_END 117MACHINE_END
diff --git a/arch/arm/mach-msm/board-trout.c b/arch/arm/mach-msm/board-trout.c
index 4ba0800e243e..919bfa32871a 100644
--- a/arch/arm/mach-msm/board-trout.c
+++ b/arch/arm/mach-msm/board-trout.c
@@ -110,5 +110,5 @@ MACHINE_START(TROUT, "HTC Dream")
110 .init_irq = trout_init_irq, 110 .init_irq = trout_init_irq,
111 .init_machine = trout_init, 111 .init_machine = trout_init,
112 .init_late = trout_init_late, 112 .init_late = trout_init_late,
113 .timer = &msm7x01_timer, 113 .init_time = msm7x01_timer_init,
114MACHINE_END 114MACHINE_END
diff --git a/arch/arm/mach-msm/common.h b/arch/arm/mach-msm/common.h
index 633a7159d5ff..ce8215a269e5 100644
--- a/arch/arm/mach-msm/common.h
+++ b/arch/arm/mach-msm/common.h
@@ -12,10 +12,10 @@
12#ifndef __MACH_COMMON_H 12#ifndef __MACH_COMMON_H
13#define __MACH_COMMON_H 13#define __MACH_COMMON_H
14 14
15extern struct sys_timer msm7x01_timer; 15extern void msm7x01_timer_init(void);
16extern struct sys_timer msm7x30_timer; 16extern void msm7x30_timer_init(void);
17extern struct sys_timer msm_dt_timer; 17extern void msm_dt_timer_init(void);
18extern struct sys_timer qsd8x50_timer; 18extern void qsd8x50_timer_init(void);
19 19
20extern void msm_map_common_io(void); 20extern void msm_map_common_io(void);
21extern void msm_map_msm7x30_io(void); 21extern void msm_map_msm7x30_io(void);
diff --git a/arch/arm/mach-msm/include/mach/uncompress.h b/arch/arm/mach-msm/include/mach/uncompress.h
index c14011fe832d..fa97a10d8695 100644
--- a/arch/arm/mach-msm/include/mach/uncompress.h
+++ b/arch/arm/mach-msm/include/mach/uncompress.h
@@ -60,8 +60,4 @@ static inline void arch_decomp_setup(void)
60{ 60{
61} 61}
62 62
63static inline void arch_decomp_wdog(void)
64{
65}
66
67#endif 63#endif
diff --git a/arch/arm/mach-msm/platsmp.c b/arch/arm/mach-msm/platsmp.c
index 7ed69b69c87c..42932865416a 100644
--- a/arch/arm/mach-msm/platsmp.c
+++ b/arch/arm/mach-msm/platsmp.c
@@ -15,8 +15,8 @@
15#include <linux/jiffies.h> 15#include <linux/jiffies.h>
16#include <linux/smp.h> 16#include <linux/smp.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/irqchip/arm-gic.h>
18 19
19#include <asm/hardware/gic.h>
20#include <asm/cacheflush.h> 20#include <asm/cacheflush.h>
21#include <asm/cputype.h> 21#include <asm/cputype.h>
22#include <asm/mach-types.h> 22#include <asm/mach-types.h>
@@ -115,7 +115,7 @@ static int __cpuinit msm_boot_secondary(unsigned int cpu, struct task_struct *id
115 * the boot monitor to read the system wide flags register, 115 * the boot monitor to read the system wide flags register,
116 * and branch to the address found there. 116 * and branch to the address found there.
117 */ 117 */
118 gic_raise_softirq(cpumask_of(cpu), 0); 118 arch_send_wakeup_ipi_mask(cpumask_of(cpu));
119 119
120 timeout = jiffies + (1 * HZ); 120 timeout = jiffies + (1 * HZ);
121 while (time_before(jiffies, timeout)) { 121 while (time_before(jiffies, timeout)) {
@@ -153,8 +153,6 @@ static void __init msm_smp_init_cpus(void)
153 153
154 for (i = 0; i < ncores; i++) 154 for (i = 0; i < ncores; i++)
155 set_cpu_possible(i, true); 155 set_cpu_possible(i, true);
156
157 set_smp_cross_call(gic_raise_softirq);
158} 156}
159 157
160static void __init msm_smp_prepare_cpus(unsigned int max_cpus) 158static void __init msm_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-msm/proc_comm.h b/arch/arm/mach-msm/proc_comm.h
index 12da4cacd4a8..e8d043a0e990 100644
--- a/arch/arm/mach-msm/proc_comm.h
+++ b/arch/arm/mach-msm/proc_comm.h
@@ -253,6 +253,6 @@ enum {
253 (((drvstr) & 0xF) << 17)) 253 (((drvstr) & 0xF) << 17))
254 254
255int msm_proc_comm(unsigned cmd, unsigned *data1, unsigned *data2); 255int msm_proc_comm(unsigned cmd, unsigned *data1, unsigned *data2);
256void __init proc_comm_boot_wait(void); 256void proc_comm_boot_wait(void);
257 257
258#endif 258#endif
diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c
index 476549a8a709..2969027f02fa 100644
--- a/arch/arm/mach-msm/timer.c
+++ b/arch/arm/mach-msm/timer.c
@@ -25,7 +25,6 @@
25#include <linux/of_irq.h> 25#include <linux/of_irq.h>
26 26
27#include <asm/mach/time.h> 27#include <asm/mach/time.h>
28#include <asm/hardware/gic.h>
29#include <asm/localtimer.h> 28#include <asm/localtimer.h>
30#include <asm/sched_clock.h> 29#include <asm/sched_clock.h>
31 30
@@ -144,13 +143,9 @@ static int __cpuinit msm_local_timer_setup(struct clock_event_device *evt)
144 evt->rating = msm_clockevent.rating; 143 evt->rating = msm_clockevent.rating;
145 evt->set_mode = msm_timer_set_mode; 144 evt->set_mode = msm_timer_set_mode;
146 evt->set_next_event = msm_timer_set_next_event; 145 evt->set_next_event = msm_timer_set_next_event;
147 evt->shift = msm_clockevent.shift;
148 evt->mult = div_sc(GPT_HZ, NSEC_PER_SEC, evt->shift);
149 evt->max_delta_ns = clockevent_delta2ns(0xf0000000, evt);
150 evt->min_delta_ns = clockevent_delta2ns(4, evt);
151 146
152 *__this_cpu_ptr(msm_evt.percpu_evt) = evt; 147 *__this_cpu_ptr(msm_evt.percpu_evt) = evt;
153 clockevents_register_device(evt); 148 clockevents_config_and_register(evt, GPT_HZ, 4, 0xf0000000);
154 enable_percpu_irq(evt->irq, IRQ_TYPE_EDGE_RISING); 149 enable_percpu_irq(evt->irq, IRQ_TYPE_EDGE_RISING);
155 return 0; 150 return 0;
156} 151}
@@ -229,7 +224,7 @@ static const struct of_device_id msm_gpt_match[] __initconst = {
229 { }, 224 { },
230}; 225};
231 226
232static void __init msm_dt_timer_init(void) 227void __init msm_dt_timer_init(void)
233{ 228{
234 struct device_node *np; 229 struct device_node *np;
235 u32 freq; 230 u32 freq;
@@ -296,10 +291,6 @@ static void __init msm_dt_timer_init(void)
296 291
297 msm_timer_init(freq, 32, irq, !!percpu_offset); 292 msm_timer_init(freq, 32, irq, !!percpu_offset);
298} 293}
299
300struct sys_timer msm_dt_timer = {
301 .init = msm_dt_timer_init
302};
303#endif 294#endif
304 295
305static int __init msm_timer_map(phys_addr_t event, phys_addr_t source) 296static int __init msm_timer_map(phys_addr_t event, phys_addr_t source)
@@ -317,7 +308,7 @@ static int __init msm_timer_map(phys_addr_t event, phys_addr_t source)
317 return 0; 308 return 0;
318} 309}
319 310
320static void __init msm7x01_timer_init(void) 311void __init msm7x01_timer_init(void)
321{ 312{
322 struct clocksource *cs = &msm_clocksource; 313 struct clocksource *cs = &msm_clocksource;
323 314
@@ -330,28 +321,16 @@ static void __init msm7x01_timer_init(void)
330 false); 321 false);
331} 322}
332 323
333struct sys_timer msm7x01_timer = { 324void __init msm7x30_timer_init(void)
334 .init = msm7x01_timer_init
335};
336
337static void __init msm7x30_timer_init(void)
338{ 325{
339 if (msm_timer_map(0xc0100004, 0xc0100024)) 326 if (msm_timer_map(0xc0100004, 0xc0100024))
340 return; 327 return;
341 msm_timer_init(24576000 / 4, 32, 1, false); 328 msm_timer_init(24576000 / 4, 32, 1, false);
342} 329}
343 330
344struct sys_timer msm7x30_timer = { 331void __init qsd8x50_timer_init(void)
345 .init = msm7x30_timer_init
346};
347
348static void __init qsd8x50_timer_init(void)
349{ 332{
350 if (msm_timer_map(0xAC100000, 0xAC100010)) 333 if (msm_timer_map(0xAC100000, 0xAC100010))
351 return; 334 return;
352 msm_timer_init(19200000 / 4, 32, 7, false); 335 msm_timer_init(19200000 / 4, 32, 7, false);
353} 336}
354
355struct sys_timer qsd8x50_timer = {
356 .init = qsd8x50_timer_init
357};
diff --git a/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c b/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c
index ee74ec97c141..1f2ef98b37c6 100644
--- a/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c
+++ b/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c
@@ -150,6 +150,6 @@ MACHINE_START(TERASTATION_WXL, "Buffalo Nas WXL")
150 .map_io = mv78xx0_map_io, 150 .map_io = mv78xx0_map_io,
151 .init_early = mv78xx0_init_early, 151 .init_early = mv78xx0_init_early,
152 .init_irq = mv78xx0_init_irq, 152 .init_irq = mv78xx0_init_irq,
153 .timer = &mv78xx0_timer, 153 .init_time = mv78xx0_timer_init,
154 .restart = mv78xx0_restart, 154 .restart = mv78xx0_restart,
155MACHINE_END 155MACHINE_END
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c
index d0cb4857b4b3..0efa14498ebc 100644
--- a/arch/arm/mach-mv78xx0/common.c
+++ b/arch/arm/mach-mv78xx0/common.c
@@ -336,16 +336,12 @@ void __init mv78xx0_init_early(void)
336 orion_time_set_base(TIMER_VIRT_BASE); 336 orion_time_set_base(TIMER_VIRT_BASE);
337} 337}
338 338
339static void __init_refok mv78xx0_timer_init(void) 339void __init_refok mv78xx0_timer_init(void)
340{ 340{
341 orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR, 341 orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR,
342 IRQ_MV78XX0_TIMER_1, get_tclk()); 342 IRQ_MV78XX0_TIMER_1, get_tclk());
343} 343}
344 344
345struct sys_timer mv78xx0_timer = {
346 .init = mv78xx0_timer_init,
347};
348
349 345
350/***************************************************************************** 346/*****************************************************************************
351 * General 347 * General
diff --git a/arch/arm/mach-mv78xx0/common.h b/arch/arm/mach-mv78xx0/common.h
index 507c767d49e0..5e9485bad0ac 100644
--- a/arch/arm/mach-mv78xx0/common.h
+++ b/arch/arm/mach-mv78xx0/common.h
@@ -47,7 +47,7 @@ void mv78xx0_uart3_init(void);
47void mv78xx0_i2c_init(void); 47void mv78xx0_i2c_init(void);
48void mv78xx0_restart(char, const char *); 48void mv78xx0_restart(char, const char *);
49 49
50extern struct sys_timer mv78xx0_timer; 50extern void mv78xx0_timer_init(void);
51 51
52 52
53#endif 53#endif
diff --git a/arch/arm/mach-mv78xx0/db78x00-bp-setup.c b/arch/arm/mach-mv78xx0/db78x00-bp-setup.c
index 4d6d48bf51ef..4e0f22b30bc8 100644
--- a/arch/arm/mach-mv78xx0/db78x00-bp-setup.c
+++ b/arch/arm/mach-mv78xx0/db78x00-bp-setup.c
@@ -98,6 +98,6 @@ MACHINE_START(DB78X00_BP, "Marvell DB-78x00-BP Development Board")
98 .map_io = mv78xx0_map_io, 98 .map_io = mv78xx0_map_io,
99 .init_early = mv78xx0_init_early, 99 .init_early = mv78xx0_init_early,
100 .init_irq = mv78xx0_init_irq, 100 .init_irq = mv78xx0_init_irq,
101 .timer = &mv78xx0_timer, 101 .init_time = mv78xx0_timer_init,
102 .restart = mv78xx0_restart, 102 .restart = mv78xx0_restart,
103MACHINE_END 103MACHINE_END
diff --git a/arch/arm/mach-mv78xx0/include/mach/uncompress.h b/arch/arm/mach-mv78xx0/include/mach/uncompress.h
index 365264298e79..6a761c44a296 100644
--- a/arch/arm/mach-mv78xx0/include/mach/uncompress.h
+++ b/arch/arm/mach-mv78xx0/include/mach/uncompress.h
@@ -44,4 +44,3 @@ static void flush(void)
44 * nothing to do 44 * nothing to do
45 */ 45 */
46#define arch_decomp_setup() 46#define arch_decomp_setup()
47#define arch_decomp_wdog()
diff --git a/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c b/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
index 9a882706e138..d2d06f3957f3 100644
--- a/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
+++ b/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
@@ -83,6 +83,6 @@ MACHINE_START(RD78X00_MASA, "Marvell RD-78x00-MASA Development Board")
83 .map_io = mv78xx0_map_io, 83 .map_io = mv78xx0_map_io,
84 .init_early = mv78xx0_init_early, 84 .init_early = mv78xx0_init_early,
85 .init_irq = mv78xx0_init_irq, 85 .init_irq = mv78xx0_init_irq,
86 .timer = &mv78xx0_timer, 86 .init_time = mv78xx0_timer_init,
87 .restart = mv78xx0_restart, 87 .restart = mv78xx0_restart,
88MACHINE_END 88MACHINE_END
diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile
index 99df4df680fd..da93bcbc74c1 100644
--- a/arch/arm/mach-mvebu/Makefile
+++ b/arch/arm/mach-mvebu/Makefile
@@ -3,7 +3,8 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
3 3
4AFLAGS_coherency_ll.o := -Wa,-march=armv7-a 4AFLAGS_coherency_ll.o := -Wa,-march=armv7-a
5 5
6obj-y += system-controller.o 6obj-y += system-controller.o
7obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o irq-armada-370-xp.o addr-map.o coherency.o coherency_ll.o pmsu.o 7obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o
8obj-$(CONFIG_ARCH_MVEBU) += addr-map.o coherency.o coherency_ll.o pmsu.o irq-armada-370-xp.o
8obj-$(CONFIG_SMP) += platsmp.o headsmp.o 9obj-$(CONFIG_SMP) += platsmp.o headsmp.o
9obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 10obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/armada-370-xp.c
index 7434b5e36197..a5ea616d6d12 100644
--- a/arch/arm/mach-mvebu/armada-370-xp.c
+++ b/arch/arm/mach-mvebu/armada-370-xp.c
@@ -56,10 +56,6 @@ void __init armada_370_xp_init_early(void)
56 init_dma_coherent_pool_size(SZ_1M); 56 init_dma_coherent_pool_size(SZ_1M);
57} 57}
58 58
59struct sys_timer armada_370_xp_timer = {
60 .init = armada_370_xp_timer_and_clk_init,
61};
62
63static void __init armada_370_xp_dt_init(void) 59static void __init armada_370_xp_dt_init(void)
64{ 60{
65 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 61 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
@@ -78,7 +74,7 @@ DT_MACHINE_START(ARMADA_XP_DT, "Marvell Armada 370/XP (Device Tree)")
78 .init_early = armada_370_xp_init_early, 74 .init_early = armada_370_xp_init_early,
79 .init_irq = armada_370_xp_init_irq, 75 .init_irq = armada_370_xp_init_irq,
80 .handle_irq = armada_370_xp_handle_irq, 76 .handle_irq = armada_370_xp_handle_irq,
81 .timer = &armada_370_xp_timer, 77 .init_time = armada_370_xp_timer_and_clk_init,
82 .restart = mvebu_restart, 78 .restart = mvebu_restart,
83 .dt_compat = armada_370_xp_dt_compat, 79 .dt_compat = armada_370_xp_dt_compat,
84MACHINE_END 80MACHINE_END
diff --git a/arch/arm/mach-mvebu/irq-armada-370-xp.c b/arch/arm/mach-mvebu/irq-armada-370-xp.c
index 8e3fb082c3c6..274ff58271de 100644
--- a/arch/arm/mach-mvebu/irq-armada-370-xp.c
+++ b/arch/arm/mach-mvebu/irq-armada-370-xp.c
@@ -34,6 +34,7 @@
34#define ARMADA_370_XP_INT_CONTROL (0x00) 34#define ARMADA_370_XP_INT_CONTROL (0x00)
35#define ARMADA_370_XP_INT_SET_ENABLE_OFFS (0x30) 35#define ARMADA_370_XP_INT_SET_ENABLE_OFFS (0x30)
36#define ARMADA_370_XP_INT_CLEAR_ENABLE_OFFS (0x34) 36#define ARMADA_370_XP_INT_CLEAR_ENABLE_OFFS (0x34)
37#define ARMADA_370_XP_INT_SOURCE_CTL(irq) (0x100 + irq*4)
37 38
38#define ARMADA_370_XP_CPU_INTACK_OFFS (0x44) 39#define ARMADA_370_XP_CPU_INTACK_OFFS (0x44)
39 40
@@ -41,28 +42,90 @@
41#define ARMADA_370_XP_IN_DRBEL_MSK_OFFS (0xc) 42#define ARMADA_370_XP_IN_DRBEL_MSK_OFFS (0xc)
42#define ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS (0x8) 43#define ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS (0x8)
43 44
45#define ARMADA_370_XP_MAX_PER_CPU_IRQS (28)
46
44#define ACTIVE_DOORBELLS (8) 47#define ACTIVE_DOORBELLS (8)
45 48
49static DEFINE_RAW_SPINLOCK(irq_controller_lock);
50
46static void __iomem *per_cpu_int_base; 51static void __iomem *per_cpu_int_base;
47static void __iomem *main_int_base; 52static void __iomem *main_int_base;
48static struct irq_domain *armada_370_xp_mpic_domain; 53static struct irq_domain *armada_370_xp_mpic_domain;
49 54
55/*
56 * In SMP mode:
57 * For shared global interrupts, mask/unmask global enable bit
58 * For CPU interrtups, mask/unmask the calling CPU's bit
59 */
50static void armada_370_xp_irq_mask(struct irq_data *d) 60static void armada_370_xp_irq_mask(struct irq_data *d)
51{ 61{
62#ifdef CONFIG_SMP
63 irq_hw_number_t hwirq = irqd_to_hwirq(d);
64
65 if (hwirq > ARMADA_370_XP_MAX_PER_CPU_IRQS)
66 writel(hwirq, main_int_base +
67 ARMADA_370_XP_INT_CLEAR_ENABLE_OFFS);
68 else
69 writel(hwirq, per_cpu_int_base +
70 ARMADA_370_XP_INT_SET_MASK_OFFS);
71#else
52 writel(irqd_to_hwirq(d), 72 writel(irqd_to_hwirq(d),
53 per_cpu_int_base + ARMADA_370_XP_INT_SET_MASK_OFFS); 73 per_cpu_int_base + ARMADA_370_XP_INT_SET_MASK_OFFS);
74#endif
54} 75}
55 76
56static void armada_370_xp_irq_unmask(struct irq_data *d) 77static void armada_370_xp_irq_unmask(struct irq_data *d)
57{ 78{
79#ifdef CONFIG_SMP
80 irq_hw_number_t hwirq = irqd_to_hwirq(d);
81
82 if (hwirq > ARMADA_370_XP_MAX_PER_CPU_IRQS)
83 writel(hwirq, main_int_base +
84 ARMADA_370_XP_INT_SET_ENABLE_OFFS);
85 else
86 writel(hwirq, per_cpu_int_base +
87 ARMADA_370_XP_INT_CLEAR_MASK_OFFS);
88#else
58 writel(irqd_to_hwirq(d), 89 writel(irqd_to_hwirq(d),
59 per_cpu_int_base + ARMADA_370_XP_INT_CLEAR_MASK_OFFS); 90 per_cpu_int_base + ARMADA_370_XP_INT_CLEAR_MASK_OFFS);
91#endif
60} 92}
61 93
62#ifdef CONFIG_SMP 94#ifdef CONFIG_SMP
63static int armada_xp_set_affinity(struct irq_data *d, 95static int armada_xp_set_affinity(struct irq_data *d,
64 const struct cpumask *mask_val, bool force) 96 const struct cpumask *mask_val, bool force)
65{ 97{
98 unsigned long reg;
99 unsigned long new_mask = 0;
100 unsigned long online_mask = 0;
101 unsigned long count = 0;
102 irq_hw_number_t hwirq = irqd_to_hwirq(d);
103 int cpu;
104
105 for_each_cpu(cpu, mask_val) {
106 new_mask |= 1 << cpu_logical_map(cpu);
107 count++;
108 }
109
110 /*
111 * Forbid mutlicore interrupt affinity
112 * This is required since the MPIC HW doesn't limit
113 * several CPUs from acknowledging the same interrupt.
114 */
115 if (count > 1)
116 return -EINVAL;
117
118 for_each_cpu(cpu, cpu_online_mask)
119 online_mask |= 1 << cpu_logical_map(cpu);
120
121 raw_spin_lock(&irq_controller_lock);
122
123 reg = readl(main_int_base + ARMADA_370_XP_INT_SOURCE_CTL(hwirq));
124 reg = (reg & (~online_mask)) | new_mask;
125 writel(reg, main_int_base + ARMADA_370_XP_INT_SOURCE_CTL(hwirq));
126
127 raw_spin_unlock(&irq_controller_lock);
128
66 return 0; 129 return 0;
67} 130}
68#endif 131#endif
@@ -82,10 +145,17 @@ static int armada_370_xp_mpic_irq_map(struct irq_domain *h,
82{ 145{
83 armada_370_xp_irq_mask(irq_get_irq_data(virq)); 146 armada_370_xp_irq_mask(irq_get_irq_data(virq));
84 writel(hw, main_int_base + ARMADA_370_XP_INT_SET_ENABLE_OFFS); 147 writel(hw, main_int_base + ARMADA_370_XP_INT_SET_ENABLE_OFFS);
85
86 irq_set_chip_and_handler(virq, &armada_370_xp_irq_chip,
87 handle_level_irq);
88 irq_set_status_flags(virq, IRQ_LEVEL); 148 irq_set_status_flags(virq, IRQ_LEVEL);
149
150 if (hw < ARMADA_370_XP_MAX_PER_CPU_IRQS) {
151 irq_set_percpu_devid(virq);
152 irq_set_chip_and_handler(virq, &armada_370_xp_irq_chip,
153 handle_percpu_devid_irq);
154
155 } else {
156 irq_set_chip_and_handler(virq, &armada_370_xp_irq_chip,
157 handle_level_irq);
158 }
89 set_irq_flags(virq, IRQF_VALID | IRQF_PROBE); 159 set_irq_flags(virq, IRQF_VALID | IRQF_PROBE);
90 160
91 return 0; 161 return 0;
@@ -155,6 +225,15 @@ static int __init armada_370_xp_mpic_of_init(struct device_node *node,
155 225
156#ifdef CONFIG_SMP 226#ifdef CONFIG_SMP
157 armada_xp_mpic_smp_cpu_init(); 227 armada_xp_mpic_smp_cpu_init();
228
229 /*
230 * Set the default affinity from all CPUs to the boot cpu.
231 * This is required since the MPIC doesn't limit several CPUs
232 * from acknowledging the same interrupt.
233 */
234 cpumask_clear(irq_default_affinity);
235 cpumask_set_cpu(smp_processor_id(), irq_default_affinity);
236
158#endif 237#endif
159 238
160 return 0; 239 return 0;
@@ -173,7 +252,7 @@ asmlinkage void __exception_irq_entry armada_370_xp_handle_irq(struct pt_regs
173 if (irqnr > 1022) 252 if (irqnr > 1022)
174 break; 253 break;
175 254
176 if (irqnr >= 8) { 255 if (irqnr > 0) {
177 irqnr = irq_find_mapping(armada_370_xp_mpic_domain, 256 irqnr = irq_find_mapping(armada_370_xp_mpic_domain,
178 irqnr); 257 irqnr);
179 handle_IRQ(irqnr, regs); 258 handle_IRQ(irqnr, regs);
diff --git a/arch/arm/mach-mxs/include/mach/uncompress.h b/arch/arm/mach-mxs/include/mach/uncompress.h
index ef2811495446..533f5186e200 100644
--- a/arch/arm/mach-mxs/include/mach/uncompress.h
+++ b/arch/arm/mach-mxs/include/mach/uncompress.h
@@ -72,6 +72,5 @@ static inline void __arch_decomp_setup(unsigned long arch_id)
72} 72}
73 73
74#define arch_decomp_setup() __arch_decomp_setup(arch_id) 74#define arch_decomp_setup() __arch_decomp_setup(arch_id)
75#define arch_decomp_wdog()
76 75
77#endif /* __MACH_MXS_UNCOMPRESS_H__ */ 76#endif /* __MACH_MXS_UNCOMPRESS_H__ */
diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c
index c66129b5dd18..052186713347 100644
--- a/arch/arm/mach-mxs/mach-mxs.c
+++ b/arch/arm/mach-mxs/mach-mxs.c
@@ -119,6 +119,23 @@ static struct fb_videomode apf28dev_video_modes[] = {
119 }, 119 },
120}; 120};
121 121
122static struct fb_videomode cfa10049_video_modes[] = {
123 {
124 .name = "Himax HX8357-B",
125 .refresh = 60,
126 .xres = 320,
127 .yres = 480,
128 .pixclock = 108506, /* picosecond (9.216 MHz) */
129 .left_margin = 2,
130 .right_margin = 2,
131 .upper_margin = 2,
132 .lower_margin = 2,
133 .hsync_len = 15,
134 .vsync_len = 15,
135 .sync = FB_SYNC_DATA_ENABLE_HIGH_ACT
136 },
137};
138
122static struct mxsfb_platform_data mxsfb_pdata __initdata; 139static struct mxsfb_platform_data mxsfb_pdata __initdata;
123 140
124/* 141/*
@@ -163,19 +180,11 @@ static void __init imx23_timer_init(void)
163 mx23_clocks_init(); 180 mx23_clocks_init();
164} 181}
165 182
166static struct sys_timer imx23_timer = {
167 .init = imx23_timer_init,
168};
169
170static void __init imx28_timer_init(void) 183static void __init imx28_timer_init(void)
171{ 184{
172 mx28_clocks_init(); 185 mx28_clocks_init();
173} 186}
174 187
175static struct sys_timer imx28_timer = {
176 .init = imx28_timer_init,
177};
178
179enum mac_oui { 188enum mac_oui {
180 OUI_FSL, 189 OUI_FSL,
181 OUI_DENX, 190 OUI_DENX,
@@ -395,6 +404,17 @@ static void __init cfa10049_init(void)
395 update_fec_mac_prop(OUI_CRYSTALFONTZ); 404 update_fec_mac_prop(OUI_CRYSTALFONTZ);
396} 405}
397 406
407static void __init cfa10037_init(void)
408{
409 enable_clk_enet_out();
410 update_fec_mac_prop(OUI_CRYSTALFONTZ);
411
412 mxsfb_pdata.mode_list = cfa10049_video_modes;
413 mxsfb_pdata.mode_count = ARRAY_SIZE(cfa10049_video_modes);
414 mxsfb_pdata.default_bpp = 32;
415 mxsfb_pdata.ld_intf_width = STMLCDIF_18BIT;
416}
417
398static void __init apf28_init(void) 418static void __init apf28_init(void)
399{ 419{
400 enable_clk_enet_out(); 420 enable_clk_enet_out();
@@ -415,6 +435,8 @@ static void __init mxs_machine_init(void)
415 m28evk_init(); 435 m28evk_init();
416 else if (of_machine_is_compatible("bluegiga,apx4devkit")) 436 else if (of_machine_is_compatible("bluegiga,apx4devkit"))
417 apx4devkit_init(); 437 apx4devkit_init();
438 else if (of_machine_is_compatible("crystalfontz,cfa10037"))
439 cfa10037_init();
418 else if (of_machine_is_compatible("crystalfontz,cfa10049")) 440 else if (of_machine_is_compatible("crystalfontz,cfa10049"))
419 cfa10049_init(); 441 cfa10049_init();
420 else if (of_machine_is_compatible("armadeus,imx28-apf28")) 442 else if (of_machine_is_compatible("armadeus,imx28-apf28"))
@@ -446,7 +468,7 @@ DT_MACHINE_START(IMX23, "Freescale i.MX23 (Device Tree)")
446 .map_io = mx23_map_io, 468 .map_io = mx23_map_io,
447 .init_irq = icoll_init_irq, 469 .init_irq = icoll_init_irq,
448 .handle_irq = icoll_handle_irq, 470 .handle_irq = icoll_handle_irq,
449 .timer = &imx23_timer, 471 .init_time = imx23_timer_init,
450 .init_machine = mxs_machine_init, 472 .init_machine = mxs_machine_init,
451 .dt_compat = imx23_dt_compat, 473 .dt_compat = imx23_dt_compat,
452 .restart = mxs_restart, 474 .restart = mxs_restart,
@@ -456,7 +478,7 @@ DT_MACHINE_START(IMX28, "Freescale i.MX28 (Device Tree)")
456 .map_io = mx28_map_io, 478 .map_io = mx28_map_io,
457 .init_irq = icoll_init_irq, 479 .init_irq = icoll_init_irq,
458 .handle_irq = icoll_handle_irq, 480 .handle_irq = icoll_handle_irq,
459 .timer = &imx28_timer, 481 .init_time = imx28_timer_init,
460 .init_machine = mxs_machine_init, 482 .init_machine = mxs_machine_init,
461 .dt_compat = imx28_dt_compat, 483 .dt_compat = imx28_dt_compat,
462 .restart = mxs_restart, 484 .restart = mxs_restart,
diff --git a/arch/arm/mach-mxs/timer.c b/arch/arm/mach-mxs/timer.c
index 856f4c796061..421020498a1b 100644
--- a/arch/arm/mach-mxs/timer.c
+++ b/arch/arm/mach-mxs/timer.c
@@ -72,8 +72,9 @@
72#define BM_TIMROT_TIMCTRLn_IRQ_EN (1 << 14) 72#define BM_TIMROT_TIMCTRLn_IRQ_EN (1 << 14)
73#define BM_TIMROT_TIMCTRLn_IRQ (1 << 15) 73#define BM_TIMROT_TIMCTRLn_IRQ (1 << 15)
74#define BP_TIMROT_TIMCTRLn_SELECT 0 74#define BP_TIMROT_TIMCTRLn_SELECT 0
75#define BV_TIMROTv1_TIMCTRLn_SELECT__32KHZ_XTAL 0x8 75#define BV_TIMROTv1_TIMCTRLn_SELECT__32KHZ_XTAL 0x8
76#define BV_TIMROTv2_TIMCTRLn_SELECT__32KHZ_XTAL 0xb 76#define BV_TIMROTv2_TIMCTRLn_SELECT__32KHZ_XTAL 0xb
77#define BV_TIMROTv2_TIMCTRLn_SELECT__TICK_ALWAYS 0xf
77 78
78static struct clock_event_device mxs_clockevent_device; 79static struct clock_event_device mxs_clockevent_device;
79static enum clock_event_mode mxs_clockevent_mode = CLOCK_EVT_MODE_UNUSED; 80static enum clock_event_mode mxs_clockevent_mode = CLOCK_EVT_MODE_UNUSED;
@@ -195,7 +196,6 @@ static void mxs_set_mode(enum clock_event_mode mode,
195static struct clock_event_device mxs_clockevent_device = { 196static struct clock_event_device mxs_clockevent_device = {
196 .name = "mxs_timrot", 197 .name = "mxs_timrot",
197 .features = CLOCK_EVT_FEAT_ONESHOT, 198 .features = CLOCK_EVT_FEAT_ONESHOT,
198 .shift = 32,
199 .set_mode = mxs_set_mode, 199 .set_mode = mxs_set_mode,
200 .set_next_event = timrotv2_set_next_event, 200 .set_next_event = timrotv2_set_next_event,
201 .rating = 200, 201 .rating = 200,
@@ -203,25 +203,13 @@ static struct clock_event_device mxs_clockevent_device = {
203 203
204static int __init mxs_clockevent_init(struct clk *timer_clk) 204static int __init mxs_clockevent_init(struct clk *timer_clk)
205{ 205{
206 unsigned int c = clk_get_rate(timer_clk); 206 if (timrot_is_v1())
207
208 mxs_clockevent_device.mult =
209 div_sc(c, NSEC_PER_SEC, mxs_clockevent_device.shift);
210 mxs_clockevent_device.cpumask = cpumask_of(0);
211 if (timrot_is_v1()) {
212 mxs_clockevent_device.set_next_event = timrotv1_set_next_event; 207 mxs_clockevent_device.set_next_event = timrotv1_set_next_event;
213 mxs_clockevent_device.max_delta_ns = 208 mxs_clockevent_device.cpumask = cpumask_of(0);
214 clockevent_delta2ns(0xfffe, &mxs_clockevent_device); 209 clockevents_config_and_register(&mxs_clockevent_device,
215 mxs_clockevent_device.min_delta_ns = 210 clk_get_rate(timer_clk),
216 clockevent_delta2ns(0xf, &mxs_clockevent_device); 211 timrot_is_v1() ? 0xf : 0x2,
217 } else { 212 timrot_is_v1() ? 0xfffe : 0xfffffffe);
218 mxs_clockevent_device.max_delta_ns =
219 clockevent_delta2ns(0xfffffffe, &mxs_clockevent_device);
220 mxs_clockevent_device.min_delta_ns =
221 clockevent_delta2ns(0xf, &mxs_clockevent_device);
222 }
223
224 clockevents_register_device(&mxs_clockevent_device);
225 213
226 return 0; 214 return 0;
227} 215}
@@ -288,7 +276,7 @@ void __init mxs_timer_init(void)
288 /* one for clock_event */ 276 /* one for clock_event */
289 __raw_writel((timrot_is_v1() ? 277 __raw_writel((timrot_is_v1() ?
290 BV_TIMROTv1_TIMCTRLn_SELECT__32KHZ_XTAL : 278 BV_TIMROTv1_TIMCTRLn_SELECT__32KHZ_XTAL :
291 BV_TIMROTv2_TIMCTRLn_SELECT__32KHZ_XTAL) | 279 BV_TIMROTv2_TIMCTRLn_SELECT__TICK_ALWAYS) |
292 BM_TIMROT_TIMCTRLn_UPDATE | 280 BM_TIMROT_TIMCTRLn_UPDATE |
293 BM_TIMROT_TIMCTRLn_IRQ_EN, 281 BM_TIMROT_TIMCTRLn_IRQ_EN,
294 mxs_timrot_base + HW_TIMROT_TIMCTRLn(0)); 282 mxs_timrot_base + HW_TIMROT_TIMCTRLn(0));
@@ -296,7 +284,7 @@ void __init mxs_timer_init(void)
296 /* another for clocksource */ 284 /* another for clocksource */
297 __raw_writel((timrot_is_v1() ? 285 __raw_writel((timrot_is_v1() ?
298 BV_TIMROTv1_TIMCTRLn_SELECT__32KHZ_XTAL : 286 BV_TIMROTv1_TIMCTRLn_SELECT__32KHZ_XTAL :
299 BV_TIMROTv2_TIMCTRLn_SELECT__32KHZ_XTAL) | 287 BV_TIMROTv2_TIMCTRLn_SELECT__TICK_ALWAYS) |
300 BM_TIMROT_TIMCTRLn_RELOAD, 288 BM_TIMROT_TIMCTRLn_RELOAD,
301 mxs_timrot_base + HW_TIMROT_TIMCTRLn(1)); 289 mxs_timrot_base + HW_TIMROT_TIMCTRLn(1));
302 290
diff --git a/arch/arm/mach-netx/generic.c b/arch/arm/mach-netx/generic.c
index aa627465d914..27c2cb7ab813 100644
--- a/arch/arm/mach-netx/generic.c
+++ b/arch/arm/mach-netx/generic.c
@@ -23,9 +23,9 @@
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/irqchip/arm-vic.h>
26#include <mach/hardware.h> 27#include <mach/hardware.h>
27#include <asm/mach/map.h> 28#include <asm/mach/map.h>
28#include <asm/hardware/vic.h>
29#include <mach/netx-regs.h> 29#include <mach/netx-regs.h>
30#include <asm/mach/irq.h> 30#include <asm/mach/irq.h>
31 31
diff --git a/arch/arm/mach-netx/generic.h b/arch/arm/mach-netx/generic.h
index 9b915119b8d6..768b26bbb42b 100644
--- a/arch/arm/mach-netx/generic.h
+++ b/arch/arm/mach-netx/generic.h
@@ -21,5 +21,4 @@ extern void __init netx_map_io(void);
21extern void __init netx_init_irq(void); 21extern void __init netx_init_irq(void);
22extern void netx_restart(char, const char *); 22extern void netx_restart(char, const char *);
23 23
24struct sys_timer; 24extern void netx_timer_init(void);
25extern struct sys_timer netx_timer;
diff --git a/arch/arm/mach-netx/include/mach/uncompress.h b/arch/arm/mach-netx/include/mach/uncompress.h
index 84f91284f612..5cb1051b5831 100644
--- a/arch/arm/mach-netx/include/mach/uncompress.h
+++ b/arch/arm/mach-netx/include/mach/uncompress.h
@@ -73,4 +73,3 @@ static inline void flush(void)
73 * nothing to do 73 * nothing to do
74 */ 74 */
75#define arch_decomp_setup() 75#define arch_decomp_setup()
76#define arch_decomp_wdog()
diff --git a/arch/arm/mach-netx/nxdb500.c b/arch/arm/mach-netx/nxdb500.c
index 8b781ff7c9e9..9b558eb3070f 100644
--- a/arch/arm/mach-netx/nxdb500.c
+++ b/arch/arm/mach-netx/nxdb500.c
@@ -28,7 +28,6 @@
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <asm/mach-types.h> 29#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31#include <asm/hardware/vic.h>
32#include <mach/netx-regs.h> 31#include <mach/netx-regs.h>
33#include <linux/platform_data/eth-netx.h> 32#include <linux/platform_data/eth-netx.h>
34 33
@@ -204,8 +203,7 @@ MACHINE_START(NXDB500, "Hilscher nxdb500")
204 .atag_offset = 0x100, 203 .atag_offset = 0x100,
205 .map_io = netx_map_io, 204 .map_io = netx_map_io,
206 .init_irq = netx_init_irq, 205 .init_irq = netx_init_irq,
207 .handle_irq = vic_handle_irq, 206 .init_time = netx_timer_init,
208 .timer = &netx_timer,
209 .init_machine = nxdb500_init, 207 .init_machine = nxdb500_init,
210 .restart = netx_restart, 208 .restart = netx_restart,
211MACHINE_END 209MACHINE_END
diff --git a/arch/arm/mach-netx/nxdkn.c b/arch/arm/mach-netx/nxdkn.c
index b26dbce334f2..a5e86cd365e7 100644
--- a/arch/arm/mach-netx/nxdkn.c
+++ b/arch/arm/mach-netx/nxdkn.c
@@ -28,7 +28,6 @@
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <asm/mach-types.h> 29#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31#include <asm/hardware/vic.h>
32#include <mach/netx-regs.h> 31#include <mach/netx-regs.h>
33#include <linux/platform_data/eth-netx.h> 32#include <linux/platform_data/eth-netx.h>
34 33
@@ -97,8 +96,7 @@ MACHINE_START(NXDKN, "Hilscher nxdkn")
97 .atag_offset = 0x100, 96 .atag_offset = 0x100,
98 .map_io = netx_map_io, 97 .map_io = netx_map_io,
99 .init_irq = netx_init_irq, 98 .init_irq = netx_init_irq,
100 .handle_irq = vic_handle_irq, 99 .init_time = netx_timer_init,
101 .timer = &netx_timer,
102 .init_machine = nxdkn_init, 100 .init_machine = nxdkn_init,
103 .restart = netx_restart, 101 .restart = netx_restart,
104MACHINE_END 102MACHINE_END
diff --git a/arch/arm/mach-netx/nxeb500hmi.c b/arch/arm/mach-netx/nxeb500hmi.c
index 257382efafa0..ad17885d0159 100644
--- a/arch/arm/mach-netx/nxeb500hmi.c
+++ b/arch/arm/mach-netx/nxeb500hmi.c
@@ -28,7 +28,6 @@
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <asm/mach-types.h> 29#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31#include <asm/hardware/vic.h>
32#include <mach/netx-regs.h> 31#include <mach/netx-regs.h>
33#include <linux/platform_data/eth-netx.h> 32#include <linux/platform_data/eth-netx.h>
34 33
@@ -181,8 +180,7 @@ MACHINE_START(NXEB500HMI, "Hilscher nxeb500hmi")
181 .atag_offset = 0x100, 180 .atag_offset = 0x100,
182 .map_io = netx_map_io, 181 .map_io = netx_map_io,
183 .init_irq = netx_init_irq, 182 .init_irq = netx_init_irq,
184 .handle_irq = vic_handle_irq, 183 .init_time = netx_timer_init,
185 .timer = &netx_timer,
186 .init_machine = nxeb500hmi_init, 184 .init_machine = nxeb500hmi_init,
187 .restart = netx_restart, 185 .restart = netx_restart,
188MACHINE_END 186MACHINE_END
diff --git a/arch/arm/mach-netx/time.c b/arch/arm/mach-netx/time.c
index e24c141ba489..6df42e643031 100644
--- a/arch/arm/mach-netx/time.c
+++ b/arch/arm/mach-netx/time.c
@@ -76,7 +76,6 @@ static int netx_set_next_event(unsigned long evt,
76 76
77static struct clock_event_device netx_clockevent = { 77static struct clock_event_device netx_clockevent = {
78 .name = "netx-timer" __stringify(TIMER_CLOCKEVENT), 78 .name = "netx-timer" __stringify(TIMER_CLOCKEVENT),
79 .shift = 32,
80 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 79 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
81 .set_next_event = netx_set_next_event, 80 .set_next_event = netx_set_next_event,
82 .set_mode = netx_set_mode, 81 .set_mode = netx_set_mode,
@@ -107,7 +106,7 @@ static struct irqaction netx_timer_irq = {
107/* 106/*
108 * Set up timer interrupt 107 * Set up timer interrupt
109 */ 108 */
110static void __init netx_timer_init(void) 109void __init netx_timer_init(void)
111{ 110{
112 /* disable timer initially */ 111 /* disable timer initially */
113 writel(0, NETX_GPIO_COUNTER_CTRL(0)); 112 writel(0, NETX_GPIO_COUNTER_CTRL(0));
@@ -140,18 +139,9 @@ static void __init netx_timer_init(void)
140 clocksource_mmio_init(NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKSOURCE), 139 clocksource_mmio_init(NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKSOURCE),
141 "netx_timer", CLOCK_TICK_RATE, 200, 32, clocksource_mmio_readl_up); 140 "netx_timer", CLOCK_TICK_RATE, 200, 32, clocksource_mmio_readl_up);
142 141
143 netx_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC,
144 netx_clockevent.shift);
145 netx_clockevent.max_delta_ns =
146 clockevent_delta2ns(0xfffffffe, &netx_clockevent);
147 /* with max_delta_ns >= delta2ns(0x800) the system currently runs fine. 142 /* with max_delta_ns >= delta2ns(0x800) the system currently runs fine.
148 * Adding some safety ... */ 143 * Adding some safety ... */
149 netx_clockevent.min_delta_ns =
150 clockevent_delta2ns(0xa00, &netx_clockevent);
151 netx_clockevent.cpumask = cpumask_of(0); 144 netx_clockevent.cpumask = cpumask_of(0);
152 clockevents_register_device(&netx_clockevent); 145 clockevents_config_and_register(&netx_clockevent, CLOCK_TICK_RATE,
146 0xa00, 0xfffffffe);
153} 147}
154
155struct sys_timer netx_timer = {
156 .init = netx_timer_init,
157};
diff --git a/arch/arm/mach-nomadik/Kconfig b/arch/arm/mach-nomadik/Kconfig
index 706dc5727bbe..82226a5d60ef 100644
--- a/arch/arm/mach-nomadik/Kconfig
+++ b/arch/arm/mach-nomadik/Kconfig
@@ -4,19 +4,13 @@ menu "Nomadik boards"
4 4
5config MACH_NOMADIK_8815NHK 5config MACH_NOMADIK_8815NHK
6 bool "ST 8815 Nomadik Hardware Kit (evaluation board)" 6 bool "ST 8815 Nomadik Hardware Kit (evaluation board)"
7 select CLKSRC_NOMADIK_MTU
8 select NOMADIK_8815 7 select NOMADIK_8815
8 select I2C
9 select I2C_ALGOBIT
9 10
10endmenu 11endmenu
11 12
12config NOMADIK_8815 13config NOMADIK_8815
13 bool 14 bool
14 15
15config I2C_BITBANG_8815NHK
16 tristate "Driver for bit-bang busses found on the 8815 NHK"
17 depends on I2C && MACH_NOMADIK_8815NHK
18 depends on PINCTRL_NOMADIK
19 default y
20 select I2C_ALGOBIT
21
22endif 16endif
diff --git a/arch/arm/mach-nomadik/Makefile b/arch/arm/mach-nomadik/Makefile
index a42c9a33d3bf..1071c3b04d1a 100644
--- a/arch/arm/mach-nomadik/Makefile
+++ b/arch/arm/mach-nomadik/Makefile
@@ -9,9 +9,3 @@
9 9
10# Cpu revision 10# Cpu revision
11obj-$(CONFIG_NOMADIK_8815) += cpu-8815.o 11obj-$(CONFIG_NOMADIK_8815) += cpu-8815.o
12
13# Specific board support
14obj-$(CONFIG_MACH_NOMADIK_8815NHK) += board-nhk8815.o
15
16# Nomadik extra devices
17obj-$(CONFIG_I2C_BITBANG_8815NHK) += i2c-8815nhk.o
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c
deleted file mode 100644
index 9f19069248da..000000000000
--- a/arch/arm/mach-nomadik/board-nhk8815.c
+++ /dev/null
@@ -1,359 +0,0 @@
1/*
2 * linux/arch/arm/mach-nomadik/board-8815nhk.c
3 *
4 * Copyright (C) STMicroelectronics
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 * NHK15 board specifc driver definition
11 */
12#include <linux/types.h>
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/platform_device.h>
16#include <linux/amba/bus.h>
17#include <linux/amba/mmci.h>
18#include <linux/interrupt.h>
19#include <linux/gpio.h>
20#include <linux/mtd/mtd.h>
21#include <linux/mtd/nand.h>
22#include <linux/mtd/fsmc.h>
23#include <linux/mtd/onenand.h>
24#include <linux/mtd/partitions.h>
25#include <linux/i2c.h>
26#include <linux/io.h>
27#include <linux/pinctrl/machine.h>
28#include <linux/platform_data/pinctrl-nomadik.h>
29#include <linux/platform_data/clocksource-nomadik-mtu.h>
30#include <asm/hardware/vic.h>
31#include <asm/sizes.h>
32#include <asm/mach-types.h>
33#include <asm/mach/arch.h>
34#include <asm/mach/flash.h>
35#include <asm/mach/time.h>
36#include <mach/irqs.h>
37
38#include "cpu-8815.h"
39
40/* Initial value for SRC control register: all timers use MXTAL/8 source */
41#define SRC_CR_INIT_MASK 0x00007fff
42#define SRC_CR_INIT_VAL 0x2aaa8000
43
44#define ALE_OFF 0x1000000
45#define CLE_OFF 0x800000
46
47/* These addresses span 16MB, so use three individual pages */
48static struct resource nhk8815_nand_resources[] = {
49 {
50 .name = "nand_data",
51 .start = 0x40000000,
52 .end = 0x40000000 + SZ_16K - 1,
53 .flags = IORESOURCE_MEM,
54 }, {
55 .name = "nand_addr",
56 .start = 0x40000000 + ALE_OFF,
57 .end = 0x40000000 +ALE_OFF + SZ_16K - 1,
58 .flags = IORESOURCE_MEM,
59 }, {
60 .name = "nand_cmd",
61 .start = 0x40000000 + CLE_OFF,
62 .end = 0x40000000 + CLE_OFF + SZ_16K - 1,
63 .flags = IORESOURCE_MEM,
64 }, {
65 .name = "fsmc_regs",
66 .start = NOMADIK_FSMC_BASE,
67 .end = NOMADIK_FSMC_BASE + SZ_4K - 1,
68 .flags = IORESOURCE_MEM,
69 },
70};
71
72/*
73 * These partitions are the same as those used in the 2.6.20 release
74 * shipped by the vendor; the first two partitions are mandated
75 * by the boot ROM, and the bootloader area is somehow oversized...
76 */
77static struct mtd_partition nhk8815_partitions[] = {
78 {
79 .name = "X-Loader(NAND)",
80 .offset = 0,
81 .size = SZ_256K,
82 }, {
83 .name = "MemInit(NAND)",
84 .offset = MTDPART_OFS_APPEND,
85 .size = SZ_256K,
86 }, {
87 .name = "BootLoader(NAND)",
88 .offset = MTDPART_OFS_APPEND,
89 .size = SZ_2M,
90 }, {
91 .name = "Kernel zImage(NAND)",
92 .offset = MTDPART_OFS_APPEND,
93 .size = 3 * SZ_1M,
94 }, {
95 .name = "Root Filesystem(NAND)",
96 .offset = MTDPART_OFS_APPEND,
97 .size = 22 * SZ_1M,
98 }, {
99 .name = "User Filesystem(NAND)",
100 .offset = MTDPART_OFS_APPEND,
101 .size = MTDPART_SIZ_FULL,
102 }
103};
104
105static struct fsmc_nand_timings nhk8815_nand_timings = {
106 .thiz = 0,
107 .thold = 0x10,
108 .twait = 0x0A,
109 .tset = 0,
110};
111
112static struct fsmc_nand_platform_data nhk8815_nand_platform_data = {
113 .nand_timings = &nhk8815_nand_timings,
114 .partitions = nhk8815_partitions,
115 .nr_partitions = ARRAY_SIZE(nhk8815_partitions),
116 .width = FSMC_NAND_BW8,
117};
118
119static struct platform_device nhk8815_nand_device = {
120 .name = "fsmc-nand",
121 .id = -1,
122 .resource = nhk8815_nand_resources,
123 .num_resources = ARRAY_SIZE(nhk8815_nand_resources),
124 .dev = {
125 .platform_data = &nhk8815_nand_platform_data,
126 },
127};
128
129/* These are the partitions for the OneNand device, different from above */
130static struct mtd_partition nhk8815_onenand_partitions[] = {
131 {
132 .name = "X-Loader(OneNAND)",
133 .offset = 0,
134 .size = SZ_256K,
135 }, {
136 .name = "MemInit(OneNAND)",
137 .offset = MTDPART_OFS_APPEND,
138 .size = SZ_256K,
139 }, {
140 .name = "BootLoader(OneNAND)",
141 .offset = MTDPART_OFS_APPEND,
142 .size = SZ_2M-SZ_256K,
143 }, {
144 .name = "SysImage(OneNAND)",
145 .offset = MTDPART_OFS_APPEND,
146 .size = 4 * SZ_1M,
147 }, {
148 .name = "Root Filesystem(OneNAND)",
149 .offset = MTDPART_OFS_APPEND,
150 .size = 22 * SZ_1M,
151 }, {
152 .name = "User Filesystem(OneNAND)",
153 .offset = MTDPART_OFS_APPEND,
154 .size = MTDPART_SIZ_FULL,
155 }
156};
157
158static struct onenand_platform_data nhk8815_onenand_data = {
159 .parts = nhk8815_onenand_partitions,
160 .nr_parts = ARRAY_SIZE(nhk8815_onenand_partitions),
161};
162
163static struct resource nhk8815_onenand_resource[] = {
164 {
165 .start = 0x30000000,
166 .end = 0x30000000 + SZ_128K - 1,
167 .flags = IORESOURCE_MEM,
168 },
169};
170
171static struct platform_device nhk8815_onenand_device = {
172 .name = "onenand-flash",
173 .id = -1,
174 .dev = {
175 .platform_data = &nhk8815_onenand_data,
176 },
177 .resource = nhk8815_onenand_resource,
178 .num_resources = ARRAY_SIZE(nhk8815_onenand_resource),
179};
180
181/* bus control reg. and bus timing reg. for CS0..CS3 */
182#define FSMC_BCR(x) (NOMADIK_FSMC_VA + (x << 3))
183#define FSMC_BTR(x) (NOMADIK_FSMC_VA + (x << 3) + 0x04)
184
185static void __init nhk8815_onenand_init(void)
186{
187#ifdef CONFIG_MTD_ONENAND
188 /* Set up SMCS0 for OneNand */
189 writel(0x000030db, FSMC_BCR(0));
190 writel(0x02100551, FSMC_BTR(0));
191#endif
192}
193
194static struct mmci_platform_data mmcsd_plat_data = {
195 .ocr_mask = MMC_VDD_29_30,
196 .f_max = 48000000,
197 .gpio_wp = -1,
198 .gpio_cd = 111,
199 .cd_invert = true,
200 .capabilities = MMC_CAP_MMC_HIGHSPEED |
201 MMC_CAP_SD_HIGHSPEED | MMC_CAP_4_BIT_DATA,
202};
203
204static int __init nhk8815_mmcsd_init(void)
205{
206 int ret;
207
208 ret = gpio_request(112, "card detect bias");
209 if (ret)
210 return ret;
211 gpio_direction_output(112, 0);
212 amba_apb_device_add(NULL, "mmci", NOMADIK_SDI_BASE, SZ_4K, IRQ_SDMMC, 0, &mmcsd_plat_data, 0x10180180);
213 return 0;
214}
215module_init(nhk8815_mmcsd_init);
216
217static struct resource nhk8815_eth_resources[] = {
218 {
219 .name = "smc91x-regs",
220 .start = 0x34000000 + 0x300,
221 .end = 0x34000000 + SZ_64K - 1,
222 .flags = IORESOURCE_MEM,
223 }, {
224 .start = NOMADIK_GPIO_TO_IRQ(115),
225 .end = NOMADIK_GPIO_TO_IRQ(115),
226 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING,
227 }
228};
229
230static struct platform_device nhk8815_eth_device = {
231 .name = "smc91x",
232 .resource = nhk8815_eth_resources,
233 .num_resources = ARRAY_SIZE(nhk8815_eth_resources),
234};
235
236static int __init nhk8815_eth_init(void)
237{
238 int gpio_nr = 115; /* hardwired in the board */
239 int err;
240
241 err = gpio_request(gpio_nr, "eth_irq");
242 if (!err) err = nmk_gpio_set_mode(gpio_nr, NMK_GPIO_ALT_GPIO);
243 if (!err) err = gpio_direction_input(gpio_nr);
244 if (err)
245 pr_err("Error %i in %s\n", err, __func__);
246 return err;
247}
248device_initcall(nhk8815_eth_init);
249
250static struct platform_device *nhk8815_platform_devices[] __initdata = {
251 &nhk8815_nand_device,
252 &nhk8815_onenand_device,
253 &nhk8815_eth_device,
254 /* will add more devices */
255};
256
257static void __init nomadik_timer_init(void)
258{
259 u32 src_cr;
260
261 /* Configure timer sources in "system reset controller" ctrl reg */
262 src_cr = readl(io_p2v(NOMADIK_SRC_BASE));
263 src_cr &= SRC_CR_INIT_MASK;
264 src_cr |= SRC_CR_INIT_VAL;
265 writel(src_cr, io_p2v(NOMADIK_SRC_BASE));
266
267 nmdk_timer_init(io_p2v(NOMADIK_MTU0_BASE), IRQ_MTU0);
268}
269
270static struct sys_timer nomadik_timer = {
271 .init = nomadik_timer_init,
272};
273
274static struct i2c_board_info __initdata nhk8815_i2c0_devices[] = {
275 {
276 I2C_BOARD_INFO("stw4811", 0x2d),
277 },
278};
279
280static struct i2c_board_info __initdata nhk8815_i2c1_devices[] = {
281 {
282 I2C_BOARD_INFO("camera", 0x10),
283 },
284 {
285 I2C_BOARD_INFO("stw5095", 0x1a),
286 },
287 {
288 I2C_BOARD_INFO("lis3lv02dl", 0x1d),
289 },
290};
291
292static struct i2c_board_info __initdata nhk8815_i2c2_devices[] = {
293 {
294 I2C_BOARD_INFO("stw4811-usb", 0x2d),
295 },
296};
297
298static unsigned long out_low[] = { PIN_OUTPUT_LOW };
299static unsigned long out_high[] = { PIN_OUTPUT_HIGH };
300static unsigned long in_nopull[] = { PIN_INPUT_NOPULL };
301static unsigned long in_pullup[] = { PIN_INPUT_PULLUP };
302
303static struct pinctrl_map __initdata nhk8815_pinmap[] = {
304 PIN_MAP_MUX_GROUP_DEFAULT("uart0", "pinctrl-stn8815", "u0_a_1", "u0"),
305 PIN_MAP_MUX_GROUP_DEFAULT("uart1", "pinctrl-stn8815", "u1_a_1", "u1"),
306 /* Hog in MMC/SD card mux */
307 PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-stn8815", "mmcsd_a_1", "mmcsd"),
308 /* MCCLK */
309 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO8_B10", out_low),
310 /* MCCMD */
311 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO9_A10", in_pullup),
312 /* MCCMDDIR */
313 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO10_C11", out_high),
314 /* MCDAT3-0 */
315 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO11_B11", in_pullup),
316 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO12_A11", in_pullup),
317 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO13_C12", in_pullup),
318 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO14_B12", in_pullup),
319 /* MCDAT0DIR */
320 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO15_A12", out_high),
321 /* MCDAT31DIR */
322 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO16_C13", out_high),
323 /* MCMSFBCLK */
324 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO24_C15", in_pullup),
325 /* CD input GPIO */
326 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO111_H21", in_nopull),
327 /* CD bias drive */
328 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO112_J21", out_low),
329};
330
331static void __init nhk8815_platform_init(void)
332{
333 pinctrl_register_mappings(nhk8815_pinmap, ARRAY_SIZE(nhk8815_pinmap));
334 cpu8815_platform_init();
335 nhk8815_onenand_init();
336 platform_add_devices(nhk8815_platform_devices,
337 ARRAY_SIZE(nhk8815_platform_devices));
338
339 amba_apb_device_add(NULL, "uart0", NOMADIK_UART0_BASE, SZ_4K, IRQ_UART0, 0, NULL, 0);
340 amba_apb_device_add(NULL, "uart1", NOMADIK_UART1_BASE, SZ_4K, IRQ_UART1, 0, NULL, 0);
341
342 i2c_register_board_info(0, nhk8815_i2c0_devices,
343 ARRAY_SIZE(nhk8815_i2c0_devices));
344 i2c_register_board_info(1, nhk8815_i2c1_devices,
345 ARRAY_SIZE(nhk8815_i2c1_devices));
346 i2c_register_board_info(2, nhk8815_i2c2_devices,
347 ARRAY_SIZE(nhk8815_i2c2_devices));
348}
349
350MACHINE_START(NOMADIK, "NHK8815")
351 /* Maintainer: ST MicroElectronics */
352 .atag_offset = 0x100,
353 .map_io = cpu8815_map_io,
354 .init_irq = cpu8815_init_irq,
355 .handle_irq = vic_handle_irq,
356 .timer = &nomadik_timer,
357 .init_machine = nhk8815_platform_init,
358 .restart = cpu8815_restart,
359MACHINE_END
diff --git a/arch/arm/mach-nomadik/cpu-8815.c b/arch/arm/mach-nomadik/cpu-8815.c
index 1273931303fb..21c1aa512640 100644
--- a/arch/arm/mach-nomadik/cpu-8815.c
+++ b/arch/arm/mach-nomadik/cpu-8815.c
@@ -25,138 +25,308 @@
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/irq.h> 26#include <linux/irq.h>
27#include <linux/dma-mapping.h> 27#include <linux/dma-mapping.h>
28#include <linux/irqchip.h>
28#include <linux/platform_data/clk-nomadik.h> 29#include <linux/platform_data/clk-nomadik.h>
29#include <linux/platform_data/pinctrl-nomadik.h> 30#include <linux/platform_data/pinctrl-nomadik.h>
31#include <linux/pinctrl/machine.h>
32#include <linux/platform_data/clocksource-nomadik-mtu.h>
33#include <linux/of_irq.h>
34#include <linux/of_gpio.h>
35#include <linux/of_address.h>
36#include <linux/of_platform.h>
37#include <linux/mtd/fsmc.h>
38#include <linux/gpio.h>
39#include <linux/amba/mmci.h>
30 40
31#include <mach/hardware.h>
32#include <mach/irqs.h> 41#include <mach/irqs.h>
42#include <asm/mach/arch.h>
33#include <asm/mach/map.h> 43#include <asm/mach/map.h>
34#include <asm/hardware/vic.h> 44#include <asm/mach/time.h>
45#include <asm/mach-types.h>
35 46
36#include <asm/cacheflush.h> 47#include <asm/cacheflush.h>
37#include <asm/hardware/cache-l2x0.h> 48#include <asm/hardware/cache-l2x0.h>
38 49
39#include "cpu-8815.h" 50/*
51 * These are the only hard-coded address offsets we still have to use.
52 */
53#define NOMADIK_FSMC_BASE 0x10100000 /* FSMC registers */
54#define NOMADIK_SDRAMC_BASE 0x10110000 /* SDRAM Controller */
55#define NOMADIK_CLCDC_BASE 0x10120000 /* CLCD Controller */
56#define NOMADIK_MDIF_BASE 0x10120000 /* MDIF */
57#define NOMADIK_DMA0_BASE 0x10130000 /* DMA0 Controller */
58#define NOMADIK_IC_BASE 0x10140000 /* Vectored Irq Controller */
59#define NOMADIK_DMA1_BASE 0x10150000 /* DMA1 Controller */
60#define NOMADIK_USB_BASE 0x10170000 /* USB-OTG conf reg base */
61#define NOMADIK_CRYP_BASE 0x10180000 /* Crypto processor */
62#define NOMADIK_SHA1_BASE 0x10190000 /* SHA-1 Processor */
63#define NOMADIK_XTI_BASE 0x101A0000 /* XTI */
64#define NOMADIK_RNG_BASE 0x101B0000 /* Random number generator */
65#define NOMADIK_SRC_BASE 0x101E0000 /* SRC base */
66#define NOMADIK_WDOG_BASE 0x101E1000 /* Watchdog */
67#define NOMADIK_MTU0_BASE 0x101E2000 /* Multiple Timer 0 */
68#define NOMADIK_MTU1_BASE 0x101E3000 /* Multiple Timer 1 */
69#define NOMADIK_GPIO0_BASE 0x101E4000 /* GPIO0 */
70#define NOMADIK_GPIO1_BASE 0x101E5000 /* GPIO1 */
71#define NOMADIK_GPIO2_BASE 0x101E6000 /* GPIO2 */
72#define NOMADIK_GPIO3_BASE 0x101E7000 /* GPIO3 */
73#define NOMADIK_RTC_BASE 0x101E8000 /* Real Time Clock base */
74#define NOMADIK_PMU_BASE 0x101E9000 /* Power Management Unit */
75#define NOMADIK_OWM_BASE 0x101EA000 /* One wire master */
76#define NOMADIK_SCR_BASE 0x101EF000 /* Secure Control registers */
77#define NOMADIK_MSP2_BASE 0x101F0000 /* MSP 2 interface */
78#define NOMADIK_MSP1_BASE 0x101F1000 /* MSP 1 interface */
79#define NOMADIK_UART2_BASE 0x101F2000 /* UART 2 interface */
80#define NOMADIK_SSIRx_BASE 0x101F3000 /* SSI 8-ch rx interface */
81#define NOMADIK_SSITx_BASE 0x101F4000 /* SSI 8-ch tx interface */
82#define NOMADIK_MSHC_BASE 0x101F5000 /* Memory Stick(Pro) Host */
83#define NOMADIK_SDI_BASE 0x101F6000 /* SD-card/MM-Card */
84#define NOMADIK_I2C1_BASE 0x101F7000 /* I2C1 interface */
85#define NOMADIK_I2C0_BASE 0x101F8000 /* I2C0 interface */
86#define NOMADIK_MSP0_BASE 0x101F9000 /* MSP 0 interface */
87#define NOMADIK_FIRDA_BASE 0x101FA000 /* FIrDA interface */
88#define NOMADIK_UART1_BASE 0x101FB000 /* UART 1 interface */
89#define NOMADIK_SSP_BASE 0x101FC000 /* SSP interface */
90#define NOMADIK_UART0_BASE 0x101FD000 /* UART 0 interface */
91#define NOMADIK_SGA_BASE 0x101FE000 /* SGA interface */
92#define NOMADIK_L2CC_BASE 0x10210000 /* L2 Cache controller */
93#define NOMADIK_UART1_VBASE 0xF01FB000
40 94
41/* The 8815 has 4 GPIO blocks, let's register them immediately */ 95static unsigned long out_low[] = { PIN_OUTPUT_LOW };
42static resource_size_t __initdata cpu8815_gpio_base[] = { 96static unsigned long out_high[] = { PIN_OUTPUT_HIGH };
43 NOMADIK_GPIO0_BASE, 97static unsigned long in_nopull[] = { PIN_INPUT_NOPULL };
44 NOMADIK_GPIO1_BASE, 98static unsigned long in_pullup[] = { PIN_INPUT_PULLUP };
45 NOMADIK_GPIO2_BASE, 99
46 NOMADIK_GPIO3_BASE, 100static struct pinctrl_map __initdata nhk8815_pinmap[] = {
101 PIN_MAP_MUX_GROUP_DEFAULT("uart0", "pinctrl-stn8815", "u0_a_1", "u0"),
102 PIN_MAP_MUX_GROUP_DEFAULT("uart1", "pinctrl-stn8815", "u1_a_1", "u1"),
103 /* Hog in MMC/SD card mux */
104 PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-stn8815", "mmcsd_a_1", "mmcsd"),
105 /* MCCLK */
106 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO8_B10", out_low),
107 /* MCCMD */
108 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO9_A10", in_pullup),
109 /* MCCMDDIR */
110 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO10_C11", out_high),
111 /* MCDAT3-0 */
112 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO11_B11", in_pullup),
113 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO12_A11", in_pullup),
114 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO13_C12", in_pullup),
115 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO14_B12", in_pullup),
116 /* MCDAT0DIR */
117 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO15_A12", out_high),
118 /* MCDAT31DIR */
119 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO16_C13", out_high),
120 /* MCMSFBCLK */
121 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO24_C15", in_pullup),
122 /* CD input GPIO */
123 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO111_H21", in_nopull),
124 /* CD bias drive */
125 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO112_J21", out_low),
126 /* I2C0 */
127 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO62_D3", in_pullup),
128 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO63_D2", in_pullup),
129 /* I2C1 */
130 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO53_L4", in_pullup),
131 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO54_L3", in_pullup),
132 /* I2C2 */
133 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO73_C21", in_pullup),
134 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO74_C20", in_pullup),
47}; 135};
48 136
49static struct platform_device * 137/* This is needed for LL-debug/earlyprintk/debug-macro.S */
50cpu8815_add_gpio(int id, resource_size_t addr, int irq, 138static struct map_desc cpu8815_io_desc[] __initdata = {
51 struct nmk_gpio_platform_data *pdata) 139 {
140 .virtual = NOMADIK_UART1_VBASE,
141 .pfn = __phys_to_pfn(NOMADIK_UART1_BASE),
142 .length = SZ_4K,
143 .type = MT_DEVICE,
144 },
145};
146
147static void __init cpu8815_map_io(void)
52{ 148{
53 struct resource resources[] = { 149 iotable_init(cpu8815_io_desc, ARRAY_SIZE(cpu8815_io_desc));
54 {
55 .start = addr,
56 .end = addr + 127,
57 .flags = IORESOURCE_MEM,
58 },
59 {
60 .start = irq,
61 .end = irq,
62 .flags = IORESOURCE_IRQ,
63 }
64 };
65
66 return platform_device_register_resndata(NULL, "gpio", id,
67 resources, ARRAY_SIZE(resources),
68 pdata, sizeof(*pdata));
69} 150}
70 151
71void cpu8815_add_gpios(resource_size_t *base, int num, int irq, 152static void cpu8815_restart(char mode, const char *cmd)
72 struct nmk_gpio_platform_data *pdata)
73{ 153{
74 int first = 0; 154 void __iomem *srcbase = ioremap(NOMADIK_SRC_BASE, SZ_4K);
75 int i;
76 155
77 for (i = 0; i < num; i++, first += 32, irq++) { 156 /* FIXME: use egpio when implemented */
78 pdata->first_gpio = first;
79 pdata->first_irq = NOMADIK_GPIO_TO_IRQ(first);
80 pdata->num_gpio = 32;
81 157
82 cpu8815_add_gpio(i, base[i], irq, pdata); 158 /* Write anything to Reset status register */
83 } 159 writel(1, srcbase + 0x18);
84} 160}
85 161
86static inline void 162/* Initial value for SRC control register: all timers use MXTAL/8 source */
87cpu8815_add_pinctrl(struct device *parent, const char *name) 163#define SRC_CR_INIT_MASK 0x00007fff
164#define SRC_CR_INIT_VAL 0x2aaa8000
165
166static void __init cpu8815_timer_init_of(void)
88{ 167{
89 struct platform_device_info pdevinfo = { 168 struct device_node *mtu;
90 .parent = parent, 169 void __iomem *base;
91 .name = name, 170 int irq;
92 .id = -1, 171 u32 src_cr;
93 }; 172
173 /* We need this to be up now */
174 nomadik_clk_init();
175
176 mtu = of_find_node_by_path("/mtu0");
177 if (!mtu)
178 return;
179 base = of_iomap(mtu, 0);
180 if (WARN_ON(!base))
181 return;
182 irq = irq_of_parse_and_map(mtu, 0);
94 183
95 platform_device_register_full(&pdevinfo); 184 pr_info("Remapped MTU @ %p, irq: %d\n", base, irq);
185
186 /* Configure timer sources in "system reset controller" ctrl reg */
187 src_cr = readl(base);
188 src_cr &= SRC_CR_INIT_MASK;
189 src_cr |= SRC_CR_INIT_VAL;
190 writel(src_cr, base);
191
192 nmdk_timer_init(base, irq);
96} 193}
97 194
98static int __init cpu8815_init(void) 195static struct fsmc_nand_timings cpu8815_nand_timings = {
196 .thiz = 0,
197 .thold = 0x10,
198 .twait = 0x0A,
199 .tset = 0,
200};
201
202static struct fsmc_nand_platform_data cpu8815_nand_data = {
203 .nand_timings = &cpu8815_nand_timings,
204};
205
206/*
207 * The SMSC911x IRQ is connected to a GPIO pin, but the driver expects
208 * to simply request an IRQ passed as a resource. So the GPIO pin needs
209 * to be requested by this hog and set as input.
210 */
211static int __init cpu8815_eth_init(void)
99{ 212{
100 struct nmk_gpio_platform_data pdata = { 213 struct device_node *eth;
101 /* No custom data yet */ 214 int gpio, irq, err;
102 }; 215
103 216 eth = of_find_node_by_path("/usb-s8815/ethernet-gpio");
104 cpu8815_add_gpios(cpu8815_gpio_base, ARRAY_SIZE(cpu8815_gpio_base), 217 if (!eth) {
105 IRQ_GPIO0, &pdata); 218 pr_info("could not find any ethernet GPIO\n");
106 cpu8815_add_pinctrl(NULL, "pinctrl-stn8815"); 219 return 0;
107 amba_apb_device_add(NULL, "rng", NOMADIK_RNG_BASE, SZ_4K, 0, 0, NULL, 0); 220 }
108 amba_apb_device_add(NULL, "rtc-pl031", NOMADIK_RTC_BASE, SZ_4K, IRQ_RTC_RTT, 0, NULL, 0); 221 gpio = of_get_gpio(eth, 0);
222 err = gpio_request(gpio, "eth_irq");
223 if (err) {
224 pr_info("failed to request ethernet GPIO\n");
225 return -ENODEV;
226 }
227 err = gpio_direction_input(gpio);
228 if (err) {
229 pr_info("failed to set ethernet GPIO as input\n");
230 return -ENODEV;
231 }
232 irq = gpio_to_irq(gpio);
233 pr_info("enabled USB-S8815 ethernet GPIO %d, IRQ %d\n", gpio, irq);
109 return 0; 234 return 0;
110} 235}
111arch_initcall(cpu8815_init); 236device_initcall(cpu8815_eth_init);
112 237
113/* All SoC devices live in the same area (see hardware.h) */ 238/*
114static struct map_desc nomadik_io_desc[] __initdata = { 239 * TODO:
115 { 240 * cannot be set from device tree, convert to a proper DT
116 .virtual = NOMADIK_IO_VIRTUAL, 241 * binding.
117 .pfn = __phys_to_pfn(NOMADIK_IO_PHYSICAL), 242 */
118 .length = NOMADIK_IO_SIZE, 243static struct mmci_platform_data mmcsd_plat_data = {
119 .type = MT_DEVICE, 244 .ocr_mask = MMC_VDD_29_30,
120 }
121 /* static ram and secured ram may be added later */
122}; 245};
123 246
124void __init cpu8815_map_io(void) 247/*
248 * This GPIO pin turns on a line that is used to detect card insertion
249 * on this board.
250 */
251static int __init cpu8815_mmcsd_init(void)
125{ 252{
126 iotable_init(nomadik_io_desc, ARRAY_SIZE(nomadik_io_desc)); 253 struct device_node *cdbias;
127} 254 int gpio, err;
128 255
129void __init cpu8815_init_irq(void) 256 cdbias = of_find_node_by_path("/usb-s8815/mmcsd-gpio");
130{ 257 if (!cdbias) {
131 /* This modified VIC cell has two register blocks, at 0 and 0x20 */ 258 pr_info("could not find MMC/SD card detect bias node\n");
132 vic_init(io_p2v(NOMADIK_IC_BASE + 0x00), IRQ_VIC_START + 0, ~0, 0); 259 return 0;
133 vic_init(io_p2v(NOMADIK_IC_BASE + 0x20), IRQ_VIC_START + 32, ~0, 0); 260 }
134 261 gpio = of_get_gpio(cdbias, 0);
135 /* 262 if (gpio < 0) {
136 * Init clocks here so that they are available for system timer 263 pr_info("could not obtain MMC/SD card detect bias GPIO\n");
137 * initialization. 264 return 0;
138 */ 265 }
139 nomadik_clk_init(); 266 err = gpio_request(gpio, "card detect bias");
267 if (err) {
268 pr_info("failed to request card detect bias GPIO %d\n", gpio);
269 return -ENODEV;
270 }
271 err = gpio_direction_output(gpio, 0);
272 if (err){
273 pr_info("failed to set GPIO %d as output, low\n", gpio);
274 return err;
275 }
276 pr_info("enabled USB-S8815 CD bias GPIO %d, low\n", gpio);
277 return 0;
140} 278}
279device_initcall(cpu8815_mmcsd_init);
141 280
142/* 281
143 * This function is called from the board init ("init_machine"). 282/* These are mostly to get the right device names for the clock lookups */
144 */ 283static struct of_dev_auxdata cpu8815_auxdata_lookup[] __initdata = {
145 void __init cpu8815_platform_init(void) 284 OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO0_BASE,
285 "gpio.0", NULL),
286 OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO1_BASE,
287 "gpio.1", NULL),
288 OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO2_BASE,
289 "gpio.2", NULL),
290 OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO3_BASE,
291 "gpio.3", NULL),
292 OF_DEV_AUXDATA("stericsson,nmk-pinctrl-stn8815", 0,
293 "pinctrl-stn8815", NULL),
294 OF_DEV_AUXDATA("arm,primecell", NOMADIK_UART0_BASE,
295 "uart0", NULL),
296 OF_DEV_AUXDATA("arm,primecell", NOMADIK_UART1_BASE,
297 "uart1", NULL),
298 OF_DEV_AUXDATA("arm,primecell", NOMADIK_RNG_BASE,
299 "rng", NULL),
300 OF_DEV_AUXDATA("arm,primecell", NOMADIK_RTC_BASE,
301 "rtc-pl031", NULL),
302 OF_DEV_AUXDATA("stericsson,fsmc-nand", NOMADIK_FSMC_BASE,
303 "fsmc-nand", &cpu8815_nand_data),
304 OF_DEV_AUXDATA("arm,primecell", NOMADIK_SDI_BASE,
305 "mmci", &mmcsd_plat_data),
306 { /* sentinel */ },
307};
308
309static void __init cpu8815_init_of(void)
146{ 310{
147#ifdef CONFIG_CACHE_L2X0 311#ifdef CONFIG_CACHE_L2X0
148 /* At full speed latency must be >=2, so 0x249 in low bits */ 312 /* At full speed latency must be >=2, so 0x249 in low bits */
149 l2x0_init(io_p2v(NOMADIK_L2CC_BASE), 0x00730249, 0xfe000fff); 313 l2x0_of_init(0x00730249, 0xfe000fff);
150#endif 314#endif
151 return; 315 pinctrl_register_mappings(nhk8815_pinmap, ARRAY_SIZE(nhk8815_pinmap));
316 of_platform_populate(NULL, of_default_bus_match_table,
317 cpu8815_auxdata_lookup, NULL);
152} 318}
153 319
154void cpu8815_restart(char mode, const char *cmd) 320static const char * cpu8815_board_compat[] = {
155{ 321 "calaosystems,usb-s8815",
156 void __iomem *src_rstsr = io_p2v(NOMADIK_SRC_BASE + 0x18); 322 NULL,
157 323};
158 /* FIXME: use egpio when implemented */
159 324
160 /* Write anything to Reset status register */ 325DT_MACHINE_START(NOMADIK_DT, "Nomadik STn8815")
161 writel(1, src_rstsr); 326 .map_io = cpu8815_map_io,
162} 327 .init_irq = irqchip_init,
328 .init_time = cpu8815_timer_init_of,
329 .init_machine = cpu8815_init_of,
330 .restart = cpu8815_restart,
331 .dt_compat = cpu8815_board_compat,
332MACHINE_END
diff --git a/arch/arm/mach-nomadik/cpu-8815.h b/arch/arm/mach-nomadik/cpu-8815.h
deleted file mode 100644
index 71c21e8a11dc..000000000000
--- a/arch/arm/mach-nomadik/cpu-8815.h
+++ /dev/null
@@ -1,4 +0,0 @@
1extern void cpu8815_map_io(void);
2extern void cpu8815_platform_init(void);
3extern void cpu8815_init_irq(void);
4extern void cpu8815_restart(char, const char *);
diff --git a/arch/arm/mach-nomadik/i2c-8815nhk.c b/arch/arm/mach-nomadik/i2c-8815nhk.c
deleted file mode 100644
index 0c2f6628299a..000000000000
--- a/arch/arm/mach-nomadik/i2c-8815nhk.c
+++ /dev/null
@@ -1,88 +0,0 @@
1#include <linux/module.h>
2#include <linux/init.h>
3#include <linux/i2c.h>
4#include <linux/i2c-algo-bit.h>
5#include <linux/i2c-gpio.h>
6#include <linux/platform_device.h>
7#include <linux/platform_data/pinctrl-nomadik.h>
8
9/*
10 * There are two busses in the 8815NHK.
11 * They could, in theory, be driven by the hardware component, but we
12 * use bit-bang through GPIO by now, to keep things simple
13 */
14
15/* I2C0 connected to the STw4811 power management chip */
16static struct i2c_gpio_platform_data nhk8815_i2c_data0 = {
17 /* keep defaults for timeouts; pins are push-pull bidirectional */
18 .scl_pin = 62,
19 .sda_pin = 63,
20};
21
22/* I2C1 connected to various sensors */
23static struct i2c_gpio_platform_data nhk8815_i2c_data1 = {
24 /* keep defaults for timeouts; pins are push-pull bidirectional */
25 .scl_pin = 53,
26 .sda_pin = 54,
27};
28
29/* I2C2 connected to the USB portions of the STw4811 only */
30static struct i2c_gpio_platform_data nhk8815_i2c_data2 = {
31 /* keep defaults for timeouts; pins are push-pull bidirectional */
32 .scl_pin = 73,
33 .sda_pin = 74,
34};
35
36static struct platform_device nhk8815_i2c_dev0 = {
37 .name = "i2c-gpio",
38 .id = 0,
39 .dev = {
40 .platform_data = &nhk8815_i2c_data0,
41 },
42};
43
44static struct platform_device nhk8815_i2c_dev1 = {
45 .name = "i2c-gpio",
46 .id = 1,
47 .dev = {
48 .platform_data = &nhk8815_i2c_data1,
49 },
50};
51
52static struct platform_device nhk8815_i2c_dev2 = {
53 .name = "i2c-gpio",
54 .id = 2,
55 .dev = {
56 .platform_data = &nhk8815_i2c_data2,
57 },
58};
59
60static pin_cfg_t cpu8815_pins_i2c[] = {
61 PIN_CFG_INPUT(62, GPIO, PULLUP),
62 PIN_CFG_INPUT(63, GPIO, PULLUP),
63 PIN_CFG_INPUT(53, GPIO, PULLUP),
64 PIN_CFG_INPUT(54, GPIO, PULLUP),
65 PIN_CFG_INPUT(73, GPIO, PULLUP),
66 PIN_CFG_INPUT(74, GPIO, PULLUP),
67};
68
69static int __init nhk8815_i2c_init(void)
70{
71 nmk_config_pins(cpu8815_pins_i2c, ARRAY_SIZE(cpu8815_pins_i2c));
72 platform_device_register(&nhk8815_i2c_dev0);
73 platform_device_register(&nhk8815_i2c_dev1);
74 platform_device_register(&nhk8815_i2c_dev2);
75
76 return 0;
77}
78
79static void __exit nhk8815_i2c_exit(void)
80{
81 platform_device_unregister(&nhk8815_i2c_dev0);
82 platform_device_unregister(&nhk8815_i2c_dev1);
83 platform_device_unregister(&nhk8815_i2c_dev2);
84 return;
85}
86
87module_init(nhk8815_i2c_init);
88module_exit(nhk8815_i2c_exit);
diff --git a/arch/arm/mach-nomadik/include/mach/hardware.h b/arch/arm/mach-nomadik/include/mach/hardware.h
deleted file mode 100644
index 02035e459f50..000000000000
--- a/arch/arm/mach-nomadik/include/mach/hardware.h
+++ /dev/null
@@ -1,90 +0,0 @@
1/*
2 * This file contains the hardware definitions of the Nomadik.
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 * YOU should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18#ifndef __ASM_ARCH_HARDWARE_H
19#define __ASM_ARCH_HARDWARE_H
20
21/* Nomadik registers live from 0x1000.0000 to 0x1023.0000 -- currently */
22#define NOMADIK_IO_VIRTUAL 0xF0000000 /* VA of IO */
23#define NOMADIK_IO_PHYSICAL 0x10000000 /* PA of IO */
24#define NOMADIK_IO_SIZE 0x00300000 /* 3MB for all regs */
25
26/* used in C code, so cast to proper type */
27#define io_p2v(x) ((void __iomem *)(x) \
28 - NOMADIK_IO_PHYSICAL + NOMADIK_IO_VIRTUAL)
29#define io_v2p(x) ((unsigned long)(x) \
30 - NOMADIK_IO_VIRTUAL + NOMADIK_IO_PHYSICAL)
31
32/* used in asm code, so no casts */
33#define IO_ADDRESS(x) IOMEM((x) - NOMADIK_IO_PHYSICAL + NOMADIK_IO_VIRTUAL)
34
35/*
36 * Base address defination for Nomadik Onchip Logic Block
37 */
38#define NOMADIK_FSMC_BASE 0x10100000 /* FSMC registers */
39#define NOMADIK_SDRAMC_BASE 0x10110000 /* SDRAM Controller */
40#define NOMADIK_CLCDC_BASE 0x10120000 /* CLCD Controller */
41#define NOMADIK_MDIF_BASE 0x10120000 /* MDIF */
42#define NOMADIK_DMA0_BASE 0x10130000 /* DMA0 Controller */
43#define NOMADIK_IC_BASE 0x10140000 /* Vectored Irq Controller */
44#define NOMADIK_DMA1_BASE 0x10150000 /* DMA1 Controller */
45#define NOMADIK_USB_BASE 0x10170000 /* USB-OTG conf reg base */
46#define NOMADIK_CRYP_BASE 0x10180000 /* Crypto processor */
47#define NOMADIK_SHA1_BASE 0x10190000 /* SHA-1 Processor */
48#define NOMADIK_XTI_BASE 0x101A0000 /* XTI */
49#define NOMADIK_RNG_BASE 0x101B0000 /* Random number generator */
50#define NOMADIK_SRC_BASE 0x101E0000 /* SRC base */
51#define NOMADIK_WDOG_BASE 0x101E1000 /* Watchdog */
52#define NOMADIK_MTU0_BASE 0x101E2000 /* Multiple Timer 0 */
53#define NOMADIK_MTU1_BASE 0x101E3000 /* Multiple Timer 1 */
54#define NOMADIK_GPIO0_BASE 0x101E4000 /* GPIO0 */
55#define NOMADIK_GPIO1_BASE 0x101E5000 /* GPIO1 */
56#define NOMADIK_GPIO2_BASE 0x101E6000 /* GPIO2 */
57#define NOMADIK_GPIO3_BASE 0x101E7000 /* GPIO3 */
58#define NOMADIK_RTC_BASE 0x101E8000 /* Real Time Clock base */
59#define NOMADIK_PMU_BASE 0x101E9000 /* Power Management Unit */
60#define NOMADIK_OWM_BASE 0x101EA000 /* One wire master */
61#define NOMADIK_SCR_BASE 0x101EF000 /* Secure Control registers */
62#define NOMADIK_MSP2_BASE 0x101F0000 /* MSP 2 interface */
63#define NOMADIK_MSP1_BASE 0x101F1000 /* MSP 1 interface */
64#define NOMADIK_UART2_BASE 0x101F2000 /* UART 2 interface */
65#define NOMADIK_SSIRx_BASE 0x101F3000 /* SSI 8-ch rx interface */
66#define NOMADIK_SSITx_BASE 0x101F4000 /* SSI 8-ch tx interface */
67#define NOMADIK_MSHC_BASE 0x101F5000 /* Memory Stick(Pro) Host */
68#define NOMADIK_SDI_BASE 0x101F6000 /* SD-card/MM-Card */
69#define NOMADIK_I2C1_BASE 0x101F7000 /* I2C1 interface */
70#define NOMADIK_I2C0_BASE 0x101F8000 /* I2C0 interface */
71#define NOMADIK_MSP0_BASE 0x101F9000 /* MSP 0 interface */
72#define NOMADIK_FIRDA_BASE 0x101FA000 /* FIrDA interface */
73#define NOMADIK_UART1_BASE 0x101FB000 /* UART 1 interface */
74#define NOMADIK_SSP_BASE 0x101FC000 /* SSP interface */
75#define NOMADIK_UART0_BASE 0x101FD000 /* UART 0 interface */
76#define NOMADIK_SGA_BASE 0x101FE000 /* SGA interface */
77#define NOMADIK_L2CC_BASE 0x10210000 /* L2 Cache controller */
78
79/* Other ranges, not for p2v/v2p */
80#define NOMADIK_BACKUP_RAM 0x80010000
81#define NOMADIK_EBROM 0x80000000 /* Embedded boot ROM */
82#define NOMADIK_HAMACV_DMEM_BASE 0xA0100000 /* HAMACV Data Memory Start */
83#define NOMADIK_HAMACV_DMEM_END 0xA01FFFFF /* HAMACV Data Memory End */
84#define NOMADIK_HAMACA_DMEM 0xA0200000 /* HAMACA Data Memory Space */
85
86#define NOMADIK_FSMC_VA IO_ADDRESS(NOMADIK_FSMC_BASE)
87#define NOMADIK_MTU0_VA IO_ADDRESS(NOMADIK_MTU0_BASE)
88#define NOMADIK_MTU1_VA IO_ADDRESS(NOMADIK_MTU1_BASE)
89
90#endif /* __ASM_ARCH_HARDWARE_H */
diff --git a/arch/arm/mach-nomadik/include/mach/irqs.h b/arch/arm/mach-nomadik/include/mach/irqs.h
index 215f8cdb4004..90ac965a92fe 100644
--- a/arch/arm/mach-nomadik/include/mach/irqs.h
+++ b/arch/arm/mach-nomadik/include/mach/irqs.h
@@ -20,8 +20,6 @@
20#ifndef __ASM_ARCH_IRQS_H 20#ifndef __ASM_ARCH_IRQS_H
21#define __ASM_ARCH_IRQS_H 21#define __ASM_ARCH_IRQS_H
22 22
23#include <mach/hardware.h>
24
25#define IRQ_VIC_START 32 /* first VIC interrupt is 1 */ 23#define IRQ_VIC_START 32 /* first VIC interrupt is 1 */
26 24
27/* 25/*
diff --git a/arch/arm/mach-nomadik/include/mach/uncompress.h b/arch/arm/mach-nomadik/include/mach/uncompress.h
index 7d4687e9cbdf..106fccca2021 100644
--- a/arch/arm/mach-nomadik/include/mach/uncompress.h
+++ b/arch/arm/mach-nomadik/include/mach/uncompress.h
@@ -21,7 +21,6 @@
21 21
22#include <asm/setup.h> 22#include <asm/setup.h>
23#include <asm/io.h> 23#include <asm/io.h>
24#include <mach/hardware.h>
25 24
26/* we need the constants in amba/serial.h, but it refers to amba_device */ 25/* we need the constants in amba/serial.h, but it refers to amba_device */
27struct amba_device; 26struct amba_device;
@@ -58,6 +57,4 @@ static inline void arch_decomp_setup(void)
58{ 57{
59} 58}
60 59
61#define arch_decomp_wdog() /* nothing to do here */
62
63#endif /* __ASM_ARCH_UNCOMPRESS_H */ 60#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index 2e98a3ac7c5e..2aab761ee68d 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -628,6 +628,6 @@ MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)")
628 .init_irq = omap1_init_irq, 628 .init_irq = omap1_init_irq,
629 .init_machine = ams_delta_init, 629 .init_machine = ams_delta_init,
630 .init_late = ams_delta_init_late, 630 .init_late = ams_delta_init_late,
631 .timer = &omap1_timer, 631 .init_time = omap1_timer_init,
632 .restart = omap1_restart, 632 .restart = omap1_restart,
633MACHINE_END 633MACHINE_END
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index 560a7dcf0a56..702d58039cc1 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -364,6 +364,6 @@ MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample")
364 .init_irq = omap1_init_irq, 364 .init_irq = omap1_init_irq,
365 .init_machine = omap_fsample_init, 365 .init_machine = omap_fsample_init,
366 .init_late = omap1_init_late, 366 .init_late = omap1_init_late,
367 .timer = &omap1_timer, 367 .init_time = omap1_timer_init,
368 .restart = omap1_restart, 368 .restart = omap1_restart,
369MACHINE_END 369MACHINE_END
diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c
index 608e7d2a2778..e1d9171774bc 100644
--- a/arch/arm/mach-omap1/board-generic.c
+++ b/arch/arm/mach-omap1/board-generic.c
@@ -84,6 +84,6 @@ MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710")
84 .init_irq = omap1_init_irq, 84 .init_irq = omap1_init_irq,
85 .init_machine = omap_generic_init, 85 .init_machine = omap_generic_init,
86 .init_late = omap1_init_late, 86 .init_late = omap1_init_late,
87 .timer = &omap1_timer, 87 .init_time = omap1_timer_init,
88 .restart = omap1_restart, 88 .restart = omap1_restart,
89MACHINE_END 89MACHINE_END
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index 2274bd677efc..0dac3d239e32 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -461,6 +461,6 @@ MACHINE_START(OMAP_H2, "TI-H2")
461 .init_irq = omap1_init_irq, 461 .init_irq = omap1_init_irq,
462 .init_machine = h2_init, 462 .init_machine = h2_init,
463 .init_late = omap1_init_late, 463 .init_late = omap1_init_late,
464 .timer = &omap1_timer, 464 .init_time = omap1_timer_init,
465 .restart = omap1_restart, 465 .restart = omap1_restart,
466MACHINE_END 466MACHINE_END
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index 1051935f0aac..816ecd13f81e 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -454,6 +454,6 @@ MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board")
454 .init_irq = omap1_init_irq, 454 .init_irq = omap1_init_irq,
455 .init_machine = h3_init, 455 .init_machine = h3_init,
456 .init_late = omap1_init_late, 456 .init_late = omap1_init_late,
457 .timer = &omap1_timer, 457 .init_time = omap1_timer_init,
458 .restart = omap1_restart, 458 .restart = omap1_restart,
459MACHINE_END 459MACHINE_END
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c
index 356f816c84a6..35a2379b986f 100644
--- a/arch/arm/mach-omap1/board-htcherald.c
+++ b/arch/arm/mach-omap1/board-htcherald.c
@@ -603,6 +603,6 @@ MACHINE_START(HERALD, "HTC Herald")
603 .init_irq = omap1_init_irq, 603 .init_irq = omap1_init_irq,
604 .init_machine = htcherald_init, 604 .init_machine = htcherald_init,
605 .init_late = omap1_init_late, 605 .init_late = omap1_init_late,
606 .timer = &omap1_timer, 606 .init_time = omap1_timer_init,
607 .restart = omap1_restart, 607 .restart = omap1_restart,
608MACHINE_END 608MACHINE_END
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index f8033fab0f82..bd5f02e9c354 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -458,6 +458,6 @@ MACHINE_START(OMAP_INNOVATOR, "TI-Innovator")
458 .init_irq = omap1_init_irq, 458 .init_irq = omap1_init_irq,
459 .init_machine = innovator_init, 459 .init_machine = innovator_init,
460 .init_late = omap1_init_late, 460 .init_late = omap1_init_late,
461 .timer = &omap1_timer, 461 .init_time = omap1_timer_init,
462 .restart = omap1_restart, 462 .restart = omap1_restart,
463MACHINE_END 463MACHINE_END
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 24d2f2df11a0..62a15e289c79 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -7,6 +7,7 @@
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
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#include <linux/irq.h>
10#include <linux/gpio.h> 11#include <linux/gpio.h>
11#include <linux/kernel.h> 12#include <linux/kernel.h>
12#include <linux/init.h> 13#include <linux/init.h>
@@ -23,6 +24,8 @@
23 24
24#include <linux/platform_data/keypad-omap.h> 25#include <linux/platform_data/keypad-omap.h>
25#include <linux/platform_data/lcd-mipid.h> 26#include <linux/platform_data/lcd-mipid.h>
27#include <linux/platform_data/gpio-omap.h>
28#include <linux/platform_data/i2c-cbus-gpio.h>
26 29
27#include <asm/mach-types.h> 30#include <asm/mach-types.h>
28#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
@@ -212,6 +215,45 @@ static inline void nokia770_mmc_init(void)
212} 215}
213#endif 216#endif
214 217
218#if defined(CONFIG_I2C_CBUS_GPIO) || defined(CONFIG_I2C_CBUS_GPIO_MODULE)
219static struct i2c_cbus_platform_data nokia770_cbus_data = {
220 .clk_gpio = OMAP_MPUIO(9),
221 .dat_gpio = OMAP_MPUIO(10),
222 .sel_gpio = OMAP_MPUIO(11),
223};
224
225static struct platform_device nokia770_cbus_device = {
226 .name = "i2c-cbus-gpio",
227 .id = 2,
228 .dev = {
229 .platform_data = &nokia770_cbus_data,
230 },
231};
232
233static struct i2c_board_info nokia770_i2c_board_info_2[] __initdata = {
234 {
235 I2C_BOARD_INFO("retu-mfd", 0x01),
236 },
237};
238
239static void __init nokia770_cbus_init(void)
240{
241 const int retu_irq_gpio = 62;
242
243 if (gpio_request_one(retu_irq_gpio, GPIOF_IN, "Retu IRQ"))
244 return;
245 irq_set_irq_type(gpio_to_irq(retu_irq_gpio), IRQ_TYPE_EDGE_RISING);
246 nokia770_i2c_board_info_2[0].irq = gpio_to_irq(retu_irq_gpio);
247 i2c_register_board_info(2, nokia770_i2c_board_info_2,
248 ARRAY_SIZE(nokia770_i2c_board_info_2));
249 platform_device_register(&nokia770_cbus_device);
250}
251#else /* CONFIG_I2C_CBUS_GPIO */
252static void __init nokia770_cbus_init(void)
253{
254}
255#endif /* CONFIG_I2C_CBUS_GPIO */
256
215static void __init omap_nokia770_init(void) 257static void __init omap_nokia770_init(void)
216{ 258{
217 /* On Nokia 770, the SleepX signal is masked with an 259 /* On Nokia 770, the SleepX signal is masked with an
@@ -233,6 +275,7 @@ static void __init omap_nokia770_init(void)
233 mipid_dev_init(); 275 mipid_dev_init();
234 omap1_usb_init(&nokia770_usb_config); 276 omap1_usb_init(&nokia770_usb_config);
235 nokia770_mmc_init(); 277 nokia770_mmc_init();
278 nokia770_cbus_init();
236} 279}
237 280
238MACHINE_START(NOKIA770, "Nokia 770") 281MACHINE_START(NOKIA770, "Nokia 770")
@@ -242,6 +285,6 @@ MACHINE_START(NOKIA770, "Nokia 770")
242 .init_irq = omap1_init_irq, 285 .init_irq = omap1_init_irq,
243 .init_machine = omap_nokia770_init, 286 .init_machine = omap_nokia770_init,
244 .init_late = omap1_init_late, 287 .init_late = omap1_init_late,
245 .timer = &omap1_timer, 288 .init_time = omap1_timer_init,
246 .restart = omap1_restart, 289 .restart = omap1_restart,
247MACHINE_END 290MACHINE_END
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index 872ea47cd28a..a7ce69286688 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -609,6 +609,6 @@ MACHINE_START(OMAP_OSK, "TI-OSK")
609 .init_irq = omap1_init_irq, 609 .init_irq = omap1_init_irq,
610 .init_machine = osk_init, 610 .init_machine = osk_init,
611 .init_late = omap1_init_late, 611 .init_late = omap1_init_late,
612 .timer = &omap1_timer, 612 .init_time = omap1_timer_init,
613 .restart = omap1_restart, 613 .restart = omap1_restart,
614MACHINE_END 614MACHINE_END
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index c33dceb46607..845a1a7aef95 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -268,6 +268,6 @@ MACHINE_START(OMAP_PALMTE, "OMAP310 based Palm Tungsten E")
268 .init_irq = omap1_init_irq, 268 .init_irq = omap1_init_irq,
269 .init_machine = omap_palmte_init, 269 .init_machine = omap_palmte_init,
270 .init_late = omap1_init_late, 270 .init_late = omap1_init_late,
271 .timer = &omap1_timer, 271 .init_time = omap1_timer_init,
272 .restart = omap1_restart, 272 .restart = omap1_restart,
273MACHINE_END 273MACHINE_END
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c
index 2948b0ee4be8..65a4a3e357f2 100644
--- a/arch/arm/mach-omap1/board-palmtt.c
+++ b/arch/arm/mach-omap1/board-palmtt.c
@@ -314,6 +314,6 @@ MACHINE_START(OMAP_PALMTT, "OMAP1510 based Palm Tungsten|T")
314 .init_irq = omap1_init_irq, 314 .init_irq = omap1_init_irq,
315 .init_machine = omap_palmtt_init, 315 .init_machine = omap_palmtt_init,
316 .init_late = omap1_init_late, 316 .init_late = omap1_init_late,
317 .timer = &omap1_timer, 317 .init_time = omap1_timer_init,
318 .restart = omap1_restart, 318 .restart = omap1_restart,
319MACHINE_END 319MACHINE_END
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index 7a05895c0be3..01c970071fd8 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -330,6 +330,6 @@ MACHINE_START(OMAP_PALMZ71, "OMAP310 based Palm Zire71")
330 .init_irq = omap1_init_irq, 330 .init_irq = omap1_init_irq,
331 .init_machine = omap_palmz71_init, 331 .init_machine = omap_palmz71_init,
332 .init_late = omap1_init_late, 332 .init_late = omap1_init_late,
333 .timer = &omap1_timer, 333 .init_time = omap1_timer_init,
334 .restart = omap1_restart, 334 .restart = omap1_restart,
335MACHINE_END 335MACHINE_END
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c
index 27f8d12ec222..8b2f7127f716 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -326,6 +326,6 @@ MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
326 .init_irq = omap1_init_irq, 326 .init_irq = omap1_init_irq,
327 .init_machine = omap_perseus2_init, 327 .init_machine = omap_perseus2_init,
328 .init_late = omap1_init_late, 328 .init_late = omap1_init_late,
329 .timer = &omap1_timer, 329 .init_time = omap1_timer_init,
330 .restart = omap1_restart, 330 .restart = omap1_restart,
331MACHINE_END 331MACHINE_END
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
index 20ed52ae1714..9732a98f3e06 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -407,6 +407,6 @@ MACHINE_START(SX1, "OMAP310 based Siemens SX1")
407 .init_irq = omap1_init_irq, 407 .init_irq = omap1_init_irq,
408 .init_machine = omap_sx1_init, 408 .init_machine = omap_sx1_init,
409 .init_late = omap1_init_late, 409 .init_late = omap1_init_late,
410 .timer = &omap1_timer, 410 .init_time = omap1_timer_init,
411 .restart = omap1_restart, 411 .restart = omap1_restart,
412MACHINE_END 412MACHINE_END
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index abf705f49b19..6c116e1a4b01 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -289,6 +289,6 @@ MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910")
289 .init_irq = omap1_init_irq, 289 .init_irq = omap1_init_irq,
290 .init_machine = voiceblue_init, 290 .init_machine = voiceblue_init,
291 .init_late = omap1_init_late, 291 .init_late = omap1_init_late,
292 .timer = &omap1_timer, 292 .init_time = omap1_timer_init,
293 .restart = voiceblue_restart, 293 .restart = voiceblue_restart,
294MACHINE_END 294MACHINE_END
diff --git a/arch/arm/mach-omap1/common.h b/arch/arm/mach-omap1/common.h
index b53e0854422f..fb18831e88aa 100644
--- a/arch/arm/mach-omap1/common.h
+++ b/arch/arm/mach-omap1/common.h
@@ -75,7 +75,7 @@ extern void __init omap_check_revision(void);
75extern void omap1_nand_cmd_ctl(struct mtd_info *mtd, int cmd, 75extern void omap1_nand_cmd_ctl(struct mtd_info *mtd, int cmd,
76 unsigned int ctrl); 76 unsigned int ctrl);
77 77
78extern struct sys_timer omap1_timer; 78extern void omap1_timer_init(void);
79#ifdef CONFIG_OMAP_32K_TIMER 79#ifdef CONFIG_OMAP_32K_TIMER
80extern int omap_32k_timer_init(void); 80extern int omap_32k_timer_init(void);
81#else 81#else
diff --git a/arch/arm/mach-omap1/dma.c b/arch/arm/mach-omap1/dma.c
index e190611e4b46..1a4e887f028d 100644
--- a/arch/arm/mach-omap1/dma.c
+++ b/arch/arm/mach-omap1/dma.c
@@ -24,7 +24,7 @@
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/device.h> 25#include <linux/device.h>
26#include <linux/io.h> 26#include <linux/io.h>
27 27#include <linux/dma-mapping.h>
28#include <linux/omap-dma.h> 28#include <linux/omap-dma.h>
29#include <mach/tc.h> 29#include <mach/tc.h>
30 30
@@ -270,11 +270,17 @@ static u32 configure_dma_errata(void)
270 return errata; 270 return errata;
271} 271}
272 272
273static const struct platform_device_info omap_dma_dev_info = {
274 .name = "omap-dma-engine",
275 .id = -1,
276 .dma_mask = DMA_BIT_MASK(32),
277};
278
273static int __init omap1_system_dma_init(void) 279static int __init omap1_system_dma_init(void)
274{ 280{
275 struct omap_system_dma_plat_info *p; 281 struct omap_system_dma_plat_info *p;
276 struct omap_dma_dev_attr *d; 282 struct omap_dma_dev_attr *d;
277 struct platform_device *pdev; 283 struct platform_device *pdev, *dma_pdev;
278 int ret; 284 int ret;
279 285
280 pdev = platform_device_alloc("omap_dma_system", 0); 286 pdev = platform_device_alloc("omap_dma_system", 0);
@@ -380,8 +386,16 @@ static int __init omap1_system_dma_init(void)
380 dma_common_ch_start = CPC; 386 dma_common_ch_start = CPC;
381 dma_common_ch_end = COLOR; 387 dma_common_ch_end = COLOR;
382 388
389 dma_pdev = platform_device_register_full(&omap_dma_dev_info);
390 if (IS_ERR(dma_pdev)) {
391 ret = PTR_ERR(dma_pdev);
392 goto exit_release_pdev;
393 }
394
383 return ret; 395 return ret;
384 396
397exit_release_pdev:
398 platform_device_del(pdev);
385exit_release_chan: 399exit_release_chan:
386 kfree(d->chan); 400 kfree(d->chan);
387exit_release_d: 401exit_release_d:
diff --git a/arch/arm/mach-omap1/i2c.c b/arch/arm/mach-omap1/i2c.c
index faca808cb3d9..7f5761cffd2e 100644
--- a/arch/arm/mach-omap1/i2c.c
+++ b/arch/arm/mach-omap1/i2c.c
@@ -91,3 +91,9 @@ int __init omap_i2c_add_bus(struct omap_i2c_bus_platform_data *pdata,
91 91
92 return platform_device_register(pdev); 92 return platform_device_register(pdev);
93} 93}
94
95static int __init omap_i2c_cmdline(void)
96{
97 return omap_register_i2c_bus_cmdline();
98}
99subsys_initcall(omap_i2c_cmdline);
diff --git a/arch/arm/mach-omap1/include/mach/uncompress.h b/arch/arm/mach-omap1/include/mach/uncompress.h
index ad6fbe7d83f2..4869633de8cd 100644
--- a/arch/arm/mach-omap1/include/mach/uncompress.h
+++ b/arch/arm/mach-omap1/include/mach/uncompress.h
@@ -115,8 +115,3 @@ static inline void arch_decomp_setup(void)
115 DEBUG_LL_OMAP1(3, sx1); 115 DEBUG_LL_OMAP1(3, sx1);
116 } while (0); 116 } while (0);
117} 117}
118
119/*
120 * nothing to do
121 */
122#define arch_decomp_wdog()
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index 4d4816fd6fc9..726ec23d29c7 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -145,7 +145,6 @@ static void omap_mpu_set_mode(enum clock_event_mode mode,
145static struct clock_event_device clockevent_mpu_timer1 = { 145static struct clock_event_device clockevent_mpu_timer1 = {
146 .name = "mpu_timer1", 146 .name = "mpu_timer1",
147 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 147 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
148 .shift = 32,
149 .set_next_event = omap_mpu_set_next_event, 148 .set_next_event = omap_mpu_set_next_event,
150 .set_mode = omap_mpu_set_mode, 149 .set_mode = omap_mpu_set_mode,
151}; 150};
@@ -170,15 +169,9 @@ static __init void omap_init_mpu_timer(unsigned long rate)
170 setup_irq(INT_TIMER1, &omap_mpu_timer1_irq); 169 setup_irq(INT_TIMER1, &omap_mpu_timer1_irq);
171 omap_mpu_timer_start(0, (rate / HZ) - 1, 1); 170 omap_mpu_timer_start(0, (rate / HZ) - 1, 1);
172 171
173 clockevent_mpu_timer1.mult = div_sc(rate, NSEC_PER_SEC,
174 clockevent_mpu_timer1.shift);
175 clockevent_mpu_timer1.max_delta_ns =
176 clockevent_delta2ns(-1, &clockevent_mpu_timer1);
177 clockevent_mpu_timer1.min_delta_ns =
178 clockevent_delta2ns(1, &clockevent_mpu_timer1);
179
180 clockevent_mpu_timer1.cpumask = cpumask_of(0); 172 clockevent_mpu_timer1.cpumask = cpumask_of(0);
181 clockevents_register_device(&clockevent_mpu_timer1); 173 clockevents_config_and_register(&clockevent_mpu_timer1, rate,
174 1, -1);
182} 175}
183 176
184 177
@@ -236,12 +229,8 @@ static inline void omap_mpu_timer_init(void)
236 * Timer initialization 229 * Timer initialization
237 * --------------------------------------------------------------------------- 230 * ---------------------------------------------------------------------------
238 */ 231 */
239static void __init omap1_timer_init(void) 232void __init omap1_timer_init(void)
240{ 233{
241 if (omap_32k_timer_init() != 0) 234 if (omap_32k_timer_init() != 0)
242 omap_mpu_timer_init(); 235 omap_mpu_timer_init();
243} 236}
244
245struct sys_timer omap1_timer = {
246 .init = omap1_timer_init,
247};
diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c
index 41152fadd4c0..0b74246ba62c 100644
--- a/arch/arm/mach-omap1/timer32k.c
+++ b/arch/arm/mach-omap1/timer32k.c
@@ -140,7 +140,6 @@ static void omap_32k_timer_set_mode(enum clock_event_mode mode,
140static struct clock_event_device clockevent_32k_timer = { 140static struct clock_event_device clockevent_32k_timer = {
141 .name = "32k-timer", 141 .name = "32k-timer",
142 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 142 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
143 .shift = 32,
144 .set_next_event = omap_32k_timer_set_next_event, 143 .set_next_event = omap_32k_timer_set_next_event,
145 .set_mode = omap_32k_timer_set_mode, 144 .set_mode = omap_32k_timer_set_mode,
146}; 145};
@@ -165,16 +164,9 @@ static __init void omap_init_32k_timer(void)
165{ 164{
166 setup_irq(INT_OS_TIMER, &omap_32k_timer_irq); 165 setup_irq(INT_OS_TIMER, &omap_32k_timer_irq);
167 166
168 clockevent_32k_timer.mult = div_sc(OMAP_32K_TICKS_PER_SEC,
169 NSEC_PER_SEC,
170 clockevent_32k_timer.shift);
171 clockevent_32k_timer.max_delta_ns =
172 clockevent_delta2ns(0xfffffffe, &clockevent_32k_timer);
173 clockevent_32k_timer.min_delta_ns =
174 clockevent_delta2ns(1, &clockevent_32k_timer);
175
176 clockevent_32k_timer.cpumask = cpumask_of(0); 167 clockevent_32k_timer.cpumask = cpumask_of(0);
177 clockevents_register_device(&clockevent_32k_timer); 168 clockevents_config_and_register(&clockevent_32k_timer,
169 OMAP_32K_TICKS_PER_SEC, 1, 0xfffffffe);
178} 170}
179 171
180/* 172/*
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 41b581fd0213..49ac3dfebef9 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -1,3 +1,26 @@
1config ARCH_OMAP
2 bool
3
4config ARCH_OMAP2PLUS
5 bool "TI OMAP2/3/4/5 SoCs with device tree support" if (ARCH_MULTI_V6 || ARCH_MULTI_V7)
6 select ARCH_HAS_CPUFREQ
7 select ARCH_HAS_HOLES_MEMORYMODEL
8 select ARCH_OMAP
9 select ARCH_REQUIRE_GPIOLIB
10 select CLKDEV_LOOKUP
11 select CLKSRC_MMIO
12 select GENERIC_CLOCKEVENTS
13 select GENERIC_IRQ_CHIP
14 select HAVE_CLK
15 select OMAP_DM_TIMER
16 select PINCTRL
17 select PROC_DEVICETREE if PROC_FS
18 select SPARSE_IRQ
19 select USE_OF
20 help
21 Systems based on OMAP2, OMAP3, OMAP4 or OMAP5
22
23
1if ARCH_OMAP2PLUS 24if ARCH_OMAP2PLUS
2 25
3menu "TI OMAP2/3/4 Specific Features" 26menu "TI OMAP2/3/4 Specific Features"
@@ -76,12 +99,12 @@ config ARCH_OMAP4
76 99
77config SOC_OMAP5 100config SOC_OMAP5
78 bool "TI OMAP5" 101 bool "TI OMAP5"
79 select ARM_ARCH_TIMER
80 select ARM_CPU_SUSPEND if PM 102 select ARM_CPU_SUSPEND if PM
81 select ARM_GIC 103 select ARM_GIC
82 select CPU_V7 104 select CPU_V7
83 select HAVE_SMP 105 select HAVE_SMP
84 select COMMON_CLK 106 select COMMON_CLK
107 select HAVE_ARM_ARCH_TIMER
85 108
86comment "OMAP Core Type" 109comment "OMAP Core Type"
87 depends on ARCH_OMAP2 110 depends on ARCH_OMAP2
@@ -165,12 +188,6 @@ config MACH_OMAP_H4
165 select OMAP_DEBUG_DEVICES 188 select OMAP_DEBUG_DEVICES
166 select OMAP_PACKAGE_ZAF 189 select OMAP_PACKAGE_ZAF
167 190
168config MACH_OMAP_APOLLON
169 bool "OMAP 2420 Apollon board"
170 depends on SOC_OMAP2420
171 default y
172 select OMAP_PACKAGE_ZAC
173
174config MACH_OMAP_2430SDP 191config MACH_OMAP_2430SDP
175 bool "OMAP 2430 SDP board" 192 bool "OMAP 2430 SDP board"
176 depends on SOC_OMAP2430 193 depends on SOC_OMAP2430
@@ -397,7 +414,7 @@ config OMAP3_SDRC_AC_TIMING
397 414
398config OMAP4_ERRATA_I688 415config OMAP4_ERRATA_I688
399 bool "OMAP4 errata: Async Bridge Corruption" 416 bool "OMAP4 errata: Async Bridge Corruption"
400 depends on ARCH_OMAP4 417 depends on ARCH_OMAP4 && !ARCH_MULTIPLATFORM
401 select ARCH_HAS_BARRIERS 418 select ARCH_HAS_BARRIERS
402 help 419 help
403 If a data is stalled inside asynchronous bridge because of back 420 If a data is stalled inside asynchronous bridge because of back
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 947cafe65aef..b068b7fe99ef 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -2,13 +2,16 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
6 -I$(srctree)/arch/arm/plat-omap/include
7
5# Common support 8# Common support
6obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o gpmc.o timer.o pm.o \ 9obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o gpmc.o timer.o pm.o \
7 common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \ 10 common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \
8 omap_device.o sram.o 11 omap_device.o sram.o
9 12
10omap-2-3-common = irq.o 13omap-2-3-common = irq.o
11hwmod-common = omap_hwmod.o \ 14hwmod-common = omap_hwmod.o omap_hwmod_reset.o \
12 omap_hwmod_common_data.o 15 omap_hwmod_common_data.o
13clock-common = clock.o clock_common_data.o \ 16clock-common = clock.o clock_common_data.o \
14 clkt_dpll.o clkt_clksel.o 17 clkt_dpll.o clkt_clksel.o
@@ -53,6 +56,7 @@ AFLAGS_sram34xx.o :=-Wa,-march=armv7-a
53# Restart code (OMAP4/5 currently in omap4-common.c) 56# Restart code (OMAP4/5 currently in omap4-common.c)
54obj-$(CONFIG_SOC_OMAP2420) += omap2-restart.o 57obj-$(CONFIG_SOC_OMAP2420) += omap2-restart.o
55obj-$(CONFIG_SOC_OMAP2430) += omap2-restart.o 58obj-$(CONFIG_SOC_OMAP2430) += omap2-restart.o
59obj-$(CONFIG_SOC_AM33XX) += am33xx-restart.o
56obj-$(CONFIG_ARCH_OMAP3) += omap3-restart.o 60obj-$(CONFIG_ARCH_OMAP3) += omap3-restart.o
57 61
58# Pin multiplexing 62# Pin multiplexing
@@ -220,7 +224,6 @@ endif
220obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o 224obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o
221obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o 225obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
222obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o 226obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o
223obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o
224obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o 227obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o
225obj-$(CONFIG_MACH_DEVKIT8000) += board-devkit8000.o 228obj-$(CONFIG_MACH_DEVKIT8000) += board-devkit8000.o
226obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o 229obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o
diff --git a/arch/arm/mach-omap2/am33xx-restart.c b/arch/arm/mach-omap2/am33xx-restart.c
new file mode 100644
index 000000000000..88e4fa8af031
--- /dev/null
+++ b/arch/arm/mach-omap2/am33xx-restart.c
@@ -0,0 +1,34 @@
1/*
2 * am33xx-restart.c - Code common to all AM33xx machines.
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#include <linux/kernel.h>
9
10#include "common.h"
11#include "prm-regbits-33xx.h"
12#include "prm33xx.h"
13
14/**
15 * am3xx_restart - trigger a software restart of the SoC
16 * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
17 * @cmd: passed from the userspace program rebooting the system (if provided)
18 *
19 * Resets the SoC. For @cmd, see the 'reboot' syscall in
20 * kernel/sys.c. No return value.
21 */
22void am33xx_restart(char mode, const char *cmd)
23{
24 /* TODO: Handle mode and cmd if necessary */
25
26 am33xx_prm_rmw_reg_bits(AM33XX_GLOBAL_WARM_SW_RST_MASK,
27 AM33XX_GLOBAL_WARM_SW_RST_MASK,
28 AM33XX_PRM_DEVICE_MOD,
29 AM33XX_PRM_RSTCTRL_OFFSET);
30
31 /* OCP barrier */
32 (void)am33xx_prm_read_reg(AM33XX_PRM_DEVICE_MOD,
33 AM33XX_PRM_RSTCTRL_OFFSET);
34}
diff --git a/arch/arm/mach-omap2/am35xx-emac.c b/arch/arm/mach-omap2/am35xx-emac.c
index af11dcdb7e2c..25b79a297365 100644
--- a/arch/arm/mach-omap2/am35xx-emac.c
+++ b/arch/arm/mach-omap2/am35xx-emac.c
@@ -62,8 +62,7 @@ static int __init omap_davinci_emac_dev_init(struct omap_hwmod *oh,
62{ 62{
63 struct platform_device *pdev; 63 struct platform_device *pdev;
64 64
65 pdev = omap_device_build(oh->class->name, 0, oh, pdata, pdata_len, 65 pdev = omap_device_build(oh->class->name, 0, oh, pdata, pdata_len);
66 NULL, 0, false);
67 if (IS_ERR(pdev)) { 66 if (IS_ERR(pdev)) {
68 WARN(1, "Can't build omap_device for %s:%s.\n", 67 WARN(1, "Can't build omap_device for %s:%s.\n",
69 oh->class->name, oh->name); 68 oh->class->name, oh->name);
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 4815ea6f8f5d..a3e0aaa4886b 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -27,6 +27,7 @@
27#include <linux/clk.h> 27#include <linux/clk.h>
28#include <linux/io.h> 28#include <linux/io.h>
29#include <linux/gpio.h> 29#include <linux/gpio.h>
30#include <linux/usb/phy.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>
@@ -263,6 +264,7 @@ static void __init omap_2430sdp_init(void)
263 omap_hsmmc_init(mmc); 264 omap_hsmmc_init(mmc);
264 265
265 omap_mux_init_signal("usb0hs_stp", OMAP_PULL_ENA | OMAP_PULL_UP); 266 omap_mux_init_signal("usb0hs_stp", OMAP_PULL_ENA | OMAP_PULL_UP);
267 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
266 usb_musb_init(NULL); 268 usb_musb_init(NULL);
267 269
268 board_smc91x_init(); 270 board_smc91x_init();
@@ -284,6 +286,6 @@ MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
284 .handle_irq = omap2_intc_handle_irq, 286 .handle_irq = omap2_intc_handle_irq,
285 .init_machine = omap_2430sdp_init, 287 .init_machine = omap_2430sdp_init,
286 .init_late = omap2430_init_late, 288 .init_late = omap2430_init_late,
287 .timer = &omap2_timer, 289 .init_time = omap2_sync32k_timer_init,
288 .restart = omap2xxx_restart, 290 .restart = omap2xxx_restart,
289MACHINE_END 291MACHINE_END
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index bb73afc9ac17..ce812decfaca 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -25,6 +25,8 @@
25#include <linux/gpio.h> 25#include <linux/gpio.h>
26#include <linux/mmc/host.h> 26#include <linux/mmc/host.h>
27#include <linux/platform_data/spi-omap2-mcspi.h> 27#include <linux/platform_data/spi-omap2-mcspi.h>
28#include <linux/platform_data/omap-twl4030.h>
29#include <linux/usb/phy.h>
28 30
29#include <asm/mach-types.h> 31#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
@@ -209,6 +211,19 @@ static struct omap2_hsmmc_info mmc[] = {
209 {} /* Terminator */ 211 {} /* Terminator */
210}; 212};
211 213
214static struct omap_tw4030_pdata omap_twl4030_audio_data = {
215 .voice_connected = true,
216 .custom_routing = true,
217
218 .has_hs = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT,
219 .has_hf = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT,
220
221 .has_mainmic = true,
222 .has_submic = true,
223 .has_hsmic = true,
224 .has_linein = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT,
225};
226
212static int sdp3430_twl_gpio_setup(struct device *dev, 227static int sdp3430_twl_gpio_setup(struct device *dev,
213 unsigned gpio, unsigned ngpio) 228 unsigned gpio, unsigned ngpio)
214{ 229{
@@ -225,6 +240,9 @@ static int sdp3430_twl_gpio_setup(struct device *dev,
225 /* gpio + 15 is "sub_lcd_nRST" (output) */ 240 /* gpio + 15 is "sub_lcd_nRST" (output) */
226 gpio_request_one(gpio + 15, GPIOF_OUT_INIT_LOW, "sub_lcd_nRST"); 241 gpio_request_one(gpio + 15, GPIOF_OUT_INIT_LOW, "sub_lcd_nRST");
227 242
243 omap_twl4030_audio_data.jack_detect = gpio + 2;
244 omap_twl4030_audio_init("SDP3430", &omap_twl4030_audio_data);
245
228 return 0; 246 return 0;
229} 247}
230 248
@@ -382,6 +400,9 @@ static int __init omap3430_i2c_init(void)
382 sdp3430_twldata.vpll2->constraints.apply_uV = true; 400 sdp3430_twldata.vpll2->constraints.apply_uV = true;
383 sdp3430_twldata.vpll2->constraints.name = "VDVI"; 401 sdp3430_twldata.vpll2->constraints.name = "VDVI";
384 402
403 sdp3430_twldata.audio->codec->hs_extmute = 1;
404 sdp3430_twldata.audio->codec->hs_extmute_gpio = -EINVAL;
405
385 omap3_pmic_init("twl4030", &sdp3430_twldata); 406 omap3_pmic_init("twl4030", &sdp3430_twldata);
386 407
387 /* i2c2 on camera connector (for sensor control) and optional isp1301 */ 408 /* i2c2 on camera connector (for sensor control) and optional isp1301 */
@@ -424,7 +445,7 @@ static void enable_board_wakeup_source(void)
424 OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP); 445 OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
425} 446}
426 447
427static const struct usbhs_omap_board_data usbhs_bdata __initconst = { 448static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
428 449
429 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 450 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
430 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 451 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
@@ -579,6 +600,7 @@ static void __init omap_3430sdp_init(void)
579 omap_ads7846_init(1, gpio_pendown, 310, NULL); 600 omap_ads7846_init(1, gpio_pendown, 310, NULL);
580 omap_serial_init(); 601 omap_serial_init();
581 omap_sdrc_init(hyb18m512160af6_sdrc_params, NULL); 602 omap_sdrc_init(hyb18m512160af6_sdrc_params, NULL);
603 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
582 usb_musb_init(NULL); 604 usb_musb_init(NULL);
583 board_smc91x_init(); 605 board_smc91x_init();
584 board_flash_init(sdp_flash_partitions, chip_sel_3430, 0); 606 board_flash_init(sdp_flash_partitions, chip_sel_3430, 0);
@@ -597,6 +619,6 @@ MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
597 .handle_irq = omap3_intc_handle_irq, 619 .handle_irq = omap3_intc_handle_irq,
598 .init_machine = omap_3430sdp_init, 620 .init_machine = omap_3430sdp_init,
599 .init_late = omap3430_init_late, 621 .init_late = omap3430_init_late,
600 .timer = &omap3_timer, 622 .init_time = omap3_sync32k_timer_init,
601 .restart = omap3xxx_restart, 623 .restart = omap3xxx_restart,
602MACHINE_END 624MACHINE_END
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index 050aaa771254..67447bd4564f 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -53,7 +53,7 @@ static void enable_board_wakeup_source(void)
53 OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP); 53 OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
54} 54}
55 55
56static const struct usbhs_omap_board_data usbhs_bdata __initconst = { 56static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
57 57
58 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 58 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
59 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 59 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
@@ -211,6 +211,6 @@ MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
211 .handle_irq = omap3_intc_handle_irq, 211 .handle_irq = omap3_intc_handle_irq,
212 .init_machine = omap_sdp_init, 212 .init_machine = omap_sdp_init,
213 .init_late = omap3630_init_late, 213 .init_late = omap3630_init_late,
214 .timer = &omap3_timer, 214 .init_time = omap3_sync32k_timer_init,
215 .restart = omap3xxx_restart, 215 .restart = omap3xxx_restart,
216MACHINE_END 216MACHINE_END
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 1cc6696594fd..35f3ad0cb7c7 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -24,12 +24,15 @@
24#include <linux/gpio_keys.h> 24#include <linux/gpio_keys.h>
25#include <linux/regulator/machine.h> 25#include <linux/regulator/machine.h>
26#include <linux/regulator/fixed.h> 26#include <linux/regulator/fixed.h>
27#include <linux/pwm.h>
27#include <linux/leds.h> 28#include <linux/leds.h>
28#include <linux/leds_pwm.h> 29#include <linux/leds_pwm.h>
30#include <linux/pwm_backlight.h>
31#include <linux/irqchip/arm-gic.h>
29#include <linux/platform_data/omap4-keypad.h> 32#include <linux/platform_data/omap4-keypad.h>
30#include <linux/usb/musb.h> 33#include <linux/usb/musb.h>
34#include <linux/usb/phy.h>
31 35
32#include <asm/hardware/gic.h>
33#include <asm/mach-types.h> 36#include <asm/mach-types.h>
34#include <asm/mach/arch.h> 37#include <asm/mach/arch.h>
35#include <asm/mach/map.h> 38#include <asm/mach/map.h>
@@ -256,10 +259,20 @@ static struct gpio_led_platform_data sdp4430_led_data = {
256 .num_leds = ARRAY_SIZE(sdp4430_gpio_leds), 259 .num_leds = ARRAY_SIZE(sdp4430_gpio_leds),
257}; 260};
258 261
262static struct pwm_lookup sdp4430_pwm_lookup[] = {
263 PWM_LOOKUP("twl-pwm", 0, "leds_pwm", "omap4::keypad"),
264 PWM_LOOKUP("twl-pwm", 1, "pwm-backlight", NULL),
265 PWM_LOOKUP("twl-pwmled", 0, "leds_pwm", "omap4:green:chrg"),
266};
267
259static struct led_pwm sdp4430_pwm_leds[] = { 268static struct led_pwm sdp4430_pwm_leds[] = {
260 { 269 {
270 .name = "omap4::keypad",
271 .max_brightness = 127,
272 .pwm_period_ns = 7812500,
273 },
274 {
261 .name = "omap4:green:chrg", 275 .name = "omap4:green:chrg",
262 .pwm_id = 1,
263 .max_brightness = 255, 276 .max_brightness = 255,
264 .pwm_period_ns = 7812500, 277 .pwm_period_ns = 7812500,
265 }, 278 },
@@ -278,6 +291,20 @@ static struct platform_device sdp4430_leds_pwm = {
278 }, 291 },
279}; 292};
280 293
294static struct platform_pwm_backlight_data sdp4430_backlight_data = {
295 .max_brightness = 127,
296 .dft_brightness = 127,
297 .pwm_period_ns = 7812500,
298};
299
300static struct platform_device sdp4430_backlight_pwm = {
301 .name = "pwm-backlight",
302 .id = -1,
303 .dev = {
304 .platform_data = &sdp4430_backlight_data,
305 },
306};
307
281static int omap_prox_activate(struct device *dev) 308static int omap_prox_activate(struct device *dev)
282{ 309{
283 gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 1); 310 gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 1);
@@ -412,6 +439,7 @@ static struct platform_device *sdp4430_devices[] __initdata = {
412 &sdp4430_gpio_keys_device, 439 &sdp4430_gpio_keys_device,
413 &sdp4430_leds_gpio, 440 &sdp4430_leds_gpio,
414 &sdp4430_leds_pwm, 441 &sdp4430_leds_pwm,
442 &sdp4430_backlight_pwm,
415 &sdp4430_vbat, 443 &sdp4430_vbat,
416 &sdp4430_dmic_codec, 444 &sdp4430_dmic_codec,
417 &sdp4430_abe_audio, 445 &sdp4430_abe_audio,
@@ -696,6 +724,7 @@ static void __init omap_4430sdp_init(void)
696 omap4_sdp4430_wifi_init(); 724 omap4_sdp4430_wifi_init();
697 omap4_twl6030_hsmmc_init(mmc); 725 omap4_twl6030_hsmmc_init(mmc);
698 726
727 usb_bind_phy("musb-hdrc.0.auto", 0, "omap-usb2.1.auto");
699 usb_musb_init(&musb_board_data); 728 usb_musb_init(&musb_board_data);
700 729
701 status = omap_ethernet_init(); 730 status = omap_ethernet_init();
@@ -707,6 +736,7 @@ static void __init omap_4430sdp_init(void)
707 ARRAY_SIZE(sdp4430_spi_board_info)); 736 ARRAY_SIZE(sdp4430_spi_board_info));
708 } 737 }
709 738
739 pwm_add_table(sdp4430_pwm_lookup, ARRAY_SIZE(sdp4430_pwm_lookup));
710 status = omap4_keyboard_init(&sdp4430_keypad_data, &keypad_data); 740 status = omap4_keyboard_init(&sdp4430_keypad_data, &keypad_data);
711 if (status) 741 if (status)
712 pr_err("Keypad initialization failed: %d\n", status); 742 pr_err("Keypad initialization failed: %d\n", status);
@@ -722,9 +752,8 @@ MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
722 .map_io = omap4_map_io, 752 .map_io = omap4_map_io,
723 .init_early = omap4430_init_early, 753 .init_early = omap4430_init_early,
724 .init_irq = gic_init_irq, 754 .init_irq = gic_init_irq,
725 .handle_irq = gic_handle_irq,
726 .init_machine = omap_4430sdp_init, 755 .init_machine = omap_4430sdp_init,
727 .init_late = omap4430_init_late, 756 .init_late = omap4430_init_late,
728 .timer = &omap4_timer, 757 .init_time = omap4_local_timer_init,
729 .restart = omap44xx_restart, 758 .restart = omap44xx_restart,
730MACHINE_END 759MACHINE_END
diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c
index 51b96a1206d1..7d3358b2e593 100644
--- a/arch/arm/mach-omap2/board-am3517crane.c
+++ b/arch/arm/mach-omap2/board-am3517crane.c
@@ -20,12 +20,18 @@
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/gpio.h> 22#include <linux/gpio.h>
23#include <linux/mfd/tps65910.h>
24#include <linux/mtd/mtd.h>
25#include <linux/mtd/nand.h>
26#include <linux/mtd/partitions.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#include <asm/mach/map.h> 30#include <asm/mach/map.h>
27 31
28#include "common.h" 32#include "common.h"
33#include "common-board-devices.h"
34#include "board-flash.h"
29 35
30#include "am35xx-emac.h" 36#include "am35xx-emac.h"
31#include "mux.h" 37#include "mux.h"
@@ -36,11 +42,12 @@
36 42
37#ifdef CONFIG_OMAP_MUX 43#ifdef CONFIG_OMAP_MUX
38static struct omap_board_mux board_mux[] __initdata = { 44static struct omap_board_mux board_mux[] __initdata = {
45 OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
39 { .reg_offset = OMAP_MUX_TERMINATOR }, 46 { .reg_offset = OMAP_MUX_TERMINATOR },
40}; 47};
41#endif 48#endif
42 49
43static struct usbhs_omap_board_data usbhs_bdata __initdata = { 50static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
44 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 51 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
45 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED, 52 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
46 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, 53 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
@@ -51,6 +58,54 @@ static struct usbhs_omap_board_data usbhs_bdata __initdata = {
51 .reset_gpio_port[2] = -EINVAL 58 .reset_gpio_port[2] = -EINVAL
52}; 59};
53 60
61static struct mtd_partition crane_nand_partitions[] = {
62 {
63 .name = "X-Loader",
64 .offset = 0,
65 .size = 4 * NAND_BLOCK_SIZE,
66 .mask_flags = MTD_WRITEABLE,
67 },
68 {
69 .name = "U-Boot",
70 .offset = MTDPART_OFS_APPEND,
71 .size = 14 * NAND_BLOCK_SIZE,
72 .mask_flags = MTD_WRITEABLE,
73 },
74 {
75 .name = "U-Boot Env",
76 .offset = MTDPART_OFS_APPEND,
77 .size = 2 * NAND_BLOCK_SIZE,
78 },
79 {
80 .name = "Kernel",
81 .offset = MTDPART_OFS_APPEND,
82 .size = 40 * NAND_BLOCK_SIZE,
83 },
84 {
85 .name = "File System",
86 .offset = MTDPART_OFS_APPEND,
87 .size = MTDPART_SIZ_FULL,
88 },
89};
90
91static struct tps65910_board tps65910_pdata = {
92 .irq = 7 + OMAP_INTC_START,
93 .en_ck32k_xtal = true,
94};
95
96static struct i2c_board_info __initdata tps65910_board_info[] = {
97 {
98 I2C_BOARD_INFO("tps65910", 0x2d),
99 .platform_data = &tps65910_pdata,
100 },
101};
102
103static void __init am3517_crane_i2c_init(void)
104{
105 omap_register_i2c_bus(1, 2600, tps65910_board_info,
106 ARRAY_SIZE(tps65910_board_info));
107}
108
54static void __init am3517_crane_init(void) 109static void __init am3517_crane_init(void)
55{ 110{
56 int ret; 111 int ret;
@@ -58,6 +113,10 @@ static void __init am3517_crane_init(void)
58 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 113 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
59 omap_serial_init(); 114 omap_serial_init();
60 omap_sdrc_init(NULL, NULL); 115 omap_sdrc_init(NULL, NULL);
116 board_nand_init(crane_nand_partitions,
117 ARRAY_SIZE(crane_nand_partitions), 0,
118 NAND_BUSWIDTH_16, NULL);
119 am3517_crane_i2c_init();
61 120
62 /* Configure GPIO for EHCI port */ 121 /* Configure GPIO for EHCI port */
63 if (omap_mux_init_gpio(GPIO_USB_NRESET, OMAP_PIN_OUTPUT)) { 122 if (omap_mux_init_gpio(GPIO_USB_NRESET, OMAP_PIN_OUTPUT)) {
@@ -92,6 +151,6 @@ MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD")
92 .handle_irq = omap3_intc_handle_irq, 151 .handle_irq = omap3_intc_handle_irq,
93 .init_machine = am3517_crane_init, 152 .init_machine = am3517_crane_init,
94 .init_late = am35xx_init_late, 153 .init_late = am35xx_init_late,
95 .timer = &omap3_timer, 154 .init_time = omap3_sync32k_timer_init,
96 .restart = omap3xxx_restart, 155 .restart = omap3xxx_restart,
97MACHINE_END 156MACHINE_END
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index f81a303b87ff..9fb85908a61e 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -274,7 +274,7 @@ static __init void am3517_evm_mcbsp1_init(void)
274 omap_ctrl_writel(devconf0, OMAP2_CONTROL_DEVCONF0); 274 omap_ctrl_writel(devconf0, OMAP2_CONTROL_DEVCONF0);
275} 275}
276 276
277static const struct usbhs_omap_board_data usbhs_bdata __initconst = { 277static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
278 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 278 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
279#if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \ 279#if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \
280 defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE) 280 defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE)
@@ -393,6 +393,6 @@ MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM")
393 .handle_irq = omap3_intc_handle_irq, 393 .handle_irq = omap3_intc_handle_irq,
394 .init_machine = am3517_evm_init, 394 .init_machine = am3517_evm_init,
395 .init_late = am35xx_init_late, 395 .init_late = am35xx_init_late,
396 .timer = &omap3_timer, 396 .init_time = omap3_sync32k_timer_init,
397 .restart = omap3xxx_restart, 397 .restart = omap3xxx_restart,
398MACHINE_END 398MACHINE_END
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
deleted file mode 100644
index 5d0a61f54165..000000000000
--- a/arch/arm/mach-omap2/board-apollon.c
+++ /dev/null
@@ -1,342 +0,0 @@
1/*
2 * linux/arch/arm/mach-omap2/board-apollon.c
3 *
4 * Copyright (C) 2005,2006 Samsung Electronics
5 * Author: Kyungmin Park <kyungmin.park@samsung.com>
6 *
7 * Modified from mach-omap/omap2/board-h4.c
8 *
9 * Code for apollon OMAP2 board. Should work on many OMAP2 systems where
10 * the bootloader passes the board-specific data to the kernel.
11 * Do not put any board specific code to this file; create a new machine
12 * type if you need custom low-level initializations.
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 version 2 as
16 * published by the Free Software Foundation.
17 */
18
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/platform_device.h>
22#include <linux/mtd/mtd.h>
23#include <linux/mtd/partitions.h>
24#include <linux/mtd/onenand.h>
25#include <linux/delay.h>
26#include <linux/leds.h>
27#include <linux/err.h>
28#include <linux/clk.h>
29#include <linux/smc91x.h>
30#include <linux/gpio.h>
31#include <linux/platform_data/leds-omap.h>
32
33#include <asm/mach-types.h>
34#include <asm/mach/arch.h>
35#include <asm/mach/flash.h>
36
37#include "common.h"
38#include "gpmc.h"
39
40#include <video/omapdss.h>
41#include <video/omap-panel-generic-dpi.h>
42
43#include "mux.h"
44#include "control.h"
45
46/* LED & Switch macros */
47#define LED0_GPIO13 13
48#define LED1_GPIO14 14
49#define LED2_GPIO15 15
50#define SW_ENTER_GPIO16 16
51#define SW_UP_GPIO17 17
52#define SW_DOWN_GPIO58 58
53
54#define APOLLON_FLASH_CS 0
55#define APOLLON_ETH_CS 1
56#define APOLLON_ETHR_GPIO_IRQ 74
57
58static struct mtd_partition apollon_partitions[] = {
59 {
60 .name = "X-Loader + U-Boot",
61 .offset = 0,
62 .size = SZ_128K,
63 .mask_flags = MTD_WRITEABLE,
64 },
65 {
66 .name = "params",
67 .offset = MTDPART_OFS_APPEND,
68 .size = SZ_128K,
69 },
70 {
71 .name = "kernel",
72 .offset = MTDPART_OFS_APPEND,
73 .size = SZ_2M,
74 },
75 {
76 .name = "rootfs",
77 .offset = MTDPART_OFS_APPEND,
78 .size = SZ_16M,
79 },
80 {
81 .name = "filesystem00",
82 .offset = MTDPART_OFS_APPEND,
83 .size = SZ_32M,
84 },
85 {
86 .name = "filesystem01",
87 .offset = MTDPART_OFS_APPEND,
88 .size = MTDPART_SIZ_FULL,
89 },
90};
91
92static struct onenand_platform_data apollon_flash_data = {
93 .parts = apollon_partitions,
94 .nr_parts = ARRAY_SIZE(apollon_partitions),
95};
96
97static struct resource apollon_flash_resource[] = {
98 [0] = {
99 .flags = IORESOURCE_MEM,
100 },
101};
102
103static struct platform_device apollon_onenand_device = {
104 .name = "onenand-flash",
105 .id = -1,
106 .dev = {
107 .platform_data = &apollon_flash_data,
108 },
109 .num_resources = ARRAY_SIZE(apollon_flash_resource),
110 .resource = apollon_flash_resource,
111};
112
113static void __init apollon_flash_init(void)
114{
115 unsigned long base;
116
117 if (gpmc_cs_request(APOLLON_FLASH_CS, SZ_128K, &base) < 0) {
118 printk(KERN_ERR "Cannot request OneNAND GPMC CS\n");
119 return;
120 }
121 apollon_flash_resource[0].start = base;
122 apollon_flash_resource[0].end = base + SZ_128K - 1;
123}
124
125static struct smc91x_platdata appolon_smc91x_info = {
126 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
127 .leda = RPC_LED_100_10,
128 .ledb = RPC_LED_TX_RX,
129};
130
131static struct resource apollon_smc91x_resources[] = {
132 [0] = {
133 .flags = IORESOURCE_MEM,
134 },
135 [1] = {
136 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
137 },
138};
139
140static struct platform_device apollon_smc91x_device = {
141 .name = "smc91x",
142 .id = -1,
143 .dev = {
144 .platform_data = &appolon_smc91x_info,
145 },
146 .num_resources = ARRAY_SIZE(apollon_smc91x_resources),
147 .resource = apollon_smc91x_resources,
148};
149
150static struct omap_led_config apollon_led_config[] = {
151 {
152 .cdev = {
153 .name = "apollon:led0",
154 },
155 .gpio = LED0_GPIO13,
156 },
157 {
158 .cdev = {
159 .name = "apollon:led1",
160 },
161 .gpio = LED1_GPIO14,
162 },
163 {
164 .cdev = {
165 .name = "apollon:led2",
166 },
167 .gpio = LED2_GPIO15,
168 },
169};
170
171static struct omap_led_platform_data apollon_led_data = {
172 .nr_leds = ARRAY_SIZE(apollon_led_config),
173 .leds = apollon_led_config,
174};
175
176static struct platform_device apollon_led_device = {
177 .name = "omap-led",
178 .id = -1,
179 .dev = {
180 .platform_data = &apollon_led_data,
181 },
182};
183
184static struct platform_device *apollon_devices[] __initdata = {
185 &apollon_onenand_device,
186 &apollon_smc91x_device,
187 &apollon_led_device,
188};
189
190static inline void __init apollon_init_smc91x(void)
191{
192 unsigned long base;
193
194 unsigned int rate;
195 struct clk *gpmc_fck;
196 int eth_cs;
197 int err;
198
199 gpmc_fck = clk_get(NULL, "gpmc_fck"); /* Always on ENABLE_ON_INIT */
200 if (IS_ERR(gpmc_fck)) {
201 WARN_ON(1);
202 return;
203 }
204
205 clk_prepare_enable(gpmc_fck);
206 rate = clk_get_rate(gpmc_fck);
207
208 eth_cs = APOLLON_ETH_CS;
209
210 /* Make sure CS1 timings are correct */
211 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG1, 0x00011200);
212
213 if (rate >= 160000000) {
214 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f01);
215 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080803);
216 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1c0b1c0a);
217 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x041f1F1F);
218 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000004C4);
219 } else if (rate >= 130000000) {
220 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f00);
221 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080802);
222 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1C091C09);
223 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x041f1F1F);
224 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000004C4);
225 } else {/* rate = 100000000 */
226 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f00);
227 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080802);
228 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1C091C09);
229 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x031A1F1F);
230 gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000003C2);
231 }
232
233 if (gpmc_cs_request(APOLLON_ETH_CS, SZ_16M, &base) < 0) {
234 printk(KERN_ERR "Failed to request GPMC CS for smc91x\n");
235 goto out;
236 }
237 apollon_smc91x_resources[0].start = base + 0x300;
238 apollon_smc91x_resources[0].end = base + 0x30f;
239 udelay(100);
240
241 omap_mux_init_gpio(APOLLON_ETHR_GPIO_IRQ, 0);
242 err = gpio_request_one(APOLLON_ETHR_GPIO_IRQ, GPIOF_IN, "SMC91x irq");
243 if (err) {
244 printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
245 APOLLON_ETHR_GPIO_IRQ);
246 gpmc_cs_free(APOLLON_ETH_CS);
247 }
248out:
249 clk_disable_unprepare(gpmc_fck);
250 clk_put(gpmc_fck);
251}
252
253static struct panel_generic_dpi_data apollon_panel_data = {
254 .name = "apollon",
255};
256
257static struct omap_dss_device apollon_lcd_device = {
258 .name = "lcd",
259 .driver_name = "generic_dpi_panel",
260 .type = OMAP_DISPLAY_TYPE_DPI,
261 .phy.dpi.data_lines = 18,
262 .data = &apollon_panel_data,
263};
264
265static struct omap_dss_device *apollon_dss_devices[] = {
266 &apollon_lcd_device,
267};
268
269static struct omap_dss_board_info apollon_dss_data = {
270 .num_devices = ARRAY_SIZE(apollon_dss_devices),
271 .devices = apollon_dss_devices,
272 .default_device = &apollon_lcd_device,
273};
274
275static struct gpio apollon_gpio_leds[] __initdata = {
276 { LED0_GPIO13, GPIOF_OUT_INIT_LOW, "LED0" }, /* LED0 - AA10 */
277 { LED1_GPIO14, GPIOF_OUT_INIT_LOW, "LED1" }, /* LED1 - AA6 */
278 { LED2_GPIO15, GPIOF_OUT_INIT_LOW, "LED2" }, /* LED2 - AA4 */
279};
280
281static void __init apollon_led_init(void)
282{
283 omap_mux_init_signal("vlynq_clk.gpio_13", 0);
284 omap_mux_init_signal("vlynq_rx1.gpio_14", 0);
285 omap_mux_init_signal("vlynq_rx0.gpio_15", 0);
286
287 gpio_request_array(apollon_gpio_leds, ARRAY_SIZE(apollon_gpio_leds));
288}
289
290#ifdef CONFIG_OMAP_MUX
291static struct omap_board_mux board_mux[] __initdata = {
292 { .reg_offset = OMAP_MUX_TERMINATOR },
293};
294#endif
295
296static void __init omap_apollon_init(void)
297{
298 u32 v;
299
300 omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
301
302 apollon_init_smc91x();
303 apollon_led_init();
304 apollon_flash_init();
305
306 /* REVISIT: where's the correct place */
307 omap_mux_init_signal("sys_nirq", OMAP_PULL_ENA | OMAP_PULL_UP);
308
309 /* LCD PWR_EN */
310 omap_mux_init_signal("mcbsp2_dr.gpio_11", OMAP_PULL_ENA | OMAP_PULL_UP);
311
312 /* Use Internal loop-back in MMC/SDIO Module Input Clock selection */
313 v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
314 v |= (1 << 24);
315 omap_ctrl_writel(v, OMAP2_CONTROL_DEVCONF0);
316
317 /*
318 * Make sure the serial ports are muxed on at this point.
319 * You have to mux them off in device drivers later on
320 * if not needed.
321 */
322 apollon_smc91x_resources[1].start = gpio_to_irq(APOLLON_ETHR_GPIO_IRQ);
323 apollon_smc91x_resources[1].end = gpio_to_irq(APOLLON_ETHR_GPIO_IRQ);
324 platform_add_devices(apollon_devices, ARRAY_SIZE(apollon_devices));
325 omap_serial_init();
326 omap_sdrc_init(NULL, NULL);
327 omap_display_init(&apollon_dss_data);
328}
329
330MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon")
331 /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
332 .atag_offset = 0x100,
333 .reserve = omap_reserve,
334 .map_io = omap242x_map_io,
335 .init_early = omap2420_init_early,
336 .init_irq = omap2_init_irq,
337 .handle_irq = omap2_intc_handle_irq,
338 .init_machine = omap_apollon_init,
339 .init_late = omap2420_init_late,
340 .timer = &omap2_timer,
341 .restart = omap2xxx_restart,
342MACHINE_END
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index b3102c2f4a3c..af2bb219e214 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -30,6 +30,7 @@
30#include <linux/regulator/fixed.h> 30#include <linux/regulator/fixed.h>
31#include <linux/regulator/machine.h> 31#include <linux/regulator/machine.h>
32#include <linux/mmc/host.h> 32#include <linux/mmc/host.h>
33#include <linux/usb/phy.h>
33 34
34#include <linux/spi/spi.h> 35#include <linux/spi/spi.h>
35#include <linux/spi/tdo24m.h> 36#include <linux/spi/tdo24m.h>
@@ -418,7 +419,7 @@ static struct omap2_hsmmc_info mmc[] = {
418 {} /* Terminator */ 419 {} /* Terminator */
419}; 420};
420 421
421static struct usbhs_omap_board_data usbhs_bdata __initdata = { 422static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
422 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 423 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
423 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 424 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
424 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, 425 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
@@ -722,8 +723,9 @@ static void __init cm_t3x_common_init(void)
722 cm_t35_init_ethernet(); 723 cm_t35_init_ethernet();
723 cm_t35_init_led(); 724 cm_t35_init_led();
724 cm_t35_init_display(); 725 cm_t35_init_display();
725 omap_twl4030_audio_init("cm-t3x"); 726 omap_twl4030_audio_init("cm-t3x", NULL);
726 727
728 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
727 usb_musb_init(NULL); 729 usb_musb_init(NULL);
728 cm_t35_init_usbh(); 730 cm_t35_init_usbh();
729 cm_t35_init_camera(); 731 cm_t35_init_camera();
@@ -751,7 +753,7 @@ MACHINE_START(CM_T35, "Compulab CM-T35")
751 .handle_irq = omap3_intc_handle_irq, 753 .handle_irq = omap3_intc_handle_irq,
752 .init_machine = cm_t35_init, 754 .init_machine = cm_t35_init,
753 .init_late = omap35xx_init_late, 755 .init_late = omap35xx_init_late,
754 .timer = &omap3_timer, 756 .init_time = omap3_sync32k_timer_init,
755 .restart = omap3xxx_restart, 757 .restart = omap3xxx_restart,
756MACHINE_END 758MACHINE_END
757 759
@@ -764,6 +766,6 @@ MACHINE_START(CM_T3730, "Compulab CM-T3730")
764 .handle_irq = omap3_intc_handle_irq, 766 .handle_irq = omap3_intc_handle_irq,
765 .init_machine = cm_t3730_init, 767 .init_machine = cm_t3730_init,
766 .init_late = omap3630_init_late, 768 .init_late = omap3630_init_late,
767 .timer = &omap3_timer, 769 .init_time = omap3_sync32k_timer_init,
768 .restart = omap3xxx_restart, 770 .restart = omap3xxx_restart,
769MACHINE_END 771MACHINE_END
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c
index ebbc2adb499e..a66da808cc4a 100644
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ b/arch/arm/mach-omap2/board-cm-t3517.c
@@ -32,6 +32,7 @@
32#include <linux/mtd/mtd.h> 32#include <linux/mtd/mtd.h>
33#include <linux/mtd/nand.h> 33#include <linux/mtd/nand.h>
34#include <linux/mtd/partitions.h> 34#include <linux/mtd/partitions.h>
35#include <linux/mmc/host.h>
35#include <linux/can/platform/ti_hecc.h> 36#include <linux/can/platform/ti_hecc.h>
36 37
37#include <asm/mach-types.h> 38#include <asm/mach-types.h>
@@ -46,6 +47,7 @@
46 47
47#include "mux.h" 48#include "mux.h"
48#include "control.h" 49#include "control.h"
50#include "hsmmc.h"
49#include "common-board-devices.h" 51#include "common-board-devices.h"
50#include "am35xx-emac.h" 52#include "am35xx-emac.h"
51#include "gpmc-nand.h" 53#include "gpmc-nand.h"
@@ -121,6 +123,26 @@ static void cm_t3517_init_hecc(void)
121static inline void cm_t3517_init_hecc(void) {} 123static inline void cm_t3517_init_hecc(void) {}
122#endif 124#endif
123 125
126#if defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)
127static struct omap2_hsmmc_info cm_t3517_mmc[] = {
128 {
129 .mmc = 1,
130 .caps = MMC_CAP_4_BIT_DATA,
131 .gpio_cd = 144,
132 .gpio_wp = 59,
133 },
134 {
135 .mmc = 2,
136 .caps = MMC_CAP_4_BIT_DATA,
137 .gpio_cd = -EINVAL,
138 .gpio_wp = -EINVAL,
139 },
140 {} /* Terminator */
141};
142#else
143#define cm_t3517_mmc NULL
144#endif
145
124#if defined(CONFIG_RTC_DRV_V3020) || defined(CONFIG_RTC_DRV_V3020_MODULE) 146#if defined(CONFIG_RTC_DRV_V3020) || defined(CONFIG_RTC_DRV_V3020_MODULE)
125#define RTC_IO_GPIO (153) 147#define RTC_IO_GPIO (153)
126#define RTC_WR_GPIO (154) 148#define RTC_WR_GPIO (154)
@@ -166,7 +188,7 @@ static inline void cm_t3517_init_rtc(void) {}
166#define HSUSB2_RESET_GPIO (147) 188#define HSUSB2_RESET_GPIO (147)
167#define USB_HUB_RESET_GPIO (152) 189#define USB_HUB_RESET_GPIO (152)
168 190
169static struct usbhs_omap_board_data cm_t3517_ehci_pdata __initdata = { 191static struct usbhs_omap_platform_data cm_t3517_ehci_pdata __initdata = {
170 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 192 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
171 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 193 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
172 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, 194 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
@@ -271,6 +293,10 @@ static struct omap_board_mux board_mux[] __initdata = {
271 /* CM-T3517 USB HUB nRESET */ 293 /* CM-T3517 USB HUB nRESET */
272 OMAP3_MUX(MCBSP4_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), 294 OMAP3_MUX(MCBSP4_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
273 295
296 /* CD - GPIO144 and WP - GPIO59 for MMC1 - SB-T35 */
297 OMAP3_MUX(UART2_CTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP),
298 OMAP3_MUX(GPMC_CLK, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP),
299
274 { .reg_offset = OMAP_MUX_TERMINATOR }, 300 { .reg_offset = OMAP_MUX_TERMINATOR },
275}; 301};
276#endif 302#endif
@@ -286,6 +312,7 @@ static void __init cm_t3517_init(void)
286 cm_t3517_init_usbh(); 312 cm_t3517_init_usbh();
287 cm_t3517_init_hecc(); 313 cm_t3517_init_hecc();
288 am35xx_emac_init(AM35XX_DEFAULT_MDIO_FREQUENCY, 1); 314 am35xx_emac_init(AM35XX_DEFAULT_MDIO_FREQUENCY, 1);
315 omap_hsmmc_init(cm_t3517_mmc);
289} 316}
290 317
291MACHINE_START(CM_T3517, "Compulab CM-T3517") 318MACHINE_START(CM_T3517, "Compulab CM-T3517")
@@ -297,6 +324,6 @@ MACHINE_START(CM_T3517, "Compulab CM-T3517")
297 .handle_irq = omap3_intc_handle_irq, 324 .handle_irq = omap3_intc_handle_irq,
298 .init_machine = cm_t3517_init, 325 .init_machine = cm_t3517_init,
299 .init_late = am35xx_init_late, 326 .init_late = am35xx_init_late,
300 .timer = &omap3_gp_timer, 327 .init_time = omap3_gp_gptimer_timer_init,
301 .restart = omap3xxx_restart, 328 .restart = omap3xxx_restart,
302MACHINE_END 329MACHINE_END
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 12865af25d3a..53056c3b0836 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -29,6 +29,7 @@
29#include <linux/mtd/partitions.h> 29#include <linux/mtd/partitions.h>
30#include <linux/mtd/nand.h> 30#include <linux/mtd/nand.h>
31#include <linux/mmc/host.h> 31#include <linux/mmc/host.h>
32#include <linux/usb/phy.h>
32 33
33#include <linux/regulator/machine.h> 34#include <linux/regulator/machine.h>
34#include <linux/i2c/twl.h> 35#include <linux/i2c/twl.h>
@@ -435,7 +436,7 @@ static struct platform_device *devkit8000_devices[] __initdata = {
435 &omap_dm9000_dev, 436 &omap_dm9000_dev,
436}; 437};
437 438
438static const struct usbhs_omap_board_data usbhs_bdata __initconst = { 439static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
439 440
440 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 441 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
441 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED, 442 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
@@ -622,12 +623,13 @@ static void __init devkit8000_init(void)
622 623
623 omap_ads7846_init(2, OMAP3_DEVKIT_TS_GPIO, 0, NULL); 624 omap_ads7846_init(2, OMAP3_DEVKIT_TS_GPIO, 0, NULL);
624 625
626 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
625 usb_musb_init(NULL); 627 usb_musb_init(NULL);
626 usbhs_init(&usbhs_bdata); 628 usbhs_init(&usbhs_bdata);
627 board_nand_init(devkit8000_nand_partitions, 629 board_nand_init(devkit8000_nand_partitions,
628 ARRAY_SIZE(devkit8000_nand_partitions), NAND_CS, 630 ARRAY_SIZE(devkit8000_nand_partitions), NAND_CS,
629 NAND_BUSWIDTH_16, NULL); 631 NAND_BUSWIDTH_16, NULL);
630 omap_twl4030_audio_init("omap3beagle"); 632 omap_twl4030_audio_init("omap3beagle", NULL);
631 633
632 /* Ensure SDRC pins are mux'd for self-refresh */ 634 /* Ensure SDRC pins are mux'd for self-refresh */
633 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); 635 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
@@ -643,6 +645,6 @@ MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000")
643 .handle_irq = omap3_intc_handle_irq, 645 .handle_irq = omap3_intc_handle_irq,
644 .init_machine = devkit8000_init, 646 .init_machine = devkit8000_init,
645 .init_late = omap35xx_init_late, 647 .init_late = omap35xx_init_late,
646 .timer = &omap3_secure_timer, 648 .init_time = omap3_secure_sync32k_timer_init,
647 .restart = omap3xxx_restart, 649 .restart = omap3xxx_restart,
648MACHINE_END 650MACHINE_END
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 53cb380b7877..0274ff7a2a2b 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -16,7 +16,6 @@
16#include <linux/of_platform.h> 16#include <linux/of_platform.h>
17#include <linux/irqdomain.h> 17#include <linux/irqdomain.h>
18 18
19#include <asm/hardware/gic.h>
20#include <asm/mach/arch.h> 19#include <asm/mach/arch.h>
21 20
22#include "common.h" 21#include "common.h"
@@ -65,7 +64,7 @@ DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)")
65 .init_irq = omap_intc_of_init, 64 .init_irq = omap_intc_of_init,
66 .handle_irq = omap2_intc_handle_irq, 65 .handle_irq = omap2_intc_handle_irq,
67 .init_machine = omap_generic_init, 66 .init_machine = omap_generic_init,
68 .timer = &omap2_timer, 67 .init_time = omap2_sync32k_timer_init,
69 .dt_compat = omap242x_boards_compat, 68 .dt_compat = omap242x_boards_compat,
70 .restart = omap2xxx_restart, 69 .restart = omap2xxx_restart,
71MACHINE_END 70MACHINE_END
@@ -84,7 +83,7 @@ DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)")
84 .init_irq = omap_intc_of_init, 83 .init_irq = omap_intc_of_init,
85 .handle_irq = omap2_intc_handle_irq, 84 .handle_irq = omap2_intc_handle_irq,
86 .init_machine = omap_generic_init, 85 .init_machine = omap_generic_init,
87 .timer = &omap2_timer, 86 .init_time = omap2_sync32k_timer_init,
88 .dt_compat = omap243x_boards_compat, 87 .dt_compat = omap243x_boards_compat,
89 .restart = omap2xxx_restart, 88 .restart = omap2xxx_restart,
90MACHINE_END 89MACHINE_END
@@ -103,7 +102,7 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
103 .init_irq = omap_intc_of_init, 102 .init_irq = omap_intc_of_init,
104 .handle_irq = omap3_intc_handle_irq, 103 .handle_irq = omap3_intc_handle_irq,
105 .init_machine = omap_generic_init, 104 .init_machine = omap_generic_init,
106 .timer = &omap3_timer, 105 .init_time = omap3_sync32k_timer_init,
107 .dt_compat = omap3_boards_compat, 106 .dt_compat = omap3_boards_compat,
108 .restart = omap3xxx_restart, 107 .restart = omap3xxx_restart,
109MACHINE_END 108MACHINE_END
@@ -120,7 +119,7 @@ DT_MACHINE_START(OMAP3_GP_DT, "Generic OMAP3-GP (Flattened Device Tree)")
120 .init_irq = omap_intc_of_init, 119 .init_irq = omap_intc_of_init,
121 .handle_irq = omap3_intc_handle_irq, 120 .handle_irq = omap3_intc_handle_irq,
122 .init_machine = omap_generic_init, 121 .init_machine = omap_generic_init,
123 .timer = &omap3_secure_timer, 122 .init_time = omap3_secure_sync32k_timer_init,
124 .dt_compat = omap3_gp_boards_compat, 123 .dt_compat = omap3_gp_boards_compat,
125 .restart = omap3xxx_restart, 124 .restart = omap3xxx_restart,
126MACHINE_END 125MACHINE_END
@@ -139,8 +138,9 @@ DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)")
139 .init_irq = omap_intc_of_init, 138 .init_irq = omap_intc_of_init,
140 .handle_irq = omap3_intc_handle_irq, 139 .handle_irq = omap3_intc_handle_irq,
141 .init_machine = omap_generic_init, 140 .init_machine = omap_generic_init,
142 .timer = &omap3_am33xx_timer, 141 .init_time = omap3_am33xx_gptimer_timer_init,
143 .dt_compat = am33xx_boards_compat, 142 .dt_compat = am33xx_boards_compat,
143 .restart = am33xx_restart,
144MACHINE_END 144MACHINE_END
145#endif 145#endif
146 146
@@ -156,10 +156,9 @@ DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
156 .map_io = omap4_map_io, 156 .map_io = omap4_map_io,
157 .init_early = omap4430_init_early, 157 .init_early = omap4430_init_early,
158 .init_irq = omap_gic_of_init, 158 .init_irq = omap_gic_of_init,
159 .handle_irq = gic_handle_irq,
160 .init_machine = omap_generic_init, 159 .init_machine = omap_generic_init,
161 .init_late = omap4430_init_late, 160 .init_late = omap4430_init_late,
162 .timer = &omap4_timer, 161 .init_time = omap4_local_timer_init,
163 .dt_compat = omap4_boards_compat, 162 .dt_compat = omap4_boards_compat,
164 .restart = omap44xx_restart, 163 .restart = omap44xx_restart,
165MACHINE_END 164MACHINE_END
@@ -177,9 +176,8 @@ DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)")
177 .map_io = omap5_map_io, 176 .map_io = omap5_map_io,
178 .init_early = omap5_init_early, 177 .init_early = omap5_init_early,
179 .init_irq = omap_gic_of_init, 178 .init_irq = omap_gic_of_init,
180 .handle_irq = gic_handle_irq,
181 .init_machine = omap_generic_init, 179 .init_machine = omap_generic_init,
182 .timer = &omap5_timer, 180 .init_time = omap5_realtime_timer_init,
183 .dt_compat = omap5_boards_compat, 181 .dt_compat = omap5_boards_compat,
184 .restart = omap44xx_restart, 182 .restart = omap44xx_restart,
185MACHINE_END 183MACHINE_END
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 3be1311f9e33..812c829fa46f 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -342,6 +342,6 @@ MACHINE_START(OMAP_H4, "OMAP2420 H4 board")
342 .handle_irq = omap2_intc_handle_irq, 342 .handle_irq = omap2_intc_handle_irq,
343 .init_machine = omap_h4_init, 343 .init_machine = omap_h4_init,
344 .init_late = omap2420_init_late, 344 .init_late = omap2420_init_late,
345 .timer = &omap2_timer, 345 .init_time = omap2_sync32k_timer_init,
346 .restart = omap2xxx_restart, 346 .restart = omap2xxx_restart,
347MACHINE_END 347MACHINE_END
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 0f24cb84ba5a..bf92678a01d0 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -18,6 +18,7 @@
18#include <linux/gpio.h> 18#include <linux/gpio.h>
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/input.h> 20#include <linux/input.h>
21#include <linux/usb/phy.h>
21 22
22#include <linux/regulator/machine.h> 23#include <linux/regulator/machine.h>
23#include <linux/regulator/fixed.h> 24#include <linux/regulator/fixed.h>
@@ -300,20 +301,20 @@ static struct omap2_hsmmc_info mmc[] = {
300 301
301static struct gpio_led igep_gpio_leds[] = { 302static struct gpio_led igep_gpio_leds[] = {
302 [0] = { 303 [0] = {
303 .name = "gpio-led:red:d0", 304 .name = "omap3:red:user0",
304 .default_trigger = "default-off" 305 .default_state = 0,
305 }, 306 },
306 [1] = { 307 [1] = {
307 .name = "gpio-led:green:d0", 308 .name = "omap3:green:boot",
308 .default_trigger = "default-off", 309 .default_state = 1,
309 }, 310 },
310 [2] = { 311 [2] = {
311 .name = "gpio-led:red:d1", 312 .name = "omap3:red:user1",
312 .default_trigger = "default-off", 313 .default_state = 0,
313 }, 314 },
314 [3] = { 315 [3] = {
315 .name = "gpio-led:green:d1", 316 .name = "omap3:green:user1",
316 .default_trigger = "heartbeat", 317 .default_state = 0,
317 .gpio = -EINVAL, /* gets replaced */ 318 .gpio = -EINVAL, /* gets replaced */
318 .active_low = 1, 319 .active_low = 1,
319 }, 320 },
@@ -526,7 +527,7 @@ static void __init igep_i2c_init(void)
526 omap3_pmic_init("twl4030", &igep_twldata); 527 omap3_pmic_init("twl4030", &igep_twldata);
527} 528}
528 529
529static const struct usbhs_omap_board_data igep2_usbhs_bdata __initconst = { 530static struct usbhs_omap_platform_data igep2_usbhs_bdata __initdata = {
530 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 531 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
531 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED, 532 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
532 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, 533 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
@@ -537,7 +538,7 @@ static const struct usbhs_omap_board_data igep2_usbhs_bdata __initconst = {
537 .reset_gpio_port[2] = -EINVAL, 538 .reset_gpio_port[2] = -EINVAL,
538}; 539};
539 540
540static const struct usbhs_omap_board_data igep3_usbhs_bdata __initconst = { 541static struct usbhs_omap_platform_data igep3_usbhs_bdata __initdata = {
541 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, 542 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
542 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 543 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
543 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, 544 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
@@ -625,11 +626,12 @@ static void __init igep_init(void)
625 omap_serial_init(); 626 omap_serial_init();
626 omap_sdrc_init(m65kxxxxam_sdrc_params, 627 omap_sdrc_init(m65kxxxxam_sdrc_params,
627 m65kxxxxam_sdrc_params); 628 m65kxxxxam_sdrc_params);
629 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
628 usb_musb_init(NULL); 630 usb_musb_init(NULL);
629 631
630 igep_flash_init(); 632 igep_flash_init();
631 igep_leds_init(); 633 igep_leds_init();
632 omap_twl4030_audio_init("igep2"); 634 omap_twl4030_audio_init("igep2", NULL);
633 635
634 /* 636 /*
635 * WLAN-BT combo module from MuRata which has a Marvell WLAN 637 * WLAN-BT combo module from MuRata which has a Marvell WLAN
@@ -655,7 +657,7 @@ MACHINE_START(IGEP0020, "IGEP v2 board")
655 .handle_irq = omap3_intc_handle_irq, 657 .handle_irq = omap3_intc_handle_irq,
656 .init_machine = igep_init, 658 .init_machine = igep_init,
657 .init_late = omap35xx_init_late, 659 .init_late = omap35xx_init_late,
658 .timer = &omap3_timer, 660 .init_time = omap3_sync32k_timer_init,
659 .restart = omap3xxx_restart, 661 .restart = omap3xxx_restart,
660MACHINE_END 662MACHINE_END
661 663
@@ -668,6 +670,6 @@ MACHINE_START(IGEP0030, "IGEP OMAP3 module")
668 .handle_irq = omap3_intc_handle_irq, 670 .handle_irq = omap3_intc_handle_irq,
669 .init_machine = igep_init, 671 .init_machine = igep_init,
670 .init_late = omap35xx_init_late, 672 .init_late = omap35xx_init_late,
671 .timer = &omap3_timer, 673 .init_time = omap3_sync32k_timer_init,
672 .restart = omap3xxx_restart, 674 .restart = omap3xxx_restart,
673MACHINE_END 675MACHINE_END
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 0869f4f3d3e1..b12fe966a7b9 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -28,6 +28,7 @@
28#include <linux/io.h> 28#include <linux/io.h>
29#include <linux/smsc911x.h> 29#include <linux/smsc911x.h>
30#include <linux/mmc/host.h> 30#include <linux/mmc/host.h>
31#include <linux/usb/phy.h>
31#include <linux/platform_data/spi-omap2-mcspi.h> 32#include <linux/platform_data/spi-omap2-mcspi.h>
32 33
33#include <asm/mach-types.h> 34#include <asm/mach-types.h>
@@ -418,6 +419,7 @@ static void __init omap_ldp_init(void)
418 omap_ads7846_init(1, 54, 310, NULL); 419 omap_ads7846_init(1, 54, 310, NULL);
419 omap_serial_init(); 420 omap_serial_init();
420 omap_sdrc_init(NULL, NULL); 421 omap_sdrc_init(NULL, NULL);
422 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
421 usb_musb_init(NULL); 423 usb_musb_init(NULL);
422 board_nand_init(ldp_nand_partitions, ARRAY_SIZE(ldp_nand_partitions), 424 board_nand_init(ldp_nand_partitions, ARRAY_SIZE(ldp_nand_partitions),
423 ZOOM_NAND_CS, 0, nand_default_timings); 425 ZOOM_NAND_CS, 0, nand_default_timings);
@@ -435,6 +437,6 @@ MACHINE_START(OMAP_LDP, "OMAP LDP board")
435 .handle_irq = omap3_intc_handle_irq, 437 .handle_irq = omap3_intc_handle_irq,
436 .init_machine = omap_ldp_init, 438 .init_machine = omap_ldp_init,
437 .init_late = omap3430_init_late, 439 .init_late = omap3430_init_late,
438 .timer = &omap3_timer, 440 .init_time = omap3_sync32k_timer_init,
439 .restart = omap3xxx_restart, 441 .restart = omap3xxx_restart,
440MACHINE_END 442MACHINE_END
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index 0abb30fe399c..f6eeb87e4e95 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -731,7 +731,7 @@ MACHINE_START(NOKIA_N800, "Nokia N800")
731 .handle_irq = omap2_intc_handle_irq, 731 .handle_irq = omap2_intc_handle_irq,
732 .init_machine = n8x0_init_machine, 732 .init_machine = n8x0_init_machine,
733 .init_late = omap2420_init_late, 733 .init_late = omap2420_init_late,
734 .timer = &omap2_timer, 734 .init_time = omap2_sync32k_timer_init,
735 .restart = omap2xxx_restart, 735 .restart = omap2xxx_restart,
736MACHINE_END 736MACHINE_END
737 737
@@ -744,7 +744,7 @@ MACHINE_START(NOKIA_N810, "Nokia N810")
744 .handle_irq = omap2_intc_handle_irq, 744 .handle_irq = omap2_intc_handle_irq,
745 .init_machine = n8x0_init_machine, 745 .init_machine = n8x0_init_machine,
746 .init_late = omap2420_init_late, 746 .init_late = omap2420_init_late,
747 .timer = &omap2_timer, 747 .init_time = omap2_sync32k_timer_init,
748 .restart = omap2xxx_restart, 748 .restart = omap2xxx_restart,
749MACHINE_END 749MACHINE_END
750 750
@@ -757,6 +757,6 @@ MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
757 .handle_irq = omap2_intc_handle_irq, 757 .handle_irq = omap2_intc_handle_irq,
758 .init_machine = n8x0_init_machine, 758 .init_machine = n8x0_init_machine,
759 .init_late = omap2420_init_late, 759 .init_late = omap2420_init_late,
760 .timer = &omap2_timer, 760 .init_time = omap2_sync32k_timer_init,
761 .restart = omap2xxx_restart, 761 .restart = omap2xxx_restart,
762MACHINE_END 762MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 22c483d5dfa8..c3558f93d42c 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -20,6 +20,8 @@
20#include <linux/clk.h> 20#include <linux/clk.h>
21#include <linux/io.h> 21#include <linux/io.h>
22#include <linux/leds.h> 22#include <linux/leds.h>
23#include <linux/pwm.h>
24#include <linux/leds_pwm.h>
23#include <linux/gpio.h> 25#include <linux/gpio.h>
24#include <linux/input.h> 26#include <linux/input.h>
25#include <linux/gpio_keys.h> 27#include <linux/gpio_keys.h>
@@ -30,6 +32,7 @@
30#include <linux/mtd/partitions.h> 32#include <linux/mtd/partitions.h>
31#include <linux/mtd/nand.h> 33#include <linux/mtd/nand.h>
32#include <linux/mmc/host.h> 34#include <linux/mmc/host.h>
35#include <linux/usb/phy.h>
33 36
34#include <linux/regulator/machine.h> 37#include <linux/regulator/machine.h>
35#include <linux/i2c/twl.h> 38#include <linux/i2c/twl.h>
@@ -55,6 +58,32 @@
55 58
56#define NAND_CS 0 59#define NAND_CS 0
57 60
61static struct pwm_lookup pwm_lookup[] = {
62 /* LEDB -> PMU_STAT */
63 PWM_LOOKUP("twl-pwmled", 1, "leds_pwm", "beagleboard::pmu_stat"),
64};
65
66static struct led_pwm pwm_leds[] = {
67 {
68 .name = "beagleboard::pmu_stat",
69 .max_brightness = 127,
70 .pwm_period_ns = 7812500,
71 },
72};
73
74static struct led_pwm_platform_data pwm_data = {
75 .num_leds = ARRAY_SIZE(pwm_leds),
76 .leds = pwm_leds,
77};
78
79static struct platform_device leds_pwm = {
80 .name = "leds_pwm",
81 .id = -1,
82 .dev = {
83 .platform_data = &pwm_data,
84 },
85};
86
58/* 87/*
59 * OMAP3 Beagle revision 88 * OMAP3 Beagle revision
60 * Run time detection of Beagle revision is done by reading GPIO. 89 * Run time detection of Beagle revision is done by reading GPIO.
@@ -292,9 +321,6 @@ static int beagle_twl_gpio_setup(struct device *dev,
292 gpio_request_one(gpio + TWL4030_GPIO_MAX, beagle_config.usb_pwr_level, 321 gpio_request_one(gpio + TWL4030_GPIO_MAX, beagle_config.usb_pwr_level,
293 "nEN_USB_PWR"); 322 "nEN_USB_PWR");
294 323
295 /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
296 gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
297
298 return 0; 324 return 0;
299} 325}
300 326
@@ -376,11 +402,6 @@ static struct gpio_led gpio_leds[] = {
376 .default_trigger = "mmc0", 402 .default_trigger = "mmc0",
377 .gpio = 149, 403 .gpio = 149,
378 }, 404 },
379 {
380 .name = "beagleboard::pmu_stat",
381 .gpio = -EINVAL, /* gets replaced */
382 .active_low = true,
383 },
384}; 405};
385 406
386static struct gpio_led_platform_data gpio_led_info = { 407static struct gpio_led_platform_data gpio_led_info = {
@@ -428,9 +449,10 @@ static struct platform_device *omap3_beagle_devices[] __initdata = {
428 &leds_gpio, 449 &leds_gpio,
429 &keys_gpio, 450 &keys_gpio,
430 &madc_hwmon, 451 &madc_hwmon,
452 &leds_pwm,
431}; 453};
432 454
433static const struct usbhs_omap_board_data usbhs_bdata __initconst = { 455static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
434 456
435 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, 457 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
436 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 458 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
@@ -494,7 +516,7 @@ static int __init beagle_opp_init(void)
494 } 516 }
495 return 0; 517 return 0;
496} 518}
497device_initcall(beagle_opp_init); 519omap_device_initcall(beagle_opp_init);
498 520
499static void __init omap3_beagle_init(void) 521static void __init omap3_beagle_init(void)
500{ 522{
@@ -519,12 +541,13 @@ static void __init omap3_beagle_init(void)
519 omap_sdrc_init(mt46h32m32lf6_sdrc_params, 541 omap_sdrc_init(mt46h32m32lf6_sdrc_params,
520 mt46h32m32lf6_sdrc_params); 542 mt46h32m32lf6_sdrc_params);
521 543
544 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
522 usb_musb_init(NULL); 545 usb_musb_init(NULL);
523 usbhs_init(&usbhs_bdata); 546 usbhs_init(&usbhs_bdata);
524 board_nand_init(omap3beagle_nand_partitions, 547 board_nand_init(omap3beagle_nand_partitions,
525 ARRAY_SIZE(omap3beagle_nand_partitions), NAND_CS, 548 ARRAY_SIZE(omap3beagle_nand_partitions), NAND_CS,
526 NAND_BUSWIDTH_16, NULL); 549 NAND_BUSWIDTH_16, NULL);
527 omap_twl4030_audio_init("omap3beagle"); 550 omap_twl4030_audio_init("omap3beagle", NULL);
528 551
529 /* Ensure msecure is mux'd to be able to set the RTC. */ 552 /* Ensure msecure is mux'd to be able to set the RTC. */
530 omap_mux_init_signal("sys_drm_msecure", OMAP_PIN_OFF_OUTPUT_HIGH); 553 omap_mux_init_signal("sys_drm_msecure", OMAP_PIN_OFF_OUTPUT_HIGH);
@@ -532,6 +555,8 @@ static void __init omap3_beagle_init(void)
532 /* Ensure SDRC pins are mux'd for self-refresh */ 555 /* Ensure SDRC pins are mux'd for self-refresh */
533 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); 556 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
534 omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); 557 omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
558
559 pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup));
535} 560}
536 561
537MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") 562MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
@@ -544,6 +569,6 @@ MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
544 .handle_irq = omap3_intc_handle_irq, 569 .handle_irq = omap3_intc_handle_irq,
545 .init_machine = omap3_beagle_init, 570 .init_machine = omap3_beagle_init,
546 .init_late = omap3_init_late, 571 .init_late = omap3_init_late,
547 .timer = &omap3_secure_timer, 572 .init_time = omap3_secure_sync32k_timer_init,
548 .restart = omap3xxx_restart, 573 .restart = omap3xxx_restart,
549MACHINE_END 574MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 3985f35aee06..48789e0bb915 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -41,6 +41,7 @@
41#include <linux/regulator/machine.h> 41#include <linux/regulator/machine.h>
42#include <linux/mmc/host.h> 42#include <linux/mmc/host.h>
43#include <linux/export.h> 43#include <linux/export.h>
44#include <linux/usb/phy.h>
44 45
45#include <asm/mach-types.h> 46#include <asm/mach-types.h>
46#include <asm/mach/arch.h> 47#include <asm/mach/arch.h>
@@ -309,7 +310,7 @@ static struct omap2_hsmmc_info mmc[] = {
309 .gpio_wp = 63, 310 .gpio_wp = 63,
310 .deferred = true, 311 .deferred = true,
311 }, 312 },
312#ifdef CONFIG_WL12XX_PLATFORM_DATA 313#ifdef CONFIG_WILINK_PLATFORM_DATA
313 { 314 {
314 .name = "wl1271", 315 .name = "wl1271",
315 .mmc = 2, 316 .mmc = 2,
@@ -450,7 +451,7 @@ static struct regulator_init_data omap3evm_vio = {
450 .consumer_supplies = omap3evm_vio_supply, 451 .consumer_supplies = omap3evm_vio_supply,
451}; 452};
452 453
453#ifdef CONFIG_WL12XX_PLATFORM_DATA 454#ifdef CONFIG_WILINK_PLATFORM_DATA
454 455
455#define OMAP3EVM_WLAN_PMENA_GPIO (150) 456#define OMAP3EVM_WLAN_PMENA_GPIO (150)
456#define OMAP3EVM_WLAN_IRQ_GPIO (149) 457#define OMAP3EVM_WLAN_IRQ_GPIO (149)
@@ -538,7 +539,7 @@ static int __init omap3_evm_i2c_init(void)
538 return 0; 539 return 0;
539} 540}
540 541
541static struct usbhs_omap_board_data usbhs_bdata __initdata = { 542static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
542 543
543 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, 544 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
544 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 545 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
@@ -563,7 +564,7 @@ static struct omap_board_mux omap35x_board_mux[] __initdata = {
563 OMAP_PIN_OFF_NONE), 564 OMAP_PIN_OFF_NONE),
564 OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP | 565 OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
565 OMAP_PIN_OFF_NONE), 566 OMAP_PIN_OFF_NONE),
566#ifdef CONFIG_WL12XX_PLATFORM_DATA 567#ifdef CONFIG_WILINK_PLATFORM_DATA
567 /* WLAN IRQ - GPIO 149 */ 568 /* WLAN IRQ - GPIO 149 */
568 OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), 569 OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
569 570
@@ -601,7 +602,7 @@ static struct omap_board_mux omap36x_board_mux[] __initdata = {
601 OMAP3_MUX(SYS_BOOT4, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), 602 OMAP3_MUX(SYS_BOOT4, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
602 OMAP3_MUX(SYS_BOOT5, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), 603 OMAP3_MUX(SYS_BOOT5, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
603 OMAP3_MUX(SYS_BOOT6, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), 604 OMAP3_MUX(SYS_BOOT6, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
604#ifdef CONFIG_WL12XX_PLATFORM_DATA 605#ifdef CONFIG_WILINK_PLATFORM_DATA
605 /* WLAN IRQ - GPIO 149 */ 606 /* WLAN IRQ - GPIO 149 */
606 OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), 607 OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
607 608
@@ -637,7 +638,7 @@ static struct gpio omap3_evm_ehci_gpios[] __initdata = {
637 638
638static void __init omap3_evm_wl12xx_init(void) 639static void __init omap3_evm_wl12xx_init(void)
639{ 640{
640#ifdef CONFIG_WL12XX_PLATFORM_DATA 641#ifdef CONFIG_WILINK_PLATFORM_DATA
641 int ret; 642 int ret;
642 643
643 /* WL12xx WLAN Init */ 644 /* WL12xx WLAN Init */
@@ -734,6 +735,7 @@ static void __init omap3_evm_init(void)
734 omap_mux_init_gpio(135, OMAP_PIN_OUTPUT); 735 omap_mux_init_gpio(135, OMAP_PIN_OUTPUT);
735 usbhs_bdata.reset_gpio_port[1] = 135; 736 usbhs_bdata.reset_gpio_port[1] = 135;
736 } 737 }
738 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
737 usb_musb_init(&musb_board_data); 739 usb_musb_init(&musb_board_data);
738 usbhs_init(&usbhs_bdata); 740 usbhs_init(&usbhs_bdata);
739 board_nand_init(omap3evm_nand_partitions, 741 board_nand_init(omap3evm_nand_partitions,
@@ -744,7 +746,7 @@ static void __init omap3_evm_init(void)
744 omap3evm_init_smsc911x(); 746 omap3evm_init_smsc911x();
745 omap3_evm_display_init(); 747 omap3_evm_display_init();
746 omap3_evm_wl12xx_init(); 748 omap3_evm_wl12xx_init();
747 omap_twl4030_audio_init("omap3evm"); 749 omap_twl4030_audio_init("omap3evm", NULL);
748} 750}
749 751
750MACHINE_START(OMAP3EVM, "OMAP3 EVM") 752MACHINE_START(OMAP3EVM, "OMAP3 EVM")
@@ -757,6 +759,6 @@ MACHINE_START(OMAP3EVM, "OMAP3 EVM")
757 .handle_irq = omap3_intc_handle_irq, 759 .handle_irq = omap3_intc_handle_irq,
758 .init_machine = omap3_evm_init, 760 .init_machine = omap3_evm_init,
759 .init_late = omap35xx_init_late, 761 .init_late = omap35xx_init_late,
760 .timer = &omap3_timer, 762 .init_time = omap3_sync32k_timer_init,
761 .restart = omap3xxx_restart, 763 .restart = omap3xxx_restart,
762MACHINE_END 764MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index 2a065ba6eb58..bab51e64c4b5 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -29,6 +29,7 @@
29 29
30#include <linux/i2c/twl.h> 30#include <linux/i2c/twl.h>
31#include <linux/mmc/host.h> 31#include <linux/mmc/host.h>
32#include <linux/usb/phy.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>
@@ -215,6 +216,7 @@ static void __init omap3logic_init(void)
215 board_mmc_init(); 216 board_mmc_init();
216 board_smsc911x_init(); 217 board_smsc911x_init();
217 218
219 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
218 usb_musb_init(NULL); 220 usb_musb_init(NULL);
219 221
220 /* Ensure SDRC pins are mux'd for self-refresh */ 222 /* Ensure SDRC pins are mux'd for self-refresh */
@@ -231,7 +233,7 @@ MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board")
231 .handle_irq = omap3_intc_handle_irq, 233 .handle_irq = omap3_intc_handle_irq,
232 .init_machine = omap3logic_init, 234 .init_machine = omap3logic_init,
233 .init_late = omap35xx_init_late, 235 .init_late = omap35xx_init_late,
234 .timer = &omap3_timer, 236 .init_time = omap3_sync32k_timer_init,
235 .restart = omap3xxx_restart, 237 .restart = omap3xxx_restart,
236MACHINE_END 238MACHINE_END
237 239
@@ -244,6 +246,6 @@ MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board")
244 .handle_irq = omap3_intc_handle_irq, 246 .handle_irq = omap3_intc_handle_irq,
245 .init_machine = omap3logic_init, 247 .init_machine = omap3logic_init,
246 .init_late = omap35xx_init_late, 248 .init_late = omap35xx_init_late,
247 .timer = &omap3_timer, 249 .init_time = omap3_sync32k_timer_init,
248 .restart = omap3xxx_restart, 250 .restart = omap3xxx_restart,
249MACHINE_END 251MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index a53a6683c1b8..2bba362148a0 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -35,6 +35,7 @@
35#include <linux/mmc/host.h> 35#include <linux/mmc/host.h>
36#include <linux/mmc/card.h> 36#include <linux/mmc/card.h>
37#include <linux/regulator/fixed.h> 37#include <linux/regulator/fixed.h>
38#include <linux/usb/phy.h>
38#include <linux/platform_data/spi-omap2-mcspi.h> 39#include <linux/platform_data/spi-omap2-mcspi.h>
39 40
40#include <asm/mach-types.h> 41#include <asm/mach-types.h>
@@ -567,7 +568,7 @@ static struct platform_device *omap3pandora_devices[] __initdata = {
567 &pandora_backlight, 568 &pandora_backlight,
568}; 569};
569 570
570static const struct usbhs_omap_board_data usbhs_bdata __initconst = { 571static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
571 572
572 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, 573 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
573 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 574 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
@@ -601,6 +602,7 @@ static void __init omap3pandora_init(void)
601 ARRAY_SIZE(omap3pandora_spi_board_info)); 602 ARRAY_SIZE(omap3pandora_spi_board_info));
602 omap_ads7846_init(1, OMAP3_PANDORA_TS_GPIO, 0, NULL); 603 omap_ads7846_init(1, OMAP3_PANDORA_TS_GPIO, 0, NULL);
603 usbhs_init(&usbhs_bdata); 604 usbhs_init(&usbhs_bdata);
605 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
604 usb_musb_init(NULL); 606 usb_musb_init(NULL);
605 gpmc_nand_init(&pandora_nand_data, NULL); 607 gpmc_nand_init(&pandora_nand_data, NULL);
606 608
@@ -618,6 +620,6 @@ MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console")
618 .handle_irq = omap3_intc_handle_irq, 620 .handle_irq = omap3_intc_handle_irq,
619 .init_machine = omap3pandora_init, 621 .init_machine = omap3pandora_init,
620 .init_late = omap35xx_init_late, 622 .init_late = omap35xx_init_late,
621 .timer = &omap3_timer, 623 .init_time = omap3_sync32k_timer_init,
622 .restart = omap3xxx_restart, 624 .restart = omap3xxx_restart,
623MACHINE_END 625MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index 53a6cbcf9747..95c10b3aa678 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -33,6 +33,7 @@
33#include <linux/interrupt.h> 33#include <linux/interrupt.h>
34#include <linux/smsc911x.h> 34#include <linux/smsc911x.h>
35#include <linux/i2c/at24.h> 35#include <linux/i2c/at24.h>
36#include <linux/usb/phy.h>
36 37
37#include <asm/mach-types.h> 38#include <asm/mach-types.h>
38#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
@@ -361,7 +362,7 @@ static struct platform_device *omap3_stalker_devices[] __initdata = {
361 &keys_gpio, 362 &keys_gpio,
362}; 363};
363 364
364static struct usbhs_omap_board_data usbhs_bdata __initconst = { 365static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
365 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, 366 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
366 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 367 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
367 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, 368 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
@@ -404,6 +405,7 @@ static void __init omap3_stalker_init(void)
404 405
405 omap_serial_init(); 406 omap_serial_init();
406 omap_sdrc_init(mt46h32m32lf6_sdrc_params, NULL); 407 omap_sdrc_init(mt46h32m32lf6_sdrc_params, NULL);
408 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
407 usb_musb_init(NULL); 409 usb_musb_init(NULL);
408 usbhs_init(&usbhs_bdata); 410 usbhs_init(&usbhs_bdata);
409 omap_ads7846_init(1, OMAP3_STALKER_TS_GPIO, 310, NULL); 411 omap_ads7846_init(1, OMAP3_STALKER_TS_GPIO, 310, NULL);
@@ -427,6 +429,6 @@ MACHINE_START(SBC3530, "OMAP3 STALKER")
427 .handle_irq = omap3_intc_handle_irq, 429 .handle_irq = omap3_intc_handle_irq,
428 .init_machine = omap3_stalker_init, 430 .init_machine = omap3_stalker_init,
429 .init_late = omap35xx_init_late, 431 .init_late = omap35xx_init_late,
430 .timer = &omap3_secure_timer, 432 .init_time = omap3_secure_sync32k_timer_init,
431 .restart = omap3xxx_restart, 433 .restart = omap3xxx_restart,
432MACHINE_END 434MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index 263cb9cfbf37..bcd44fbcd877 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -28,6 +28,7 @@
28#include <linux/mtd/partitions.h> 28#include <linux/mtd/partitions.h>
29#include <linux/mtd/nand.h> 29#include <linux/mtd/nand.h>
30#include <linux/mmc/host.h> 30#include <linux/mmc/host.h>
31#include <linux/usb/phy.h>
31 32
32#include <linux/platform_data/spi-omap2-mcspi.h> 33#include <linux/platform_data/spi-omap2-mcspi.h>
33#include <linux/spi/spi.h> 34#include <linux/spi/spi.h>
@@ -309,7 +310,7 @@ static struct platform_device *omap3_touchbook_devices[] __initdata = {
309 &keys_gpio, 310 &keys_gpio,
310}; 311};
311 312
312static const struct usbhs_omap_board_data usbhs_bdata __initconst = { 313static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
313 314
314 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 315 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
315 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 316 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
@@ -365,6 +366,7 @@ static void __init omap3_touchbook_init(void)
365 366
366 /* Touchscreen and accelerometer */ 367 /* Touchscreen and accelerometer */
367 omap_ads7846_init(4, OMAP3_TS_GPIO, 310, &ads7846_pdata); 368 omap_ads7846_init(4, OMAP3_TS_GPIO, 310, &ads7846_pdata);
369 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
368 usb_musb_init(NULL); 370 usb_musb_init(NULL);
369 usbhs_init(&usbhs_bdata); 371 usbhs_init(&usbhs_bdata);
370 board_nand_init(omap3touchbook_nand_partitions, 372 board_nand_init(omap3touchbook_nand_partitions,
@@ -386,6 +388,6 @@ MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board")
386 .handle_irq = omap3_intc_handle_irq, 388 .handle_irq = omap3_intc_handle_irq,
387 .init_machine = omap3_touchbook_init, 389 .init_machine = omap3_touchbook_init,
388 .init_late = omap3430_init_late, 390 .init_late = omap3430_init_late,
389 .timer = &omap3_secure_timer, 391 .init_time = omap3_secure_sync32k_timer_init,
390 .restart = omap3xxx_restart, 392 .restart = omap3xxx_restart,
391MACHINE_END 393MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 769c1feee1c4..b02c2f00609b 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -30,10 +30,11 @@
30#include <linux/regulator/fixed.h> 30#include <linux/regulator/fixed.h>
31#include <linux/ti_wilink_st.h> 31#include <linux/ti_wilink_st.h>
32#include <linux/usb/musb.h> 32#include <linux/usb/musb.h>
33#include <linux/usb/phy.h>
33#include <linux/wl12xx.h> 34#include <linux/wl12xx.h>
35#include <linux/irqchip/arm-gic.h>
34#include <linux/platform_data/omap-abe-twl6040.h> 36#include <linux/platform_data/omap-abe-twl6040.h>
35 37
36#include <asm/hardware/gic.h>
37#include <asm/mach-types.h> 38#include <asm/mach-types.h>
38#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
39#include <asm/mach/map.h> 40#include <asm/mach/map.h>
@@ -139,7 +140,7 @@ static struct platform_device *panda_devices[] __initdata = {
139 &btwilink_device, 140 &btwilink_device,
140}; 141};
141 142
142static const struct usbhs_omap_board_data usbhs_bdata __initconst = { 143static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
143 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 144 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
144 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED, 145 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
145 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, 146 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
@@ -447,6 +448,7 @@ static void __init omap4_panda_init(void)
447 omap_sdrc_init(NULL, NULL); 448 omap_sdrc_init(NULL, NULL);
448 omap4_twl6030_hsmmc_init(mmc); 449 omap4_twl6030_hsmmc_init(mmc);
449 omap4_ehci_init(); 450 omap4_ehci_init();
451 usb_bind_phy("musb-hdrc.0.auto", 0, "omap-usb2.1.auto");
450 usb_musb_init(&musb_board_data); 452 usb_musb_init(&musb_board_data);
451 omap4_panda_display_init(); 453 omap4_panda_display_init();
452} 454}
@@ -459,9 +461,8 @@ MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board")
459 .map_io = omap4_map_io, 461 .map_io = omap4_map_io,
460 .init_early = omap4430_init_early, 462 .init_early = omap4430_init_early,
461 .init_irq = gic_init_irq, 463 .init_irq = gic_init_irq,
462 .handle_irq = gic_handle_irq,
463 .init_machine = omap4_panda_init, 464 .init_machine = omap4_panda_init,
464 .init_late = omap4430_init_late, 465 .init_late = omap4430_init_late,
465 .timer = &omap4_timer, 466 .init_time = omap4_local_timer_init,
466 .restart = omap44xx_restart, 467 .restart = omap44xx_restart,
467MACHINE_END 468MACHINE_END
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index c8fde3e56441..86bab51154ee 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -36,6 +36,7 @@
36#include <linux/mtd/nand.h> 36#include <linux/mtd/nand.h>
37#include <linux/mtd/partitions.h> 37#include <linux/mtd/partitions.h>
38#include <linux/mmc/host.h> 38#include <linux/mmc/host.h>
39#include <linux/usb/phy.h>
39 40
40#include <linux/platform_data/mtd-nand-omap2.h> 41#include <linux/platform_data/mtd-nand-omap2.h>
41#include <linux/platform_data/spi-omap2-mcspi.h> 42#include <linux/platform_data/spi-omap2-mcspi.h>
@@ -457,7 +458,7 @@ static int __init overo_spi_init(void)
457 return 0; 458 return 0;
458} 459}
459 460
460static const struct usbhs_omap_board_data usbhs_bdata __initconst = { 461static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
461 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, 462 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
462 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 463 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
463 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, 464 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
@@ -499,6 +500,7 @@ static void __init overo_init(void)
499 mt46h32m32lf6_sdrc_params); 500 mt46h32m32lf6_sdrc_params);
500 board_nand_init(overo_nand_partitions, 501 board_nand_init(overo_nand_partitions,
501 ARRAY_SIZE(overo_nand_partitions), NAND_CS, 0, NULL); 502 ARRAY_SIZE(overo_nand_partitions), NAND_CS, 0, NULL);
503 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
502 usb_musb_init(NULL); 504 usb_musb_init(NULL);
503 usbhs_init(&usbhs_bdata); 505 usbhs_init(&usbhs_bdata);
504 overo_spi_init(); 506 overo_spi_init();
@@ -506,7 +508,7 @@ static void __init overo_init(void)
506 overo_display_init(); 508 overo_display_init();
507 overo_init_led(); 509 overo_init_led();
508 overo_init_keys(); 510 overo_init_keys();
509 omap_twl4030_audio_init("overo"); 511 omap_twl4030_audio_init("overo", NULL);
510 512
511 /* Ensure SDRC pins are mux'd for self-refresh */ 513 /* Ensure SDRC pins are mux'd for self-refresh */
512 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); 514 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
@@ -551,6 +553,6 @@ MACHINE_START(OVERO, "Gumstix Overo")
551 .handle_irq = omap3_intc_handle_irq, 553 .handle_irq = omap3_intc_handle_irq,
552 .init_machine = overo_init, 554 .init_machine = overo_init,
553 .init_late = omap35xx_init_late, 555 .init_late = omap35xx_init_late,
554 .timer = &omap3_timer, 556 .init_time = omap3_sync32k_timer_init,
555 .restart = omap3xxx_restart, 557 .restart = omap3xxx_restart,
556MACHINE_END 558MACHINE_END
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c
index 0c777b75e484..345e8c4b8731 100644
--- a/arch/arm/mach-omap2/board-rm680.c
+++ b/arch/arm/mach-omap2/board-rm680.c
@@ -18,6 +18,7 @@
18#include <linux/regulator/machine.h> 18#include <linux/regulator/machine.h>
19#include <linux/regulator/consumer.h> 19#include <linux/regulator/consumer.h>
20#include <linux/platform_data/mtd-onenand-omap2.h> 20#include <linux/platform_data/mtd-onenand-omap2.h>
21#include <linux/usb/phy.h>
21 22
22#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
23#include <asm/mach-types.h> 24#include <asm/mach-types.h>
@@ -134,6 +135,7 @@ static void __init rm680_init(void)
134 sdrc_params = nokia_get_sdram_timings(); 135 sdrc_params = nokia_get_sdram_timings();
135 omap_sdrc_init(sdrc_params, sdrc_params); 136 omap_sdrc_init(sdrc_params, sdrc_params);
136 137
138 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
137 usb_musb_init(NULL); 139 usb_musb_init(NULL);
138 rm680_peripherals_init(); 140 rm680_peripherals_init();
139} 141}
@@ -147,7 +149,7 @@ MACHINE_START(NOKIA_RM680, "Nokia RM-680 board")
147 .handle_irq = omap3_intc_handle_irq, 149 .handle_irq = omap3_intc_handle_irq,
148 .init_machine = rm680_init, 150 .init_machine = rm680_init,
149 .init_late = omap3630_init_late, 151 .init_late = omap3630_init_late,
150 .timer = &omap3_timer, 152 .init_time = omap3_sync32k_timer_init,
151 .restart = omap3xxx_restart, 153 .restart = omap3xxx_restart,
152MACHINE_END 154MACHINE_END
153 155
@@ -160,6 +162,6 @@ MACHINE_START(NOKIA_RM696, "Nokia RM-696 board")
160 .handle_irq = omap3_intc_handle_irq, 162 .handle_irq = omap3_intc_handle_irq,
161 .init_machine = rm680_init, 163 .init_machine = rm680_init,
162 .init_late = omap3630_init_late, 164 .init_late = omap3630_init_late,
163 .timer = &omap3_timer, 165 .init_time = omap3_sync32k_timer_init,
164 .restart = omap3xxx_restart, 166 .restart = omap3xxx_restart,
165MACHINE_END 167MACHINE_END
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index cf07e289b4ea..3a077df6b8df 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -40,9 +40,9 @@
40#include <sound/tpa6130a2-plat.h> 40#include <sound/tpa6130a2-plat.h>
41#include <media/radio-si4713.h> 41#include <media/radio-si4713.h>
42#include <media/si4713.h> 42#include <media/si4713.h>
43#include <linux/leds-lp5523.h> 43#include <linux/platform_data/leds-lp55xx.h>
44 44
45#include <../drivers/staging/iio/light/tsl2563.h> 45#include <linux/platform_data/tsl2563.h>
46#include <linux/lis3lv02d.h> 46#include <linux/lis3lv02d.h>
47 47
48#if defined(CONFIG_IR_RX51) || defined(CONFIG_IR_RX51_MODULE) 48#if defined(CONFIG_IR_RX51) || defined(CONFIG_IR_RX51_MODULE)
@@ -160,32 +160,41 @@ static struct tsl2563_platform_data rx51_tsl2563_platform_data = {
160#endif 160#endif
161 161
162#if defined(CONFIG_LEDS_LP5523) || defined(CONFIG_LEDS_LP5523_MODULE) 162#if defined(CONFIG_LEDS_LP5523) || defined(CONFIG_LEDS_LP5523_MODULE)
163static struct lp5523_led_config rx51_lp5523_led_config[] = { 163static struct lp55xx_led_config rx51_lp5523_led_config[] = {
164 { 164 {
165 .name = "lp5523:kb1",
165 .chan_nr = 0, 166 .chan_nr = 0,
166 .led_current = 50, 167 .led_current = 50,
167 }, { 168 }, {
169 .name = "lp5523:kb2",
168 .chan_nr = 1, 170 .chan_nr = 1,
169 .led_current = 50, 171 .led_current = 50,
170 }, { 172 }, {
173 .name = "lp5523:kb3",
171 .chan_nr = 2, 174 .chan_nr = 2,
172 .led_current = 50, 175 .led_current = 50,
173 }, { 176 }, {
177 .name = "lp5523:kb4",
174 .chan_nr = 3, 178 .chan_nr = 3,
175 .led_current = 50, 179 .led_current = 50,
176 }, { 180 }, {
181 .name = "lp5523:b",
177 .chan_nr = 4, 182 .chan_nr = 4,
178 .led_current = 50, 183 .led_current = 50,
179 }, { 184 }, {
185 .name = "lp5523:g",
180 .chan_nr = 5, 186 .chan_nr = 5,
181 .led_current = 50, 187 .led_current = 50,
182 }, { 188 }, {
189 .name = "lp5523:r",
183 .chan_nr = 6, 190 .chan_nr = 6,
184 .led_current = 50, 191 .led_current = 50,
185 }, { 192 }, {
193 .name = "lp5523:kb5",
186 .chan_nr = 7, 194 .chan_nr = 7,
187 .led_current = 50, 195 .led_current = 50,
188 }, { 196 }, {
197 .name = "lp5523:kb6",
189 .chan_nr = 8, 198 .chan_nr = 8,
190 .led_current = 50, 199 .led_current = 50,
191 } 200 }
@@ -207,10 +216,10 @@ static void rx51_lp5523_enable(bool state)
207 gpio_set_value(RX51_LP5523_CHIP_EN_GPIO, !!state); 216 gpio_set_value(RX51_LP5523_CHIP_EN_GPIO, !!state);
208} 217}
209 218
210static struct lp5523_platform_data rx51_lp5523_platform_data = { 219static struct lp55xx_platform_data rx51_lp5523_platform_data = {
211 .led_config = rx51_lp5523_led_config, 220 .led_config = rx51_lp5523_led_config,
212 .num_channels = ARRAY_SIZE(rx51_lp5523_led_config), 221 .num_channels = ARRAY_SIZE(rx51_lp5523_led_config),
213 .clock_mode = LP5523_CLOCK_AUTO, 222 .clock_mode = LP55XX_CLOCK_AUTO,
214 .setup_resources = rx51_lp5523_setup, 223 .setup_resources = rx51_lp5523_setup,
215 .release_resources = rx51_lp5523_release, 224 .release_resources = rx51_lp5523_release,
216 .enable = rx51_lp5523_enable, 225 .enable = rx51_lp5523_enable,
@@ -1253,6 +1262,16 @@ static void __init rx51_init_lirc(void)
1253} 1262}
1254#endif 1263#endif
1255 1264
1265static struct platform_device madc_hwmon = {
1266 .name = "twl4030_madc_hwmon",
1267 .id = -1,
1268};
1269
1270static void __init rx51_init_twl4030_hwmon(void)
1271{
1272 platform_device_register(&madc_hwmon);
1273}
1274
1256void __init rx51_peripherals_init(void) 1275void __init rx51_peripherals_init(void)
1257{ 1276{
1258 rx51_i2c_init(); 1277 rx51_i2c_init();
@@ -1272,5 +1291,6 @@ void __init rx51_peripherals_init(void)
1272 omap_hsmmc_init(mmc); 1291 omap_hsmmc_init(mmc);
1273 1292
1274 rx51_charger_init(); 1293 rx51_charger_init();
1294 rx51_init_twl4030_hwmon();
1275} 1295}
1276 1296
diff --git a/arch/arm/mach-omap2/board-rx51-video.c b/arch/arm/mach-omap2/board-rx51-video.c
index 46f4fc982766..eb667261df08 100644
--- a/arch/arm/mach-omap2/board-rx51-video.c
+++ b/arch/arm/mach-omap2/board-rx51-video.c
@@ -18,6 +18,7 @@
18#include <video/omapdss.h> 18#include <video/omapdss.h>
19#include <linux/platform_data/spi-omap2-mcspi.h> 19#include <linux/platform_data/spi-omap2-mcspi.h>
20 20
21#include "soc.h"
21#include "board-rx51.h" 22#include "board-rx51.h"
22 23
23#include "mux.h" 24#include "mux.h"
@@ -85,5 +86,5 @@ static int __init rx51_video_init(void)
85 return 0; 86 return 0;
86} 87}
87 88
88subsys_initcall(rx51_video_init); 89omap_subsys_initcall(rx51_video_init);
89#endif /* defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) */ 90#endif /* defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) */
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index d0374ea2dfb0..f7c4616cbb60 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -123,6 +123,6 @@ MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
123 .handle_irq = omap3_intc_handle_irq, 123 .handle_irq = omap3_intc_handle_irq,
124 .init_machine = rx51_init, 124 .init_machine = rx51_init,
125 .init_late = omap3430_init_late, 125 .init_late = omap3430_init_late,
126 .timer = &omap3_timer, 126 .init_time = omap3_sync32k_timer_init,
127 .restart = omap3xxx_restart, 127 .restart = omap3xxx_restart,
128MACHINE_END 128MACHINE_END
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c b/arch/arm/mach-omap2/board-ti8168evm.c
index 1a3e056d63a7..6273c286e1d8 100644
--- a/arch/arm/mach-omap2/board-ti8168evm.c
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -43,7 +43,7 @@ MACHINE_START(TI8168EVM, "ti8168evm")
43 .map_io = ti81xx_map_io, 43 .map_io = ti81xx_map_io,
44 .init_early = ti81xx_init_early, 44 .init_early = ti81xx_init_early,
45 .init_irq = ti81xx_init_irq, 45 .init_irq = ti81xx_init_irq,
46 .timer = &omap3_timer, 46 .init_time = omap3_sync32k_timer_init,
47 .init_machine = ti81xx_evm_init, 47 .init_machine = ti81xx_evm_init,
48 .init_late = ti81xx_init_late, 48 .init_late = ti81xx_init_late,
49 .restart = omap44xx_restart, 49 .restart = omap44xx_restart,
@@ -55,7 +55,7 @@ MACHINE_START(TI8148EVM, "ti8148evm")
55 .map_io = ti81xx_map_io, 55 .map_io = ti81xx_map_io,
56 .init_early = ti81xx_init_early, 56 .init_early = ti81xx_init_early,
57 .init_irq = ti81xx_init_irq, 57 .init_irq = ti81xx_init_irq,
58 .timer = &omap3_timer, 58 .init_time = omap3_sync32k_timer_init,
59 .init_machine = ti81xx_evm_init, 59 .init_machine = ti81xx_evm_init,
60 .init_late = ti81xx_init_late, 60 .init_late = ti81xx_init_late,
61 .restart = omap44xx_restart, 61 .restart = omap44xx_restart,
diff --git a/arch/arm/mach-omap2/board-zoom-display.c b/arch/arm/mach-omap2/board-zoom-display.c
index 1c7c834a5b5f..8cef477d6b00 100644
--- a/arch/arm/mach-omap2/board-zoom-display.c
+++ b/arch/arm/mach-omap2/board-zoom-display.c
@@ -49,13 +49,13 @@ static void zoom_panel_disable_lcd(struct omap_dss_device *dssdev)
49{ 49{
50} 50}
51 51
52/* 52/* Register offsets in TWL4030_MODULE_INTBR */
53 * PWMA/B register offsets (TWL4030_MODULE_PWMA)
54 */
55#define TWL_INTBR_PMBR1 0xD 53#define TWL_INTBR_PMBR1 0xD
56#define TWL_INTBR_GPBR1 0xC 54#define TWL_INTBR_GPBR1 0xC
57#define TWL_LED_PWMON 0x0 55
58#define TWL_LED_PWMOFF 0x1 56/* Register offsets in TWL_MODULE_PWM */
57#define TWL_LED_PWMON 0x3
58#define TWL_LED_PWMOFF 0x4
59 59
60static int zoom_set_bl_intensity(struct omap_dss_device *dssdev, int level) 60static int zoom_set_bl_intensity(struct omap_dss_device *dssdev, int level)
61{ 61{
@@ -93,8 +93,8 @@ static int zoom_set_bl_intensity(struct omap_dss_device *dssdev, int level)
93 } 93 }
94 94
95 c = ((50 * (100 - level)) / 100) + 1; 95 c = ((50 * (100 - level)) / 100) + 1;
96 twl_i2c_write_u8(TWL4030_MODULE_PWM1, 0x7F, TWL_LED_PWMOFF); 96 twl_i2c_write_u8(TWL_MODULE_PWM, 0x7F, TWL_LED_PWMOFF);
97 twl_i2c_write_u8(TWL4030_MODULE_PWM1, c, TWL_LED_PWMON); 97 twl_i2c_write_u8(TWL_MODULE_PWM, c, TWL_LED_PWMON);
98#else 98#else
99 pr_warn("Backlight not enabled\n"); 99 pr_warn("Backlight not enabled\n");
100#endif 100#endif
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
index 26e07addc9d7..cdc0c1021863 100644
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -20,6 +20,8 @@
20#include <linux/wl12xx.h> 20#include <linux/wl12xx.h>
21#include <linux/mmc/host.h> 21#include <linux/mmc/host.h>
22#include <linux/platform_data/gpio-omap.h> 22#include <linux/platform_data/gpio-omap.h>
23#include <linux/platform_data/omap-twl4030.h>
24#include <linux/usb/phy.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>
@@ -34,11 +36,9 @@
34#include "common-board-devices.h" 36#include "common-board-devices.h"
35 37
36#define OMAP_ZOOM_WLAN_PMENA_GPIO (101) 38#define OMAP_ZOOM_WLAN_PMENA_GPIO (101)
37#define ZOOM2_HEADSET_EXTMUTE_GPIO (153) 39#define OMAP_ZOOM_TSC2004_IRQ_GPIO (153)
38#define OMAP_ZOOM_WLAN_IRQ_GPIO (162) 40#define OMAP_ZOOM_WLAN_IRQ_GPIO (162)
39 41
40#define LCD_PANEL_ENABLE_GPIO (7 + OMAP_MAX_GPIO_LINES)
41
42/* Zoom2 has Qwerty keyboard*/ 42/* Zoom2 has Qwerty keyboard*/
43static uint32_t board_keymap[] = { 43static uint32_t board_keymap[] = {
44 KEY(0, 0, KEY_E), 44 KEY(0, 0, KEY_E),
@@ -226,22 +226,31 @@ static struct omap2_hsmmc_info mmc[] = {
226 {} /* Terminator */ 226 {} /* Terminator */
227}; 227};
228 228
229static struct omap_tw4030_pdata omap_twl4030_audio_data = {
230 .voice_connected = true,
231 .custom_routing = true,
232
233 .has_hs = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT,
234 .has_hf = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT,
235
236 .has_mainmic = true,
237 .has_submic = true,
238 .has_hsmic = true,
239 .has_linein = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT,
240};
241
229static int zoom_twl_gpio_setup(struct device *dev, 242static int zoom_twl_gpio_setup(struct device *dev,
230 unsigned gpio, unsigned ngpio) 243 unsigned gpio, unsigned ngpio)
231{ 244{
232 int ret;
233
234 /* gpio + 0 is "mmc0_cd" (input/IRQ) */ 245 /* gpio + 0 is "mmc0_cd" (input/IRQ) */
235 mmc[0].gpio_cd = gpio + 0; 246 mmc[0].gpio_cd = gpio + 0;
236 omap_hsmmc_late_init(mmc); 247 omap_hsmmc_late_init(mmc);
237 248
238 ret = gpio_request_one(LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, 249 /* Audio setup */
239 "lcd enable"); 250 omap_twl4030_audio_data.jack_detect = gpio + 2;
240 if (ret) 251 omap_twl4030_audio_init("Zoom2", &omap_twl4030_audio_data);
241 pr_err("Failed to get LCD_PANEL_ENABLE_GPIO (gpio%d).\n",
242 LCD_PANEL_ENABLE_GPIO);
243 252
244 return ret; 253 return 0;
245} 254}
246 255
247static struct twl4030_gpio_platform_data zoom_gpio_data = { 256static struct twl4030_gpio_platform_data zoom_gpio_data = {
@@ -264,14 +273,9 @@ static int __init omap_i2c_init(void)
264 TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_AUDIO, 273 TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_AUDIO,
265 TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2); 274 TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
266 275
267 if (machine_is_omap_zoom2()) { 276 if (machine_is_omap_zoom2())
268 struct twl4030_codec_data *codec_data; 277 zoom_twldata.audio->codec->ramp_delay_value = 3; /* 161 ms */
269 codec_data = zoom_twldata.audio->codec;
270 278
271 codec_data->ramp_delay_value = 3; /* 161 ms */
272 codec_data->hs_extmute = 1;
273 codec_data->hs_extmute_gpio = ZOOM2_HEADSET_EXTMUTE_GPIO;
274 }
275 omap_pmic_init(1, 2400, "twl5030", 7 + OMAP_INTC_START, &zoom_twldata); 279 omap_pmic_init(1, 2400, "twl5030", 7 + OMAP_INTC_START, &zoom_twldata);
276 omap_register_i2c_bus(2, 400, NULL, 0); 280 omap_register_i2c_bus(2, 400, NULL, 0);
277 omap_register_i2c_bus(3, 400, NULL, 0); 281 omap_register_i2c_bus(3, 400, NULL, 0);
@@ -298,6 +302,7 @@ void __init zoom_peripherals_init(void)
298 omap_hsmmc_init(mmc); 302 omap_hsmmc_init(mmc);
299 omap_i2c_init(); 303 omap_i2c_init();
300 platform_device_register(&omap_vwlan_device); 304 platform_device_register(&omap_vwlan_device);
305 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
301 usb_musb_init(NULL); 306 usb_musb_init(NULL);
302 enable_board_wakeup_source(); 307 enable_board_wakeup_source();
303 omap_serial_init(); 308 omap_serial_init();
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c
index d7fa31e67238..5e4d4c9fe61a 100644
--- a/arch/arm/mach-omap2/board-zoom.c
+++ b/arch/arm/mach-omap2/board-zoom.c
@@ -92,7 +92,7 @@ static struct mtd_partition zoom_nand_partitions[] = {
92 }, 92 },
93}; 93};
94 94
95static const struct usbhs_omap_board_data usbhs_bdata __initconst = { 95static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
96 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, 96 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
97 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 97 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
98 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, 98 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
@@ -137,7 +137,7 @@ MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
137 .handle_irq = omap3_intc_handle_irq, 137 .handle_irq = omap3_intc_handle_irq,
138 .init_machine = omap_zoom_init, 138 .init_machine = omap_zoom_init,
139 .init_late = omap3430_init_late, 139 .init_late = omap3430_init_late,
140 .timer = &omap3_timer, 140 .init_time = omap3_sync32k_timer_init,
141 .restart = omap3xxx_restart, 141 .restart = omap3xxx_restart,
142MACHINE_END 142MACHINE_END
143 143
@@ -150,6 +150,6 @@ MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
150 .handle_irq = omap3_intc_handle_irq, 150 .handle_irq = omap3_intc_handle_irq,
151 .init_machine = omap_zoom_init, 151 .init_machine = omap_zoom_init,
152 .init_late = omap3630_init_late, 152 .init_late = omap3630_init_late,
153 .timer = &omap3_timer, 153 .init_time = omap3_sync32k_timer_init,
154 .restart = omap3xxx_restart, 154 .restart = omap3xxx_restart,
155MACHINE_END 155MACHINE_END
diff --git a/arch/arm/mach-omap2/cclock2420_data.c b/arch/arm/mach-omap2/cclock2420_data.c
index ab7e952d2070..0f0a97c1fcc0 100644
--- a/arch/arm/mach-omap2/cclock2420_data.c
+++ b/arch/arm/mach-omap2/cclock2420_data.c
@@ -622,15 +622,10 @@ static struct clk_hw_omap gpios_fck_hw = {
622 622
623DEFINE_STRUCT_CLK(gpios_fck, gpios_fck_parent_names, aes_ick_ops); 623DEFINE_STRUCT_CLK(gpios_fck, gpios_fck_parent_names, aes_ick_ops);
624 624
625static struct clk wu_l4_ick;
626
627DEFINE_STRUCT_CLK_HW_OMAP(wu_l4_ick, "wkup_clkdm");
628DEFINE_STRUCT_CLK(wu_l4_ick, dpll_ck_parent_names, core_ck_ops);
629
630static struct clk gpios_ick; 625static struct clk gpios_ick;
631 626
632static const char *gpios_ick_parent_names[] = { 627static const char *gpios_ick_parent_names[] = {
633 "wu_l4_ick", 628 "sys_ck",
634}; 629};
635 630
636static struct clk_hw_omap gpios_ick_hw = { 631static struct clk_hw_omap gpios_ick_hw = {
@@ -1682,13 +1677,6 @@ static struct clk_hw_omap wdt1_ick_hw = {
1682 1677
1683DEFINE_STRUCT_CLK(wdt1_ick, gpios_ick_parent_names, aes_ick_ops); 1678DEFINE_STRUCT_CLK(wdt1_ick, gpios_ick_parent_names, aes_ick_ops);
1684 1679
1685static struct clk wdt1_osc_ck;
1686
1687static const struct clk_ops wdt1_osc_ck_ops = {};
1688
1689DEFINE_STRUCT_CLK_HW_OMAP(wdt1_osc_ck, NULL);
1690DEFINE_STRUCT_CLK(wdt1_osc_ck, sys_ck_parent_names, wdt1_osc_ck_ops);
1691
1692static struct clk wdt3_fck; 1680static struct clk wdt3_fck;
1693 1681
1694static struct clk_hw_omap wdt3_fck_hw = { 1682static struct clk_hw_omap wdt3_fck_hw = {
@@ -1767,7 +1755,6 @@ static struct omap_clk omap2420_clks[] = {
1767 CLK(NULL, "func_96m_ck", &func_96m_ck, CK_242X), 1755 CLK(NULL, "func_96m_ck", &func_96m_ck, CK_242X),
1768 CLK(NULL, "func_48m_ck", &func_48m_ck, CK_242X), 1756 CLK(NULL, "func_48m_ck", &func_48m_ck, CK_242X),
1769 CLK(NULL, "func_12m_ck", &func_12m_ck, CK_242X), 1757 CLK(NULL, "func_12m_ck", &func_12m_ck, CK_242X),
1770 CLK(NULL, "ck_wdt1_osc", &wdt1_osc_ck, CK_242X),
1771 CLK(NULL, "sys_clkout_src", &sys_clkout_src, CK_242X), 1758 CLK(NULL, "sys_clkout_src", &sys_clkout_src, CK_242X),
1772 CLK(NULL, "sys_clkout", &sys_clkout, CK_242X), 1759 CLK(NULL, "sys_clkout", &sys_clkout, CK_242X),
1773 CLK(NULL, "sys_clkout2_src", &sys_clkout2_src, CK_242X), 1760 CLK(NULL, "sys_clkout2_src", &sys_clkout2_src, CK_242X),
@@ -1797,7 +1784,6 @@ static struct omap_clk omap2420_clks[] = {
1797 /* L4 domain clocks */ 1784 /* L4 domain clocks */
1798 CLK(NULL, "l4_ck", &l4_ck, CK_242X), 1785 CLK(NULL, "l4_ck", &l4_ck, CK_242X),
1799 CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_242X), 1786 CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_242X),
1800 CLK(NULL, "wu_l4_ick", &wu_l4_ick, CK_242X),
1801 /* virtual meta-group clock */ 1787 /* virtual meta-group clock */
1802 CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_242X), 1788 CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_242X),
1803 /* general l4 interface ck, multi-parent functional clk */ 1789 /* general l4 interface ck, multi-parent functional clk */
diff --git a/arch/arm/mach-omap2/cclock2430_data.c b/arch/arm/mach-omap2/cclock2430_data.c
index eb3dab68d536..aed8f74ca076 100644
--- a/arch/arm/mach-omap2/cclock2430_data.c
+++ b/arch/arm/mach-omap2/cclock2430_data.c
@@ -601,15 +601,10 @@ static struct clk_hw_omap gpios_fck_hw = {
601 601
602DEFINE_STRUCT_CLK(gpios_fck, gpio5_fck_parent_names, aes_ick_ops); 602DEFINE_STRUCT_CLK(gpios_fck, gpio5_fck_parent_names, aes_ick_ops);
603 603
604static struct clk wu_l4_ick;
605
606DEFINE_STRUCT_CLK_HW_OMAP(wu_l4_ick, "wkup_clkdm");
607DEFINE_STRUCT_CLK(wu_l4_ick, dpll_ck_parent_names, core_ck_ops);
608
609static struct clk gpios_ick; 604static struct clk gpios_ick;
610 605
611static const char *gpios_ick_parent_names[] = { 606static const char *gpios_ick_parent_names[] = {
612 "wu_l4_ick", 607 "sys_ck",
613}; 608};
614 609
615static struct clk_hw_omap gpios_ick_hw = { 610static struct clk_hw_omap gpios_ick_hw = {
@@ -1811,13 +1806,6 @@ static struct clk_hw_omap wdt1_ick_hw = {
1811 1806
1812DEFINE_STRUCT_CLK(wdt1_ick, gpios_ick_parent_names, aes_ick_ops); 1807DEFINE_STRUCT_CLK(wdt1_ick, gpios_ick_parent_names, aes_ick_ops);
1813 1808
1814static struct clk wdt1_osc_ck;
1815
1816static const struct clk_ops wdt1_osc_ck_ops = {};
1817
1818DEFINE_STRUCT_CLK_HW_OMAP(wdt1_osc_ck, NULL);
1819DEFINE_STRUCT_CLK(wdt1_osc_ck, sys_ck_parent_names, wdt1_osc_ck_ops);
1820
1821static struct clk wdt4_fck; 1809static struct clk wdt4_fck;
1822 1810
1823static struct clk_hw_omap wdt4_fck_hw = { 1811static struct clk_hw_omap wdt4_fck_hw = {
@@ -1869,7 +1857,6 @@ static struct omap_clk omap2430_clks[] = {
1869 CLK(NULL, "func_96m_ck", &func_96m_ck, CK_243X), 1857 CLK(NULL, "func_96m_ck", &func_96m_ck, CK_243X),
1870 CLK(NULL, "func_48m_ck", &func_48m_ck, CK_243X), 1858 CLK(NULL, "func_48m_ck", &func_48m_ck, CK_243X),
1871 CLK(NULL, "func_12m_ck", &func_12m_ck, CK_243X), 1859 CLK(NULL, "func_12m_ck", &func_12m_ck, CK_243X),
1872 CLK(NULL, "ck_wdt1_osc", &wdt1_osc_ck, CK_243X),
1873 CLK(NULL, "sys_clkout_src", &sys_clkout_src, CK_243X), 1860 CLK(NULL, "sys_clkout_src", &sys_clkout_src, CK_243X),
1874 CLK(NULL, "sys_clkout", &sys_clkout, CK_243X), 1861 CLK(NULL, "sys_clkout", &sys_clkout, CK_243X),
1875 CLK(NULL, "emul_ck", &emul_ck, CK_243X), 1862 CLK(NULL, "emul_ck", &emul_ck, CK_243X),
@@ -1898,7 +1885,6 @@ static struct omap_clk omap2430_clks[] = {
1898 /* L4 domain clocks */ 1885 /* L4 domain clocks */
1899 CLK(NULL, "l4_ck", &l4_ck, CK_243X), 1886 CLK(NULL, "l4_ck", &l4_ck, CK_243X),
1900 CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_243X), 1887 CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_243X),
1901 CLK(NULL, "wu_l4_ick", &wu_l4_ick, CK_243X),
1902 /* virtual meta-group clock */ 1888 /* virtual meta-group clock */
1903 CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_243X), 1889 CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_243X),
1904 /* general l4 interface ck, multi-parent functional clk */ 1890 /* general l4 interface ck, multi-parent functional clk */
diff --git a/arch/arm/mach-omap2/cclock33xx_data.c b/arch/arm/mach-omap2/cclock33xx_data.c
index ea64ad606759..476b82066cb6 100644
--- a/arch/arm/mach-omap2/cclock33xx_data.c
+++ b/arch/arm/mach-omap2/cclock33xx_data.c
@@ -284,9 +284,10 @@ DEFINE_STRUCT_CLK(dpll_disp_ck, dpll_core_ck_parents, dpll_ddr_ck_ops);
284 * TODO: Add clksel here (sys_clkin, CORE_CLKOUTM6, PER_CLKOUTM2 284 * TODO: Add clksel here (sys_clkin, CORE_CLKOUTM6, PER_CLKOUTM2
285 * and ALT_CLK1/2) 285 * and ALT_CLK1/2)
286 */ 286 */
287DEFINE_CLK_DIVIDER(dpll_disp_m2_ck, "dpll_disp_ck", &dpll_disp_ck, 0x0, 287DEFINE_CLK_DIVIDER(dpll_disp_m2_ck, "dpll_disp_ck", &dpll_disp_ck,
288 AM33XX_CM_DIV_M2_DPLL_DISP, AM33XX_DPLL_CLKOUT_DIV_SHIFT, 288 CLK_SET_RATE_PARENT, AM33XX_CM_DIV_M2_DPLL_DISP,
289 AM33XX_DPLL_CLKOUT_DIV_WIDTH, CLK_DIVIDER_ONE_BASED, NULL); 289 AM33XX_DPLL_CLKOUT_DIV_SHIFT, AM33XX_DPLL_CLKOUT_DIV_WIDTH,
290 CLK_DIVIDER_ONE_BASED, NULL);
290 291
291/* DPLL_PER */ 292/* DPLL_PER */
292static struct dpll_data dpll_per_dd = { 293static struct dpll_data dpll_per_dd = {
@@ -723,7 +724,8 @@ static struct clk_hw_omap lcd_gclk_hw = {
723 .clksel_mask = AM33XX_CLKSEL_0_1_MASK, 724 .clksel_mask = AM33XX_CLKSEL_0_1_MASK,
724}; 725};
725 726
726DEFINE_STRUCT_CLK(lcd_gclk, lcd_ck_parents, gpio_fck_ops); 727DEFINE_STRUCT_CLK_FLAGS(lcd_gclk, lcd_ck_parents,
728 gpio_fck_ops, CLK_SET_RATE_PARENT);
727 729
728DEFINE_CLK_FIXED_FACTOR(mmc_clk, "dpll_per_m2_ck", &dpll_per_m2_ck, 0x0, 1, 2); 730DEFINE_CLK_FIXED_FACTOR(mmc_clk, "dpll_per_m2_ck", &dpll_per_m2_ck, 0x0, 1, 2);
729 731
diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c b/arch/arm/mach-omap2/cclock3xxx_data.c
index 6ef87580c33f..4579c3c5338f 100644
--- a/arch/arm/mach-omap2/cclock3xxx_data.c
+++ b/arch/arm/mach-omap2/cclock3xxx_data.c
@@ -426,6 +426,7 @@ static struct clk dpll4_m5x2_ck_3630 = {
426 .parent_names = dpll4_m5x2_ck_parent_names, 426 .parent_names = dpll4_m5x2_ck_parent_names,
427 .num_parents = ARRAY_SIZE(dpll4_m5x2_ck_parent_names), 427 .num_parents = ARRAY_SIZE(dpll4_m5x2_ck_parent_names),
428 .ops = &dpll4_m5x2_ck_3630_ops, 428 .ops = &dpll4_m5x2_ck_3630_ops,
429 .flags = CLK_SET_RATE_PARENT,
429}; 430};
430 431
431static struct clk cam_mclk; 432static struct clk cam_mclk;
@@ -443,7 +444,14 @@ static struct clk_hw_omap cam_mclk_hw = {
443 .clkdm_name = "cam_clkdm", 444 .clkdm_name = "cam_clkdm",
444}; 445};
445 446
446DEFINE_STRUCT_CLK(cam_mclk, cam_mclk_parent_names, aes2_ick_ops); 447static struct clk cam_mclk = {
448 .name = "cam_mclk",
449 .hw = &cam_mclk_hw.hw,
450 .parent_names = cam_mclk_parent_names,
451 .num_parents = ARRAY_SIZE(cam_mclk_parent_names),
452 .ops = &aes2_ick_ops,
453 .flags = CLK_SET_RATE_PARENT,
454};
447 455
448static const struct clksel_rate clkout2_src_core_rates[] = { 456static const struct clksel_rate clkout2_src_core_rates[] = {
449 { .div = 1, .val = 0, .flags = RATE_IN_3XXX }, 457 { .div = 1, .val = 0, .flags = RATE_IN_3XXX },
diff --git a/arch/arm/mach-omap2/cclock44xx_data.c b/arch/arm/mach-omap2/cclock44xx_data.c
index a2cc046b47f4..3d58f335f173 100644
--- a/arch/arm/mach-omap2/cclock44xx_data.c
+++ b/arch/arm/mach-omap2/cclock44xx_data.c
@@ -16,6 +16,10 @@
16 * XXX Some of the ES1 clocks have been removed/changed; once support 16 * XXX Some of the ES1 clocks have been removed/changed; once support
17 * is added for discriminating clocks by ES level, these should be added back 17 * is added for discriminating clocks by ES level, these should be added back
18 * in. 18 * in.
19 *
20 * XXX All of the remaining MODULEMODE clock nodes should be removed
21 * once the drivers are updated to use pm_runtime or to use the appropriate
22 * upstream clock node for rate/parent selection.
19 */ 23 */
20 24
21#include <linux/kernel.h> 25#include <linux/kernel.h>
@@ -315,7 +319,7 @@ DEFINE_CLK_DIVIDER(dpll_abe_m2_ck, "dpll_abe_ck", &dpll_abe_ck, 0x0,
315 OMAP4430_CM_DIV_M2_DPLL_ABE, OMAP4430_DPLL_CLKOUT_DIV_SHIFT, 319 OMAP4430_CM_DIV_M2_DPLL_ABE, OMAP4430_DPLL_CLKOUT_DIV_SHIFT,
316 OMAP4430_DPLL_CLKOUT_DIV_WIDTH, CLK_DIVIDER_ONE_BASED, NULL); 320 OMAP4430_DPLL_CLKOUT_DIV_WIDTH, CLK_DIVIDER_ONE_BASED, NULL);
317 321
318static const struct clk_ops dmic_fck_ops = { 322static const struct clk_ops dpll_hsd_ops = {
319 .enable = &omap2_dflt_clk_enable, 323 .enable = &omap2_dflt_clk_enable,
320 .disable = &omap2_dflt_clk_disable, 324 .disable = &omap2_dflt_clk_disable,
321 .is_enabled = &omap2_dflt_clk_is_enabled, 325 .is_enabled = &omap2_dflt_clk_is_enabled,
@@ -325,6 +329,12 @@ static const struct clk_ops dmic_fck_ops = {
325 .init = &omap2_init_clk_clkdm, 329 .init = &omap2_init_clk_clkdm,
326}; 330};
327 331
332static const struct clk_ops func_dmic_abe_gfclk_ops = {
333 .recalc_rate = &omap2_clksel_recalc,
334 .get_parent = &omap2_clksel_find_parent_index,
335 .set_parent = &omap2_clksel_set_parent,
336};
337
328static const char *dpll_core_m3x2_ck_parents[] = { 338static const char *dpll_core_m3x2_ck_parents[] = {
329 "dpll_core_x2_ck", 339 "dpll_core_x2_ck",
330}; 340};
@@ -340,7 +350,7 @@ DEFINE_CLK_OMAP_MUX_GATE(dpll_core_m3x2_ck, NULL, dpll_core_m3x2_div,
340 OMAP4430_DPLL_CLKOUTHIF_DIV_MASK, 350 OMAP4430_DPLL_CLKOUTHIF_DIV_MASK,
341 OMAP4430_CM_DIV_M3_DPLL_CORE, 351 OMAP4430_CM_DIV_M3_DPLL_CORE,
342 OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_SHIFT, NULL, 352 OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_SHIFT, NULL,
343 dpll_core_m3x2_ck_parents, dmic_fck_ops); 353 dpll_core_m3x2_ck_parents, dpll_hsd_ops);
344 354
345DEFINE_CLK_OMAP_HSDIVIDER(dpll_core_m7x2_ck, "dpll_core_x2_ck", 355DEFINE_CLK_OMAP_HSDIVIDER(dpll_core_m7x2_ck, "dpll_core_x2_ck",
346 &dpll_core_x2_ck, 0x0, OMAP4430_CM_DIV_M7_DPLL_CORE, 356 &dpll_core_x2_ck, 0x0, OMAP4430_CM_DIV_M7_DPLL_CORE,
@@ -547,7 +557,7 @@ DEFINE_CLK_OMAP_MUX_GATE(dpll_per_m3x2_ck, NULL, dpll_per_m3x2_div,
547 OMAP4430_DPLL_CLKOUTHIF_DIV_MASK, 557 OMAP4430_DPLL_CLKOUTHIF_DIV_MASK,
548 OMAP4430_CM_DIV_M3_DPLL_PER, 558 OMAP4430_CM_DIV_M3_DPLL_PER,
549 OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_SHIFT, NULL, 559 OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_SHIFT, NULL,
550 dpll_per_m3x2_ck_parents, dmic_fck_ops); 560 dpll_per_m3x2_ck_parents, dpll_hsd_ops);
551 561
552DEFINE_CLK_OMAP_HSDIVIDER(dpll_per_m4x2_ck, "dpll_per_x2_ck", &dpll_per_x2_ck, 562DEFINE_CLK_OMAP_HSDIVIDER(dpll_per_m4x2_ck, "dpll_per_x2_ck", &dpll_per_x2_ck,
553 0x0, OMAP4430_CM_DIV_M4_DPLL_PER, 563 0x0, OMAP4430_CM_DIV_M4_DPLL_PER,
@@ -595,15 +605,26 @@ static const char *dpll_usb_ck_parents[] = {
595 605
596static struct clk dpll_usb_ck; 606static struct clk dpll_usb_ck;
597 607
608static const struct clk_ops dpll_usb_ck_ops = {
609 .enable = &omap3_noncore_dpll_enable,
610 .disable = &omap3_noncore_dpll_disable,
611 .recalc_rate = &omap3_dpll_recalc,
612 .round_rate = &omap2_dpll_round_rate,
613 .set_rate = &omap3_noncore_dpll_set_rate,
614 .get_parent = &omap2_init_dpll_parent,
615 .init = &omap2_init_clk_clkdm,
616};
617
598static struct clk_hw_omap dpll_usb_ck_hw = { 618static struct clk_hw_omap dpll_usb_ck_hw = {
599 .hw = { 619 .hw = {
600 .clk = &dpll_usb_ck, 620 .clk = &dpll_usb_ck,
601 }, 621 },
602 .dpll_data = &dpll_usb_dd, 622 .dpll_data = &dpll_usb_dd,
623 .clkdm_name = "l3_init_clkdm",
603 .ops = &clkhwops_omap3_dpll, 624 .ops = &clkhwops_omap3_dpll,
604}; 625};
605 626
606DEFINE_STRUCT_CLK(dpll_usb_ck, dpll_usb_ck_parents, dpll_ck_ops); 627DEFINE_STRUCT_CLK(dpll_usb_ck, dpll_usb_ck_parents, dpll_usb_ck_ops);
607 628
608static const char *dpll_usb_clkdcoldo_ck_parents[] = { 629static const char *dpll_usb_clkdcoldo_ck_parents[] = {
609 "dpll_usb_ck", 630 "dpll_usb_ck",
@@ -749,10 +770,6 @@ DEFINE_CLK_GATE(aes2_fck, "l3_div_ck", &l3_div_ck, 0x0,
749 OMAP4430_CM_L4SEC_AES2_CLKCTRL, 770 OMAP4430_CM_L4SEC_AES2_CLKCTRL,
750 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL); 771 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
751 772
752DEFINE_CLK_GATE(aess_fck, "aess_fclk", &aess_fclk, 0x0,
753 OMAP4430_CM1_ABE_AESS_CLKCTRL, OMAP4430_MODULEMODE_SWCTRL_SHIFT,
754 0x0, NULL);
755
756DEFINE_CLK_GATE(bandgap_fclk, "sys_32k_ck", &sys_32k_ck, 0x0, 773DEFINE_CLK_GATE(bandgap_fclk, "sys_32k_ck", &sys_32k_ck, 0x0,
757 OMAP4430_CM_WKUP_BANDGAP_CLKCTRL, 774 OMAP4430_CM_WKUP_BANDGAP_CLKCTRL,
758 OMAP4430_OPTFCLKEN_BGAP_32K_SHIFT, 0x0, NULL); 775 OMAP4430_OPTFCLKEN_BGAP_32K_SHIFT, 0x0, NULL);
@@ -774,11 +791,6 @@ DEFINE_CLK_GATE(bandgap_ts_fclk, "div_ts_ck", &div_ts_ck, 0x0,
774 OMAP4460_OPTFCLKEN_TS_FCLK_SHIFT, 791 OMAP4460_OPTFCLKEN_TS_FCLK_SHIFT,
775 0x0, NULL); 792 0x0, NULL);
776 793
777DEFINE_CLK_GATE(des3des_fck, "l4_div_ck", &l4_div_ck, 0x0,
778 OMAP4430_CM_L4SEC_DES3DES_CLKCTRL,
779 OMAP4430_MODULEMODE_SWCTRL_SHIFT,
780 0x0, NULL);
781
782static const char *dmic_sync_mux_ck_parents[] = { 794static const char *dmic_sync_mux_ck_parents[] = {
783 "abe_24m_fclk", "syc_clk_div_ck", "func_24m_clk", 795 "abe_24m_fclk", "syc_clk_div_ck", "func_24m_clk",
784}; 796};
@@ -795,23 +807,13 @@ static const struct clksel func_dmic_abe_gfclk_sel[] = {
795 { .parent = NULL }, 807 { .parent = NULL },
796}; 808};
797 809
798static const char *dmic_fck_parents[] = { 810static const char *func_dmic_abe_gfclk_parents[] = {
799 "dmic_sync_mux_ck", "pad_clks_ck", "slimbus_clk", 811 "dmic_sync_mux_ck", "pad_clks_ck", "slimbus_clk",
800}; 812};
801 813
802/* Merged func_dmic_abe_gfclk into dmic */ 814DEFINE_CLK_OMAP_MUX(func_dmic_abe_gfclk, "abe_clkdm", func_dmic_abe_gfclk_sel,
803static struct clk dmic_fck; 815 OMAP4430_CM1_ABE_DMIC_CLKCTRL, OMAP4430_CLKSEL_SOURCE_MASK,
804 816 func_dmic_abe_gfclk_parents, func_dmic_abe_gfclk_ops);
805DEFINE_CLK_OMAP_MUX_GATE(dmic_fck, "abe_clkdm", func_dmic_abe_gfclk_sel,
806 OMAP4430_CM1_ABE_DMIC_CLKCTRL,
807 OMAP4430_CLKSEL_SOURCE_MASK,
808 OMAP4430_CM1_ABE_DMIC_CLKCTRL,
809 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
810 dmic_fck_parents, dmic_fck_ops);
811
812DEFINE_CLK_GATE(dsp_fck, "dpll_iva_m4x2_ck", &dpll_iva_m4x2_ck, 0x0,
813 OMAP4430_CM_TESLA_TESLA_CLKCTRL,
814 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
815 817
816DEFINE_CLK_GATE(dss_sys_clk, "syc_clk_div_ck", &syc_clk_div_ck, 0x0, 818DEFINE_CLK_GATE(dss_sys_clk, "syc_clk_div_ck", &syc_clk_div_ck, 0x0,
817 OMAP4430_CM_DSS_DSS_CLKCTRL, 819 OMAP4430_CM_DSS_DSS_CLKCTRL,
@@ -833,177 +835,57 @@ DEFINE_CLK_GATE(dss_fck, "l3_div_ck", &l3_div_ck, 0x0,
833 OMAP4430_CM_DSS_DSS_CLKCTRL, OMAP4430_MODULEMODE_SWCTRL_SHIFT, 835 OMAP4430_CM_DSS_DSS_CLKCTRL, OMAP4430_MODULEMODE_SWCTRL_SHIFT,
834 0x0, NULL); 836 0x0, NULL);
835 837
836DEFINE_CLK_GATE(efuse_ctrl_cust_fck, "sys_clkin_ck", &sys_clkin_ck, 0x0,
837 OMAP4430_CM_CEFUSE_CEFUSE_CLKCTRL,
838 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
839
840DEFINE_CLK_GATE(emif1_fck, "ddrphy_ck", &ddrphy_ck, 0x0,
841 OMAP4430_CM_MEMIF_EMIF_1_CLKCTRL,
842 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
843
844DEFINE_CLK_GATE(emif2_fck, "ddrphy_ck", &ddrphy_ck, 0x0,
845 OMAP4430_CM_MEMIF_EMIF_2_CLKCTRL,
846 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
847
848DEFINE_CLK_DIVIDER(fdif_fck, "dpll_per_m4x2_ck", &dpll_per_m4x2_ck, 0x0, 838DEFINE_CLK_DIVIDER(fdif_fck, "dpll_per_m4x2_ck", &dpll_per_m4x2_ck, 0x0,
849 OMAP4430_CM_CAM_FDIF_CLKCTRL, OMAP4430_CLKSEL_FCLK_SHIFT, 839 OMAP4430_CM_CAM_FDIF_CLKCTRL, OMAP4430_CLKSEL_FCLK_SHIFT,
850 OMAP4430_CLKSEL_FCLK_WIDTH, CLK_DIVIDER_POWER_OF_TWO, NULL); 840 OMAP4430_CLKSEL_FCLK_WIDTH, CLK_DIVIDER_POWER_OF_TWO, NULL);
851 841
852DEFINE_CLK_GATE(fpka_fck, "l4_div_ck", &l4_div_ck, 0x0,
853 OMAP4430_CM_L4SEC_PKAEIP29_CLKCTRL,
854 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
855
856DEFINE_CLK_GATE(gpio1_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0, 842DEFINE_CLK_GATE(gpio1_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
857 OMAP4430_CM_WKUP_GPIO1_CLKCTRL, 843 OMAP4430_CM_WKUP_GPIO1_CLKCTRL,
858 OMAP4430_OPTFCLKEN_DBCLK_SHIFT, 0x0, NULL); 844 OMAP4430_OPTFCLKEN_DBCLK_SHIFT, 0x0, NULL);
859 845
860DEFINE_CLK_GATE(gpio1_ick, "l4_wkup_clk_mux_ck", &l4_wkup_clk_mux_ck, 0x0,
861 OMAP4430_CM_WKUP_GPIO1_CLKCTRL,
862 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
863
864DEFINE_CLK_GATE(gpio2_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0, 846DEFINE_CLK_GATE(gpio2_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
865 OMAP4430_CM_L4PER_GPIO2_CLKCTRL, OMAP4430_OPTFCLKEN_DBCLK_SHIFT, 847 OMAP4430_CM_L4PER_GPIO2_CLKCTRL, OMAP4430_OPTFCLKEN_DBCLK_SHIFT,
866 0x0, NULL); 848 0x0, NULL);
867 849
868DEFINE_CLK_GATE(gpio2_ick, "l4_div_ck", &l4_div_ck, 0x0,
869 OMAP4430_CM_L4PER_GPIO2_CLKCTRL,
870 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
871
872DEFINE_CLK_GATE(gpio3_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0, 850DEFINE_CLK_GATE(gpio3_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
873 OMAP4430_CM_L4PER_GPIO3_CLKCTRL, 851 OMAP4430_CM_L4PER_GPIO3_CLKCTRL,
874 OMAP4430_OPTFCLKEN_DBCLK_SHIFT, 0x0, NULL); 852 OMAP4430_OPTFCLKEN_DBCLK_SHIFT, 0x0, NULL);
875 853
876DEFINE_CLK_GATE(gpio3_ick, "l4_div_ck", &l4_div_ck, 0x0,
877 OMAP4430_CM_L4PER_GPIO3_CLKCTRL,
878 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
879
880DEFINE_CLK_GATE(gpio4_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0, 854DEFINE_CLK_GATE(gpio4_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
881 OMAP4430_CM_L4PER_GPIO4_CLKCTRL, OMAP4430_OPTFCLKEN_DBCLK_SHIFT, 855 OMAP4430_CM_L4PER_GPIO4_CLKCTRL, OMAP4430_OPTFCLKEN_DBCLK_SHIFT,
882 0x0, NULL); 856 0x0, NULL);
883 857
884DEFINE_CLK_GATE(gpio4_ick, "l4_div_ck", &l4_div_ck, 0x0,
885 OMAP4430_CM_L4PER_GPIO4_CLKCTRL,
886 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
887
888DEFINE_CLK_GATE(gpio5_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0, 858DEFINE_CLK_GATE(gpio5_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
889 OMAP4430_CM_L4PER_GPIO5_CLKCTRL, OMAP4430_OPTFCLKEN_DBCLK_SHIFT, 859 OMAP4430_CM_L4PER_GPIO5_CLKCTRL, OMAP4430_OPTFCLKEN_DBCLK_SHIFT,
890 0x0, NULL); 860 0x0, NULL);
891 861
892DEFINE_CLK_GATE(gpio5_ick, "l4_div_ck", &l4_div_ck, 0x0,
893 OMAP4430_CM_L4PER_GPIO5_CLKCTRL,
894 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
895
896DEFINE_CLK_GATE(gpio6_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0, 862DEFINE_CLK_GATE(gpio6_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
897 OMAP4430_CM_L4PER_GPIO6_CLKCTRL, OMAP4430_OPTFCLKEN_DBCLK_SHIFT, 863 OMAP4430_CM_L4PER_GPIO6_CLKCTRL, OMAP4430_OPTFCLKEN_DBCLK_SHIFT,
898 0x0, NULL); 864 0x0, NULL);
899 865
900DEFINE_CLK_GATE(gpio6_ick, "l4_div_ck", &l4_div_ck, 0x0,
901 OMAP4430_CM_L4PER_GPIO6_CLKCTRL,
902 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
903
904DEFINE_CLK_GATE(gpmc_ick, "l3_div_ck", &l3_div_ck, 0x0,
905 OMAP4430_CM_L3_2_GPMC_CLKCTRL, OMAP4430_MODULEMODE_HWCTRL_SHIFT,
906 0x0, NULL);
907
908static const struct clksel sgx_clk_mux_sel[] = { 866static const struct clksel sgx_clk_mux_sel[] = {
909 { .parent = &dpll_core_m7x2_ck, .rates = div_1_0_rates }, 867 { .parent = &dpll_core_m7x2_ck, .rates = div_1_0_rates },
910 { .parent = &dpll_per_m7x2_ck, .rates = div_1_1_rates }, 868 { .parent = &dpll_per_m7x2_ck, .rates = div_1_1_rates },
911 { .parent = NULL }, 869 { .parent = NULL },
912}; 870};
913 871
914static const char *gpu_fck_parents[] = { 872static const char *sgx_clk_mux_parents[] = {
915 "dpll_core_m7x2_ck", "dpll_per_m7x2_ck", 873 "dpll_core_m7x2_ck", "dpll_per_m7x2_ck",
916}; 874};
917 875
918/* Merged sgx_clk_mux into gpu */ 876DEFINE_CLK_OMAP_MUX(sgx_clk_mux, "l3_gfx_clkdm", sgx_clk_mux_sel,
919DEFINE_CLK_OMAP_MUX_GATE(gpu_fck, "l3_gfx_clkdm", sgx_clk_mux_sel, 877 OMAP4430_CM_GFX_GFX_CLKCTRL, OMAP4430_CLKSEL_SGX_FCLK_MASK,
920 OMAP4430_CM_GFX_GFX_CLKCTRL, 878 sgx_clk_mux_parents, func_dmic_abe_gfclk_ops);
921 OMAP4430_CLKSEL_SGX_FCLK_MASK,
922 OMAP4430_CM_GFX_GFX_CLKCTRL,
923 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
924 gpu_fck_parents, dmic_fck_ops);
925
926DEFINE_CLK_GATE(hdq1w_fck, "func_12m_fclk", &func_12m_fclk, 0x0,
927 OMAP4430_CM_L4PER_HDQ1W_CLKCTRL,
928 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
929 879
930DEFINE_CLK_DIVIDER(hsi_fck, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck, 0x0, 880DEFINE_CLK_DIVIDER(hsi_fck, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck, 0x0,
931 OMAP4430_CM_L3INIT_HSI_CLKCTRL, OMAP4430_CLKSEL_24_25_SHIFT, 881 OMAP4430_CM_L3INIT_HSI_CLKCTRL, OMAP4430_CLKSEL_24_25_SHIFT,
932 OMAP4430_CLKSEL_24_25_WIDTH, CLK_DIVIDER_POWER_OF_TWO, 882 OMAP4430_CLKSEL_24_25_WIDTH, CLK_DIVIDER_POWER_OF_TWO,
933 NULL); 883 NULL);
934 884
935DEFINE_CLK_GATE(i2c1_fck, "func_96m_fclk", &func_96m_fclk, 0x0,
936 OMAP4430_CM_L4PER_I2C1_CLKCTRL,
937 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
938
939DEFINE_CLK_GATE(i2c2_fck, "func_96m_fclk", &func_96m_fclk, 0x0,
940 OMAP4430_CM_L4PER_I2C2_CLKCTRL,
941 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
942
943DEFINE_CLK_GATE(i2c3_fck, "func_96m_fclk", &func_96m_fclk, 0x0,
944 OMAP4430_CM_L4PER_I2C3_CLKCTRL,
945 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
946
947DEFINE_CLK_GATE(i2c4_fck, "func_96m_fclk", &func_96m_fclk, 0x0,
948 OMAP4430_CM_L4PER_I2C4_CLKCTRL,
949 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
950
951DEFINE_CLK_GATE(ipu_fck, "ducati_clk_mux_ck", &ducati_clk_mux_ck, 0x0,
952 OMAP4430_CM_DUCATI_DUCATI_CLKCTRL,
953 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
954
955DEFINE_CLK_GATE(iss_ctrlclk, "func_96m_fclk", &func_96m_fclk, 0x0, 885DEFINE_CLK_GATE(iss_ctrlclk, "func_96m_fclk", &func_96m_fclk, 0x0,
956 OMAP4430_CM_CAM_ISS_CLKCTRL, OMAP4430_OPTFCLKEN_CTRLCLK_SHIFT, 886 OMAP4430_CM_CAM_ISS_CLKCTRL, OMAP4430_OPTFCLKEN_CTRLCLK_SHIFT,
957 0x0, NULL); 887 0x0, NULL);
958 888
959DEFINE_CLK_GATE(iss_fck, "ducati_clk_mux_ck", &ducati_clk_mux_ck, 0x0,
960 OMAP4430_CM_CAM_ISS_CLKCTRL, OMAP4430_MODULEMODE_SWCTRL_SHIFT,
961 0x0, NULL);
962
963DEFINE_CLK_GATE(iva_fck, "dpll_iva_m5x2_ck", &dpll_iva_m5x2_ck, 0x0,
964 OMAP4430_CM_IVAHD_IVAHD_CLKCTRL,
965 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
966
967DEFINE_CLK_GATE(kbd_fck, "sys_32k_ck", &sys_32k_ck, 0x0,
968 OMAP4430_CM_WKUP_KEYBOARD_CLKCTRL,
969 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
970
971static struct clk l3_instr_ick;
972
973static const char *l3_instr_ick_parent_names[] = {
974 "l3_div_ck",
975};
976
977static const struct clk_ops l3_instr_ick_ops = {
978 .enable = &omap2_dflt_clk_enable,
979 .disable = &omap2_dflt_clk_disable,
980 .is_enabled = &omap2_dflt_clk_is_enabled,
981 .init = &omap2_init_clk_clkdm,
982};
983
984static struct clk_hw_omap l3_instr_ick_hw = {
985 .hw = {
986 .clk = &l3_instr_ick,
987 },
988 .enable_reg = OMAP4430_CM_L3INSTR_L3_INSTR_CLKCTRL,
989 .enable_bit = OMAP4430_MODULEMODE_HWCTRL_SHIFT,
990 .clkdm_name = "l3_instr_clkdm",
991};
992
993DEFINE_STRUCT_CLK(l3_instr_ick, l3_instr_ick_parent_names, l3_instr_ick_ops);
994
995static struct clk l3_main_3_ick;
996static struct clk_hw_omap l3_main_3_ick_hw = {
997 .hw = {
998 .clk = &l3_main_3_ick,
999 },
1000 .enable_reg = OMAP4430_CM_L3INSTR_L3_3_CLKCTRL,
1001 .enable_bit = OMAP4430_MODULEMODE_HWCTRL_SHIFT,
1002 .clkdm_name = "l3_instr_clkdm",
1003};
1004
1005DEFINE_STRUCT_CLK(l3_main_3_ick, l3_instr_ick_parent_names, l3_instr_ick_ops);
1006
1007DEFINE_CLK_MUX(mcasp_sync_mux_ck, dmic_sync_mux_ck_parents, NULL, 0x0, 889DEFINE_CLK_MUX(mcasp_sync_mux_ck, dmic_sync_mux_ck_parents, NULL, 0x0,
1008 OMAP4430_CM1_ABE_MCASP_CLKCTRL, 890 OMAP4430_CM1_ABE_MCASP_CLKCTRL,
1009 OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT, 891 OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT,
@@ -1016,17 +898,13 @@ static const struct clksel func_mcasp_abe_gfclk_sel[] = {
1016 { .parent = NULL }, 898 { .parent = NULL },
1017}; 899};
1018 900
1019static const char *mcasp_fck_parents[] = { 901static const char *func_mcasp_abe_gfclk_parents[] = {
1020 "mcasp_sync_mux_ck", "pad_clks_ck", "slimbus_clk", 902 "mcasp_sync_mux_ck", "pad_clks_ck", "slimbus_clk",
1021}; 903};
1022 904
1023/* Merged func_mcasp_abe_gfclk into mcasp */ 905DEFINE_CLK_OMAP_MUX(func_mcasp_abe_gfclk, "abe_clkdm", func_mcasp_abe_gfclk_sel,
1024DEFINE_CLK_OMAP_MUX_GATE(mcasp_fck, "abe_clkdm", func_mcasp_abe_gfclk_sel, 906 OMAP4430_CM1_ABE_MCASP_CLKCTRL, OMAP4430_CLKSEL_SOURCE_MASK,
1025 OMAP4430_CM1_ABE_MCASP_CLKCTRL, 907 func_mcasp_abe_gfclk_parents, func_dmic_abe_gfclk_ops);
1026 OMAP4430_CLKSEL_SOURCE_MASK,
1027 OMAP4430_CM1_ABE_MCASP_CLKCTRL,
1028 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1029 mcasp_fck_parents, dmic_fck_ops);
1030 908
1031DEFINE_CLK_MUX(mcbsp1_sync_mux_ck, dmic_sync_mux_ck_parents, NULL, 0x0, 909DEFINE_CLK_MUX(mcbsp1_sync_mux_ck, dmic_sync_mux_ck_parents, NULL, 0x0,
1032 OMAP4430_CM1_ABE_MCBSP1_CLKCTRL, 910 OMAP4430_CM1_ABE_MCBSP1_CLKCTRL,
@@ -1040,17 +918,14 @@ static const struct clksel func_mcbsp1_gfclk_sel[] = {
1040 { .parent = NULL }, 918 { .parent = NULL },
1041}; 919};
1042 920
1043static const char *mcbsp1_fck_parents[] = { 921static const char *func_mcbsp1_gfclk_parents[] = {
1044 "mcbsp1_sync_mux_ck", "pad_clks_ck", "slimbus_clk", 922 "mcbsp1_sync_mux_ck", "pad_clks_ck", "slimbus_clk",
1045}; 923};
1046 924
1047/* Merged func_mcbsp1_gfclk into mcbsp1 */ 925DEFINE_CLK_OMAP_MUX(func_mcbsp1_gfclk, "abe_clkdm", func_mcbsp1_gfclk_sel,
1048DEFINE_CLK_OMAP_MUX_GATE(mcbsp1_fck, "abe_clkdm", func_mcbsp1_gfclk_sel, 926 OMAP4430_CM1_ABE_MCBSP1_CLKCTRL,
1049 OMAP4430_CM1_ABE_MCBSP1_CLKCTRL, 927 OMAP4430_CLKSEL_SOURCE_MASK, func_mcbsp1_gfclk_parents,
1050 OMAP4430_CLKSEL_SOURCE_MASK, 928 func_dmic_abe_gfclk_ops);
1051 OMAP4430_CM1_ABE_MCBSP1_CLKCTRL,
1052 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1053 mcbsp1_fck_parents, dmic_fck_ops);
1054 929
1055DEFINE_CLK_MUX(mcbsp2_sync_mux_ck, dmic_sync_mux_ck_parents, NULL, 0x0, 930DEFINE_CLK_MUX(mcbsp2_sync_mux_ck, dmic_sync_mux_ck_parents, NULL, 0x0,
1056 OMAP4430_CM1_ABE_MCBSP2_CLKCTRL, 931 OMAP4430_CM1_ABE_MCBSP2_CLKCTRL,
@@ -1064,17 +939,14 @@ static const struct clksel func_mcbsp2_gfclk_sel[] = {
1064 { .parent = NULL }, 939 { .parent = NULL },
1065}; 940};
1066 941
1067static const char *mcbsp2_fck_parents[] = { 942static const char *func_mcbsp2_gfclk_parents[] = {
1068 "mcbsp2_sync_mux_ck", "pad_clks_ck", "slimbus_clk", 943 "mcbsp2_sync_mux_ck", "pad_clks_ck", "slimbus_clk",
1069}; 944};
1070 945
1071/* Merged func_mcbsp2_gfclk into mcbsp2 */ 946DEFINE_CLK_OMAP_MUX(func_mcbsp2_gfclk, "abe_clkdm", func_mcbsp2_gfclk_sel,
1072DEFINE_CLK_OMAP_MUX_GATE(mcbsp2_fck, "abe_clkdm", func_mcbsp2_gfclk_sel, 947 OMAP4430_CM1_ABE_MCBSP2_CLKCTRL,
1073 OMAP4430_CM1_ABE_MCBSP2_CLKCTRL, 948 OMAP4430_CLKSEL_SOURCE_MASK, func_mcbsp2_gfclk_parents,
1074 OMAP4430_CLKSEL_SOURCE_MASK, 949 func_dmic_abe_gfclk_ops);
1075 OMAP4430_CM1_ABE_MCBSP2_CLKCTRL,
1076 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1077 mcbsp2_fck_parents, dmic_fck_ops);
1078 950
1079DEFINE_CLK_MUX(mcbsp3_sync_mux_ck, dmic_sync_mux_ck_parents, NULL, 0x0, 951DEFINE_CLK_MUX(mcbsp3_sync_mux_ck, dmic_sync_mux_ck_parents, NULL, 0x0,
1080 OMAP4430_CM1_ABE_MCBSP3_CLKCTRL, 952 OMAP4430_CM1_ABE_MCBSP3_CLKCTRL,
@@ -1088,17 +960,14 @@ static const struct clksel func_mcbsp3_gfclk_sel[] = {
1088 { .parent = NULL }, 960 { .parent = NULL },
1089}; 961};
1090 962
1091static const char *mcbsp3_fck_parents[] = { 963static const char *func_mcbsp3_gfclk_parents[] = {
1092 "mcbsp3_sync_mux_ck", "pad_clks_ck", "slimbus_clk", 964 "mcbsp3_sync_mux_ck", "pad_clks_ck", "slimbus_clk",
1093}; 965};
1094 966
1095/* Merged func_mcbsp3_gfclk into mcbsp3 */ 967DEFINE_CLK_OMAP_MUX(func_mcbsp3_gfclk, "abe_clkdm", func_mcbsp3_gfclk_sel,
1096DEFINE_CLK_OMAP_MUX_GATE(mcbsp3_fck, "abe_clkdm", func_mcbsp3_gfclk_sel, 968 OMAP4430_CM1_ABE_MCBSP3_CLKCTRL,
1097 OMAP4430_CM1_ABE_MCBSP3_CLKCTRL, 969 OMAP4430_CLKSEL_SOURCE_MASK, func_mcbsp3_gfclk_parents,
1098 OMAP4430_CLKSEL_SOURCE_MASK, 970 func_dmic_abe_gfclk_ops);
1099 OMAP4430_CM1_ABE_MCBSP3_CLKCTRL,
1100 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1101 mcbsp3_fck_parents, dmic_fck_ops);
1102 971
1103static const char *mcbsp4_sync_mux_ck_parents[] = { 972static const char *mcbsp4_sync_mux_ck_parents[] = {
1104 "func_96m_fclk", "per_abe_nc_fclk", 973 "func_96m_fclk", "per_abe_nc_fclk",
@@ -1115,37 +984,14 @@ static const struct clksel per_mcbsp4_gfclk_sel[] = {
1115 { .parent = NULL }, 984 { .parent = NULL },
1116}; 985};
1117 986
1118static const char *mcbsp4_fck_parents[] = { 987static const char *per_mcbsp4_gfclk_parents[] = {
1119 "mcbsp4_sync_mux_ck", "pad_clks_ck", 988 "mcbsp4_sync_mux_ck", "pad_clks_ck",
1120}; 989};
1121 990
1122/* Merged per_mcbsp4_gfclk into mcbsp4 */ 991DEFINE_CLK_OMAP_MUX(per_mcbsp4_gfclk, "l4_per_clkdm", per_mcbsp4_gfclk_sel,
1123DEFINE_CLK_OMAP_MUX_GATE(mcbsp4_fck, "l4_per_clkdm", per_mcbsp4_gfclk_sel, 992 OMAP4430_CM_L4PER_MCBSP4_CLKCTRL,
1124 OMAP4430_CM_L4PER_MCBSP4_CLKCTRL, 993 OMAP4430_CLKSEL_SOURCE_24_24_MASK, per_mcbsp4_gfclk_parents,
1125 OMAP4430_CLKSEL_SOURCE_24_24_MASK, 994 func_dmic_abe_gfclk_ops);
1126 OMAP4430_CM_L4PER_MCBSP4_CLKCTRL,
1127 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1128 mcbsp4_fck_parents, dmic_fck_ops);
1129
1130DEFINE_CLK_GATE(mcpdm_fck, "pad_clks_ck", &pad_clks_ck, 0x0,
1131 OMAP4430_CM1_ABE_PDM_CLKCTRL, OMAP4430_MODULEMODE_SWCTRL_SHIFT,
1132 0x0, NULL);
1133
1134DEFINE_CLK_GATE(mcspi1_fck, "func_48m_fclk", &func_48m_fclk, 0x0,
1135 OMAP4430_CM_L4PER_MCSPI1_CLKCTRL,
1136 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1137
1138DEFINE_CLK_GATE(mcspi2_fck, "func_48m_fclk", &func_48m_fclk, 0x0,
1139 OMAP4430_CM_L4PER_MCSPI2_CLKCTRL,
1140 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1141
1142DEFINE_CLK_GATE(mcspi3_fck, "func_48m_fclk", &func_48m_fclk, 0x0,
1143 OMAP4430_CM_L4PER_MCSPI3_CLKCTRL,
1144 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1145
1146DEFINE_CLK_GATE(mcspi4_fck, "func_48m_fclk", &func_48m_fclk, 0x0,
1147 OMAP4430_CM_L4PER_MCSPI4_CLKCTRL,
1148 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1149 995
1150static const struct clksel hsmmc1_fclk_sel[] = { 996static const struct clksel hsmmc1_fclk_sel[] = {
1151 { .parent = &func_64m_fclk, .rates = div_1_0_rates }, 997 { .parent = &func_64m_fclk, .rates = div_1_0_rates },
@@ -1153,69 +999,22 @@ static const struct clksel hsmmc1_fclk_sel[] = {
1153 { .parent = NULL }, 999 { .parent = NULL },
1154}; 1000};
1155 1001
1156static const char *mmc1_fck_parents[] = { 1002static const char *hsmmc1_fclk_parents[] = {
1157 "func_64m_fclk", "func_96m_fclk", 1003 "func_64m_fclk", "func_96m_fclk",
1158}; 1004};
1159 1005
1160/* Merged hsmmc1_fclk into mmc1 */ 1006DEFINE_CLK_OMAP_MUX(hsmmc1_fclk, "l3_init_clkdm", hsmmc1_fclk_sel,
1161DEFINE_CLK_OMAP_MUX_GATE(mmc1_fck, "l3_init_clkdm", hsmmc1_fclk_sel, 1007 OMAP4430_CM_L3INIT_MMC1_CLKCTRL, OMAP4430_CLKSEL_MASK,
1162 OMAP4430_CM_L3INIT_MMC1_CLKCTRL, OMAP4430_CLKSEL_MASK, 1008 hsmmc1_fclk_parents, func_dmic_abe_gfclk_ops);
1163 OMAP4430_CM_L3INIT_MMC1_CLKCTRL,
1164 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1165 mmc1_fck_parents, dmic_fck_ops);
1166
1167/* Merged hsmmc2_fclk into mmc2 */
1168DEFINE_CLK_OMAP_MUX_GATE(mmc2_fck, "l3_init_clkdm", hsmmc1_fclk_sel,
1169 OMAP4430_CM_L3INIT_MMC2_CLKCTRL, OMAP4430_CLKSEL_MASK,
1170 OMAP4430_CM_L3INIT_MMC2_CLKCTRL,
1171 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1172 mmc1_fck_parents, dmic_fck_ops);
1173
1174DEFINE_CLK_GATE(mmc3_fck, "func_48m_fclk", &func_48m_fclk, 0x0,
1175 OMAP4430_CM_L4PER_MMCSD3_CLKCTRL,
1176 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1177
1178DEFINE_CLK_GATE(mmc4_fck, "func_48m_fclk", &func_48m_fclk, 0x0,
1179 OMAP4430_CM_L4PER_MMCSD4_CLKCTRL,
1180 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1181
1182DEFINE_CLK_GATE(mmc5_fck, "func_48m_fclk", &func_48m_fclk, 0x0,
1183 OMAP4430_CM_L4PER_MMCSD5_CLKCTRL,
1184 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1185
1186DEFINE_CLK_GATE(ocp2scp_usb_phy_phy_48m, "func_48m_fclk", &func_48m_fclk, 0x0,
1187 OMAP4430_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL,
1188 OMAP4430_OPTFCLKEN_PHY_48M_SHIFT, 0x0, NULL);
1189
1190DEFINE_CLK_GATE(ocp2scp_usb_phy_ick, "l4_div_ck", &l4_div_ck, 0x0,
1191 OMAP4430_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL,
1192 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
1193 1009
1194static struct clk ocp_wp_noc_ick; 1010DEFINE_CLK_OMAP_MUX(hsmmc2_fclk, "l3_init_clkdm", hsmmc1_fclk_sel,
1195 1011 OMAP4430_CM_L3INIT_MMC2_CLKCTRL, OMAP4430_CLKSEL_MASK,
1196static struct clk_hw_omap ocp_wp_noc_ick_hw = { 1012 hsmmc1_fclk_parents, func_dmic_abe_gfclk_ops);
1197 .hw = {
1198 .clk = &ocp_wp_noc_ick,
1199 },
1200 .enable_reg = OMAP4430_CM_L3INSTR_OCP_WP1_CLKCTRL,
1201 .enable_bit = OMAP4430_MODULEMODE_HWCTRL_SHIFT,
1202 .clkdm_name = "l3_instr_clkdm",
1203};
1204
1205DEFINE_STRUCT_CLK(ocp_wp_noc_ick, l3_instr_ick_parent_names, l3_instr_ick_ops);
1206
1207DEFINE_CLK_GATE(rng_ick, "l4_div_ck", &l4_div_ck, 0x0,
1208 OMAP4430_CM_L4SEC_RNG_CLKCTRL, OMAP4430_MODULEMODE_HWCTRL_SHIFT,
1209 0x0, NULL);
1210 1013
1211DEFINE_CLK_GATE(sha2md5_fck, "l3_div_ck", &l3_div_ck, 0x0, 1014DEFINE_CLK_GATE(sha2md5_fck, "l3_div_ck", &l3_div_ck, 0x0,
1212 OMAP4430_CM_L4SEC_SHA2MD51_CLKCTRL, 1015 OMAP4430_CM_L4SEC_SHA2MD51_CLKCTRL,
1213 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL); 1016 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1214 1017
1215DEFINE_CLK_GATE(sl2if_ick, "dpll_iva_m5x2_ck", &dpll_iva_m5x2_ck, 0x0,
1216 OMAP4430_CM_IVAHD_SL2_CLKCTRL, OMAP4430_MODULEMODE_HWCTRL_SHIFT,
1217 0x0, NULL);
1218
1219DEFINE_CLK_GATE(slimbus1_fclk_1, "func_24m_clk", &func_24m_clk, 0x0, 1018DEFINE_CLK_GATE(slimbus1_fclk_1, "func_24m_clk", &func_24m_clk, 0x0,
1220 OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL, 1019 OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL,
1221 OMAP4430_OPTFCLKEN_FCLK1_SHIFT, 0x0, NULL); 1020 OMAP4430_OPTFCLKEN_FCLK1_SHIFT, 0x0, NULL);
@@ -1232,10 +1031,6 @@ DEFINE_CLK_GATE(slimbus1_slimbus_clk, "slimbus_clk", &slimbus_clk, 0x0,
1232 OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL, 1031 OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL,
1233 OMAP4430_OPTFCLKEN_SLIMBUS_CLK_11_11_SHIFT, 0x0, NULL); 1032 OMAP4430_OPTFCLKEN_SLIMBUS_CLK_11_11_SHIFT, 0x0, NULL);
1234 1033
1235DEFINE_CLK_GATE(slimbus1_fck, "ocp_abe_iclk", &ocp_abe_iclk, 0x0,
1236 OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL,
1237 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1238
1239DEFINE_CLK_GATE(slimbus2_fclk_1, "per_abe_24m_fclk", &per_abe_24m_fclk, 0x0, 1034DEFINE_CLK_GATE(slimbus2_fclk_1, "per_abe_24m_fclk", &per_abe_24m_fclk, 0x0,
1240 OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL, 1035 OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL,
1241 OMAP4430_OPTFCLKEN_PERABE24M_GFCLK_SHIFT, 0x0, NULL); 1036 OMAP4430_OPTFCLKEN_PERABE24M_GFCLK_SHIFT, 0x0, NULL);
@@ -1249,10 +1044,6 @@ DEFINE_CLK_GATE(slimbus2_slimbus_clk, "pad_slimbus_core_clks_ck",
1249 OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL, 1044 OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL,
1250 OMAP4430_OPTFCLKEN_SLIMBUS_CLK_SHIFT, 0x0, NULL); 1045 OMAP4430_OPTFCLKEN_SLIMBUS_CLK_SHIFT, 0x0, NULL);
1251 1046
1252DEFINE_CLK_GATE(slimbus2_fck, "l4_div_ck", &l4_div_ck, 0x0,
1253 OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL,
1254 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1255
1256DEFINE_CLK_GATE(smartreflex_core_fck, "l4_wkup_clk_mux_ck", &l4_wkup_clk_mux_ck, 1047DEFINE_CLK_GATE(smartreflex_core_fck, "l4_wkup_clk_mux_ck", &l4_wkup_clk_mux_ck,
1257 0x0, OMAP4430_CM_ALWON_SR_CORE_CLKCTRL, 1048 0x0, OMAP4430_CM_ALWON_SR_CORE_CLKCTRL,
1258 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL); 1049 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
@@ -1271,52 +1062,35 @@ static const struct clksel dmt1_clk_mux_sel[] = {
1271 { .parent = NULL }, 1062 { .parent = NULL },
1272}; 1063};
1273 1064
1274/* Merged dmt1_clk_mux into timer1 */ 1065DEFINE_CLK_OMAP_MUX(dmt1_clk_mux, "l4_wkup_clkdm", dmt1_clk_mux_sel,
1275DEFINE_CLK_OMAP_MUX_GATE(timer1_fck, "l4_wkup_clkdm", dmt1_clk_mux_sel, 1066 OMAP4430_CM_WKUP_TIMER1_CLKCTRL, OMAP4430_CLKSEL_MASK,
1276 OMAP4430_CM_WKUP_TIMER1_CLKCTRL, OMAP4430_CLKSEL_MASK, 1067 abe_dpll_bypass_clk_mux_ck_parents,
1277 OMAP4430_CM_WKUP_TIMER1_CLKCTRL, 1068 func_dmic_abe_gfclk_ops);
1278 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL, 1069
1279 abe_dpll_bypass_clk_mux_ck_parents, dmic_fck_ops); 1070DEFINE_CLK_OMAP_MUX(cm2_dm10_mux, "l4_per_clkdm", dmt1_clk_mux_sel,
1280 1071 OMAP4430_CM_L4PER_DMTIMER10_CLKCTRL, OMAP4430_CLKSEL_MASK,
1281/* Merged cm2_dm10_mux into timer10 */ 1072 abe_dpll_bypass_clk_mux_ck_parents,
1282DEFINE_CLK_OMAP_MUX_GATE(timer10_fck, "l4_per_clkdm", dmt1_clk_mux_sel, 1073 func_dmic_abe_gfclk_ops);
1283 OMAP4430_CM_L4PER_DMTIMER10_CLKCTRL, 1074
1284 OMAP4430_CLKSEL_MASK, 1075DEFINE_CLK_OMAP_MUX(cm2_dm11_mux, "l4_per_clkdm", dmt1_clk_mux_sel,
1285 OMAP4430_CM_L4PER_DMTIMER10_CLKCTRL, 1076 OMAP4430_CM_L4PER_DMTIMER11_CLKCTRL, OMAP4430_CLKSEL_MASK,
1286 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL, 1077 abe_dpll_bypass_clk_mux_ck_parents,
1287 abe_dpll_bypass_clk_mux_ck_parents, dmic_fck_ops); 1078 func_dmic_abe_gfclk_ops);
1288 1079
1289/* Merged cm2_dm11_mux into timer11 */ 1080DEFINE_CLK_OMAP_MUX(cm2_dm2_mux, "l4_per_clkdm", dmt1_clk_mux_sel,
1290DEFINE_CLK_OMAP_MUX_GATE(timer11_fck, "l4_per_clkdm", dmt1_clk_mux_sel, 1081 OMAP4430_CM_L4PER_DMTIMER2_CLKCTRL, OMAP4430_CLKSEL_MASK,
1291 OMAP4430_CM_L4PER_DMTIMER11_CLKCTRL, 1082 abe_dpll_bypass_clk_mux_ck_parents,
1292 OMAP4430_CLKSEL_MASK, 1083 func_dmic_abe_gfclk_ops);
1293 OMAP4430_CM_L4PER_DMTIMER11_CLKCTRL, 1084
1294 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL, 1085DEFINE_CLK_OMAP_MUX(cm2_dm3_mux, "l4_per_clkdm", dmt1_clk_mux_sel,
1295 abe_dpll_bypass_clk_mux_ck_parents, dmic_fck_ops); 1086 OMAP4430_CM_L4PER_DMTIMER3_CLKCTRL, OMAP4430_CLKSEL_MASK,
1296 1087 abe_dpll_bypass_clk_mux_ck_parents,
1297/* Merged cm2_dm2_mux into timer2 */ 1088 func_dmic_abe_gfclk_ops);
1298DEFINE_CLK_OMAP_MUX_GATE(timer2_fck, "l4_per_clkdm", dmt1_clk_mux_sel, 1089
1299 OMAP4430_CM_L4PER_DMTIMER2_CLKCTRL, 1090DEFINE_CLK_OMAP_MUX(cm2_dm4_mux, "l4_per_clkdm", dmt1_clk_mux_sel,
1300 OMAP4430_CLKSEL_MASK, 1091 OMAP4430_CM_L4PER_DMTIMER4_CLKCTRL, OMAP4430_CLKSEL_MASK,
1301 OMAP4430_CM_L4PER_DMTIMER2_CLKCTRL, 1092 abe_dpll_bypass_clk_mux_ck_parents,
1302 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL, 1093 func_dmic_abe_gfclk_ops);
1303 abe_dpll_bypass_clk_mux_ck_parents, dmic_fck_ops);
1304
1305/* Merged cm2_dm3_mux into timer3 */
1306DEFINE_CLK_OMAP_MUX_GATE(timer3_fck, "l4_per_clkdm", dmt1_clk_mux_sel,
1307 OMAP4430_CM_L4PER_DMTIMER3_CLKCTRL,
1308 OMAP4430_CLKSEL_MASK,
1309 OMAP4430_CM_L4PER_DMTIMER3_CLKCTRL,
1310 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1311 abe_dpll_bypass_clk_mux_ck_parents, dmic_fck_ops);
1312
1313/* Merged cm2_dm4_mux into timer4 */
1314DEFINE_CLK_OMAP_MUX_GATE(timer4_fck, "l4_per_clkdm", dmt1_clk_mux_sel,
1315 OMAP4430_CM_L4PER_DMTIMER4_CLKCTRL,
1316 OMAP4430_CLKSEL_MASK,
1317 OMAP4430_CM_L4PER_DMTIMER4_CLKCTRL,
1318 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1319 abe_dpll_bypass_clk_mux_ck_parents, dmic_fck_ops);
1320 1094
1321static const struct clksel timer5_sync_mux_sel[] = { 1095static const struct clksel timer5_sync_mux_sel[] = {
1322 { .parent = &syc_clk_div_ck, .rates = div_1_0_rates }, 1096 { .parent = &syc_clk_div_ck, .rates = div_1_0_rates },
@@ -1324,61 +1098,30 @@ static const struct clksel timer5_sync_mux_sel[] = {
1324 { .parent = NULL }, 1098 { .parent = NULL },
1325}; 1099};
1326 1100
1327static const char *timer5_fck_parents[] = { 1101static const char *timer5_sync_mux_parents[] = {
1328 "syc_clk_div_ck", "sys_32k_ck", 1102 "syc_clk_div_ck", "sys_32k_ck",
1329}; 1103};
1330 1104
1331/* Merged timer5_sync_mux into timer5 */ 1105DEFINE_CLK_OMAP_MUX(timer5_sync_mux, "abe_clkdm", timer5_sync_mux_sel,
1332DEFINE_CLK_OMAP_MUX_GATE(timer5_fck, "abe_clkdm", timer5_sync_mux_sel, 1106 OMAP4430_CM1_ABE_TIMER5_CLKCTRL, OMAP4430_CLKSEL_MASK,
1333 OMAP4430_CM1_ABE_TIMER5_CLKCTRL, OMAP4430_CLKSEL_MASK, 1107 timer5_sync_mux_parents, func_dmic_abe_gfclk_ops);
1334 OMAP4430_CM1_ABE_TIMER5_CLKCTRL,
1335 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1336 timer5_fck_parents, dmic_fck_ops);
1337
1338/* Merged timer6_sync_mux into timer6 */
1339DEFINE_CLK_OMAP_MUX_GATE(timer6_fck, "abe_clkdm", timer5_sync_mux_sel,
1340 OMAP4430_CM1_ABE_TIMER6_CLKCTRL, OMAP4430_CLKSEL_MASK,
1341 OMAP4430_CM1_ABE_TIMER6_CLKCTRL,
1342 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1343 timer5_fck_parents, dmic_fck_ops);
1344
1345/* Merged timer7_sync_mux into timer7 */
1346DEFINE_CLK_OMAP_MUX_GATE(timer7_fck, "abe_clkdm", timer5_sync_mux_sel,
1347 OMAP4430_CM1_ABE_TIMER7_CLKCTRL, OMAP4430_CLKSEL_MASK,
1348 OMAP4430_CM1_ABE_TIMER7_CLKCTRL,
1349 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1350 timer5_fck_parents, dmic_fck_ops);
1351
1352/* Merged timer8_sync_mux into timer8 */
1353DEFINE_CLK_OMAP_MUX_GATE(timer8_fck, "abe_clkdm", timer5_sync_mux_sel,
1354 OMAP4430_CM1_ABE_TIMER8_CLKCTRL, OMAP4430_CLKSEL_MASK,
1355 OMAP4430_CM1_ABE_TIMER8_CLKCTRL,
1356 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1357 timer5_fck_parents, dmic_fck_ops);
1358
1359/* Merged cm2_dm9_mux into timer9 */
1360DEFINE_CLK_OMAP_MUX_GATE(timer9_fck, "l4_per_clkdm", dmt1_clk_mux_sel,
1361 OMAP4430_CM_L4PER_DMTIMER9_CLKCTRL,
1362 OMAP4430_CLKSEL_MASK,
1363 OMAP4430_CM_L4PER_DMTIMER9_CLKCTRL,
1364 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1365 abe_dpll_bypass_clk_mux_ck_parents, dmic_fck_ops);
1366
1367DEFINE_CLK_GATE(uart1_fck, "func_48m_fclk", &func_48m_fclk, 0x0,
1368 OMAP4430_CM_L4PER_UART1_CLKCTRL,
1369 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1370 1108
1371DEFINE_CLK_GATE(uart2_fck, "func_48m_fclk", &func_48m_fclk, 0x0, 1109DEFINE_CLK_OMAP_MUX(timer6_sync_mux, "abe_clkdm", timer5_sync_mux_sel,
1372 OMAP4430_CM_L4PER_UART2_CLKCTRL, 1110 OMAP4430_CM1_ABE_TIMER6_CLKCTRL, OMAP4430_CLKSEL_MASK,
1373 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL); 1111 timer5_sync_mux_parents, func_dmic_abe_gfclk_ops);
1374 1112
1375DEFINE_CLK_GATE(uart3_fck, "func_48m_fclk", &func_48m_fclk, 0x0, 1113DEFINE_CLK_OMAP_MUX(timer7_sync_mux, "abe_clkdm", timer5_sync_mux_sel,
1376 OMAP4430_CM_L4PER_UART3_CLKCTRL, 1114 OMAP4430_CM1_ABE_TIMER7_CLKCTRL, OMAP4430_CLKSEL_MASK,
1377 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL); 1115 timer5_sync_mux_parents, func_dmic_abe_gfclk_ops);
1378 1116
1379DEFINE_CLK_GATE(uart4_fck, "func_48m_fclk", &func_48m_fclk, 0x0, 1117DEFINE_CLK_OMAP_MUX(timer8_sync_mux, "abe_clkdm", timer5_sync_mux_sel,
1380 OMAP4430_CM_L4PER_UART4_CLKCTRL, 1118 OMAP4430_CM1_ABE_TIMER8_CLKCTRL, OMAP4430_CLKSEL_MASK,
1381 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL); 1119 timer5_sync_mux_parents, func_dmic_abe_gfclk_ops);
1120
1121DEFINE_CLK_OMAP_MUX(cm2_dm9_mux, "l4_per_clkdm", dmt1_clk_mux_sel,
1122 OMAP4430_CM_L4PER_DMTIMER9_CLKCTRL, OMAP4430_CLKSEL_MASK,
1123 abe_dpll_bypass_clk_mux_ck_parents,
1124 func_dmic_abe_gfclk_ops);
1382 1125
1383static struct clk usb_host_fs_fck; 1126static struct clk usb_host_fs_fck;
1384 1127
@@ -1512,18 +1255,6 @@ DEFINE_CLK_GATE(usim_fclk, "usim_ck", &usim_ck, 0x0,
1512 OMAP4430_CM_WKUP_USIM_CLKCTRL, OMAP4430_OPTFCLKEN_FCLK_SHIFT, 1255 OMAP4430_CM_WKUP_USIM_CLKCTRL, OMAP4430_OPTFCLKEN_FCLK_SHIFT,
1513 0x0, NULL); 1256 0x0, NULL);
1514 1257
1515DEFINE_CLK_GATE(usim_fck, "sys_32k_ck", &sys_32k_ck, 0x0,
1516 OMAP4430_CM_WKUP_USIM_CLKCTRL, OMAP4430_MODULEMODE_HWCTRL_SHIFT,
1517 0x0, NULL);
1518
1519DEFINE_CLK_GATE(wd_timer2_fck, "sys_32k_ck", &sys_32k_ck, 0x0,
1520 OMAP4430_CM_WKUP_WDT2_CLKCTRL, OMAP4430_MODULEMODE_SWCTRL_SHIFT,
1521 0x0, NULL);
1522
1523DEFINE_CLK_GATE(wd_timer3_fck, "sys_32k_ck", &sys_32k_ck, 0x0,
1524 OMAP4430_CM1_ABE_WDT3_CLKCTRL, OMAP4430_MODULEMODE_SWCTRL_SHIFT,
1525 0x0, NULL);
1526
1527/* Remaining optional clocks */ 1258/* Remaining optional clocks */
1528static const char *pmd_stm_clock_mux_ck_parents[] = { 1259static const char *pmd_stm_clock_mux_ck_parents[] = {
1529 "sys_clkin_ck", "dpll_core_m6x2_ck", "tie_low_clock_ck", 1260 "sys_clkin_ck", "dpll_core_m6x2_ck", "tie_low_clock_ck",
@@ -1774,106 +1505,61 @@ static struct omap_clk omap44xx_clks[] = {
1774 CLK(NULL, "syc_clk_div_ck", &syc_clk_div_ck, CK_443X), 1505 CLK(NULL, "syc_clk_div_ck", &syc_clk_div_ck, CK_443X),
1775 CLK(NULL, "aes1_fck", &aes1_fck, CK_443X), 1506 CLK(NULL, "aes1_fck", &aes1_fck, CK_443X),
1776 CLK(NULL, "aes2_fck", &aes2_fck, CK_443X), 1507 CLK(NULL, "aes2_fck", &aes2_fck, CK_443X),
1777 CLK(NULL, "aess_fck", &aess_fck, CK_443X),
1778 CLK(NULL, "bandgap_fclk", &bandgap_fclk, CK_443X), 1508 CLK(NULL, "bandgap_fclk", &bandgap_fclk, CK_443X),
1779 CLK(NULL, "div_ts_ck", &div_ts_ck, CK_446X), 1509 CLK(NULL, "div_ts_ck", &div_ts_ck, CK_446X),
1780 CLK(NULL, "bandgap_ts_fclk", &bandgap_ts_fclk, CK_446X), 1510 CLK(NULL, "bandgap_ts_fclk", &bandgap_ts_fclk, CK_446X),
1781 CLK(NULL, "des3des_fck", &des3des_fck, CK_443X),
1782 CLK(NULL, "dmic_sync_mux_ck", &dmic_sync_mux_ck, CK_443X), 1511 CLK(NULL, "dmic_sync_mux_ck", &dmic_sync_mux_ck, CK_443X),
1783 CLK(NULL, "dmic_fck", &dmic_fck, CK_443X), 1512 CLK(NULL, "func_dmic_abe_gfclk", &func_dmic_abe_gfclk, CK_443X),
1784 CLK(NULL, "dsp_fck", &dsp_fck, CK_443X),
1785 CLK(NULL, "dss_sys_clk", &dss_sys_clk, CK_443X), 1513 CLK(NULL, "dss_sys_clk", &dss_sys_clk, CK_443X),
1786 CLK(NULL, "dss_tv_clk", &dss_tv_clk, CK_443X), 1514 CLK(NULL, "dss_tv_clk", &dss_tv_clk, CK_443X),
1787 CLK(NULL, "dss_dss_clk", &dss_dss_clk, CK_443X), 1515 CLK(NULL, "dss_dss_clk", &dss_dss_clk, CK_443X),
1788 CLK(NULL, "dss_48mhz_clk", &dss_48mhz_clk, CK_443X), 1516 CLK(NULL, "dss_48mhz_clk", &dss_48mhz_clk, CK_443X),
1789 CLK(NULL, "dss_fck", &dss_fck, CK_443X), 1517 CLK(NULL, "dss_fck", &dss_fck, CK_443X),
1790 CLK("omapdss_dss", "ick", &dss_fck, CK_443X), 1518 CLK("omapdss_dss", "ick", &dss_fck, CK_443X),
1791 CLK(NULL, "efuse_ctrl_cust_fck", &efuse_ctrl_cust_fck, CK_443X),
1792 CLK(NULL, "emif1_fck", &emif1_fck, CK_443X),
1793 CLK(NULL, "emif2_fck", &emif2_fck, CK_443X),
1794 CLK(NULL, "fdif_fck", &fdif_fck, CK_443X), 1519 CLK(NULL, "fdif_fck", &fdif_fck, CK_443X),
1795 CLK(NULL, "fpka_fck", &fpka_fck, CK_443X),
1796 CLK(NULL, "gpio1_dbclk", &gpio1_dbclk, CK_443X), 1520 CLK(NULL, "gpio1_dbclk", &gpio1_dbclk, CK_443X),
1797 CLK(NULL, "gpio1_ick", &gpio1_ick, CK_443X),
1798 CLK(NULL, "gpio2_dbclk", &gpio2_dbclk, CK_443X), 1521 CLK(NULL, "gpio2_dbclk", &gpio2_dbclk, CK_443X),
1799 CLK(NULL, "gpio2_ick", &gpio2_ick, CK_443X),
1800 CLK(NULL, "gpio3_dbclk", &gpio3_dbclk, CK_443X), 1522 CLK(NULL, "gpio3_dbclk", &gpio3_dbclk, CK_443X),
1801 CLK(NULL, "gpio3_ick", &gpio3_ick, CK_443X),
1802 CLK(NULL, "gpio4_dbclk", &gpio4_dbclk, CK_443X), 1523 CLK(NULL, "gpio4_dbclk", &gpio4_dbclk, CK_443X),
1803 CLK(NULL, "gpio4_ick", &gpio4_ick, CK_443X),
1804 CLK(NULL, "gpio5_dbclk", &gpio5_dbclk, CK_443X), 1524 CLK(NULL, "gpio5_dbclk", &gpio5_dbclk, CK_443X),
1805 CLK(NULL, "gpio5_ick", &gpio5_ick, CK_443X),
1806 CLK(NULL, "gpio6_dbclk", &gpio6_dbclk, CK_443X), 1525 CLK(NULL, "gpio6_dbclk", &gpio6_dbclk, CK_443X),
1807 CLK(NULL, "gpio6_ick", &gpio6_ick, CK_443X), 1526 CLK(NULL, "sgx_clk_mux", &sgx_clk_mux, CK_443X),
1808 CLK(NULL, "gpmc_ick", &gpmc_ick, CK_443X),
1809 CLK(NULL, "gpu_fck", &gpu_fck, CK_443X),
1810 CLK(NULL, "hdq1w_fck", &hdq1w_fck, CK_443X),
1811 CLK(NULL, "hsi_fck", &hsi_fck, CK_443X), 1527 CLK(NULL, "hsi_fck", &hsi_fck, CK_443X),
1812 CLK(NULL, "i2c1_fck", &i2c1_fck, CK_443X),
1813 CLK(NULL, "i2c2_fck", &i2c2_fck, CK_443X),
1814 CLK(NULL, "i2c3_fck", &i2c3_fck, CK_443X),
1815 CLK(NULL, "i2c4_fck", &i2c4_fck, CK_443X),
1816 CLK(NULL, "ipu_fck", &ipu_fck, CK_443X),
1817 CLK(NULL, "iss_ctrlclk", &iss_ctrlclk, CK_443X), 1528 CLK(NULL, "iss_ctrlclk", &iss_ctrlclk, CK_443X),
1818 CLK(NULL, "iss_fck", &iss_fck, CK_443X),
1819 CLK(NULL, "iva_fck", &iva_fck, CK_443X),
1820 CLK(NULL, "kbd_fck", &kbd_fck, CK_443X),
1821 CLK(NULL, "l3_instr_ick", &l3_instr_ick, CK_443X),
1822 CLK(NULL, "l3_main_3_ick", &l3_main_3_ick, CK_443X),
1823 CLK(NULL, "mcasp_sync_mux_ck", &mcasp_sync_mux_ck, CK_443X), 1529 CLK(NULL, "mcasp_sync_mux_ck", &mcasp_sync_mux_ck, CK_443X),
1824 CLK(NULL, "mcasp_fck", &mcasp_fck, CK_443X), 1530 CLK(NULL, "func_mcasp_abe_gfclk", &func_mcasp_abe_gfclk, CK_443X),
1825 CLK(NULL, "mcbsp1_sync_mux_ck", &mcbsp1_sync_mux_ck, CK_443X), 1531 CLK(NULL, "mcbsp1_sync_mux_ck", &mcbsp1_sync_mux_ck, CK_443X),
1826 CLK(NULL, "mcbsp1_fck", &mcbsp1_fck, CK_443X), 1532 CLK(NULL, "func_mcbsp1_gfclk", &func_mcbsp1_gfclk, CK_443X),
1827 CLK(NULL, "mcbsp2_sync_mux_ck", &mcbsp2_sync_mux_ck, CK_443X), 1533 CLK(NULL, "mcbsp2_sync_mux_ck", &mcbsp2_sync_mux_ck, CK_443X),
1828 CLK(NULL, "mcbsp2_fck", &mcbsp2_fck, CK_443X), 1534 CLK(NULL, "func_mcbsp2_gfclk", &func_mcbsp2_gfclk, CK_443X),
1829 CLK(NULL, "mcbsp3_sync_mux_ck", &mcbsp3_sync_mux_ck, CK_443X), 1535 CLK(NULL, "mcbsp3_sync_mux_ck", &mcbsp3_sync_mux_ck, CK_443X),
1830 CLK(NULL, "mcbsp3_fck", &mcbsp3_fck, CK_443X), 1536 CLK(NULL, "func_mcbsp3_gfclk", &func_mcbsp3_gfclk, CK_443X),
1831 CLK(NULL, "mcbsp4_sync_mux_ck", &mcbsp4_sync_mux_ck, CK_443X), 1537 CLK(NULL, "mcbsp4_sync_mux_ck", &mcbsp4_sync_mux_ck, CK_443X),
1832 CLK(NULL, "mcbsp4_fck", &mcbsp4_fck, CK_443X), 1538 CLK(NULL, "per_mcbsp4_gfclk", &per_mcbsp4_gfclk, CK_443X),
1833 CLK(NULL, "mcpdm_fck", &mcpdm_fck, CK_443X), 1539 CLK(NULL, "hsmmc1_fclk", &hsmmc1_fclk, CK_443X),
1834 CLK(NULL, "mcspi1_fck", &mcspi1_fck, CK_443X), 1540 CLK(NULL, "hsmmc2_fclk", &hsmmc2_fclk, CK_443X),
1835 CLK(NULL, "mcspi2_fck", &mcspi2_fck, CK_443X),
1836 CLK(NULL, "mcspi3_fck", &mcspi3_fck, CK_443X),
1837 CLK(NULL, "mcspi4_fck", &mcspi4_fck, CK_443X),
1838 CLK(NULL, "mmc1_fck", &mmc1_fck, CK_443X),
1839 CLK(NULL, "mmc2_fck", &mmc2_fck, CK_443X),
1840 CLK(NULL, "mmc3_fck", &mmc3_fck, CK_443X),
1841 CLK(NULL, "mmc4_fck", &mmc4_fck, CK_443X),
1842 CLK(NULL, "mmc5_fck", &mmc5_fck, CK_443X),
1843 CLK(NULL, "ocp2scp_usb_phy_phy_48m", &ocp2scp_usb_phy_phy_48m, CK_443X),
1844 CLK(NULL, "ocp2scp_usb_phy_ick", &ocp2scp_usb_phy_ick, CK_443X),
1845 CLK(NULL, "ocp_wp_noc_ick", &ocp_wp_noc_ick, CK_443X),
1846 CLK(NULL, "rng_ick", &rng_ick, CK_443X),
1847 CLK("omap_rng", "ick", &rng_ick, CK_443X),
1848 CLK(NULL, "sha2md5_fck", &sha2md5_fck, CK_443X), 1541 CLK(NULL, "sha2md5_fck", &sha2md5_fck, CK_443X),
1849 CLK(NULL, "sl2if_ick", &sl2if_ick, CK_443X),
1850 CLK(NULL, "slimbus1_fclk_1", &slimbus1_fclk_1, CK_443X), 1542 CLK(NULL, "slimbus1_fclk_1", &slimbus1_fclk_1, CK_443X),
1851 CLK(NULL, "slimbus1_fclk_0", &slimbus1_fclk_0, CK_443X), 1543 CLK(NULL, "slimbus1_fclk_0", &slimbus1_fclk_0, CK_443X),
1852 CLK(NULL, "slimbus1_fclk_2", &slimbus1_fclk_2, CK_443X), 1544 CLK(NULL, "slimbus1_fclk_2", &slimbus1_fclk_2, CK_443X),
1853 CLK(NULL, "slimbus1_slimbus_clk", &slimbus1_slimbus_clk, CK_443X), 1545 CLK(NULL, "slimbus1_slimbus_clk", &slimbus1_slimbus_clk, CK_443X),
1854 CLK(NULL, "slimbus1_fck", &slimbus1_fck, CK_443X),
1855 CLK(NULL, "slimbus2_fclk_1", &slimbus2_fclk_1, CK_443X), 1546 CLK(NULL, "slimbus2_fclk_1", &slimbus2_fclk_1, CK_443X),
1856 CLK(NULL, "slimbus2_fclk_0", &slimbus2_fclk_0, CK_443X), 1547 CLK(NULL, "slimbus2_fclk_0", &slimbus2_fclk_0, CK_443X),
1857 CLK(NULL, "slimbus2_slimbus_clk", &slimbus2_slimbus_clk, CK_443X), 1548 CLK(NULL, "slimbus2_slimbus_clk", &slimbus2_slimbus_clk, CK_443X),
1858 CLK(NULL, "slimbus2_fck", &slimbus2_fck, CK_443X),
1859 CLK(NULL, "smartreflex_core_fck", &smartreflex_core_fck, CK_443X), 1549 CLK(NULL, "smartreflex_core_fck", &smartreflex_core_fck, CK_443X),
1860 CLK(NULL, "smartreflex_iva_fck", &smartreflex_iva_fck, CK_443X), 1550 CLK(NULL, "smartreflex_iva_fck", &smartreflex_iva_fck, CK_443X),
1861 CLK(NULL, "smartreflex_mpu_fck", &smartreflex_mpu_fck, CK_443X), 1551 CLK(NULL, "smartreflex_mpu_fck", &smartreflex_mpu_fck, CK_443X),
1862 CLK(NULL, "timer1_fck", &timer1_fck, CK_443X), 1552 CLK(NULL, "dmt1_clk_mux", &dmt1_clk_mux, CK_443X),
1863 CLK(NULL, "timer10_fck", &timer10_fck, CK_443X), 1553 CLK(NULL, "cm2_dm10_mux", &cm2_dm10_mux, CK_443X),
1864 CLK(NULL, "timer11_fck", &timer11_fck, CK_443X), 1554 CLK(NULL, "cm2_dm11_mux", &cm2_dm11_mux, CK_443X),
1865 CLK(NULL, "timer2_fck", &timer2_fck, CK_443X), 1555 CLK(NULL, "cm2_dm2_mux", &cm2_dm2_mux, CK_443X),
1866 CLK(NULL, "timer3_fck", &timer3_fck, CK_443X), 1556 CLK(NULL, "cm2_dm3_mux", &cm2_dm3_mux, CK_443X),
1867 CLK(NULL, "timer4_fck", &timer4_fck, CK_443X), 1557 CLK(NULL, "cm2_dm4_mux", &cm2_dm4_mux, CK_443X),
1868 CLK(NULL, "timer5_fck", &timer5_fck, CK_443X), 1558 CLK(NULL, "timer5_sync_mux", &timer5_sync_mux, CK_443X),
1869 CLK(NULL, "timer6_fck", &timer6_fck, CK_443X), 1559 CLK(NULL, "timer6_sync_mux", &timer6_sync_mux, CK_443X),
1870 CLK(NULL, "timer7_fck", &timer7_fck, CK_443X), 1560 CLK(NULL, "timer7_sync_mux", &timer7_sync_mux, CK_443X),
1871 CLK(NULL, "timer8_fck", &timer8_fck, CK_443X), 1561 CLK(NULL, "timer8_sync_mux", &timer8_sync_mux, CK_443X),
1872 CLK(NULL, "timer9_fck", &timer9_fck, CK_443X), 1562 CLK(NULL, "cm2_dm9_mux", &cm2_dm9_mux, CK_443X),
1873 CLK(NULL, "uart1_fck", &uart1_fck, CK_443X),
1874 CLK(NULL, "uart2_fck", &uart2_fck, CK_443X),
1875 CLK(NULL, "uart3_fck", &uart3_fck, CK_443X),
1876 CLK(NULL, "uart4_fck", &uart4_fck, CK_443X),
1877 CLK(NULL, "usb_host_fs_fck", &usb_host_fs_fck, CK_443X), 1563 CLK(NULL, "usb_host_fs_fck", &usb_host_fs_fck, CK_443X),
1878 CLK("usbhs_omap", "fs_fck", &usb_host_fs_fck, CK_443X), 1564 CLK("usbhs_omap", "fs_fck", &usb_host_fs_fck, CK_443X),
1879 CLK(NULL, "utmi_p1_gfclk", &utmi_p1_gfclk, CK_443X), 1565 CLK(NULL, "utmi_p1_gfclk", &utmi_p1_gfclk, CK_443X),
@@ -1901,9 +1587,6 @@ static struct omap_clk omap44xx_clks[] = {
1901 CLK("usbhs_tll", "usbtll_ick", &usb_tll_hs_ick, CK_443X), 1587 CLK("usbhs_tll", "usbtll_ick", &usb_tll_hs_ick, CK_443X),
1902 CLK(NULL, "usim_ck", &usim_ck, CK_443X), 1588 CLK(NULL, "usim_ck", &usim_ck, CK_443X),
1903 CLK(NULL, "usim_fclk", &usim_fclk, CK_443X), 1589 CLK(NULL, "usim_fclk", &usim_fclk, CK_443X),
1904 CLK(NULL, "usim_fck", &usim_fck, CK_443X),
1905 CLK(NULL, "wd_timer2_fck", &wd_timer2_fck, CK_443X),
1906 CLK(NULL, "wd_timer3_fck", &wd_timer3_fck, CK_443X),
1907 CLK(NULL, "pmd_stm_clock_mux_ck", &pmd_stm_clock_mux_ck, CK_443X), 1590 CLK(NULL, "pmd_stm_clock_mux_ck", &pmd_stm_clock_mux_ck, CK_443X),
1908 CLK(NULL, "pmd_trace_clk_mux_ck", &pmd_trace_clk_mux_ck, CK_443X), 1591 CLK(NULL, "pmd_trace_clk_mux_ck", &pmd_trace_clk_mux_ck, CK_443X),
1909 CLK(NULL, "stm_clk_div_ck", &stm_clk_div_ck, CK_443X), 1592 CLK(NULL, "stm_clk_div_ck", &stm_clk_div_ck, CK_443X),
@@ -1980,15 +1663,6 @@ static struct omap_clk omap44xx_clks[] = {
1980 CLK(NULL, "cpufreq_ck", &dpll_mpu_ck, CK_443X), 1663 CLK(NULL, "cpufreq_ck", &dpll_mpu_ck, CK_443X),
1981}; 1664};
1982 1665
1983static const char *enable_init_clks[] = {
1984 "emif1_fck",
1985 "emif2_fck",
1986 "gpmc_ick",
1987 "l3_instr_ick",
1988 "l3_main_3_ick",
1989 "ocp_wp_noc_ick",
1990};
1991
1992int __init omap4xxx_clk_init(void) 1666int __init omap4xxx_clk_init(void)
1993{ 1667{
1994 u32 cpu_clkflg; 1668 u32 cpu_clkflg;
@@ -2019,9 +1693,6 @@ int __init omap4xxx_clk_init(void)
2019 1693
2020 omap2_clk_disable_autoidle_all(); 1694 omap2_clk_disable_autoidle_all();
2021 1695
2022 omap2_clk_enable_init_clocks(enable_init_clks,
2023 ARRAY_SIZE(enable_init_clks));
2024
2025 /* 1696 /*
2026 * On OMAP4460 the ABE DPLL fails to turn on if in idle low-power 1697 * On OMAP4460 the ABE DPLL fails to turn on if in idle low-power
2027 * state when turning the ABE clock domain. Workaround this by 1698 * state when turning the ABE clock domain. Workaround this by
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index b40204837bd7..60ddd8612b4d 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -65,6 +65,17 @@ struct clockdomain;
65 .ops = &_clkops_name, \ 65 .ops = &_clkops_name, \
66 }; 66 };
67 67
68#define DEFINE_STRUCT_CLK_FLAGS(_name, _parent_array_name, \
69 _clkops_name, _flags) \
70 static struct clk _name = { \
71 .name = #_name, \
72 .hw = &_name##_hw.hw, \
73 .parent_names = _parent_array_name, \
74 .num_parents = ARRAY_SIZE(_parent_array_name), \
75 .ops = &_clkops_name, \
76 .flags = _flags, \
77 };
78
68#define DEFINE_STRUCT_CLK_HW_OMAP(_name, _clkdm_name) \ 79#define DEFINE_STRUCT_CLK_HW_OMAP(_name, _clkdm_name) \
69 static struct clk_hw_omap _name##_hw = { \ 80 static struct clk_hw_omap _name##_hw = { \
70 .hw = { \ 81 .hw = { \
diff --git a/arch/arm/mach-omap2/clock2xxx.c b/arch/arm/mach-omap2/clock2xxx.c
index 1ff646908627..b870f6a9e283 100644
--- a/arch/arm/mach-omap2/clock2xxx.c
+++ b/arch/arm/mach-omap2/clock2xxx.c
@@ -52,6 +52,6 @@ static int __init omap2xxx_clk_arch_init(void)
52 return ret; 52 return ret;
53} 53}
54 54
55arch_initcall(omap2xxx_clk_arch_init); 55omap_arch_initcall(omap2xxx_clk_arch_init);
56 56
57 57
diff --git a/arch/arm/mach-omap2/clock3xxx.c b/arch/arm/mach-omap2/clock3xxx.c
index 4eacab8f1176..0b02b4161d71 100644
--- a/arch/arm/mach-omap2/clock3xxx.c
+++ b/arch/arm/mach-omap2/clock3xxx.c
@@ -94,6 +94,6 @@ static int __init omap3xxx_clk_arch_init(void)
94 return ret; 94 return ret;
95} 95}
96 96
97arch_initcall(omap3xxx_clk_arch_init); 97omap_arch_initcall(omap3xxx_clk_arch_init);
98 98
99 99
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c
index 7faf82d4e85c..2da3b5ec010c 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -92,8 +92,6 @@ static int _clkdm_register(struct clockdomain *clkdm)
92 92
93 pwrdm_add_clkdm(pwrdm, clkdm); 93 pwrdm_add_clkdm(pwrdm, clkdm);
94 94
95 spin_lock_init(&clkdm->lock);
96
97 pr_debug("clockdomain: registered %s\n", clkdm->name); 95 pr_debug("clockdomain: registered %s\n", clkdm->name);
98 96
99 return 0; 97 return 0;
@@ -122,7 +120,7 @@ static struct clkdm_dep *_clkdm_deps_lookup(struct clockdomain *clkdm,
122 return cd; 120 return cd;
123} 121}
124 122
125/* 123/**
126 * _autodep_lookup - resolve autodep clkdm names to clkdm pointers; store 124 * _autodep_lookup - resolve autodep clkdm names to clkdm pointers; store
127 * @autodep: struct clkdm_autodep * to resolve 125 * @autodep: struct clkdm_autodep * to resolve
128 * 126 *
@@ -154,88 +152,206 @@ static void _autodep_lookup(struct clkdm_autodep *autodep)
154 autodep->clkdm.ptr = clkdm; 152 autodep->clkdm.ptr = clkdm;
155} 153}
156 154
157/* 155/**
158 * _clkdm_add_autodeps - add auto sleepdeps/wkdeps to clkdm upon clock enable 156 * _resolve_clkdm_deps() - resolve clkdm_names in @clkdm_deps to clkdms
159 * @clkdm: struct clockdomain * 157 * @clkdm: clockdomain that we are resolving dependencies for
158 * @clkdm_deps: ptr to array of struct clkdm_deps to resolve
160 * 159 *
161 * Add the "autodep" sleep & wakeup dependencies to clockdomain 'clkdm' 160 * Iterates through @clkdm_deps, looking up the struct clockdomain named by
162 * in hardware-supervised mode. Meant to be called from clock framework 161 * clkdm_name and storing the clockdomain pointer in the struct clkdm_dep.
163 * when a clock inside clockdomain 'clkdm' is enabled. No return value. 162 * No return value.
163 */
164static void _resolve_clkdm_deps(struct clockdomain *clkdm,
165 struct clkdm_dep *clkdm_deps)
166{
167 struct clkdm_dep *cd;
168
169 for (cd = clkdm_deps; cd && cd->clkdm_name; cd++) {
170 if (cd->clkdm)
171 continue;
172 cd->clkdm = _clkdm_lookup(cd->clkdm_name);
173
174 WARN(!cd->clkdm, "clockdomain: %s: could not find clkdm %s while resolving dependencies - should never happen",
175 clkdm->name, cd->clkdm_name);
176 }
177}
178
179/**
180 * _clkdm_add_wkdep - add a wakeup dependency from clkdm2 to clkdm1 (lockless)
181 * @clkdm1: wake this struct clockdomain * up (dependent)
182 * @clkdm2: when this struct clockdomain * wakes up (source)
164 * 183 *
165 * XXX autodeps are deprecated and should be removed at the earliest 184 * When the clockdomain represented by @clkdm2 wakes up, wake up
166 * opportunity 185 * @clkdm1. Implemented in hardware on the OMAP, this feature is
186 * designed to reduce wakeup latency of the dependent clockdomain @clkdm1.
187 * Returns -EINVAL if presented with invalid clockdomain pointers,
188 * -ENOENT if @clkdm2 cannot wake up clkdm1 in hardware, or 0 upon
189 * success.
167 */ 190 */
168void _clkdm_add_autodeps(struct clockdomain *clkdm) 191static int _clkdm_add_wkdep(struct clockdomain *clkdm1,
192 struct clockdomain *clkdm2)
169{ 193{
170 struct clkdm_autodep *autodep; 194 struct clkdm_dep *cd;
195 int ret = 0;
171 196
172 if (!autodeps || clkdm->flags & CLKDM_NO_AUTODEPS) 197 if (!clkdm1 || !clkdm2)
173 return; 198 return -EINVAL;
174 199
175 for (autodep = autodeps; autodep->clkdm.ptr; autodep++) { 200 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs);
176 if (IS_ERR(autodep->clkdm.ptr)) 201 if (IS_ERR(cd))
177 continue; 202 ret = PTR_ERR(cd);
178 203
179 pr_debug("clockdomain: %s: adding %s sleepdep/wkdep\n", 204 if (!arch_clkdm || !arch_clkdm->clkdm_add_wkdep)
180 clkdm->name, autodep->clkdm.ptr->name); 205 ret = -EINVAL;
206
207 if (ret) {
208 pr_debug("clockdomain: hardware cannot set/clear wake up of %s when %s wakes up\n",
209 clkdm1->name, clkdm2->name);
210 return ret;
211 }
212
213 cd->wkdep_usecount++;
214 if (cd->wkdep_usecount == 1) {
215 pr_debug("clockdomain: hardware will wake up %s when %s wakes up\n",
216 clkdm1->name, clkdm2->name);
181 217
182 clkdm_add_sleepdep(clkdm, autodep->clkdm.ptr); 218 ret = arch_clkdm->clkdm_add_wkdep(clkdm1, clkdm2);
183 clkdm_add_wkdep(clkdm, autodep->clkdm.ptr);
184 } 219 }
220
221 return ret;
185} 222}
186 223
187/* 224/**
188 * _clkdm_add_autodeps - remove auto sleepdeps/wkdeps from clkdm 225 * _clkdm_del_wkdep - remove a wakeup dep from clkdm2 to clkdm1 (lockless)
189 * @clkdm: struct clockdomain * 226 * @clkdm1: wake this struct clockdomain * up (dependent)
227 * @clkdm2: when this struct clockdomain * wakes up (source)
190 * 228 *
191 * Remove the "autodep" sleep & wakeup dependencies from clockdomain 'clkdm' 229 * Remove a wakeup dependency causing @clkdm1 to wake up when @clkdm2
192 * in hardware-supervised mode. Meant to be called from clock framework 230 * wakes up. Returns -EINVAL if presented with invalid clockdomain
193 * when a clock inside clockdomain 'clkdm' is disabled. No return value. 231 * pointers, -ENOENT if @clkdm2 cannot wake up clkdm1 in hardware, or
232 * 0 upon success.
233 */
234static int _clkdm_del_wkdep(struct clockdomain *clkdm1,
235 struct clockdomain *clkdm2)
236{
237 struct clkdm_dep *cd;
238 int ret = 0;
239
240 if (!clkdm1 || !clkdm2)
241 return -EINVAL;
242
243 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs);
244 if (IS_ERR(cd))
245 ret = PTR_ERR(cd);
246
247 if (!arch_clkdm || !arch_clkdm->clkdm_del_wkdep)
248 ret = -EINVAL;
249
250 if (ret) {
251 pr_debug("clockdomain: hardware cannot set/clear wake up of %s when %s wakes up\n",
252 clkdm1->name, clkdm2->name);
253 return ret;
254 }
255
256 cd->wkdep_usecount--;
257 if (cd->wkdep_usecount == 0) {
258 pr_debug("clockdomain: hardware will no longer wake up %s after %s wakes up\n",
259 clkdm1->name, clkdm2->name);
260
261 ret = arch_clkdm->clkdm_del_wkdep(clkdm1, clkdm2);
262 }
263
264 return ret;
265}
266
267/**
268 * _clkdm_add_sleepdep - add a sleep dependency from clkdm2 to clkdm1 (lockless)
269 * @clkdm1: prevent this struct clockdomain * from sleeping (dependent)
270 * @clkdm2: when this struct clockdomain * is active (source)
194 * 271 *
195 * XXX autodeps are deprecated and should be removed at the earliest 272 * Prevent @clkdm1 from automatically going inactive (and then to
196 * opportunity 273 * retention or off) if @clkdm2 is active. Returns -EINVAL if
274 * presented with invalid clockdomain pointers or called on a machine
275 * that does not support software-configurable hardware sleep
276 * dependencies, -ENOENT if the specified dependency cannot be set in
277 * hardware, or 0 upon success.
197 */ 278 */
198void _clkdm_del_autodeps(struct clockdomain *clkdm) 279static int _clkdm_add_sleepdep(struct clockdomain *clkdm1,
280 struct clockdomain *clkdm2)
199{ 281{
200 struct clkdm_autodep *autodep; 282 struct clkdm_dep *cd;
283 int ret = 0;
201 284
202 if (!autodeps || clkdm->flags & CLKDM_NO_AUTODEPS) 285 if (!clkdm1 || !clkdm2)
203 return; 286 return -EINVAL;
204 287
205 for (autodep = autodeps; autodep->clkdm.ptr; autodep++) { 288 cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs);
206 if (IS_ERR(autodep->clkdm.ptr)) 289 if (IS_ERR(cd))
207 continue; 290 ret = PTR_ERR(cd);
208 291
209 pr_debug("clockdomain: %s: removing %s sleepdep/wkdep\n", 292 if (!arch_clkdm || !arch_clkdm->clkdm_add_sleepdep)
210 clkdm->name, autodep->clkdm.ptr->name); 293 ret = -EINVAL;
211 294
212 clkdm_del_sleepdep(clkdm, autodep->clkdm.ptr); 295 if (ret) {
213 clkdm_del_wkdep(clkdm, autodep->clkdm.ptr); 296 pr_debug("clockdomain: hardware cannot set/clear sleep dependency affecting %s from %s\n",
297 clkdm1->name, clkdm2->name);
298 return ret;
299 }
300
301 cd->sleepdep_usecount++;
302 if (cd->sleepdep_usecount == 1) {
303 pr_debug("clockdomain: will prevent %s from sleeping if %s is active\n",
304 clkdm1->name, clkdm2->name);
305
306 ret = arch_clkdm->clkdm_add_sleepdep(clkdm1, clkdm2);
214 } 307 }
308
309 return ret;
215} 310}
216 311
217/** 312/**
218 * _resolve_clkdm_deps() - resolve clkdm_names in @clkdm_deps to clkdms 313 * _clkdm_del_sleepdep - remove a sleep dep from clkdm2 to clkdm1 (lockless)
219 * @clkdm: clockdomain that we are resolving dependencies for 314 * @clkdm1: prevent this struct clockdomain * from sleeping (dependent)
220 * @clkdm_deps: ptr to array of struct clkdm_deps to resolve 315 * @clkdm2: when this struct clockdomain * is active (source)
221 * 316 *
222 * Iterates through @clkdm_deps, looking up the struct clockdomain named by 317 * Allow @clkdm1 to automatically go inactive (and then to retention or
223 * clkdm_name and storing the clockdomain pointer in the struct clkdm_dep. 318 * off), independent of the activity state of @clkdm2. Returns -EINVAL
224 * No return value. 319 * if presented with invalid clockdomain pointers or called on a machine
320 * that does not support software-configurable hardware sleep dependencies,
321 * -ENOENT if the specified dependency cannot be cleared in hardware, or
322 * 0 upon success.
225 */ 323 */
226static void _resolve_clkdm_deps(struct clockdomain *clkdm, 324static int _clkdm_del_sleepdep(struct clockdomain *clkdm1,
227 struct clkdm_dep *clkdm_deps) 325 struct clockdomain *clkdm2)
228{ 326{
229 struct clkdm_dep *cd; 327 struct clkdm_dep *cd;
328 int ret = 0;
230 329
231 for (cd = clkdm_deps; cd && cd->clkdm_name; cd++) { 330 if (!clkdm1 || !clkdm2)
232 if (cd->clkdm) 331 return -EINVAL;
233 continue;
234 cd->clkdm = _clkdm_lookup(cd->clkdm_name);
235 332
236 WARN(!cd->clkdm, "clockdomain: %s: could not find clkdm %s while resolving dependencies - should never happen", 333 cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs);
237 clkdm->name, cd->clkdm_name); 334 if (IS_ERR(cd))
335 ret = PTR_ERR(cd);
336
337 if (!arch_clkdm || !arch_clkdm->clkdm_del_sleepdep)
338 ret = -EINVAL;
339
340 if (ret) {
341 pr_debug("clockdomain: hardware cannot set/clear sleep dependency affecting %s from %s\n",
342 clkdm1->name, clkdm2->name);
343 return ret;
238 } 344 }
345
346 cd->sleepdep_usecount--;
347 if (cd->sleepdep_usecount == 0) {
348 pr_debug("clockdomain: will no longer prevent %s from sleeping if %s is active\n",
349 clkdm1->name, clkdm2->name);
350
351 ret = arch_clkdm->clkdm_del_sleepdep(clkdm1, clkdm2);
352 }
353
354 return ret;
239} 355}
240 356
241/* Public functions */ 357/* Public functions */
@@ -456,30 +572,18 @@ struct powerdomain *clkdm_get_pwrdm(struct clockdomain *clkdm)
456int clkdm_add_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) 572int clkdm_add_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
457{ 573{
458 struct clkdm_dep *cd; 574 struct clkdm_dep *cd;
459 int ret = 0; 575 int ret;
460 576
461 if (!clkdm1 || !clkdm2) 577 if (!clkdm1 || !clkdm2)
462 return -EINVAL; 578 return -EINVAL;
463 579
464 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); 580 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs);
465 if (IS_ERR(cd)) 581 if (IS_ERR(cd))
466 ret = PTR_ERR(cd); 582 return PTR_ERR(cd);
467 583
468 if (!arch_clkdm || !arch_clkdm->clkdm_add_wkdep) 584 pwrdm_lock(cd->clkdm->pwrdm.ptr);
469 ret = -EINVAL; 585 ret = _clkdm_add_wkdep(clkdm1, clkdm2);
470 586 pwrdm_unlock(cd->clkdm->pwrdm.ptr);
471 if (ret) {
472 pr_debug("clockdomain: hardware cannot set/clear wake up of %s when %s wakes up\n",
473 clkdm1->name, clkdm2->name);
474 return ret;
475 }
476
477 if (atomic_inc_return(&cd->wkdep_usecount) == 1) {
478 pr_debug("clockdomain: hardware will wake up %s when %s wakes up\n",
479 clkdm1->name, clkdm2->name);
480
481 ret = arch_clkdm->clkdm_add_wkdep(clkdm1, clkdm2);
482 }
483 587
484 return ret; 588 return ret;
485} 589}
@@ -497,30 +601,18 @@ int clkdm_add_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
497int clkdm_del_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) 601int clkdm_del_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
498{ 602{
499 struct clkdm_dep *cd; 603 struct clkdm_dep *cd;
500 int ret = 0; 604 int ret;
501 605
502 if (!clkdm1 || !clkdm2) 606 if (!clkdm1 || !clkdm2)
503 return -EINVAL; 607 return -EINVAL;
504 608
505 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); 609 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs);
506 if (IS_ERR(cd)) 610 if (IS_ERR(cd))
507 ret = PTR_ERR(cd); 611 return PTR_ERR(cd);
508 612
509 if (!arch_clkdm || !arch_clkdm->clkdm_del_wkdep) 613 pwrdm_lock(cd->clkdm->pwrdm.ptr);
510 ret = -EINVAL; 614 ret = _clkdm_del_wkdep(clkdm1, clkdm2);
511 615 pwrdm_unlock(cd->clkdm->pwrdm.ptr);
512 if (ret) {
513 pr_debug("clockdomain: hardware cannot set/clear wake up of %s when %s wakes up\n",
514 clkdm1->name, clkdm2->name);
515 return ret;
516 }
517
518 if (atomic_dec_return(&cd->wkdep_usecount) == 0) {
519 pr_debug("clockdomain: hardware will no longer wake up %s after %s wakes up\n",
520 clkdm1->name, clkdm2->name);
521
522 ret = arch_clkdm->clkdm_del_wkdep(clkdm1, clkdm2);
523 }
524 616
525 return ret; 617 return ret;
526} 618}
@@ -560,7 +652,7 @@ int clkdm_read_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
560 return ret; 652 return ret;
561 } 653 }
562 654
563 /* XXX It's faster to return the atomic wkdep_usecount */ 655 /* XXX It's faster to return the wkdep_usecount */
564 return arch_clkdm->clkdm_read_wkdep(clkdm1, clkdm2); 656 return arch_clkdm->clkdm_read_wkdep(clkdm1, clkdm2);
565} 657}
566 658
@@ -600,30 +692,18 @@ int clkdm_clear_all_wkdeps(struct clockdomain *clkdm)
600int clkdm_add_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) 692int clkdm_add_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
601{ 693{
602 struct clkdm_dep *cd; 694 struct clkdm_dep *cd;
603 int ret = 0; 695 int ret;
604 696
605 if (!clkdm1 || !clkdm2) 697 if (!clkdm1 || !clkdm2)
606 return -EINVAL; 698 return -EINVAL;
607 699
608 cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs); 700 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs);
609 if (IS_ERR(cd)) 701 if (IS_ERR(cd))
610 ret = PTR_ERR(cd); 702 return PTR_ERR(cd);
611 703
612 if (!arch_clkdm || !arch_clkdm->clkdm_add_sleepdep) 704 pwrdm_lock(cd->clkdm->pwrdm.ptr);
613 ret = -EINVAL; 705 ret = _clkdm_add_sleepdep(clkdm1, clkdm2);
614 706 pwrdm_unlock(cd->clkdm->pwrdm.ptr);
615 if (ret) {
616 pr_debug("clockdomain: hardware cannot set/clear sleep dependency affecting %s from %s\n",
617 clkdm1->name, clkdm2->name);
618 return ret;
619 }
620
621 if (atomic_inc_return(&cd->sleepdep_usecount) == 1) {
622 pr_debug("clockdomain: will prevent %s from sleeping if %s is active\n",
623 clkdm1->name, clkdm2->name);
624
625 ret = arch_clkdm->clkdm_add_sleepdep(clkdm1, clkdm2);
626 }
627 707
628 return ret; 708 return ret;
629} 709}
@@ -643,30 +723,18 @@ int clkdm_add_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
643int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) 723int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
644{ 724{
645 struct clkdm_dep *cd; 725 struct clkdm_dep *cd;
646 int ret = 0; 726 int ret;
647 727
648 if (!clkdm1 || !clkdm2) 728 if (!clkdm1 || !clkdm2)
649 return -EINVAL; 729 return -EINVAL;
650 730
651 cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs); 731 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs);
652 if (IS_ERR(cd)) 732 if (IS_ERR(cd))
653 ret = PTR_ERR(cd); 733 return PTR_ERR(cd);
654 734
655 if (!arch_clkdm || !arch_clkdm->clkdm_del_sleepdep) 735 pwrdm_lock(cd->clkdm->pwrdm.ptr);
656 ret = -EINVAL; 736 ret = _clkdm_del_sleepdep(clkdm1, clkdm2);
657 737 pwrdm_unlock(cd->clkdm->pwrdm.ptr);
658 if (ret) {
659 pr_debug("clockdomain: hardware cannot set/clear sleep dependency affecting %s from %s\n",
660 clkdm1->name, clkdm2->name);
661 return ret;
662 }
663
664 if (atomic_dec_return(&cd->sleepdep_usecount) == 0) {
665 pr_debug("clockdomain: will no longer prevent %s from sleeping if %s is active\n",
666 clkdm1->name, clkdm2->name);
667
668 ret = arch_clkdm->clkdm_del_sleepdep(clkdm1, clkdm2);
669 }
670 738
671 return ret; 739 return ret;
672} 740}
@@ -708,7 +776,7 @@ int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
708 return ret; 776 return ret;
709 } 777 }
710 778
711 /* XXX It's faster to return the atomic sleepdep_usecount */ 779 /* XXX It's faster to return the sleepdep_usecount */
712 return arch_clkdm->clkdm_read_sleepdep(clkdm1, clkdm2); 780 return arch_clkdm->clkdm_read_sleepdep(clkdm1, clkdm2);
713} 781}
714 782
@@ -734,18 +802,17 @@ int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm)
734} 802}
735 803
736/** 804/**
737 * clkdm_sleep - force clockdomain sleep transition 805 * clkdm_sleep_nolock - force clockdomain sleep transition (lockless)
738 * @clkdm: struct clockdomain * 806 * @clkdm: struct clockdomain *
739 * 807 *
740 * Instruct the CM to force a sleep transition on the specified 808 * Instruct the CM to force a sleep transition on the specified
741 * clockdomain @clkdm. Returns -EINVAL if @clkdm is NULL or if 809 * clockdomain @clkdm. Only for use by the powerdomain code. Returns
742 * clockdomain does not support software-initiated sleep; 0 upon 810 * -EINVAL if @clkdm is NULL or if clockdomain does not support
743 * success. 811 * software-initiated sleep; 0 upon success.
744 */ 812 */
745int clkdm_sleep(struct clockdomain *clkdm) 813int clkdm_sleep_nolock(struct clockdomain *clkdm)
746{ 814{
747 int ret; 815 int ret;
748 unsigned long flags;
749 816
750 if (!clkdm) 817 if (!clkdm)
751 return -EINVAL; 818 return -EINVAL;
@@ -761,26 +828,45 @@ int clkdm_sleep(struct clockdomain *clkdm)
761 828
762 pr_debug("clockdomain: forcing sleep on %s\n", clkdm->name); 829 pr_debug("clockdomain: forcing sleep on %s\n", clkdm->name);
763 830
764 spin_lock_irqsave(&clkdm->lock, flags);
765 clkdm->_flags &= ~_CLKDM_FLAG_HWSUP_ENABLED; 831 clkdm->_flags &= ~_CLKDM_FLAG_HWSUP_ENABLED;
766 ret = arch_clkdm->clkdm_sleep(clkdm); 832 ret = arch_clkdm->clkdm_sleep(clkdm);
767 spin_unlock_irqrestore(&clkdm->lock, flags); 833 ret |= pwrdm_state_switch_nolock(clkdm->pwrdm.ptr);
834
768 return ret; 835 return ret;
769} 836}
770 837
771/** 838/**
772 * clkdm_wakeup - force clockdomain wakeup transition 839 * clkdm_sleep - force clockdomain sleep transition
773 * @clkdm: struct clockdomain * 840 * @clkdm: struct clockdomain *
774 * 841 *
775 * Instruct the CM to force a wakeup transition on the specified 842 * Instruct the CM to force a sleep transition on the specified
776 * clockdomain @clkdm. Returns -EINVAL if @clkdm is NULL or if the 843 * clockdomain @clkdm. Returns -EINVAL if @clkdm is NULL or if
777 * clockdomain does not support software-controlled wakeup; 0 upon 844 * clockdomain does not support software-initiated sleep; 0 upon
778 * success. 845 * success.
779 */ 846 */
780int clkdm_wakeup(struct clockdomain *clkdm) 847int clkdm_sleep(struct clockdomain *clkdm)
848{
849 int ret;
850
851 pwrdm_lock(clkdm->pwrdm.ptr);
852 ret = clkdm_sleep_nolock(clkdm);
853 pwrdm_unlock(clkdm->pwrdm.ptr);
854
855 return ret;
856}
857
858/**
859 * clkdm_wakeup_nolock - force clockdomain wakeup transition (lockless)
860 * @clkdm: struct clockdomain *
861 *
862 * Instruct the CM to force a wakeup transition on the specified
863 * clockdomain @clkdm. Only for use by the powerdomain code. Returns
864 * -EINVAL if @clkdm is NULL or if the clockdomain does not support
865 * software-controlled wakeup; 0 upon success.
866 */
867int clkdm_wakeup_nolock(struct clockdomain *clkdm)
781{ 868{
782 int ret; 869 int ret;
783 unsigned long flags;
784 870
785 if (!clkdm) 871 if (!clkdm)
786 return -EINVAL; 872 return -EINVAL;
@@ -796,28 +882,46 @@ int clkdm_wakeup(struct clockdomain *clkdm)
796 882
797 pr_debug("clockdomain: forcing wakeup on %s\n", clkdm->name); 883 pr_debug("clockdomain: forcing wakeup on %s\n", clkdm->name);
798 884
799 spin_lock_irqsave(&clkdm->lock, flags);
800 clkdm->_flags &= ~_CLKDM_FLAG_HWSUP_ENABLED; 885 clkdm->_flags &= ~_CLKDM_FLAG_HWSUP_ENABLED;
801 ret = arch_clkdm->clkdm_wakeup(clkdm); 886 ret = arch_clkdm->clkdm_wakeup(clkdm);
802 ret |= pwrdm_state_switch(clkdm->pwrdm.ptr); 887 ret |= pwrdm_state_switch_nolock(clkdm->pwrdm.ptr);
803 spin_unlock_irqrestore(&clkdm->lock, flags); 888
804 return ret; 889 return ret;
805} 890}
806 891
807/** 892/**
808 * clkdm_allow_idle - enable hwsup idle transitions for clkdm 893 * clkdm_wakeup - force clockdomain wakeup transition
809 * @clkdm: struct clockdomain * 894 * @clkdm: struct clockdomain *
810 * 895 *
811 * Allow the hardware to automatically switch the clockdomain @clkdm into 896 * Instruct the CM to force a wakeup transition on the specified
812 * active or idle states, as needed by downstream clocks. If the 897 * clockdomain @clkdm. Returns -EINVAL if @clkdm is NULL or if the
898 * clockdomain does not support software-controlled wakeup; 0 upon
899 * success.
900 */
901int clkdm_wakeup(struct clockdomain *clkdm)
902{
903 int ret;
904
905 pwrdm_lock(clkdm->pwrdm.ptr);
906 ret = clkdm_wakeup_nolock(clkdm);
907 pwrdm_unlock(clkdm->pwrdm.ptr);
908
909 return ret;
910}
911
912/**
913 * clkdm_allow_idle_nolock - enable hwsup idle transitions for clkdm
914 * @clkdm: struct clockdomain *
915 *
916 * Allow the hardware to automatically switch the clockdomain @clkdm
917 * into active or idle states, as needed by downstream clocks. If the
813 * clockdomain has any downstream clocks enabled in the clock 918 * clockdomain has any downstream clocks enabled in the clock
814 * framework, wkdep/sleepdep autodependencies are added; this is so 919 * framework, wkdep/sleepdep autodependencies are added; this is so
815 * device drivers can read and write to the device. No return value. 920 * device drivers can read and write to the device. Only for use by
921 * the powerdomain code. No return value.
816 */ 922 */
817void clkdm_allow_idle(struct clockdomain *clkdm) 923void clkdm_allow_idle_nolock(struct clockdomain *clkdm)
818{ 924{
819 unsigned long flags;
820
821 if (!clkdm) 925 if (!clkdm)
822 return; 926 return;
823 927
@@ -833,11 +937,26 @@ void clkdm_allow_idle(struct clockdomain *clkdm)
833 pr_debug("clockdomain: enabling automatic idle transitions for %s\n", 937 pr_debug("clockdomain: enabling automatic idle transitions for %s\n",
834 clkdm->name); 938 clkdm->name);
835 939
836 spin_lock_irqsave(&clkdm->lock, flags);
837 clkdm->_flags |= _CLKDM_FLAG_HWSUP_ENABLED; 940 clkdm->_flags |= _CLKDM_FLAG_HWSUP_ENABLED;
838 arch_clkdm->clkdm_allow_idle(clkdm); 941 arch_clkdm->clkdm_allow_idle(clkdm);
839 pwrdm_state_switch(clkdm->pwrdm.ptr); 942 pwrdm_state_switch_nolock(clkdm->pwrdm.ptr);
840 spin_unlock_irqrestore(&clkdm->lock, flags); 943}
944
945/**
946 * clkdm_allow_idle - enable hwsup idle transitions for clkdm
947 * @clkdm: struct clockdomain *
948 *
949 * Allow the hardware to automatically switch the clockdomain @clkdm into
950 * active or idle states, as needed by downstream clocks. If the
951 * clockdomain has any downstream clocks enabled in the clock
952 * framework, wkdep/sleepdep autodependencies are added; this is so
953 * device drivers can read and write to the device. No return value.
954 */
955void clkdm_allow_idle(struct clockdomain *clkdm)
956{
957 pwrdm_lock(clkdm->pwrdm.ptr);
958 clkdm_allow_idle_nolock(clkdm);
959 pwrdm_unlock(clkdm->pwrdm.ptr);
841} 960}
842 961
843/** 962/**
@@ -847,12 +966,11 @@ void clkdm_allow_idle(struct clockdomain *clkdm)
847 * Prevent the hardware from automatically switching the clockdomain 966 * Prevent the hardware from automatically switching the clockdomain
848 * @clkdm into inactive or idle states. If the clockdomain has 967 * @clkdm into inactive or idle states. If the clockdomain has
849 * downstream clocks enabled in the clock framework, wkdep/sleepdep 968 * downstream clocks enabled in the clock framework, wkdep/sleepdep
850 * autodependencies are removed. No return value. 969 * autodependencies are removed. Only for use by the powerdomain
970 * code. No return value.
851 */ 971 */
852void clkdm_deny_idle(struct clockdomain *clkdm) 972void clkdm_deny_idle_nolock(struct clockdomain *clkdm)
853{ 973{
854 unsigned long flags;
855
856 if (!clkdm) 974 if (!clkdm)
857 return; 975 return;
858 976
@@ -868,11 +986,25 @@ void clkdm_deny_idle(struct clockdomain *clkdm)
868 pr_debug("clockdomain: disabling automatic idle transitions for %s\n", 986 pr_debug("clockdomain: disabling automatic idle transitions for %s\n",
869 clkdm->name); 987 clkdm->name);
870 988
871 spin_lock_irqsave(&clkdm->lock, flags);
872 clkdm->_flags &= ~_CLKDM_FLAG_HWSUP_ENABLED; 989 clkdm->_flags &= ~_CLKDM_FLAG_HWSUP_ENABLED;
873 arch_clkdm->clkdm_deny_idle(clkdm); 990 arch_clkdm->clkdm_deny_idle(clkdm);
874 pwrdm_state_switch(clkdm->pwrdm.ptr); 991 pwrdm_state_switch_nolock(clkdm->pwrdm.ptr);
875 spin_unlock_irqrestore(&clkdm->lock, flags); 992}
993
994/**
995 * clkdm_deny_idle - disable hwsup idle transitions for clkdm
996 * @clkdm: struct clockdomain *
997 *
998 * Prevent the hardware from automatically switching the clockdomain
999 * @clkdm into inactive or idle states. If the clockdomain has
1000 * downstream clocks enabled in the clock framework, wkdep/sleepdep
1001 * autodependencies are removed. No return value.
1002 */
1003void clkdm_deny_idle(struct clockdomain *clkdm)
1004{
1005 pwrdm_lock(clkdm->pwrdm.ptr);
1006 clkdm_deny_idle_nolock(clkdm);
1007 pwrdm_unlock(clkdm->pwrdm.ptr);
876} 1008}
877 1009
878/** 1010/**
@@ -889,14 +1021,11 @@ void clkdm_deny_idle(struct clockdomain *clkdm)
889bool clkdm_in_hwsup(struct clockdomain *clkdm) 1021bool clkdm_in_hwsup(struct clockdomain *clkdm)
890{ 1022{
891 bool ret; 1023 bool ret;
892 unsigned long flags;
893 1024
894 if (!clkdm) 1025 if (!clkdm)
895 return false; 1026 return false;
896 1027
897 spin_lock_irqsave(&clkdm->lock, flags);
898 ret = (clkdm->_flags & _CLKDM_FLAG_HWSUP_ENABLED) ? true : false; 1028 ret = (clkdm->_flags & _CLKDM_FLAG_HWSUP_ENABLED) ? true : false;
899 spin_unlock_irqrestore(&clkdm->lock, flags);
900 1029
901 return ret; 1030 return ret;
902} 1031}
@@ -918,30 +1047,91 @@ bool clkdm_missing_idle_reporting(struct clockdomain *clkdm)
918 return (clkdm->flags & CLKDM_MISSING_IDLE_REPORTING) ? true : false; 1047 return (clkdm->flags & CLKDM_MISSING_IDLE_REPORTING) ? true : false;
919} 1048}
920 1049
1050/* Public autodep handling functions (deprecated) */
1051
1052/**
1053 * clkdm_add_autodeps - add auto sleepdeps/wkdeps to clkdm upon clock enable
1054 * @clkdm: struct clockdomain *
1055 *
1056 * Add the "autodep" sleep & wakeup dependencies to clockdomain 'clkdm'
1057 * in hardware-supervised mode. Meant to be called from clock framework
1058 * when a clock inside clockdomain 'clkdm' is enabled. No return value.
1059 *
1060 * XXX autodeps are deprecated and should be removed at the earliest
1061 * opportunity
1062 */
1063void clkdm_add_autodeps(struct clockdomain *clkdm)
1064{
1065 struct clkdm_autodep *autodep;
1066
1067 if (!autodeps || clkdm->flags & CLKDM_NO_AUTODEPS)
1068 return;
1069
1070 for (autodep = autodeps; autodep->clkdm.ptr; autodep++) {
1071 if (IS_ERR(autodep->clkdm.ptr))
1072 continue;
1073
1074 pr_debug("clockdomain: %s: adding %s sleepdep/wkdep\n",
1075 clkdm->name, autodep->clkdm.ptr->name);
1076
1077 _clkdm_add_sleepdep(clkdm, autodep->clkdm.ptr);
1078 _clkdm_add_wkdep(clkdm, autodep->clkdm.ptr);
1079 }
1080}
1081
1082/**
1083 * clkdm_del_autodeps - remove auto sleepdeps/wkdeps from clkdm
1084 * @clkdm: struct clockdomain *
1085 *
1086 * Remove the "autodep" sleep & wakeup dependencies from clockdomain 'clkdm'
1087 * in hardware-supervised mode. Meant to be called from clock framework
1088 * when a clock inside clockdomain 'clkdm' is disabled. No return value.
1089 *
1090 * XXX autodeps are deprecated and should be removed at the earliest
1091 * opportunity
1092 */
1093void clkdm_del_autodeps(struct clockdomain *clkdm)
1094{
1095 struct clkdm_autodep *autodep;
1096
1097 if (!autodeps || clkdm->flags & CLKDM_NO_AUTODEPS)
1098 return;
1099
1100 for (autodep = autodeps; autodep->clkdm.ptr; autodep++) {
1101 if (IS_ERR(autodep->clkdm.ptr))
1102 continue;
1103
1104 pr_debug("clockdomain: %s: removing %s sleepdep/wkdep\n",
1105 clkdm->name, autodep->clkdm.ptr->name);
1106
1107 _clkdm_del_sleepdep(clkdm, autodep->clkdm.ptr);
1108 _clkdm_del_wkdep(clkdm, autodep->clkdm.ptr);
1109 }
1110}
1111
921/* Clockdomain-to-clock/hwmod framework interface code */ 1112/* Clockdomain-to-clock/hwmod framework interface code */
922 1113
923static int _clkdm_clk_hwmod_enable(struct clockdomain *clkdm) 1114static int _clkdm_clk_hwmod_enable(struct clockdomain *clkdm)
924{ 1115{
925 unsigned long flags;
926
927 if (!clkdm || !arch_clkdm || !arch_clkdm->clkdm_clk_enable) 1116 if (!clkdm || !arch_clkdm || !arch_clkdm->clkdm_clk_enable)
928 return -EINVAL; 1117 return -EINVAL;
929 1118
930 spin_lock_irqsave(&clkdm->lock, flags); 1119 pwrdm_lock(clkdm->pwrdm.ptr);
931 1120
932 /* 1121 /*
933 * For arch's with no autodeps, clkcm_clk_enable 1122 * For arch's with no autodeps, clkcm_clk_enable
934 * should be called for every clock instance or hwmod that is 1123 * should be called for every clock instance or hwmod that is
935 * enabled, so the clkdm can be force woken up. 1124 * enabled, so the clkdm can be force woken up.
936 */ 1125 */
937 if ((atomic_inc_return(&clkdm->usecount) > 1) && autodeps) { 1126 clkdm->usecount++;
938 spin_unlock_irqrestore(&clkdm->lock, flags); 1127 if (clkdm->usecount > 1 && autodeps) {
1128 pwrdm_unlock(clkdm->pwrdm.ptr);
939 return 0; 1129 return 0;
940 } 1130 }
941 1131
942 arch_clkdm->clkdm_clk_enable(clkdm); 1132 arch_clkdm->clkdm_clk_enable(clkdm);
943 pwrdm_state_switch(clkdm->pwrdm.ptr); 1133 pwrdm_state_switch_nolock(clkdm->pwrdm.ptr);
944 spin_unlock_irqrestore(&clkdm->lock, flags); 1134 pwrdm_unlock(clkdm->pwrdm.ptr);
945 1135
946 pr_debug("clockdomain: %s: enabled\n", clkdm->name); 1136 pr_debug("clockdomain: %s: enabled\n", clkdm->name);
947 1137
@@ -990,36 +1180,34 @@ int clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
990 */ 1180 */
991int clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk) 1181int clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk)
992{ 1182{
993 unsigned long flags;
994
995 if (!clkdm || !clk || !arch_clkdm || !arch_clkdm->clkdm_clk_disable) 1183 if (!clkdm || !clk || !arch_clkdm || !arch_clkdm->clkdm_clk_disable)
996 return -EINVAL; 1184 return -EINVAL;
997 1185
998 spin_lock_irqsave(&clkdm->lock, flags); 1186 pwrdm_lock(clkdm->pwrdm.ptr);
999 1187
1000 /* corner case: disabling unused clocks */ 1188 /* corner case: disabling unused clocks */
1001 if ((__clk_get_enable_count(clk) == 0) && 1189 if ((__clk_get_enable_count(clk) == 0) && clkdm->usecount == 0)
1002 (atomic_read(&clkdm->usecount) == 0))
1003 goto ccd_exit; 1190 goto ccd_exit;
1004 1191
1005 if (atomic_read(&clkdm->usecount) == 0) { 1192 if (clkdm->usecount == 0) {
1006 spin_unlock_irqrestore(&clkdm->lock, flags); 1193 pwrdm_unlock(clkdm->pwrdm.ptr);
1007 WARN_ON(1); /* underflow */ 1194 WARN_ON(1); /* underflow */
1008 return -ERANGE; 1195 return -ERANGE;
1009 } 1196 }
1010 1197
1011 if (atomic_dec_return(&clkdm->usecount) > 0) { 1198 clkdm->usecount--;
1012 spin_unlock_irqrestore(&clkdm->lock, flags); 1199 if (clkdm->usecount > 0) {
1200 pwrdm_unlock(clkdm->pwrdm.ptr);
1013 return 0; 1201 return 0;
1014 } 1202 }
1015 1203
1016 arch_clkdm->clkdm_clk_disable(clkdm); 1204 arch_clkdm->clkdm_clk_disable(clkdm);
1017 pwrdm_state_switch(clkdm->pwrdm.ptr); 1205 pwrdm_state_switch_nolock(clkdm->pwrdm.ptr);
1018 1206
1019 pr_debug("clockdomain: %s: disabled\n", clkdm->name); 1207 pr_debug("clockdomain: %s: disabled\n", clkdm->name);
1020 1208
1021ccd_exit: 1209ccd_exit:
1022 spin_unlock_irqrestore(&clkdm->lock, flags); 1210 pwrdm_unlock(clkdm->pwrdm.ptr);
1023 1211
1024 return 0; 1212 return 0;
1025} 1213}
@@ -1072,8 +1260,6 @@ int clkdm_hwmod_enable(struct clockdomain *clkdm, struct omap_hwmod *oh)
1072 */ 1260 */
1073int clkdm_hwmod_disable(struct clockdomain *clkdm, struct omap_hwmod *oh) 1261int clkdm_hwmod_disable(struct clockdomain *clkdm, struct omap_hwmod *oh)
1074{ 1262{
1075 unsigned long flags;
1076
1077 /* The clkdm attribute does not exist yet prior OMAP4 */ 1263 /* The clkdm attribute does not exist yet prior OMAP4 */
1078 if (cpu_is_omap24xx() || cpu_is_omap34xx()) 1264 if (cpu_is_omap24xx() || cpu_is_omap34xx())
1079 return 0; 1265 return 0;
@@ -1086,22 +1272,23 @@ int clkdm_hwmod_disable(struct clockdomain *clkdm, struct omap_hwmod *oh)
1086 if (!clkdm || !oh || !arch_clkdm || !arch_clkdm->clkdm_clk_disable) 1272 if (!clkdm || !oh || !arch_clkdm || !arch_clkdm->clkdm_clk_disable)
1087 return -EINVAL; 1273 return -EINVAL;
1088 1274
1089 spin_lock_irqsave(&clkdm->lock, flags); 1275 pwrdm_lock(clkdm->pwrdm.ptr);
1090 1276
1091 if (atomic_read(&clkdm->usecount) == 0) { 1277 if (clkdm->usecount == 0) {
1092 spin_unlock_irqrestore(&clkdm->lock, flags); 1278 pwrdm_unlock(clkdm->pwrdm.ptr);
1093 WARN_ON(1); /* underflow */ 1279 WARN_ON(1); /* underflow */
1094 return -ERANGE; 1280 return -ERANGE;
1095 } 1281 }
1096 1282
1097 if (atomic_dec_return(&clkdm->usecount) > 0) { 1283 clkdm->usecount--;
1098 spin_unlock_irqrestore(&clkdm->lock, flags); 1284 if (clkdm->usecount > 0) {
1285 pwrdm_unlock(clkdm->pwrdm.ptr);
1099 return 0; 1286 return 0;
1100 } 1287 }
1101 1288
1102 arch_clkdm->clkdm_clk_disable(clkdm); 1289 arch_clkdm->clkdm_clk_disable(clkdm);
1103 pwrdm_state_switch(clkdm->pwrdm.ptr); 1290 pwrdm_state_switch_nolock(clkdm->pwrdm.ptr);
1104 spin_unlock_irqrestore(&clkdm->lock, flags); 1291 pwrdm_unlock(clkdm->pwrdm.ptr);
1105 1292
1106 pr_debug("clockdomain: %s: disabled\n", clkdm->name); 1293 pr_debug("clockdomain: %s: disabled\n", clkdm->name);
1107 1294
diff --git a/arch/arm/mach-omap2/clockdomain.h b/arch/arm/mach-omap2/clockdomain.h
index bc42446e23ab..2da37656a693 100644
--- a/arch/arm/mach-omap2/clockdomain.h
+++ b/arch/arm/mach-omap2/clockdomain.h
@@ -15,7 +15,6 @@
15#define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAIN_H 15#define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAIN_H
16 16
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/spinlock.h>
19 18
20#include "powerdomain.h" 19#include "powerdomain.h"
21#include "clock.h" 20#include "clock.h"
@@ -92,8 +91,8 @@ struct clkdm_autodep {
92struct clkdm_dep { 91struct clkdm_dep {
93 const char *clkdm_name; 92 const char *clkdm_name;
94 struct clockdomain *clkdm; 93 struct clockdomain *clkdm;
95 atomic_t wkdep_usecount; 94 s16 wkdep_usecount;
96 atomic_t sleepdep_usecount; 95 s16 sleepdep_usecount;
97}; 96};
98 97
99/* Possible flags for struct clockdomain._flags */ 98/* Possible flags for struct clockdomain._flags */
@@ -137,9 +136,8 @@ struct clockdomain {
137 const u16 clkdm_offs; 136 const u16 clkdm_offs;
138 struct clkdm_dep *wkdep_srcs; 137 struct clkdm_dep *wkdep_srcs;
139 struct clkdm_dep *sleepdep_srcs; 138 struct clkdm_dep *sleepdep_srcs;
140 atomic_t usecount; 139 int usecount;
141 struct list_head node; 140 struct list_head node;
142 spinlock_t lock;
143}; 141};
144 142
145/** 143/**
@@ -196,12 +194,16 @@ int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
196int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2); 194int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
197int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm); 195int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm);
198 196
197void clkdm_allow_idle_nolock(struct clockdomain *clkdm);
199void clkdm_allow_idle(struct clockdomain *clkdm); 198void clkdm_allow_idle(struct clockdomain *clkdm);
199void clkdm_deny_idle_nolock(struct clockdomain *clkdm);
200void clkdm_deny_idle(struct clockdomain *clkdm); 200void clkdm_deny_idle(struct clockdomain *clkdm);
201bool clkdm_in_hwsup(struct clockdomain *clkdm); 201bool clkdm_in_hwsup(struct clockdomain *clkdm);
202bool clkdm_missing_idle_reporting(struct clockdomain *clkdm); 202bool clkdm_missing_idle_reporting(struct clockdomain *clkdm);
203 203
204int clkdm_wakeup_nolock(struct clockdomain *clkdm);
204int clkdm_wakeup(struct clockdomain *clkdm); 205int clkdm_wakeup(struct clockdomain *clkdm);
206int clkdm_sleep_nolock(struct clockdomain *clkdm);
205int clkdm_sleep(struct clockdomain *clkdm); 207int clkdm_sleep(struct clockdomain *clkdm);
206 208
207int clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk); 209int clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk);
@@ -214,8 +216,9 @@ extern void __init omap243x_clockdomains_init(void);
214extern void __init omap3xxx_clockdomains_init(void); 216extern void __init omap3xxx_clockdomains_init(void);
215extern void __init am33xx_clockdomains_init(void); 217extern void __init am33xx_clockdomains_init(void);
216extern void __init omap44xx_clockdomains_init(void); 218extern void __init omap44xx_clockdomains_init(void);
217extern void _clkdm_add_autodeps(struct clockdomain *clkdm); 219
218extern void _clkdm_del_autodeps(struct clockdomain *clkdm); 220extern void clkdm_add_autodeps(struct clockdomain *clkdm);
221extern void clkdm_del_autodeps(struct clockdomain *clkdm);
219 222
220extern struct clkdm_ops omap2_clkdm_operations; 223extern struct clkdm_ops omap2_clkdm_operations;
221extern struct clkdm_ops omap3_clkdm_operations; 224extern struct clkdm_ops omap3_clkdm_operations;
diff --git a/arch/arm/mach-omap2/cm2xxx.c b/arch/arm/mach-omap2/cm2xxx.c
index db650690e9d0..6774a53a3874 100644
--- a/arch/arm/mach-omap2/cm2xxx.c
+++ b/arch/arm/mach-omap2/cm2xxx.c
@@ -273,9 +273,6 @@ int omap2xxx_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id, u8 idlest_shift)
273 273
274static void omap2xxx_clkdm_allow_idle(struct clockdomain *clkdm) 274static void omap2xxx_clkdm_allow_idle(struct clockdomain *clkdm)
275{ 275{
276 if (atomic_read(&clkdm->usecount) > 0)
277 _clkdm_add_autodeps(clkdm);
278
279 omap2xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs, 276 omap2xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
280 clkdm->clktrctrl_mask); 277 clkdm->clktrctrl_mask);
281} 278}
@@ -284,9 +281,6 @@ static void omap2xxx_clkdm_deny_idle(struct clockdomain *clkdm)
284{ 281{
285 omap2xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs, 282 omap2xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
286 clkdm->clktrctrl_mask); 283 clkdm->clktrctrl_mask);
287
288 if (atomic_read(&clkdm->usecount) > 0)
289 _clkdm_del_autodeps(clkdm);
290} 284}
291 285
292static int omap2xxx_clkdm_clk_enable(struct clockdomain *clkdm) 286static int omap2xxx_clkdm_clk_enable(struct clockdomain *clkdm)
@@ -298,18 +292,8 @@ static int omap2xxx_clkdm_clk_enable(struct clockdomain *clkdm)
298 292
299 hwsup = omap2xxx_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs, 293 hwsup = omap2xxx_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
300 clkdm->clktrctrl_mask); 294 clkdm->clktrctrl_mask);
301 295 if (!hwsup && clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)
302 if (hwsup) { 296 omap2xxx_clkdm_wakeup(clkdm);
303 /* Disable HW transitions when we are changing deps */
304 omap2xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
305 clkdm->clktrctrl_mask);
306 _clkdm_add_autodeps(clkdm);
307 omap2xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
308 clkdm->clktrctrl_mask);
309 } else {
310 if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)
311 omap2xxx_clkdm_wakeup(clkdm);
312 }
313 297
314 return 0; 298 return 0;
315} 299}
@@ -324,17 +308,8 @@ static int omap2xxx_clkdm_clk_disable(struct clockdomain *clkdm)
324 hwsup = omap2xxx_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs, 308 hwsup = omap2xxx_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
325 clkdm->clktrctrl_mask); 309 clkdm->clktrctrl_mask);
326 310
327 if (hwsup) { 311 if (!hwsup && clkdm->flags & CLKDM_CAN_FORCE_SLEEP)
328 /* Disable HW transitions when we are changing deps */ 312 omap2xxx_clkdm_sleep(clkdm);
329 omap2xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
330 clkdm->clktrctrl_mask);
331 _clkdm_del_autodeps(clkdm);
332 omap2xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
333 clkdm->clktrctrl_mask);
334 } else {
335 if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP)
336 omap2xxx_clkdm_sleep(clkdm);
337 }
338 313
339 return 0; 314 return 0;
340} 315}
diff --git a/arch/arm/mach-omap2/cm33xx.c b/arch/arm/mach-omap2/cm33xx.c
index 058ce3c0873e..325a51576576 100644
--- a/arch/arm/mach-omap2/cm33xx.c
+++ b/arch/arm/mach-omap2/cm33xx.c
@@ -241,9 +241,6 @@ int am33xx_cm_wait_module_ready(u16 inst, s16 cdoffs, u16 clkctrl_offs)
241{ 241{
242 int i = 0; 242 int i = 0;
243 243
244 if (!clkctrl_offs)
245 return 0;
246
247 omap_test_timeout(_is_module_ready(inst, cdoffs, clkctrl_offs), 244 omap_test_timeout(_is_module_ready(inst, cdoffs, clkctrl_offs),
248 MAX_MODULE_READY_TIME, i); 245 MAX_MODULE_READY_TIME, i);
249 246
diff --git a/arch/arm/mach-omap2/cm33xx.h b/arch/arm/mach-omap2/cm33xx.h
index 5fa0b62e1a79..64f4bafe7bd9 100644
--- a/arch/arm/mach-omap2/cm33xx.h
+++ b/arch/arm/mach-omap2/cm33xx.h
@@ -17,16 +17,11 @@
17#ifndef __ARCH_ARM_MACH_OMAP2_CM_33XX_H 17#ifndef __ARCH_ARM_MACH_OMAP2_CM_33XX_H
18#define __ARCH_ARM_MACH_OMAP2_CM_33XX_H 18#define __ARCH_ARM_MACH_OMAP2_CM_33XX_H
19 19
20#include <linux/delay.h>
21#include <linux/errno.h>
22#include <linux/err.h>
23#include <linux/io.h>
24
25#include "common.h" 20#include "common.h"
26 21
27#include "cm.h" 22#include "cm.h"
28#include "cm-regbits-33xx.h" 23#include "cm-regbits-33xx.h"
29#include "cm33xx.h" 24#include "iomap.h"
30 25
31/* CM base address */ 26/* CM base address */
32#define AM33XX_CM_BASE 0x44e00000 27#define AM33XX_CM_BASE 0x44e00000
@@ -381,6 +376,7 @@
381#define AM33XX_CM_CEFUSE_CEFUSE_CLKCTRL AM33XX_CM_REGADDR(AM33XX_CM_CEFUSE_MOD, 0x0020) 376#define AM33XX_CM_CEFUSE_CEFUSE_CLKCTRL AM33XX_CM_REGADDR(AM33XX_CM_CEFUSE_MOD, 0x0020)
382 377
383 378
379#ifndef __ASSEMBLER__
384extern bool am33xx_cm_is_clkdm_in_hwsup(s16 inst, u16 cdoffs); 380extern bool am33xx_cm_is_clkdm_in_hwsup(s16 inst, u16 cdoffs);
385extern void am33xx_cm_clkdm_enable_hwsup(s16 inst, u16 cdoffs); 381extern void am33xx_cm_clkdm_enable_hwsup(s16 inst, u16 cdoffs);
386extern void am33xx_cm_clkdm_disable_hwsup(s16 inst, u16 cdoffs); 382extern void am33xx_cm_clkdm_disable_hwsup(s16 inst, u16 cdoffs);
@@ -417,4 +413,5 @@ static inline int am33xx_cm_wait_module_ready(u16 inst, s16 cdoffs,
417} 413}
418#endif 414#endif
419 415
416#endif /* ASSEMBLER */
420#endif 417#endif
diff --git a/arch/arm/mach-omap2/cm3xxx.c b/arch/arm/mach-omap2/cm3xxx.c
index c2086f2e86b6..9061c307d915 100644
--- a/arch/arm/mach-omap2/cm3xxx.c
+++ b/arch/arm/mach-omap2/cm3xxx.c
@@ -186,7 +186,7 @@ static int omap3xxx_clkdm_clear_all_sleepdeps(struct clockdomain *clkdm)
186 continue; /* only happens if data is erroneous */ 186 continue; /* only happens if data is erroneous */
187 187
188 mask |= 1 << cd->clkdm->dep_bit; 188 mask |= 1 << cd->clkdm->dep_bit;
189 atomic_set(&cd->sleepdep_usecount, 0); 189 cd->sleepdep_usecount = 0;
190 } 190 }
191 omap2_cm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs, 191 omap2_cm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs,
192 OMAP3430_CM_SLEEPDEP); 192 OMAP3430_CM_SLEEPDEP);
@@ -209,8 +209,8 @@ static int omap3xxx_clkdm_wakeup(struct clockdomain *clkdm)
209 209
210static void omap3xxx_clkdm_allow_idle(struct clockdomain *clkdm) 210static void omap3xxx_clkdm_allow_idle(struct clockdomain *clkdm)
211{ 211{
212 if (atomic_read(&clkdm->usecount) > 0) 212 if (clkdm->usecount > 0)
213 _clkdm_add_autodeps(clkdm); 213 clkdm_add_autodeps(clkdm);
214 214
215 omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs, 215 omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
216 clkdm->clktrctrl_mask); 216 clkdm->clktrctrl_mask);
@@ -221,8 +221,8 @@ static void omap3xxx_clkdm_deny_idle(struct clockdomain *clkdm)
221 omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs, 221 omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
222 clkdm->clktrctrl_mask); 222 clkdm->clktrctrl_mask);
223 223
224 if (atomic_read(&clkdm->usecount) > 0) 224 if (clkdm->usecount > 0)
225 _clkdm_del_autodeps(clkdm); 225 clkdm_del_autodeps(clkdm);
226} 226}
227 227
228static int omap3xxx_clkdm_clk_enable(struct clockdomain *clkdm) 228static int omap3xxx_clkdm_clk_enable(struct clockdomain *clkdm)
@@ -250,7 +250,7 @@ static int omap3xxx_clkdm_clk_enable(struct clockdomain *clkdm)
250 /* Disable HW transitions when we are changing deps */ 250 /* Disable HW transitions when we are changing deps */
251 omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs, 251 omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
252 clkdm->clktrctrl_mask); 252 clkdm->clktrctrl_mask);
253 _clkdm_add_autodeps(clkdm); 253 clkdm_add_autodeps(clkdm);
254 omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs, 254 omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
255 clkdm->clktrctrl_mask); 255 clkdm->clktrctrl_mask);
256 } else { 256 } else {
@@ -287,7 +287,7 @@ static int omap3xxx_clkdm_clk_disable(struct clockdomain *clkdm)
287 /* Disable HW transitions when we are changing deps */ 287 /* Disable HW transitions when we are changing deps */
288 omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs, 288 omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
289 clkdm->clktrctrl_mask); 289 clkdm->clktrctrl_mask);
290 _clkdm_del_autodeps(clkdm); 290 clkdm_del_autodeps(clkdm);
291 omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs, 291 omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
292 clkdm->clktrctrl_mask); 292 clkdm->clktrctrl_mask);
293 } else { 293 } else {
diff --git a/arch/arm/mach-omap2/cminst44xx.c b/arch/arm/mach-omap2/cminst44xx.c
index 7f9a464f01e9..f0290f5566fe 100644
--- a/arch/arm/mach-omap2/cminst44xx.c
+++ b/arch/arm/mach-omap2/cminst44xx.c
@@ -393,7 +393,7 @@ static int omap4_clkdm_clear_all_wkup_sleep_deps(struct clockdomain *clkdm)
393 continue; /* only happens if data is erroneous */ 393 continue; /* only happens if data is erroneous */
394 394
395 mask |= 1 << cd->clkdm->dep_bit; 395 mask |= 1 << cd->clkdm->dep_bit;
396 atomic_set(&cd->wkdep_usecount, 0); 396 cd->wkdep_usecount = 0;
397 } 397 }
398 398
399 omap4_cminst_clear_inst_reg_bits(mask, clkdm->prcm_partition, 399 omap4_cminst_clear_inst_reg_bits(mask, clkdm->prcm_partition,
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 948bcaa82eb6..0a6b9c7a63da 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -79,13 +79,13 @@ static inline int omap_mux_late_init(void)
79 79
80extern void omap2_init_common_infrastructure(void); 80extern void omap2_init_common_infrastructure(void);
81 81
82extern struct sys_timer omap2_timer; 82extern void omap2_sync32k_timer_init(void);
83extern struct sys_timer omap3_timer; 83extern void omap3_sync32k_timer_init(void);
84extern struct sys_timer omap3_secure_timer; 84extern void omap3_secure_sync32k_timer_init(void);
85extern struct sys_timer omap3_gp_timer; 85extern void omap3_gp_gptimer_timer_init(void);
86extern struct sys_timer omap3_am33xx_timer; 86extern void omap3_am33xx_gptimer_timer_init(void);
87extern struct sys_timer omap4_timer; 87extern void omap4_local_timer_init(void);
88extern struct sys_timer omap5_timer; 88extern void omap5_realtime_timer_init(void);
89 89
90void omap2420_init_early(void); 90void omap2420_init_early(void);
91void omap2430_init_early(void); 91void omap2430_init_early(void);
@@ -119,6 +119,14 @@ static inline void omap2xxx_restart(char mode, const char *cmd)
119} 119}
120#endif 120#endif
121 121
122#ifdef CONFIG_SOC_AM33XX
123void am33xx_restart(char mode, const char *cmd);
124#else
125static inline void am33xx_restart(char mode, const char *cmd)
126{
127}
128#endif
129
122#ifdef CONFIG_ARCH_OMAP3 130#ifdef CONFIG_ARCH_OMAP3
123void omap3xxx_restart(char mode, const char *cmd); 131void omap3xxx_restart(char mode, const char *cmd);
124#else 132#else
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index 22590dbe8f14..80392fca86c6 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -36,40 +36,66 @@
36 36
37/* Mach specific information to be recorded in the C-state driver_data */ 37/* Mach specific information to be recorded in the C-state driver_data */
38struct omap3_idle_statedata { 38struct omap3_idle_statedata {
39 u32 mpu_state; 39 u8 mpu_state;
40 u32 core_state; 40 u8 core_state;
41 u8 per_min_state;
42 u8 flags;
41}; 43};
42 44
43static struct powerdomain *mpu_pd, *core_pd, *per_pd, *cam_pd; 45static struct powerdomain *mpu_pd, *core_pd, *per_pd, *cam_pd;
44 46
47/*
48 * Possible flag bits for struct omap3_idle_statedata.flags:
49 *
50 * OMAP_CPUIDLE_CX_NO_CLKDM_IDLE: don't allow the MPU clockdomain to go
51 * inactive. This in turn prevents the MPU DPLL from entering autoidle
52 * mode, so wakeup latency is greatly reduced, at the cost of additional
53 * energy consumption. This also prevents the CORE clockdomain from
54 * entering idle.
55 */
56#define OMAP_CPUIDLE_CX_NO_CLKDM_IDLE BIT(0)
57
58/*
59 * Prevent PER OFF if CORE is not in RETention or OFF as this would
60 * disable PER wakeups completely.
61 */
45static struct omap3_idle_statedata omap3_idle_data[] = { 62static struct omap3_idle_statedata omap3_idle_data[] = {
46 { 63 {
47 .mpu_state = PWRDM_POWER_ON, 64 .mpu_state = PWRDM_POWER_ON,
48 .core_state = PWRDM_POWER_ON, 65 .core_state = PWRDM_POWER_ON,
66 /* In C1 do not allow PER state lower than CORE state */
67 .per_min_state = PWRDM_POWER_ON,
68 .flags = OMAP_CPUIDLE_CX_NO_CLKDM_IDLE,
49 }, 69 },
50 { 70 {
51 .mpu_state = PWRDM_POWER_ON, 71 .mpu_state = PWRDM_POWER_ON,
52 .core_state = PWRDM_POWER_ON, 72 .core_state = PWRDM_POWER_ON,
73 .per_min_state = PWRDM_POWER_RET,
53 }, 74 },
54 { 75 {
55 .mpu_state = PWRDM_POWER_RET, 76 .mpu_state = PWRDM_POWER_RET,
56 .core_state = PWRDM_POWER_ON, 77 .core_state = PWRDM_POWER_ON,
78 .per_min_state = PWRDM_POWER_RET,
57 }, 79 },
58 { 80 {
59 .mpu_state = PWRDM_POWER_OFF, 81 .mpu_state = PWRDM_POWER_OFF,
60 .core_state = PWRDM_POWER_ON, 82 .core_state = PWRDM_POWER_ON,
83 .per_min_state = PWRDM_POWER_RET,
61 }, 84 },
62 { 85 {
63 .mpu_state = PWRDM_POWER_RET, 86 .mpu_state = PWRDM_POWER_RET,
64 .core_state = PWRDM_POWER_RET, 87 .core_state = PWRDM_POWER_RET,
88 .per_min_state = PWRDM_POWER_OFF,
65 }, 89 },
66 { 90 {
67 .mpu_state = PWRDM_POWER_OFF, 91 .mpu_state = PWRDM_POWER_OFF,
68 .core_state = PWRDM_POWER_RET, 92 .core_state = PWRDM_POWER_RET,
93 .per_min_state = PWRDM_POWER_OFF,
69 }, 94 },
70 { 95 {
71 .mpu_state = PWRDM_POWER_OFF, 96 .mpu_state = PWRDM_POWER_OFF,
72 .core_state = PWRDM_POWER_OFF, 97 .core_state = PWRDM_POWER_OFF,
98 .per_min_state = PWRDM_POWER_OFF,
73 }, 99 },
74}; 100};
75 101
@@ -80,27 +106,25 @@ static int __omap3_enter_idle(struct cpuidle_device *dev,
80 int index) 106 int index)
81{ 107{
82 struct omap3_idle_statedata *cx = &omap3_idle_data[index]; 108 struct omap3_idle_statedata *cx = &omap3_idle_data[index];
83 u32 mpu_state = cx->mpu_state, core_state = cx->core_state;
84 109
85 local_fiq_disable(); 110 local_fiq_disable();
86 111
87 pwrdm_set_next_pwrst(mpu_pd, mpu_state);
88 pwrdm_set_next_pwrst(core_pd, core_state);
89
90 if (omap_irq_pending() || need_resched()) 112 if (omap_irq_pending() || need_resched())
91 goto return_sleep_time; 113 goto return_sleep_time;
92 114
93 /* Deny idle for C1 */ 115 /* Deny idle for C1 */
94 if (index == 0) { 116 if (cx->flags & OMAP_CPUIDLE_CX_NO_CLKDM_IDLE) {
95 clkdm_deny_idle(mpu_pd->pwrdm_clkdms[0]); 117 clkdm_deny_idle(mpu_pd->pwrdm_clkdms[0]);
96 clkdm_deny_idle(core_pd->pwrdm_clkdms[0]); 118 } else {
119 pwrdm_set_next_pwrst(mpu_pd, cx->mpu_state);
120 pwrdm_set_next_pwrst(core_pd, cx->core_state);
97 } 121 }
98 122
99 /* 123 /*
100 * Call idle CPU PM enter notifier chain so that 124 * Call idle CPU PM enter notifier chain so that
101 * VFP context is saved. 125 * VFP context is saved.
102 */ 126 */
103 if (mpu_state == PWRDM_POWER_OFF) 127 if (cx->mpu_state == PWRDM_POWER_OFF)
104 cpu_pm_enter(); 128 cpu_pm_enter();
105 129
106 /* Execute ARM wfi */ 130 /* Execute ARM wfi */
@@ -110,17 +134,15 @@ static int __omap3_enter_idle(struct cpuidle_device *dev,
110 * Call idle CPU PM enter notifier chain to restore 134 * Call idle CPU PM enter notifier chain to restore
111 * VFP context. 135 * VFP context.
112 */ 136 */
113 if (pwrdm_read_prev_pwrst(mpu_pd) == PWRDM_POWER_OFF) 137 if (cx->mpu_state == PWRDM_POWER_OFF &&
138 pwrdm_read_prev_pwrst(mpu_pd) == PWRDM_POWER_OFF)
114 cpu_pm_exit(); 139 cpu_pm_exit();
115 140
116 /* Re-allow idle for C1 */ 141 /* Re-allow idle for C1 */
117 if (index == 0) { 142 if (cx->flags & OMAP_CPUIDLE_CX_NO_CLKDM_IDLE)
118 clkdm_allow_idle(mpu_pd->pwrdm_clkdms[0]); 143 clkdm_allow_idle(mpu_pd->pwrdm_clkdms[0]);
119 clkdm_allow_idle(core_pd->pwrdm_clkdms[0]);
120 }
121 144
122return_sleep_time: 145return_sleep_time:
123
124 local_fiq_enable(); 146 local_fiq_enable();
125 147
126 return index; 148 return index;
@@ -185,7 +207,7 @@ static int next_valid_state(struct cpuidle_device *dev,
185 * Start search from the next (lower) state. 207 * Start search from the next (lower) state.
186 */ 208 */
187 for (idx = index - 1; idx >= 0; idx--) { 209 for (idx = index - 1; idx >= 0; idx--) {
188 cx = &omap3_idle_data[idx]; 210 cx = &omap3_idle_data[idx];
189 if ((cx->mpu_state >= mpu_deepest_state) && 211 if ((cx->mpu_state >= mpu_deepest_state) &&
190 (cx->core_state >= core_deepest_state)) { 212 (cx->core_state >= core_deepest_state)) {
191 next_index = idx; 213 next_index = idx;
@@ -209,10 +231,9 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev,
209 struct cpuidle_driver *drv, 231 struct cpuidle_driver *drv,
210 int index) 232 int index)
211{ 233{
212 int new_state_idx; 234 int new_state_idx, ret;
213 u32 core_next_state, per_next_state = 0, per_saved_state = 0; 235 u8 per_next_state, per_saved_state;
214 struct omap3_idle_statedata *cx; 236 struct omap3_idle_statedata *cx;
215 int ret;
216 237
217 /* 238 /*
218 * Use only C1 if CAM is active. 239 * Use only C1 if CAM is active.
@@ -233,25 +254,13 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev,
233 254
234 /* Program PER state */ 255 /* Program PER state */
235 cx = &omap3_idle_data[new_state_idx]; 256 cx = &omap3_idle_data[new_state_idx];
236 core_next_state = cx->core_state;
237 per_next_state = per_saved_state = pwrdm_read_next_pwrst(per_pd);
238 if (new_state_idx == 0) {
239 /* In C1 do not allow PER state lower than CORE state */
240 if (per_next_state < core_next_state)
241 per_next_state = core_next_state;
242 } else {
243 /*
244 * Prevent PER OFF if CORE is not in RETention or OFF as this
245 * would disable PER wakeups completely.
246 */
247 if ((per_next_state == PWRDM_POWER_OFF) &&
248 (core_next_state > PWRDM_POWER_RET))
249 per_next_state = PWRDM_POWER_RET;
250 }
251 257
252 /* Are we changing PER target state? */ 258 per_next_state = pwrdm_read_next_pwrst(per_pd);
253 if (per_next_state != per_saved_state) 259 per_saved_state = per_next_state;
260 if (per_next_state < cx->per_min_state) {
261 per_next_state = cx->per_min_state;
254 pwrdm_set_next_pwrst(per_pd, per_next_state); 262 pwrdm_set_next_pwrst(per_pd, per_next_state);
263 }
255 264
256 ret = omap3_enter_idle(dev, drv, new_state_idx); 265 ret = omap3_enter_idle(dev, drv, new_state_idx);
257 266
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 626f3ea3142f..1ec7f0597710 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -20,6 +20,7 @@
20#include <linux/pinctrl/machine.h> 20#include <linux/pinctrl/machine.h>
21#include <linux/platform_data/omap4-keypad.h> 21#include <linux/platform_data/omap4-keypad.h>
22#include <linux/platform_data/omap_ocp2scp.h> 22#include <linux/platform_data/omap_ocp2scp.h>
23#include <linux/usb/omap_control_usb.h>
23 24
24#include <asm/mach-types.h> 25#include <asm/mach-types.h>
25#include <asm/mach/map.h> 26#include <asm/mach/map.h>
@@ -61,14 +62,13 @@ static int __init omap3_l3_init(void)
61 if (!oh) 62 if (!oh)
62 pr_err("could not look up %s\n", oh_name); 63 pr_err("could not look up %s\n", oh_name);
63 64
64 pdev = omap_device_build("omap_l3_smx", 0, oh, NULL, 0, 65 pdev = omap_device_build("omap_l3_smx", 0, oh, NULL, 0);
65 NULL, 0, 0);
66 66
67 WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name); 67 WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
68 68
69 return IS_ERR(pdev) ? PTR_ERR(pdev) : 0; 69 return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
70} 70}
71postcore_initcall(omap3_l3_init); 71omap_postcore_initcall(omap3_l3_init);
72 72
73static int __init omap4_l3_init(void) 73static int __init omap4_l3_init(void)
74{ 74{
@@ -96,14 +96,13 @@ static int __init omap4_l3_init(void)
96 pr_err("could not look up %s\n", oh_name); 96 pr_err("could not look up %s\n", oh_name);
97 } 97 }
98 98
99 pdev = omap_device_build_ss("omap_l3_noc", 0, oh, 3, NULL, 99 pdev = omap_device_build_ss("omap_l3_noc", 0, oh, 3, NULL, 0);
100 0, NULL, 0, 0);
101 100
102 WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name); 101 WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
103 102
104 return IS_ERR(pdev) ? PTR_ERR(pdev) : 0; 103 return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
105} 104}
106postcore_initcall(omap4_l3_init); 105omap_postcore_initcall(omap4_l3_init);
107 106
108#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) 107#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
109 108
@@ -254,6 +253,49 @@ static inline void omap_init_camera(void)
254#endif 253#endif
255} 254}
256 255
256#if IS_ENABLED(CONFIG_OMAP_CONTROL_USB)
257static struct omap_control_usb_platform_data omap4_control_usb_pdata = {
258 .type = 1,
259};
260
261struct resource omap4_control_usb_res[] = {
262 {
263 .name = "control_dev_conf",
264 .start = 0x4a002300,
265 .end = 0x4a002303,
266 .flags = IORESOURCE_MEM,
267 },
268 {
269 .name = "otghs_control",
270 .start = 0x4a00233c,
271 .end = 0x4a00233f,
272 .flags = IORESOURCE_MEM,
273 },
274};
275
276static struct platform_device omap4_control_usb = {
277 .name = "omap-control-usb",
278 .id = -1,
279 .dev = {
280 .platform_data = &omap4_control_usb_pdata,
281 },
282 .num_resources = 2,
283 .resource = omap4_control_usb_res,
284};
285
286static inline void __init omap_init_control_usb(void)
287{
288 if (!cpu_is_omap44xx())
289 return;
290
291 if (platform_device_register(&omap4_control_usb))
292 pr_err("Error registering omap_control_usb device\n");
293}
294
295#else
296static inline void omap_init_control_usb(void) { }
297#endif /* CONFIG_OMAP_CONTROL_USB */
298
257int __init omap4_keyboard_init(struct omap4_keypad_platform_data 299int __init omap4_keyboard_init(struct omap4_keypad_platform_data
258 *sdp4430_keypad_data, struct omap_board_data *bdata) 300 *sdp4430_keypad_data, struct omap_board_data *bdata)
259{ 301{
@@ -273,7 +315,7 @@ int __init omap4_keyboard_init(struct omap4_keypad_platform_data
273 keypad_data = sdp4430_keypad_data; 315 keypad_data = sdp4430_keypad_data;
274 316
275 pdev = omap_device_build(name, id, oh, keypad_data, 317 pdev = omap_device_build(name, id, oh, keypad_data,
276 sizeof(struct omap4_keypad_platform_data), NULL, 0, 0); 318 sizeof(struct omap4_keypad_platform_data));
277 319
278 if (IS_ERR(pdev)) { 320 if (IS_ERR(pdev)) {
279 WARN(1, "Can't build omap_device for %s:%s.\n", 321 WARN(1, "Can't build omap_device for %s:%s.\n",
@@ -297,7 +339,7 @@ static inline void __init omap_init_mbox(void)
297 return; 339 return;
298 } 340 }
299 341
300 pdev = omap_device_build("omap-mailbox", -1, oh, NULL, 0, NULL, 0, 0); 342 pdev = omap_device_build("omap-mailbox", -1, oh, NULL, 0);
301 WARN(IS_ERR(pdev), "%s: could not build device, err %ld\n", 343 WARN(IS_ERR(pdev), "%s: could not build device, err %ld\n",
302 __func__, PTR_ERR(pdev)); 344 __func__, PTR_ERR(pdev));
303} 345}
@@ -337,7 +379,7 @@ static void __init omap_init_mcpdm(void)
337 return; 379 return;
338 } 380 }
339 381
340 pdev = omap_device_build("omap-mcpdm", -1, oh, NULL, 0, NULL, 0, 0); 382 pdev = omap_device_build("omap-mcpdm", -1, oh, NULL, 0);
341 WARN(IS_ERR(pdev), "Can't build omap_device for omap-mcpdm.\n"); 383 WARN(IS_ERR(pdev), "Can't build omap_device for omap-mcpdm.\n");
342} 384}
343#else 385#else
@@ -358,7 +400,7 @@ static void __init omap_init_dmic(void)
358 return; 400 return;
359 } 401 }
360 402
361 pdev = omap_device_build("omap-dmic", -1, oh, NULL, 0, NULL, 0, 0); 403 pdev = omap_device_build("omap-dmic", -1, oh, NULL, 0);
362 WARN(IS_ERR(pdev), "Can't build omap_device for omap-dmic.\n"); 404 WARN(IS_ERR(pdev), "Can't build omap_device for omap-dmic.\n");
363} 405}
364#else 406#else
@@ -384,8 +426,7 @@ static void __init omap_init_hdmi_audio(void)
384 return; 426 return;
385 } 427 }
386 428
387 pdev = omap_device_build("omap-hdmi-audio-dai", 429 pdev = omap_device_build("omap-hdmi-audio-dai", -1, oh, NULL, 0);
388 -1, oh, NULL, 0, NULL, 0, 0);
389 WARN(IS_ERR(pdev), 430 WARN(IS_ERR(pdev),
390 "Can't build omap_device for omap-hdmi-audio-dai.\n"); 431 "Can't build omap_device for omap-hdmi-audio-dai.\n");
391 432
@@ -429,8 +470,7 @@ static int __init omap_mcspi_init(struct omap_hwmod *oh, void *unused)
429 } 470 }
430 471
431 spi_num++; 472 spi_num++;
432 pdev = omap_device_build(name, spi_num, oh, pdata, 473 pdev = omap_device_build(name, spi_num, oh, pdata, sizeof(*pdata));
433 sizeof(*pdata), NULL, 0, 0);
434 WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s\n", 474 WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s\n",
435 name, oh->name); 475 name, oh->name);
436 kfree(pdata); 476 kfree(pdata);
@@ -460,7 +500,7 @@ static void omap_init_rng(void)
460 if (!oh) 500 if (!oh)
461 return; 501 return;
462 502
463 pdev = omap_device_build("omap_rng", -1, oh, NULL, 0, NULL, 0, 0); 503 pdev = omap_device_build("omap_rng", -1, oh, NULL, 0);
464 WARN(IS_ERR(pdev), "Can't build omap_device for omap_rng\n"); 504 WARN(IS_ERR(pdev), "Can't build omap_device for omap_rng\n");
465} 505}
466 506
@@ -689,8 +729,7 @@ static void __init omap_init_ocp2scp(void)
689 729
690 pdata->dev_cnt = dev_cnt; 730 pdata->dev_cnt = dev_cnt;
691 731
692 pdev = omap_device_build(name, bus_id, oh, pdata, sizeof(*pdata), NULL, 732 pdev = omap_device_build(name, bus_id, oh, pdata, sizeof(*pdata));
693 0, false);
694 if (IS_ERR(pdev)) { 733 if (IS_ERR(pdev)) {
695 pr_err("Could not build omap_device for %s %s\n", 734 pr_err("Could not build omap_device for %s %s\n",
696 name, oh_name); 735 name, oh_name);
@@ -721,6 +760,7 @@ static int __init omap2_init_devices(void)
721 omap_init_mbox(); 760 omap_init_mbox();
722 /* If dtb is there, the devices will be created dynamically */ 761 /* If dtb is there, the devices will be created dynamically */
723 if (!of_have_populated_dt()) { 762 if (!of_have_populated_dt()) {
763 omap_init_control_usb();
724 omap_init_dmic(); 764 omap_init_dmic();
725 omap_init_mcpdm(); 765 omap_init_mcpdm();
726 omap_init_mcspi(); 766 omap_init_mcspi();
@@ -734,4 +774,4 @@ static int __init omap2_init_devices(void)
734 774
735 return 0; 775 return 0;
736} 776}
737arch_initcall(omap2_init_devices); 777omap_arch_initcall(omap2_init_devices);
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index cc75aaf6e764..ff37be1f6f93 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -226,7 +226,7 @@ static struct platform_device *create_dss_pdev(const char *pdev_name,
226 dev_set_name(&pdev->dev, "%s", pdev->name); 226 dev_set_name(&pdev->dev, "%s", pdev->name);
227 227
228 ohs[0] = oh; 228 ohs[0] = oh;
229 od = omap_device_alloc(pdev, ohs, 1, NULL, 0); 229 od = omap_device_alloc(pdev, ohs, 1);
230 if (IS_ERR(od)) { 230 if (IS_ERR(od)) {
231 pr_err("Could not alloc omap_device for %s\n", pdev_name); 231 pr_err("Could not alloc omap_device for %s\n", pdev_name);
232 r = -ENOMEM; 232 r = -ENOMEM;
diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c
index 612b98249873..dab9fc014b97 100644
--- a/arch/arm/mach-omap2/dma.c
+++ b/arch/arm/mach-omap2/dma.c
@@ -27,7 +27,7 @@
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/device.h> 29#include <linux/device.h>
30 30#include <linux/dma-mapping.h>
31#include <linux/omap-dma.h> 31#include <linux/omap-dma.h>
32 32
33#include "soc.h" 33#include "soc.h"
@@ -248,7 +248,7 @@ static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused)
248 248
249 p->errata = configure_dma_errata(); 249 p->errata = configure_dma_errata();
250 250
251 pdev = omap_device_build(name, 0, oh, p, sizeof(*p), NULL, 0, 0); 251 pdev = omap_device_build(name, 0, oh, p, sizeof(*p));
252 kfree(p); 252 kfree(p);
253 if (IS_ERR(pdev)) { 253 if (IS_ERR(pdev)) {
254 pr_err("%s: Can't build omap_device for %s:%s.\n", 254 pr_err("%s: Can't build omap_device for %s:%s.\n",
@@ -288,9 +288,26 @@ static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused)
288 return 0; 288 return 0;
289} 289}
290 290
291static const struct platform_device_info omap_dma_dev_info = {
292 .name = "omap-dma-engine",
293 .id = -1,
294 .dma_mask = DMA_BIT_MASK(32),
295};
296
291static int __init omap2_system_dma_init(void) 297static int __init omap2_system_dma_init(void)
292{ 298{
293 return omap_hwmod_for_each_by_class("dma", 299 struct platform_device *pdev;
300 int res;
301
302 res = omap_hwmod_for_each_by_class("dma",
294 omap2_system_dma_init_dev, NULL); 303 omap2_system_dma_init_dev, NULL);
304 if (res)
305 return res;
306
307 pdev = platform_device_register_full(&omap_dma_dev_info);
308 if (IS_ERR(pdev))
309 return PTR_ERR(pdev);
310
311 return res;
295} 312}
296arch_initcall(omap2_system_dma_init); 313omap_arch_initcall(omap2_system_dma_init);
diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c
index 0a02aab5df67..3aed4b0b9563 100644
--- a/arch/arm/mach-omap2/dpll3xxx.c
+++ b/arch/arm/mach-omap2/dpll3xxx.c
@@ -500,8 +500,9 @@ int omap3_noncore_dpll_set_rate(struct clk_hw *hw, unsigned long rate,
500 if (dd->last_rounded_rate == 0) 500 if (dd->last_rounded_rate == 0)
501 return -EINVAL; 501 return -EINVAL;
502 502
503 /* No freqsel on OMAP4 and OMAP3630 */ 503 /* No freqsel on AM335x, OMAP4 and OMAP3630 */
504 if (!cpu_is_omap44xx() && !cpu_is_omap3630()) { 504 if (!soc_is_am33xx() && !cpu_is_omap44xx() &&
505 !cpu_is_omap3630()) {
505 freqsel = _omap3_dpll_compute_freqsel(clk, 506 freqsel = _omap3_dpll_compute_freqsel(clk,
506 dd->last_rounded_n); 507 dd->last_rounded_n);
507 WARN_ON(!freqsel); 508 WARN_ON(!freqsel);
diff --git a/arch/arm/mach-omap2/drm.c b/arch/arm/mach-omap2/drm.c
index 2a2cfa88ddbf..59a4af779f42 100644
--- a/arch/arm/mach-omap2/drm.c
+++ b/arch/arm/mach-omap2/drm.c
@@ -51,8 +51,7 @@ static int __init omap_init_drm(void)
51 oh = omap_hwmod_lookup("dmm"); 51 oh = omap_hwmod_lookup("dmm");
52 52
53 if (oh) { 53 if (oh) {
54 pdev = omap_device_build(oh->name, -1, oh, NULL, 0, NULL, 0, 54 pdev = omap_device_build(oh->name, -1, oh, NULL, 0);
55 false);
56 WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", 55 WARN(IS_ERR(pdev), "Could not build omap_device for %s\n",
57 oh->name); 56 oh->name);
58 } 57 }
@@ -63,6 +62,6 @@ static int __init omap_init_drm(void)
63 62
64} 63}
65 64
66arch_initcall(omap_init_drm); 65omap_arch_initcall(omap_init_drm);
67 66
68#endif 67#endif
diff --git a/arch/arm/mach-omap2/emu.c b/arch/arm/mach-omap2/emu.c
index b3566f68a559..cbeaca2d7695 100644
--- a/arch/arm/mach-omap2/emu.c
+++ b/arch/arm/mach-omap2/emu.c
@@ -47,4 +47,4 @@ static int __init emu_init(void)
47 return 0; 47 return 0;
48} 48}
49 49
50subsys_initcall(emu_init); 50omap_subsys_initcall(emu_init);
diff --git a/arch/arm/mach-omap2/fb.c b/arch/arm/mach-omap2/fb.c
index d9bd965f6d07..190ae493c6ef 100644
--- a/arch/arm/mach-omap2/fb.c
+++ b/arch/arm/mach-omap2/fb.c
@@ -89,7 +89,7 @@ static int __init omap_init_vrfb(void)
89 return 0; 89 return 0;
90} 90}
91 91
92arch_initcall(omap_init_vrfb); 92omap_arch_initcall(omap_init_vrfb);
93#endif 93#endif
94 94
95#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) 95#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
@@ -113,6 +113,6 @@ static int __init omap_init_fb(void)
113 return platform_device_register(&omap_fb_device); 113 return platform_device_register(&omap_fb_device);
114} 114}
115 115
116arch_initcall(omap_init_fb); 116omap_arch_initcall(omap_init_fb);
117 117
118#endif 118#endif
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index 399acabc3d0b..7a577145b68b 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -23,6 +23,7 @@
23#include <linux/of.h> 23#include <linux/of.h>
24#include <linux/platform_data/gpio-omap.h> 24#include <linux/platform_data/gpio-omap.h>
25 25
26#include "soc.h"
26#include "omap_hwmod.h" 27#include "omap_hwmod.h"
27#include "omap_device.h" 28#include "omap_device.h"
28#include "omap-pm.h" 29#include "omap-pm.h"
@@ -131,8 +132,7 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
131 pwrdm = omap_hwmod_get_pwrdm(oh); 132 pwrdm = omap_hwmod_get_pwrdm(oh);
132 pdata->loses_context = pwrdm_can_ever_lose_context(pwrdm); 133 pdata->loses_context = pwrdm_can_ever_lose_context(pwrdm);
133 134
134 pdev = omap_device_build(name, id - 1, oh, pdata, 135 pdev = omap_device_build(name, id - 1, oh, pdata, sizeof(*pdata));
135 sizeof(*pdata), NULL, 0, false);
136 kfree(pdata); 136 kfree(pdata);
137 137
138 if (IS_ERR(pdev)) { 138 if (IS_ERR(pdev)) {
@@ -147,7 +147,7 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
147/* 147/*
148 * gpio_init needs to be done before 148 * gpio_init needs to be done before
149 * machine_init functions access gpio APIs. 149 * machine_init functions access gpio APIs.
150 * Hence gpio_init is a postcore_initcall. 150 * Hence gpio_init is a omap_postcore_initcall.
151 */ 151 */
152static int __init omap2_gpio_init(void) 152static int __init omap2_gpio_init(void)
153{ 153{
@@ -157,4 +157,4 @@ static int __init omap2_gpio_init(void)
157 157
158 return omap_hwmod_for_each_by_class("gpio", omap2_gpio_dev_init, NULL); 158 return omap_hwmod_for_each_by_class("gpio", omap2_gpio_dev_init, NULL);
159} 159}
160postcore_initcall(omap2_gpio_init); 160omap_postcore_initcall(omap2_gpio_init);
diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
index db969a5c4998..afc1e8c32d6c 100644
--- a/arch/arm/mach-omap2/gpmc-nand.c
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -89,20 +89,21 @@ static int omap2_nand_gpmc_retime(
89 return 0; 89 return 0;
90} 90}
91 91
92static bool __init gpmc_hwecc_bch_capable(enum omap_ecc ecc_opt) 92static bool gpmc_hwecc_bch_capable(enum omap_ecc ecc_opt)
93{ 93{
94 /* support only OMAP3 class */ 94 /* support only OMAP3 class */
95 if (!cpu_is_omap34xx()) { 95 if (!cpu_is_omap34xx() && !soc_is_am33xx()) {
96 pr_err("BCH ecc is not supported on this CPU\n"); 96 pr_err("BCH ecc is not supported on this CPU\n");
97 return 0; 97 return 0;
98 } 98 }
99 99
100 /* 100 /*
101 * For now, assume 4-bit mode is only supported on OMAP3630 ES1.x, x>=1. 101 * For now, assume 4-bit mode is only supported on OMAP3630 ES1.x, x>=1
102 * Other chips may be added if confirmed to work. 102 * and AM33xx derivates. Other chips may be added if confirmed to work.
103 */ 103 */
104 if ((ecc_opt == OMAP_ECC_BCH4_CODE_HW) && 104 if ((ecc_opt == OMAP_ECC_BCH4_CODE_HW) &&
105 (!cpu_is_omap3630() || (GET_OMAP_REVISION() == 0))) { 105 (!cpu_is_omap3630() || (GET_OMAP_REVISION() == 0)) &&
106 (!soc_is_am33xx())) {
106 pr_err("BCH 4-bit mode is not supported on this CPU\n"); 107 pr_err("BCH 4-bit mode is not supported on this CPU\n");
107 return 0; 108 return 0;
108 } 109 }
@@ -110,8 +111,8 @@ static bool __init gpmc_hwecc_bch_capable(enum omap_ecc ecc_opt)
110 return 1; 111 return 1;
111} 112}
112 113
113int __init gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data, 114int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data,
114 struct gpmc_timings *gpmc_t) 115 struct gpmc_timings *gpmc_t)
115{ 116{
116 int err = 0; 117 int err = 0;
117 struct device *dev = &gpmc_nand_device.dev; 118 struct device *dev = &gpmc_nand_device.dev;
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c
index 94a349e4dc96..fadd87435cd0 100644
--- a/arch/arm/mach-omap2/gpmc-onenand.c
+++ b/arch/arm/mach-omap2/gpmc-onenand.c
@@ -356,7 +356,7 @@ static int gpmc_onenand_setup(void __iomem *onenand_base, int *freq_ptr)
356 return ret; 356 return ret;
357} 357}
358 358
359void __init gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data) 359void gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data)
360{ 360{
361 int err; 361 int err;
362 362
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 8033cb747c86..e4b16c8efe8b 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -25,6 +25,10 @@
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/platform_device.h> 27#include <linux/platform_device.h>
28#include <linux/of.h>
29#include <linux/of_mtd.h>
30#include <linux/of_device.h>
31#include <linux/mtd/nand.h>
28 32
29#include <linux/platform_data/mtd-nand-omap2.h> 33#include <linux/platform_data/mtd-nand-omap2.h>
30 34
@@ -34,6 +38,8 @@
34#include "common.h" 38#include "common.h"
35#include "omap_device.h" 39#include "omap_device.h"
36#include "gpmc.h" 40#include "gpmc.h"
41#include "gpmc-nand.h"
42#include "gpmc-onenand.h"
37 43
38#define DEVICE_NAME "omap-gpmc" 44#define DEVICE_NAME "omap-gpmc"
39 45
@@ -145,7 +151,8 @@ static unsigned gpmc_irq_start;
145static struct resource gpmc_mem_root; 151static struct resource gpmc_mem_root;
146static struct resource gpmc_cs_mem[GPMC_CS_NUM]; 152static struct resource gpmc_cs_mem[GPMC_CS_NUM];
147static DEFINE_SPINLOCK(gpmc_mem_lock); 153static DEFINE_SPINLOCK(gpmc_mem_lock);
148static unsigned int gpmc_cs_map; /* flag for cs which are initialized */ 154/* Define chip-selects as reserved by default until probe completes */
155static unsigned int gpmc_cs_map = ((1 << GPMC_CS_NUM) - 1);
149static struct device *gpmc_dev; 156static struct device *gpmc_dev;
150static int gpmc_irq; 157static int gpmc_irq;
151static resource_size_t phys_base, mem_size; 158static resource_size_t phys_base, mem_size;
@@ -783,9 +790,6 @@ static int gpmc_mem_init(void)
783 * even if we didn't boot from ROM. 790 * even if we didn't boot from ROM.
784 */ 791 */
785 boot_rom_space = BOOT_ROM_SPACE; 792 boot_rom_space = BOOT_ROM_SPACE;
786 /* In apollon the CS0 is mapped as 0x0000 0000 */
787 if (machine_is_omap_apollon())
788 boot_rom_space = 0;
789 gpmc_mem_root.start = GPMC_MEM_START + boot_rom_space; 793 gpmc_mem_root.start = GPMC_MEM_START + boot_rom_space;
790 gpmc_mem_root.end = GPMC_MEM_END; 794 gpmc_mem_root.end = GPMC_MEM_END;
791 795
@@ -1118,8 +1122,215 @@ int gpmc_calc_timings(struct gpmc_timings *gpmc_t,
1118 /* TODO: remove, see function definition */ 1122 /* TODO: remove, see function definition */
1119 gpmc_convert_ps_to_ns(gpmc_t); 1123 gpmc_convert_ps_to_ns(gpmc_t);
1120 1124
1125 /* Now the GPMC is initialised, unreserve the chip-selects */
1126 gpmc_cs_map = 0;
1127
1128 return 0;
1129}
1130
1131#ifdef CONFIG_OF
1132static struct of_device_id gpmc_dt_ids[] = {
1133 { .compatible = "ti,omap2420-gpmc" },
1134 { .compatible = "ti,omap2430-gpmc" },
1135 { .compatible = "ti,omap3430-gpmc" }, /* omap3430 & omap3630 */
1136 { .compatible = "ti,omap4430-gpmc" }, /* omap4430 & omap4460 & omap543x */
1137 { .compatible = "ti,am3352-gpmc" }, /* am335x devices */
1138 { }
1139};
1140MODULE_DEVICE_TABLE(of, gpmc_dt_ids);
1141
1142static void __maybe_unused gpmc_read_timings_dt(struct device_node *np,
1143 struct gpmc_timings *gpmc_t)
1144{
1145 u32 val;
1146
1147 memset(gpmc_t, 0, sizeof(*gpmc_t));
1148
1149 /* minimum clock period for syncronous mode */
1150 if (!of_property_read_u32(np, "gpmc,sync-clk", &val))
1151 gpmc_t->sync_clk = val;
1152
1153 /* chip select timtings */
1154 if (!of_property_read_u32(np, "gpmc,cs-on", &val))
1155 gpmc_t->cs_on = val;
1156
1157 if (!of_property_read_u32(np, "gpmc,cs-rd-off", &val))
1158 gpmc_t->cs_rd_off = val;
1159
1160 if (!of_property_read_u32(np, "gpmc,cs-wr-off", &val))
1161 gpmc_t->cs_wr_off = val;
1162
1163 /* ADV signal timings */
1164 if (!of_property_read_u32(np, "gpmc,adv-on", &val))
1165 gpmc_t->adv_on = val;
1166
1167 if (!of_property_read_u32(np, "gpmc,adv-rd-off", &val))
1168 gpmc_t->adv_rd_off = val;
1169
1170 if (!of_property_read_u32(np, "gpmc,adv-wr-off", &val))
1171 gpmc_t->adv_wr_off = val;
1172
1173 /* WE signal timings */
1174 if (!of_property_read_u32(np, "gpmc,we-on", &val))
1175 gpmc_t->we_on = val;
1176
1177 if (!of_property_read_u32(np, "gpmc,we-off", &val))
1178 gpmc_t->we_off = val;
1179
1180 /* OE signal timings */
1181 if (!of_property_read_u32(np, "gpmc,oe-on", &val))
1182 gpmc_t->oe_on = val;
1183
1184 if (!of_property_read_u32(np, "gpmc,oe-off", &val))
1185 gpmc_t->oe_off = val;
1186
1187 /* access and cycle timings */
1188 if (!of_property_read_u32(np, "gpmc,page-burst-access", &val))
1189 gpmc_t->page_burst_access = val;
1190
1191 if (!of_property_read_u32(np, "gpmc,access", &val))
1192 gpmc_t->access = val;
1193
1194 if (!of_property_read_u32(np, "gpmc,rd-cycle", &val))
1195 gpmc_t->rd_cycle = val;
1196
1197 if (!of_property_read_u32(np, "gpmc,wr-cycle", &val))
1198 gpmc_t->wr_cycle = val;
1199
1200 /* only for OMAP3430 */
1201 if (!of_property_read_u32(np, "gpmc,wr-access", &val))
1202 gpmc_t->wr_access = val;
1203
1204 if (!of_property_read_u32(np, "gpmc,wr-data-mux-bus", &val))
1205 gpmc_t->wr_data_mux_bus = val;
1206}
1207
1208#ifdef CONFIG_MTD_NAND
1209
1210static const char * const nand_ecc_opts[] = {
1211 [OMAP_ECC_HAMMING_CODE_DEFAULT] = "sw",
1212 [OMAP_ECC_HAMMING_CODE_HW] = "hw",
1213 [OMAP_ECC_HAMMING_CODE_HW_ROMCODE] = "hw-romcode",
1214 [OMAP_ECC_BCH4_CODE_HW] = "bch4",
1215 [OMAP_ECC_BCH8_CODE_HW] = "bch8",
1216};
1217
1218static int gpmc_probe_nand_child(struct platform_device *pdev,
1219 struct device_node *child)
1220{
1221 u32 val;
1222 const char *s;
1223 struct gpmc_timings gpmc_t;
1224 struct omap_nand_platform_data *gpmc_nand_data;
1225
1226 if (of_property_read_u32(child, "reg", &val) < 0) {
1227 dev_err(&pdev->dev, "%s has no 'reg' property\n",
1228 child->full_name);
1229 return -ENODEV;
1230 }
1231
1232 gpmc_nand_data = devm_kzalloc(&pdev->dev, sizeof(*gpmc_nand_data),
1233 GFP_KERNEL);
1234 if (!gpmc_nand_data)
1235 return -ENOMEM;
1236
1237 gpmc_nand_data->cs = val;
1238 gpmc_nand_data->of_node = child;
1239
1240 if (!of_property_read_string(child, "ti,nand-ecc-opt", &s))
1241 for (val = 0; val < ARRAY_SIZE(nand_ecc_opts); val++)
1242 if (!strcasecmp(s, nand_ecc_opts[val])) {
1243 gpmc_nand_data->ecc_opt = val;
1244 break;
1245 }
1246
1247 val = of_get_nand_bus_width(child);
1248 if (val == 16)
1249 gpmc_nand_data->devsize = NAND_BUSWIDTH_16;
1250
1251 gpmc_read_timings_dt(child, &gpmc_t);
1252 gpmc_nand_init(gpmc_nand_data, &gpmc_t);
1253
1254 return 0;
1255}
1256#else
1257static int gpmc_probe_nand_child(struct platform_device *pdev,
1258 struct device_node *child)
1259{
1121 return 0; 1260 return 0;
1122} 1261}
1262#endif
1263
1264#ifdef CONFIG_MTD_ONENAND
1265static int gpmc_probe_onenand_child(struct platform_device *pdev,
1266 struct device_node *child)
1267{
1268 u32 val;
1269 struct omap_onenand_platform_data *gpmc_onenand_data;
1270
1271 if (of_property_read_u32(child, "reg", &val) < 0) {
1272 dev_err(&pdev->dev, "%s has no 'reg' property\n",
1273 child->full_name);
1274 return -ENODEV;
1275 }
1276
1277 gpmc_onenand_data = devm_kzalloc(&pdev->dev, sizeof(*gpmc_onenand_data),
1278 GFP_KERNEL);
1279 if (!gpmc_onenand_data)
1280 return -ENOMEM;
1281
1282 gpmc_onenand_data->cs = val;
1283 gpmc_onenand_data->of_node = child;
1284 gpmc_onenand_data->dma_channel = -1;
1285
1286 if (!of_property_read_u32(child, "dma-channel", &val))
1287 gpmc_onenand_data->dma_channel = val;
1288
1289 gpmc_onenand_init(gpmc_onenand_data);
1290
1291 return 0;
1292}
1293#else
1294static int gpmc_probe_onenand_child(struct platform_device *pdev,
1295 struct device_node *child)
1296{
1297 return 0;
1298}
1299#endif
1300
1301static int gpmc_probe_dt(struct platform_device *pdev)
1302{
1303 int ret;
1304 struct device_node *child;
1305 const struct of_device_id *of_id =
1306 of_match_device(gpmc_dt_ids, &pdev->dev);
1307
1308 if (!of_id)
1309 return 0;
1310
1311 for_each_node_by_name(child, "nand") {
1312 ret = gpmc_probe_nand_child(pdev, child);
1313 if (ret < 0) {
1314 of_node_put(child);
1315 return ret;
1316 }
1317 }
1318
1319 for_each_node_by_name(child, "onenand") {
1320 ret = gpmc_probe_onenand_child(pdev, child);
1321 if (ret < 0) {
1322 of_node_put(child);
1323 return ret;
1324 }
1325 }
1326 return 0;
1327}
1328#else
1329static int gpmc_probe_dt(struct platform_device *pdev)
1330{
1331 return 0;
1332}
1333#endif
1123 1334
1124static int gpmc_probe(struct platform_device *pdev) 1335static int gpmc_probe(struct platform_device *pdev)
1125{ 1336{
@@ -1134,11 +1345,9 @@ static int gpmc_probe(struct platform_device *pdev)
1134 phys_base = res->start; 1345 phys_base = res->start;
1135 mem_size = resource_size(res); 1346 mem_size = resource_size(res);
1136 1347
1137 gpmc_base = devm_request_and_ioremap(&pdev->dev, res); 1348 gpmc_base = devm_ioremap_resource(&pdev->dev, res);
1138 if (!gpmc_base) { 1349 if (IS_ERR(gpmc_base))
1139 dev_err(&pdev->dev, "error: request memory / ioremap\n"); 1350 return PTR_ERR(gpmc_base);
1140 return -EADDRNOTAVAIL;
1141 }
1142 1351
1143 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 1352 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
1144 if (res == NULL) 1353 if (res == NULL)
@@ -1174,6 +1383,14 @@ static int gpmc_probe(struct platform_device *pdev)
1174 if (IS_ERR_VALUE(gpmc_setup_irq())) 1383 if (IS_ERR_VALUE(gpmc_setup_irq()))
1175 dev_warn(gpmc_dev, "gpmc_setup_irq failed\n"); 1384 dev_warn(gpmc_dev, "gpmc_setup_irq failed\n");
1176 1385
1386 rc = gpmc_probe_dt(pdev);
1387 if (rc < 0) {
1388 clk_disable_unprepare(gpmc_l3_clk);
1389 clk_put(gpmc_l3_clk);
1390 dev_err(gpmc_dev, "failed to probe DT parameters\n");
1391 return rc;
1392 }
1393
1177 return 0; 1394 return 0;
1178} 1395}
1179 1396
@@ -1191,6 +1408,7 @@ static struct platform_driver gpmc_driver = {
1191 .driver = { 1408 .driver = {
1192 .name = DEVICE_NAME, 1409 .name = DEVICE_NAME,
1193 .owner = THIS_MODULE, 1410 .owner = THIS_MODULE,
1411 .of_match_table = of_match_ptr(gpmc_dt_ids),
1194 }, 1412 },
1195}; 1413};
1196 1414
@@ -1205,7 +1423,7 @@ static __exit void gpmc_exit(void)
1205 1423
1206} 1424}
1207 1425
1208postcore_initcall(gpmc_init); 1426omap_postcore_initcall(gpmc_init);
1209module_exit(gpmc_exit); 1427module_exit(gpmc_exit);
1210 1428
1211static int __init omap_gpmc_init(void) 1429static int __init omap_gpmc_init(void)
@@ -1214,18 +1432,25 @@ static int __init omap_gpmc_init(void)
1214 struct platform_device *pdev; 1432 struct platform_device *pdev;
1215 char *oh_name = "gpmc"; 1433 char *oh_name = "gpmc";
1216 1434
1435 /*
1436 * if the board boots up with a populated DT, do not
1437 * manually add the device from this initcall
1438 */
1439 if (of_have_populated_dt())
1440 return -ENODEV;
1441
1217 oh = omap_hwmod_lookup(oh_name); 1442 oh = omap_hwmod_lookup(oh_name);
1218 if (!oh) { 1443 if (!oh) {
1219 pr_err("Could not look up %s\n", oh_name); 1444 pr_err("Could not look up %s\n", oh_name);
1220 return -ENODEV; 1445 return -ENODEV;
1221 } 1446 }
1222 1447
1223 pdev = omap_device_build(DEVICE_NAME, -1, oh, NULL, 0, NULL, 0, 0); 1448 pdev = omap_device_build(DEVICE_NAME, -1, oh, NULL, 0);
1224 WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name); 1449 WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
1225 1450
1226 return IS_ERR(pdev) ? PTR_ERR(pdev) : 0; 1451 return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
1227} 1452}
1228postcore_initcall(omap_gpmc_init); 1453omap_postcore_initcall(omap_gpmc_init);
1229 1454
1230static irqreturn_t gpmc_handle_irq(int irq, void *dev) 1455static irqreturn_t gpmc_handle_irq(int irq, void *dev)
1231{ 1456{
diff --git a/arch/arm/mach-omap2/hdq1w.c b/arch/arm/mach-omap2/hdq1w.c
index ab7bf181a105..cbc8e3c480e0 100644
--- a/arch/arm/mach-omap2/hdq1w.c
+++ b/arch/arm/mach-omap2/hdq1w.c
@@ -27,6 +27,7 @@
27#include <linux/err.h> 27#include <linux/err.h>
28#include <linux/platform_device.h> 28#include <linux/platform_device.h>
29 29
30#include "soc.h"
30#include "omap_hwmod.h" 31#include "omap_hwmod.h"
31#include "omap_device.h" 32#include "omap_device.h"
32#include "hdq1w.h" 33#include "hdq1w.h"
@@ -87,10 +88,10 @@ static int __init omap_init_hdq(void)
87 if (!oh) 88 if (!oh)
88 return 0; 89 return 0;
89 90
90 pdev = omap_device_build(devname, id, oh, NULL, 0, NULL, 0, 0); 91 pdev = omap_device_build(devname, id, oh, NULL, 0);
91 WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s.\n", 92 WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s.\n",
92 devname, oh->name); 93 devname, oh->name);
93 94
94 return 0; 95 return 0;
95} 96}
96arch_initcall(omap_init_hdq); 97omap_arch_initcall(omap_init_hdq);
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 4a964338992a..2ef1f8714fcf 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -522,7 +522,7 @@ static void __init omap_hsmmc_init_one(struct omap2_hsmmc_info *hsmmcinfo,
522 } 522 }
523 dev_set_name(&pdev->dev, "%s.%d", pdev->name, pdev->id); 523 dev_set_name(&pdev->dev, "%s.%d", pdev->name, pdev->id);
524 524
525 od = omap_device_alloc(pdev, ohs, 1, NULL, 0); 525 od = omap_device_alloc(pdev, ohs, 1);
526 if (IS_ERR(od)) { 526 if (IS_ERR(od)) {
527 pr_err("Could not allocate od for %s\n", name); 527 pr_err("Could not allocate od for %s\n", name);
528 goto put_pdev; 528 goto put_pdev;
diff --git a/arch/arm/mach-omap2/hwspinlock.c b/arch/arm/mach-omap2/hwspinlock.c
index 1df9b5feda16..ef175acaeaa2 100644
--- a/arch/arm/mach-omap2/hwspinlock.c
+++ b/arch/arm/mach-omap2/hwspinlock.c
@@ -21,6 +21,7 @@
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/hwspinlock.h> 22#include <linux/hwspinlock.h>
23 23
24#include "soc.h"
24#include "omap_hwmod.h" 25#include "omap_hwmod.h"
25#include "omap_device.h" 26#include "omap_device.h"
26 27
@@ -46,8 +47,7 @@ static int __init hwspinlocks_init(void)
46 return -EINVAL; 47 return -EINVAL;
47 48
48 pdev = omap_device_build(dev_name, 0, oh, &omap_hwspinlock_pdata, 49 pdev = omap_device_build(dev_name, 0, oh, &omap_hwspinlock_pdata,
49 sizeof(struct hwspinlock_pdata), 50 sizeof(struct hwspinlock_pdata));
50 NULL, 0, false);
51 if (IS_ERR(pdev)) { 51 if (IS_ERR(pdev)) {
52 pr_err("Can't build omap_device for %s:%s\n", dev_name, 52 pr_err("Can't build omap_device for %s:%s\n", dev_name,
53 oh_name); 53 oh_name);
@@ -57,4 +57,4 @@ static int __init hwspinlocks_init(void)
57 return retval; 57 return retval;
58} 58}
59/* early board code might need to reserve specific hwspinlock instances */ 59/* early board code might need to reserve specific hwspinlock instances */
60postcore_initcall(hwspinlocks_init); 60omap_postcore_initcall(hwspinlocks_init);
diff --git a/arch/arm/mach-omap2/i2c.c b/arch/arm/mach-omap2/i2c.c
index b9074dde3b9c..d940e53dd9f2 100644
--- a/arch/arm/mach-omap2/i2c.c
+++ b/arch/arm/mach-omap2/i2c.c
@@ -178,10 +178,14 @@ int __init omap_i2c_add_bus(struct omap_i2c_bus_platform_data *i2c_pdata,
178 if (cpu_is_omap34xx()) 178 if (cpu_is_omap34xx())
179 pdata->set_mpu_wkup_lat = omap_pm_set_max_mpu_wakeup_lat_compat; 179 pdata->set_mpu_wkup_lat = omap_pm_set_max_mpu_wakeup_lat_compat;
180 pdev = omap_device_build(name, bus_id, oh, pdata, 180 pdev = omap_device_build(name, bus_id, oh, pdata,
181 sizeof(struct omap_i2c_bus_platform_data), 181 sizeof(struct omap_i2c_bus_platform_data));
182 NULL, 0, 0);
183 WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", name); 182 WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", name);
184 183
185 return PTR_RET(pdev); 184 return PTR_RET(pdev);
186} 185}
187 186
187static int __init omap_i2c_cmdline(void)
188{
189 return omap_register_i2c_bus_cmdline();
190}
191omap_subsys_initcall(omap_i2c_cmdline);
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 1377c363fded..577298ed5a44 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -399,8 +399,18 @@ void __init omap3xxx_check_revision(void)
399 } 399 }
400 break; 400 break;
401 case 0xb944: 401 case 0xb944:
402 omap_revision = AM335X_REV_ES1_0; 402 switch (rev) {
403 cpu_rev = "1.0"; 403 case 0:
404 omap_revision = AM335X_REV_ES1_0;
405 cpu_rev = "1.0";
406 break;
407 case 1:
408 /* FALLTHROUGH */
409 default:
410 omap_revision = AM335X_REV_ES2_0;
411 cpu_rev = "2.0";
412 break;
413 }
404 break; 414 break;
405 case 0xb8f2: 415 case 0xb8f2:
406 switch (rev) { 416 switch (rev) {
diff --git a/arch/arm/mach-omap2/include/mach/serial.h b/arch/arm/mach-omap2/include/mach/serial.h
index 70eda00db7a4..7ca1fcff453b 100644
--- a/arch/arm/mach-omap2/include/mach/serial.h
+++ b/arch/arm/mach-omap2/include/mach/serial.h
@@ -8,20 +8,6 @@
8 * GNU General Public License for more details. 8 * GNU General Public License for more details.
9 */ 9 */
10 10
11/*
12 * Memory entry used for the DEBUG_LL UART configuration, relative to
13 * start of RAM. See also uncompress.h and debug-macro.S.
14 *
15 * Note that using a memory location for storing the UART configuration
16 * has at least two limitations:
17 *
18 * 1. Kernel uncompress code cannot overlap OMAP_UART_INFO as the
19 * uncompress code could then partially overwrite itself
20 * 2. We assume printascii is called at least once before paging_init,
21 * and addruart has a chance to read OMAP_UART_INFO
22 */
23#define OMAP_UART_INFO_OFS 0x3ffc
24
25/* OMAP2 serial ports */ 11/* OMAP2 serial ports */
26#define OMAP2_UART1_BASE 0x4806a000 12#define OMAP2_UART1_BASE 0x4806a000
27#define OMAP2_UART2_BASE 0x4806c000 13#define OMAP2_UART2_BASE 0x4806c000
@@ -68,29 +54,6 @@
68 54
69#define OMAP24XX_BASE_BAUD (48000000/16) 55#define OMAP24XX_BASE_BAUD (48000000/16)
70 56
71/*
72 * DEBUG_LL port encoding stored into the UART1 scratchpad register by
73 * decomp_setup in uncompress.h
74 */
75#define OMAP2UART1 21
76#define OMAP2UART2 22
77#define OMAP2UART3 23
78#define OMAP3UART1 OMAP2UART1
79#define OMAP3UART2 OMAP2UART2
80#define OMAP3UART3 33
81#define OMAP3UART4 34 /* Only on 36xx */
82#define OMAP4UART1 OMAP2UART1
83#define OMAP4UART2 OMAP2UART2
84#define OMAP4UART3 43
85#define OMAP4UART4 44
86#define TI81XXUART1 81
87#define TI81XXUART2 82
88#define TI81XXUART3 83
89#define AM33XXUART1 84
90#define OMAP5UART3 OMAP4UART3
91#define OMAP5UART4 OMAP4UART4
92#define ZOOM_UART 95 /* Only on zoom2/3 */
93
94#ifndef __ASSEMBLER__ 57#ifndef __ASSEMBLER__
95 58
96struct omap_board_data; 59struct omap_board_data;
diff --git a/arch/arm/mach-omap2/include/mach/uncompress.h b/arch/arm/mach-omap2/include/mach/uncompress.h
deleted file mode 100644
index 8e3546d3e041..000000000000
--- a/arch/arm/mach-omap2/include/mach/uncompress.h
+++ /dev/null
@@ -1,176 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/uncompress.h
3 *
4 * Serial port stubs for kernel decompress status messages
5 *
6 * Initially based on:
7 * linux-2.4.15-rmk1-dsplinux1.6/arch/arm/plat-omap/include/mach1510/uncompress.h
8 * Copyright (C) 2000 RidgeRun, Inc.
9 * Author: Greg Lonnon <glonnon@ridgerun.com>
10 *
11 * Rewritten by:
12 * Author: <source@mvista.com>
13 * 2004 (c) MontaVista Software, Inc.
14 *
15 * This file is licensed under the terms of the GNU General Public License
16 * version 2. This program is licensed "as is" without any warranty of any
17 * kind, whether express or implied.
18 */
19
20#include <linux/types.h>
21#include <linux/serial_reg.h>
22
23#include <asm/memory.h>
24#include <asm/mach-types.h>
25
26#include <mach/serial.h>
27
28#define MDR1_MODE_MASK 0x07
29
30volatile u8 *uart_base;
31int uart_shift;
32
33/*
34 * Store the DEBUG_LL uart number into memory.
35 * See also debug-macro.S, and serial.c for related code.
36 */
37static void set_omap_uart_info(unsigned char port)
38{
39 /*
40 * Get address of some.bss variable and round it down
41 * a la CONFIG_AUTO_ZRELADDR.
42 */
43 u32 ram_start = (u32)&uart_shift & 0xf8000000;
44 u32 *uart_info = (u32 *)(ram_start + OMAP_UART_INFO_OFS);
45 *uart_info = port;
46}
47
48static void putc(int c)
49{
50 if (!uart_base)
51 return;
52
53 /* Check for UART 16x mode */
54 if ((uart_base[UART_OMAP_MDR1 << uart_shift] & MDR1_MODE_MASK) != 0)
55 return;
56
57 while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE))
58 barrier();
59 uart_base[UART_TX << uart_shift] = c;
60}
61
62static inline void flush(void)
63{
64}
65
66/*
67 * Macros to configure UART1 and debug UART
68 */
69#define _DEBUG_LL_ENTRY(mach, dbg_uart, dbg_shft, dbg_id) \
70 if (machine_is_##mach()) { \
71 uart_base = (volatile u8 *)(dbg_uart); \
72 uart_shift = (dbg_shft); \
73 port = (dbg_id); \
74 set_omap_uart_info(port); \
75 break; \
76 }
77
78#define DEBUG_LL_OMAP2(p, mach) \
79 _DEBUG_LL_ENTRY(mach, OMAP2_UART##p##_BASE, OMAP_PORT_SHIFT, \
80 OMAP2UART##p)
81
82#define DEBUG_LL_OMAP3(p, mach) \
83 _DEBUG_LL_ENTRY(mach, OMAP3_UART##p##_BASE, OMAP_PORT_SHIFT, \
84 OMAP3UART##p)
85
86#define DEBUG_LL_OMAP4(p, mach) \
87 _DEBUG_LL_ENTRY(mach, OMAP4_UART##p##_BASE, OMAP_PORT_SHIFT, \
88 OMAP4UART##p)
89
90#define DEBUG_LL_OMAP5(p, mach) \
91 _DEBUG_LL_ENTRY(mach, OMAP5_UART##p##_BASE, OMAP_PORT_SHIFT, \
92 OMAP5UART##p)
93/* Zoom2/3 shift is different for UART1 and external port */
94#define DEBUG_LL_ZOOM(mach) \
95 _DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
96
97#define DEBUG_LL_TI81XX(p, mach) \
98 _DEBUG_LL_ENTRY(mach, TI81XX_UART##p##_BASE, OMAP_PORT_SHIFT, \
99 TI81XXUART##p)
100
101#define DEBUG_LL_AM33XX(p, mach) \
102 _DEBUG_LL_ENTRY(mach, AM33XX_UART##p##_BASE, OMAP_PORT_SHIFT, \
103 AM33XXUART##p)
104
105static inline void arch_decomp_setup(void)
106{
107 int port = 0;
108
109 /*
110 * Initialize the port based on the machine ID from the bootloader.
111 * Note that we're using macros here instead of switch statement
112 * as machine_is functions are optimized out for the boards that
113 * are not selected.
114 */
115 do {
116 /* omap2 based boards using UART1 */
117 DEBUG_LL_OMAP2(1, omap_2430sdp);
118 DEBUG_LL_OMAP2(1, omap_apollon);
119 DEBUG_LL_OMAP2(1, omap_h4);
120
121 /* omap2 based boards using UART3 */
122 DEBUG_LL_OMAP2(3, nokia_n800);
123 DEBUG_LL_OMAP2(3, nokia_n810);
124 DEBUG_LL_OMAP2(3, nokia_n810_wimax);
125
126 /* omap3 based boards using UART1 */
127 DEBUG_LL_OMAP2(1, omap3evm);
128 DEBUG_LL_OMAP3(1, omap_3430sdp);
129 DEBUG_LL_OMAP3(1, omap_3630sdp);
130 DEBUG_LL_OMAP3(1, omap3530_lv_som);
131 DEBUG_LL_OMAP3(1, omap3_torpedo);
132
133 /* omap3 based boards using UART3 */
134 DEBUG_LL_OMAP3(3, cm_t35);
135 DEBUG_LL_OMAP3(3, cm_t3517);
136 DEBUG_LL_OMAP3(3, cm_t3730);
137 DEBUG_LL_OMAP3(3, craneboard);
138 DEBUG_LL_OMAP3(3, devkit8000);
139 DEBUG_LL_OMAP3(3, igep0020);
140 DEBUG_LL_OMAP3(3, igep0030);
141 DEBUG_LL_OMAP3(3, nokia_rm680);
142 DEBUG_LL_OMAP3(3, nokia_rm696);
143 DEBUG_LL_OMAP3(3, nokia_rx51);
144 DEBUG_LL_OMAP3(3, omap3517evm);
145 DEBUG_LL_OMAP3(3, omap3_beagle);
146 DEBUG_LL_OMAP3(3, omap3_pandora);
147 DEBUG_LL_OMAP3(3, omap_ldp);
148 DEBUG_LL_OMAP3(3, overo);
149 DEBUG_LL_OMAP3(3, touchbook);
150
151 /* omap4 based boards using UART3 */
152 DEBUG_LL_OMAP4(3, omap_4430sdp);
153 DEBUG_LL_OMAP4(3, omap4_panda);
154
155 /* omap5 based boards using UART3 */
156 DEBUG_LL_OMAP5(3, omap5_sevm);
157
158 /* zoom2/3 external uart */
159 DEBUG_LL_ZOOM(omap_zoom2);
160 DEBUG_LL_ZOOM(omap_zoom3);
161
162 /* TI8168 base boards using UART3 */
163 DEBUG_LL_TI81XX(3, ti8168evm);
164
165 /* TI8148 base boards using UART1 */
166 DEBUG_LL_TI81XX(1, ti8148evm);
167
168 /* AM33XX base boards using UART1 */
169 DEBUG_LL_AM33XX(1, am335xevm);
170 } while (0);
171}
172
173/*
174 * nothing to do
175 */
176#define arch_decomp_wdog()
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
index df49f2a49461..5d8768075dd9 100644
--- a/arch/arm/mach-omap2/mcbsp.c
+++ b/arch/arm/mach-omap2/mcbsp.c
@@ -23,6 +23,7 @@
23 23
24#include <linux/omap-dma.h> 24#include <linux/omap-dma.h>
25 25
26#include "soc.h"
26#include "omap_device.h" 27#include "omap_device.h"
27 28
28/* 29/*
@@ -101,7 +102,7 @@ static int __init omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
101 count++; 102 count++;
102 } 103 }
103 pdev = omap_device_build_ss(name, id, oh_device, count, pdata, 104 pdev = omap_device_build_ss(name, id, oh_device, count, pdata,
104 sizeof(*pdata), NULL, 0, false); 105 sizeof(*pdata));
105 kfree(pdata); 106 kfree(pdata);
106 if (IS_ERR(pdev)) { 107 if (IS_ERR(pdev)) {
107 pr_err("%s: Can't build omap_device for %s:%s.\n", __func__, 108 pr_err("%s: Can't build omap_device for %s:%s.\n", __func__,
@@ -118,4 +119,4 @@ static int __init omap2_mcbsp_init(void)
118 119
119 return 0; 120 return 0;
120} 121}
121arch_initcall(omap2_mcbsp_init); 122omap_arch_initcall(omap2_mcbsp_init);
diff --git a/arch/arm/mach-omap2/msdi.c b/arch/arm/mach-omap2/msdi.c
index aafdd4ca9f4f..c52d8b4a3e91 100644
--- a/arch/arm/mach-omap2/msdi.c
+++ b/arch/arm/mach-omap2/msdi.c
@@ -150,7 +150,7 @@ void __init omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data)
150 return; 150 return;
151 } 151 }
152 pdev = omap_device_build(dev_name, id, oh, mmc_data[0], 152 pdev = omap_device_build(dev_name, id, oh, mmc_data[0],
153 sizeof(struct omap_mmc_platform_data), NULL, 0, 0); 153 sizeof(struct omap_mmc_platform_data));
154 if (IS_ERR(pdev)) 154 if (IS_ERR(pdev))
155 WARN(1, "Can'd build omap_device for %s:%s.\n", 155 WARN(1, "Can'd build omap_device for %s:%s.\n",
156 dev_name, oh->name); 156 dev_name, oh->name);
diff --git a/arch/arm/mach-omap2/omap-iommu.c b/arch/arm/mach-omap2/omap-iommu.c
index 6da4f7ae9d7f..f6daae821ebb 100644
--- a/arch/arm/mach-omap2/omap-iommu.c
+++ b/arch/arm/mach-omap2/omap-iommu.c
@@ -16,6 +16,7 @@
16#include <linux/slab.h> 16#include <linux/slab.h>
17 17
18#include <linux/platform_data/iommu-omap.h> 18#include <linux/platform_data/iommu-omap.h>
19#include "soc.h"
19#include "omap_hwmod.h" 20#include "omap_hwmod.h"
20#include "omap_device.h" 21#include "omap_device.h"
21 22
@@ -41,8 +42,7 @@ static int __init omap_iommu_dev_init(struct omap_hwmod *oh, void *unused)
41 pdata->deassert_reset = omap_device_deassert_hardreset; 42 pdata->deassert_reset = omap_device_deassert_hardreset;
42 } 43 }
43 44
44 pdev = omap_device_build("omap-iommu", i, oh, pdata, sizeof(*pdata), 45 pdev = omap_device_build("omap-iommu", i, oh, pdata, sizeof(*pdata));
45 NULL, 0, 0);
46 46
47 kfree(pdata); 47 kfree(pdata);
48 48
@@ -61,7 +61,7 @@ static int __init omap_iommu_init(void)
61 return omap_hwmod_for_each_by_class("mmu", omap_iommu_dev_init, NULL); 61 return omap_hwmod_for_each_by_class("mmu", omap_iommu_dev_init, NULL);
62} 62}
63/* must be ready before omap3isp is probed */ 63/* must be ready before omap3isp is probed */
64subsys_initcall(omap_iommu_init); 64omap_subsys_initcall(omap_iommu_init);
65 65
66static void __exit omap_iommu_exit(void) 66static void __exit omap_iommu_exit(void)
67{ 67{
diff --git a/arch/arm/mach-omap2/omap-mpuss-lowpower.c b/arch/arm/mach-omap2/omap-mpuss-lowpower.c
index aac46bfdbeb2..8bcb64bcdcdb 100644
--- a/arch/arm/mach-omap2/omap-mpuss-lowpower.c
+++ b/arch/arm/mach-omap2/omap-mpuss-lowpower.c
@@ -87,37 +87,6 @@ static inline void set_cpu_wakeup_addr(unsigned int cpu_id, u32 addr)
87} 87}
88 88
89/* 89/*
90 * Set the CPUx powerdomain's previous power state
91 */
92static inline void set_cpu_next_pwrst(unsigned int cpu_id,
93 unsigned int power_state)
94{
95 struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu_id);
96
97 pwrdm_set_next_pwrst(pm_info->pwrdm, power_state);
98}
99
100/*
101 * Read CPU's previous power state
102 */
103static inline unsigned int read_cpu_prev_pwrst(unsigned int cpu_id)
104{
105 struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu_id);
106
107 return pwrdm_read_prev_pwrst(pm_info->pwrdm);
108}
109
110/*
111 * Clear the CPUx powerdomain's previous power state
112 */
113static inline void clear_cpu_prev_pwrst(unsigned int cpu_id)
114{
115 struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu_id);
116
117 pwrdm_clear_all_prev_pwrst(pm_info->pwrdm);
118}
119
120/*
121 * Store the SCU power status value to scratchpad memory 90 * Store the SCU power status value to scratchpad memory
122 */ 91 */
123static void scu_pwrst_prepare(unsigned int cpu_id, unsigned int cpu_state) 92static void scu_pwrst_prepare(unsigned int cpu_id, unsigned int cpu_state)
@@ -230,6 +199,7 @@ static void save_l2x0_context(void)
230 */ 199 */
231int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state) 200int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state)
232{ 201{
202 struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu);
233 unsigned int save_state = 0; 203 unsigned int save_state = 0;
234 unsigned int wakeup_cpu; 204 unsigned int wakeup_cpu;
235 205
@@ -268,7 +238,7 @@ int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state)
268 save_state = 2; 238 save_state = 2;
269 239
270 cpu_clear_prev_logic_pwrst(cpu); 240 cpu_clear_prev_logic_pwrst(cpu);
271 set_cpu_next_pwrst(cpu, power_state); 241 pwrdm_set_next_pwrst(pm_info->pwrdm, power_state);
272 set_cpu_wakeup_addr(cpu, virt_to_phys(omap4_cpu_resume)); 242 set_cpu_wakeup_addr(cpu, virt_to_phys(omap4_cpu_resume));
273 scu_pwrst_prepare(cpu, power_state); 243 scu_pwrst_prepare(cpu, power_state);
274 l2x0_pwrst_prepare(cpu, save_state); 244 l2x0_pwrst_prepare(cpu, save_state);
@@ -286,7 +256,7 @@ int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state)
286 * domain transition 256 * domain transition
287 */ 257 */
288 wakeup_cpu = smp_processor_id(); 258 wakeup_cpu = smp_processor_id();
289 set_cpu_next_pwrst(wakeup_cpu, PWRDM_POWER_ON); 259 pwrdm_set_next_pwrst(pm_info->pwrdm, PWRDM_POWER_ON);
290 260
291 pwrdm_post_transition(NULL); 261 pwrdm_post_transition(NULL);
292 262
@@ -300,8 +270,8 @@ int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state)
300 */ 270 */
301int __cpuinit omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state) 271int __cpuinit omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state)
302{ 272{
303 unsigned int cpu_state = 0;
304 struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu); 273 struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu);
274 unsigned int cpu_state = 0;
305 275
306 if (omap_rev() == OMAP4430_REV_ES1_0) 276 if (omap_rev() == OMAP4430_REV_ES1_0)
307 return -ENXIO; 277 return -ENXIO;
@@ -309,8 +279,8 @@ int __cpuinit omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state)
309 if (power_state == PWRDM_POWER_OFF) 279 if (power_state == PWRDM_POWER_OFF)
310 cpu_state = 1; 280 cpu_state = 1;
311 281
312 clear_cpu_prev_pwrst(cpu); 282 pwrdm_clear_all_prev_pwrst(pm_info->pwrdm);
313 set_cpu_next_pwrst(cpu, power_state); 283 pwrdm_set_next_pwrst(pm_info->pwrdm, power_state);
314 set_cpu_wakeup_addr(cpu, virt_to_phys(pm_info->secondary_startup)); 284 set_cpu_wakeup_addr(cpu, virt_to_phys(pm_info->secondary_startup));
315 scu_pwrst_prepare(cpu, power_state); 285 scu_pwrst_prepare(cpu, power_state);
316 286
@@ -321,7 +291,7 @@ int __cpuinit omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state)
321 */ 291 */
322 omap4_finish_suspend(cpu_state); 292 omap4_finish_suspend(cpu_state);
323 293
324 set_cpu_next_pwrst(cpu, PWRDM_POWER_ON); 294 pwrdm_set_next_pwrst(pm_info->pwrdm, PWRDM_POWER_ON);
325 return 0; 295 return 0;
326} 296}
327 297
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c
index 707098ecf8d3..7f5626d8fd3e 100644
--- a/arch/arm/mach-omap2/omap-smp.c
+++ b/arch/arm/mach-omap2/omap-smp.c
@@ -19,9 +19,9 @@
19#include <linux/device.h> 19#include <linux/device.h>
20#include <linux/smp.h> 20#include <linux/smp.h>
21#include <linux/io.h> 21#include <linux/io.h>
22#include <linux/irqchip/arm-gic.h>
22 23
23#include <asm/cacheflush.h> 24#include <asm/cacheflush.h>
24#include <asm/hardware/gic.h>
25#include <asm/smp_scu.h> 25#include <asm/smp_scu.h>
26 26
27#include "omap-secure.h" 27#include "omap-secure.h"
@@ -157,7 +157,7 @@ static int __cpuinit omap4_boot_secondary(unsigned int cpu, struct task_struct *
157 booted = true; 157 booted = true;
158 } 158 }
159 159
160 gic_raise_softirq(cpumask_of(cpu), 0); 160 arch_send_wakeup_ipi_mask(cpumask_of(cpu));
161 161
162 /* 162 /*
163 * Now the secondary core is starting up let it run its 163 * Now the secondary core is starting up let it run its
@@ -215,7 +215,7 @@ static void __init omap4_smp_init_cpus(void)
215 * Currently we can't call ioremap here because 215 * Currently we can't call ioremap here because
216 * SoC detection won't work until after init_early. 216 * SoC detection won't work until after init_early.
217 */ 217 */
218 scu_base = OMAP2_L4_IO_ADDRESS(OMAP44XX_SCU_BASE); 218 scu_base = OMAP2_L4_IO_ADDRESS(scu_a9_get_base());
219 BUG_ON(!scu_base); 219 BUG_ON(!scu_base);
220 ncores = scu_get_core_count(scu_base); 220 ncores = scu_get_core_count(scu_base);
221 } else if (cpu_id == CPU_CORTEX_A15) { 221 } else if (cpu_id == CPU_CORTEX_A15) {
@@ -231,8 +231,6 @@ static void __init omap4_smp_init_cpus(void)
231 231
232 for (i = 0; i < ncores; i++) 232 for (i = 0; i < ncores; i++)
233 set_cpu_possible(i, true); 233 set_cpu_possible(i, true);
234
235 set_smp_cross_call(gic_raise_softirq);
236} 234}
237 235
238static void __init omap4_smp_prepare_cpus(unsigned int max_cpus) 236static void __init omap4_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-omap2/omap-wakeupgen.c b/arch/arm/mach-omap2/omap-wakeupgen.c
index 5d3b4f4f81ae..f8bb3b9b6a76 100644
--- a/arch/arm/mach-omap2/omap-wakeupgen.c
+++ b/arch/arm/mach-omap2/omap-wakeupgen.c
@@ -24,8 +24,7 @@
24#include <linux/cpu.h> 24#include <linux/cpu.h>
25#include <linux/notifier.h> 25#include <linux/notifier.h>
26#include <linux/cpu_pm.h> 26#include <linux/cpu_pm.h>
27 27#include <linux/irqchip/arm-gic.h>
28#include <asm/hardware/gic.h>
29 28
30#include "omap-wakeupgen.h" 29#include "omap-wakeupgen.h"
31#include "omap-secure.h" 30#include "omap-secure.h"
@@ -46,7 +45,7 @@
46 45
47static void __iomem *wakeupgen_base; 46static void __iomem *wakeupgen_base;
48static void __iomem *sar_base; 47static void __iomem *sar_base;
49static DEFINE_SPINLOCK(wakeupgen_lock); 48static DEFINE_RAW_SPINLOCK(wakeupgen_lock);
50static unsigned int irq_target_cpu[MAX_IRQS]; 49static unsigned int irq_target_cpu[MAX_IRQS];
51static unsigned int irq_banks = MAX_NR_REG_BANKS; 50static unsigned int irq_banks = MAX_NR_REG_BANKS;
52static unsigned int max_irqs = MAX_IRQS; 51static unsigned int max_irqs = MAX_IRQS;
@@ -134,9 +133,9 @@ static void wakeupgen_mask(struct irq_data *d)
134{ 133{
135 unsigned long flags; 134 unsigned long flags;
136 135
137 spin_lock_irqsave(&wakeupgen_lock, flags); 136 raw_spin_lock_irqsave(&wakeupgen_lock, flags);
138 _wakeupgen_clear(d->irq, irq_target_cpu[d->irq]); 137 _wakeupgen_clear(d->irq, irq_target_cpu[d->irq]);
139 spin_unlock_irqrestore(&wakeupgen_lock, flags); 138 raw_spin_unlock_irqrestore(&wakeupgen_lock, flags);
140} 139}
141 140
142/* 141/*
@@ -146,9 +145,9 @@ static void wakeupgen_unmask(struct irq_data *d)
146{ 145{
147 unsigned long flags; 146 unsigned long flags;
148 147
149 spin_lock_irqsave(&wakeupgen_lock, flags); 148 raw_spin_lock_irqsave(&wakeupgen_lock, flags);
150 _wakeupgen_set(d->irq, irq_target_cpu[d->irq]); 149 _wakeupgen_set(d->irq, irq_target_cpu[d->irq]);
151 spin_unlock_irqrestore(&wakeupgen_lock, flags); 150 raw_spin_unlock_irqrestore(&wakeupgen_lock, flags);
152} 151}
153 152
154#ifdef CONFIG_HOTPLUG_CPU 153#ifdef CONFIG_HOTPLUG_CPU
@@ -189,7 +188,7 @@ static void wakeupgen_irqmask_all(unsigned int cpu, unsigned int set)
189{ 188{
190 unsigned long flags; 189 unsigned long flags;
191 190
192 spin_lock_irqsave(&wakeupgen_lock, flags); 191 raw_spin_lock_irqsave(&wakeupgen_lock, flags);
193 if (set) { 192 if (set) {
194 _wakeupgen_save_masks(cpu); 193 _wakeupgen_save_masks(cpu);
195 _wakeupgen_set_all(cpu, WKG_MASK_ALL); 194 _wakeupgen_set_all(cpu, WKG_MASK_ALL);
@@ -197,7 +196,7 @@ static void wakeupgen_irqmask_all(unsigned int cpu, unsigned int set)
197 _wakeupgen_set_all(cpu, WKG_UNMASK_ALL); 196 _wakeupgen_set_all(cpu, WKG_UNMASK_ALL);
198 _wakeupgen_restore_masks(cpu); 197 _wakeupgen_restore_masks(cpu);
199 } 198 }
200 spin_unlock_irqrestore(&wakeupgen_lock, flags); 199 raw_spin_unlock_irqrestore(&wakeupgen_lock, flags);
201} 200}
202#endif 201#endif
203 202
diff --git a/arch/arm/mach-omap2/omap2-restart.c b/arch/arm/mach-omap2/omap2-restart.c
index be6bc89ab1e8..719b716a4494 100644
--- a/arch/arm/mach-omap2/omap2-restart.c
+++ b/arch/arm/mach-omap2/omap2-restart.c
@@ -13,6 +13,7 @@
13#include <linux/clk.h> 13#include <linux/clk.h>
14#include <linux/io.h> 14#include <linux/io.h>
15 15
16#include "soc.h"
16#include "common.h" 17#include "common.h"
17#include "prm2xxx.h" 18#include "prm2xxx.h"
18 19
@@ -62,4 +63,4 @@ static int __init omap2xxx_common_look_up_clks_for_reset(void)
62 63
63 return 0; 64 return 0;
64} 65}
65core_initcall(omap2xxx_common_look_up_clks_for_reset); 66omap_core_initcall(omap2xxx_common_look_up_clks_for_reset);
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
index 6897ae21bb82..708bb115a27f 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -15,13 +15,14 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/irq.h> 17#include <linux/irq.h>
18#include <linux/irqchip.h>
18#include <linux/platform_device.h> 19#include <linux/platform_device.h>
19#include <linux/memblock.h> 20#include <linux/memblock.h>
20#include <linux/of_irq.h> 21#include <linux/of_irq.h>
21#include <linux/of_platform.h> 22#include <linux/of_platform.h>
22#include <linux/export.h> 23#include <linux/export.h>
24#include <linux/irqchip/arm-gic.h>
23 25
24#include <asm/hardware/gic.h>
25#include <asm/hardware/cache-l2x0.h> 26#include <asm/hardware/cache-l2x0.h>
26#include <asm/mach/map.h> 27#include <asm/mach/map.h>
27#include <asm/memblock.h> 28#include <asm/memblock.h>
@@ -225,7 +226,7 @@ static int __init omap_l2_cache_init(void)
225 226
226 return 0; 227 return 0;
227} 228}
228early_initcall(omap_l2_cache_init); 229omap_early_initcall(omap_l2_cache_init);
229#endif 230#endif
230 231
231void __iomem *omap4_get_sar_ram_base(void) 232void __iomem *omap4_get_sar_ram_base(void)
@@ -253,18 +254,12 @@ static int __init omap4_sar_ram_init(void)
253 254
254 return 0; 255 return 0;
255} 256}
256early_initcall(omap4_sar_ram_init); 257omap_early_initcall(omap4_sar_ram_init);
257
258static struct of_device_id irq_match[] __initdata = {
259 { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
260 { .compatible = "arm,cortex-a15-gic", .data = gic_of_init, },
261 { }
262};
263 258
264void __init omap_gic_of_init(void) 259void __init omap_gic_of_init(void)
265{ 260{
266 omap_wakeupgen_init(); 261 omap_wakeupgen_init();
267 of_irq_init(irq_match); 262 irqchip_init();
268} 263}
269 264
270#if defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) 265#if defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)
diff --git a/arch/arm/mach-omap2/omap44xx.h b/arch/arm/mach-omap2/omap44xx.h
index 43b927b2e2e8..8a515bb74639 100644
--- a/arch/arm/mach-omap2/omap44xx.h
+++ b/arch/arm/mach-omap2/omap44xx.h
@@ -40,7 +40,6 @@
40#define OMAP44XX_GIC_DIST_BASE 0x48241000 40#define OMAP44XX_GIC_DIST_BASE 0x48241000
41#define OMAP44XX_GIC_CPU_BASE 0x48240100 41#define OMAP44XX_GIC_CPU_BASE 0x48240100
42#define OMAP44XX_IRQ_GIC_START 32 42#define OMAP44XX_IRQ_GIC_START 32
43#define OMAP44XX_SCU_BASE 0x48240000
44#define OMAP44XX_LOCAL_TWD_BASE 0x48240600 43#define OMAP44XX_LOCAL_TWD_BASE 0x48240600
45#define OMAP44XX_L2CACHE_BASE 0x48242000 44#define OMAP44XX_L2CACHE_BASE 0x48242000
46#define OMAP44XX_WKUPGEN_BASE 0x48281000 45#define OMAP44XX_WKUPGEN_BASE 0x48281000
diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
index e065daa537c0..381be7ac0c17 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -17,68 +17,15 @@
17 * to control power management and interconnect properties of their 17 * to control power management and interconnect properties of their
18 * devices. 18 * devices.
19 * 19 *
20 * In the medium- to long-term, this code should either be 20 * In the medium- to long-term, this code should be implemented as a
21 * a) implemented via arch-specific pointers in platform_data 21 * proper omap_bus/omap_device in Linux, no more platform_data func
22 * or 22 * pointers
23 * b) implemented as a proper omap_bus/omap_device in Linux, no more
24 * platform_data func pointers
25 * 23 *
26 * 24 *
27 * Guidelines for usage by driver authors:
28 *
29 * 1. These functions are intended to be used by device drivers via
30 * function pointers in struct platform_data. As an example,
31 * omap_device_enable() should be passed to the driver as
32 *
33 * struct foo_driver_platform_data {
34 * ...
35 * int (*device_enable)(struct platform_device *pdev);
36 * ...
37 * }
38 *
39 * Note that the generic "device_enable" name is used, rather than
40 * "omap_device_enable". This is so other architectures can pass in their
41 * own enable/disable functions here.
42 *
43 * This should be populated during device setup:
44 *
45 * ...
46 * pdata->device_enable = omap_device_enable;
47 * ...
48 *
49 * 2. Drivers should first check to ensure the function pointer is not null
50 * before calling it, as in:
51 *
52 * if (pdata->device_enable)
53 * pdata->device_enable(pdev);
54 *
55 * This allows other architectures that don't use similar device_enable()/
56 * device_shutdown() functions to execute normally.
57 *
58 * ...
59 *
60 * Suggested usage by device drivers:
61 *
62 * During device initialization:
63 * device_enable()
64 *
65 * During device idle:
66 * (save remaining device context if necessary)
67 * device_idle();
68 *
69 * During device resume:
70 * device_enable();
71 * (restore context if necessary)
72 *
73 * During device shutdown:
74 * device_shutdown()
75 * (device must be reinitialized at this point to use it again)
76 *
77 */ 25 */
78#undef DEBUG 26#undef DEBUG
79 27
80#include <linux/kernel.h> 28#include <linux/kernel.h>
81#include <linux/export.h>
82#include <linux/platform_device.h> 29#include <linux/platform_device.h>
83#include <linux/slab.h> 30#include <linux/slab.h>
84#include <linux/err.h> 31#include <linux/err.h>
@@ -89,158 +36,12 @@
89#include <linux/of.h> 36#include <linux/of.h>
90#include <linux/notifier.h> 37#include <linux/notifier.h>
91 38
39#include "soc.h"
92#include "omap_device.h" 40#include "omap_device.h"
93#include "omap_hwmod.h" 41#include "omap_hwmod.h"
94 42
95/* These parameters are passed to _omap_device_{de,}activate() */
96#define USE_WAKEUP_LAT 0
97#define IGNORE_WAKEUP_LAT 1
98
99static int omap_early_device_register(struct platform_device *pdev);
100
101static struct omap_device_pm_latency omap_default_latency[] = {
102 {
103 .deactivate_func = omap_device_idle_hwmods,
104 .activate_func = omap_device_enable_hwmods,
105 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
106 }
107};
108
109/* Private functions */ 43/* Private functions */
110 44
111/**
112 * _omap_device_activate - increase device readiness
113 * @od: struct omap_device *
114 * @ignore_lat: increase to latency target (0) or full readiness (1)?
115 *
116 * Increase readiness of omap_device @od (thus decreasing device
117 * wakeup latency, but consuming more power). If @ignore_lat is
118 * IGNORE_WAKEUP_LAT, make the omap_device fully active. Otherwise,
119 * if @ignore_lat is USE_WAKEUP_LAT, and the device's maximum wakeup
120 * latency is greater than the requested maximum wakeup latency, step
121 * backwards in the omap_device_pm_latency table to ensure the
122 * device's maximum wakeup latency is less than or equal to the
123 * requested maximum wakeup latency. Returns 0.
124 */
125static int _omap_device_activate(struct omap_device *od, u8 ignore_lat)
126{
127 struct timespec a, b, c;
128
129 dev_dbg(&od->pdev->dev, "omap_device: activating\n");
130
131 while (od->pm_lat_level > 0) {
132 struct omap_device_pm_latency *odpl;
133 unsigned long long act_lat = 0;
134
135 od->pm_lat_level--;
136
137 odpl = od->pm_lats + od->pm_lat_level;
138
139 if (!ignore_lat &&
140 (od->dev_wakeup_lat <= od->_dev_wakeup_lat_limit))
141 break;
142
143 read_persistent_clock(&a);
144
145 /* XXX check return code */
146 odpl->activate_func(od);
147
148 read_persistent_clock(&b);
149
150 c = timespec_sub(b, a);
151 act_lat = timespec_to_ns(&c);
152
153 dev_dbg(&od->pdev->dev,
154 "omap_device: pm_lat %d: activate: elapsed time %llu nsec\n",
155 od->pm_lat_level, act_lat);
156
157 if (act_lat > odpl->activate_lat) {
158 odpl->activate_lat_worst = act_lat;
159 if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) {
160 odpl->activate_lat = act_lat;
161 dev_dbg(&od->pdev->dev,
162 "new worst case activate latency %d: %llu\n",
163 od->pm_lat_level, act_lat);
164 } else
165 dev_warn(&od->pdev->dev,
166 "activate latency %d higher than expected. (%llu > %d)\n",
167 od->pm_lat_level, act_lat,
168 odpl->activate_lat);
169 }
170
171 od->dev_wakeup_lat -= odpl->activate_lat;
172 }
173
174 return 0;
175}
176
177/**
178 * _omap_device_deactivate - decrease device readiness
179 * @od: struct omap_device *
180 * @ignore_lat: decrease to latency target (0) or full inactivity (1)?
181 *
182 * Decrease readiness of omap_device @od (thus increasing device
183 * wakeup latency, but conserving power). If @ignore_lat is
184 * IGNORE_WAKEUP_LAT, make the omap_device fully inactive. Otherwise,
185 * if @ignore_lat is USE_WAKEUP_LAT, and the device's maximum wakeup
186 * latency is less than the requested maximum wakeup latency, step
187 * forwards in the omap_device_pm_latency table to ensure the device's
188 * maximum wakeup latency is less than or equal to the requested
189 * maximum wakeup latency. Returns 0.
190 */
191static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat)
192{
193 struct timespec a, b, c;
194
195 dev_dbg(&od->pdev->dev, "omap_device: deactivating\n");
196
197 while (od->pm_lat_level < od->pm_lats_cnt) {
198 struct omap_device_pm_latency *odpl;
199 unsigned long long deact_lat = 0;
200
201 odpl = od->pm_lats + od->pm_lat_level;
202
203 if (!ignore_lat &&
204 ((od->dev_wakeup_lat + odpl->activate_lat) >
205 od->_dev_wakeup_lat_limit))
206 break;
207
208 read_persistent_clock(&a);
209
210 /* XXX check return code */
211 odpl->deactivate_func(od);
212
213 read_persistent_clock(&b);
214
215 c = timespec_sub(b, a);
216 deact_lat = timespec_to_ns(&c);
217
218 dev_dbg(&od->pdev->dev,
219 "omap_device: pm_lat %d: deactivate: elapsed time %llu nsec\n",
220 od->pm_lat_level, deact_lat);
221
222 if (deact_lat > odpl->deactivate_lat) {
223 odpl->deactivate_lat_worst = deact_lat;
224 if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) {
225 odpl->deactivate_lat = deact_lat;
226 dev_dbg(&od->pdev->dev,
227 "new worst case deactivate latency %d: %llu\n",
228 od->pm_lat_level, deact_lat);
229 } else
230 dev_warn(&od->pdev->dev,
231 "deactivate latency %d higher than expected. (%llu > %d)\n",
232 od->pm_lat_level, deact_lat,
233 odpl->deactivate_lat);
234 }
235
236 od->dev_wakeup_lat += odpl->activate_lat;
237
238 od->pm_lat_level++;
239 }
240
241 return 0;
242}
243
244static void _add_clkdev(struct omap_device *od, const char *clk_alias, 45static void _add_clkdev(struct omap_device *od, const char *clk_alias,
245 const char *clk_name) 46 const char *clk_name)
246{ 47{
@@ -315,9 +116,6 @@ static void _add_hwmod_clocks_clkdev(struct omap_device *od,
315 * @oh: ptr to the single omap_hwmod that backs this omap_device 116 * @oh: ptr to the single omap_hwmod that backs this omap_device
316 * @pdata: platform_data ptr to associate with the platform_device 117 * @pdata: platform_data ptr to associate with the platform_device
317 * @pdata_len: amount of memory pointed to by @pdata 118 * @pdata_len: amount of memory pointed to by @pdata
318 * @pm_lats: pointer to a omap_device_pm_latency array for this device
319 * @pm_lats_cnt: ARRAY_SIZE() of @pm_lats
320 * @is_early_device: should the device be registered as an early device or not
321 * 119 *
322 * Function for building an omap_device already registered from device-tree 120 * Function for building an omap_device already registered from device-tree
323 * 121 *
@@ -356,7 +154,7 @@ static int omap_device_build_from_dt(struct platform_device *pdev)
356 hwmods[i] = oh; 154 hwmods[i] = oh;
357 } 155 }
358 156
359 od = omap_device_alloc(pdev, hwmods, oh_cnt, NULL, 0); 157 od = omap_device_alloc(pdev, hwmods, oh_cnt);
360 if (!od) { 158 if (!od) {
361 dev_err(&pdev->dev, "Cannot allocate omap_device for :%s\n", 159 dev_err(&pdev->dev, "Cannot allocate omap_device for :%s\n",
362 oh_name); 160 oh_name);
@@ -407,6 +205,39 @@ static int _omap_device_notifier_call(struct notifier_block *nb,
407 return NOTIFY_DONE; 205 return NOTIFY_DONE;
408} 206}
409 207
208/**
209 * _omap_device_enable_hwmods - call omap_hwmod_enable() on all hwmods
210 * @od: struct omap_device *od
211 *
212 * Enable all underlying hwmods. Returns 0.
213 */
214static int _omap_device_enable_hwmods(struct omap_device *od)
215{
216 int i;
217
218 for (i = 0; i < od->hwmods_cnt; i++)
219 omap_hwmod_enable(od->hwmods[i]);
220
221 /* XXX pass along return value here? */
222 return 0;
223}
224
225/**
226 * _omap_device_idle_hwmods - call omap_hwmod_idle() on all hwmods
227 * @od: struct omap_device *od
228 *
229 * Idle all underlying hwmods. Returns 0.
230 */
231static int _omap_device_idle_hwmods(struct omap_device *od)
232{
233 int i;
234
235 for (i = 0; i < od->hwmods_cnt; i++)
236 omap_hwmod_idle(od->hwmods[i]);
237
238 /* XXX pass along return value here? */
239 return 0;
240}
410 241
411/* Public functions for use by core code */ 242/* Public functions for use by core code */
412 243
@@ -526,18 +357,14 @@ static int _od_fill_dma_resources(struct omap_device *od,
526 * @oh: ptr to the single omap_hwmod that backs this omap_device 357 * @oh: ptr to the single omap_hwmod that backs this omap_device
527 * @pdata: platform_data ptr to associate with the platform_device 358 * @pdata: platform_data ptr to associate with the platform_device
528 * @pdata_len: amount of memory pointed to by @pdata 359 * @pdata_len: amount of memory pointed to by @pdata
529 * @pm_lats: pointer to a omap_device_pm_latency array for this device
530 * @pm_lats_cnt: ARRAY_SIZE() of @pm_lats
531 * 360 *
532 * Convenience function for allocating an omap_device structure and filling 361 * Convenience function for allocating an omap_device structure and filling
533 * hwmods, resources and pm_latency attributes. 362 * hwmods, and resources.
534 * 363 *
535 * Returns an struct omap_device pointer or ERR_PTR() on error; 364 * Returns an struct omap_device pointer or ERR_PTR() on error;
536 */ 365 */
537struct omap_device *omap_device_alloc(struct platform_device *pdev, 366struct omap_device *omap_device_alloc(struct platform_device *pdev,
538 struct omap_hwmod **ohs, int oh_cnt, 367 struct omap_hwmod **ohs, int oh_cnt)
539 struct omap_device_pm_latency *pm_lats,
540 int pm_lats_cnt)
541{ 368{
542 int ret = -ENOMEM; 369 int ret = -ENOMEM;
543 struct omap_device *od; 370 struct omap_device *od;
@@ -626,18 +453,6 @@ struct omap_device *omap_device_alloc(struct platform_device *pdev,
626 goto oda_exit3; 453 goto oda_exit3;
627 454
628have_everything: 455have_everything:
629 if (!pm_lats) {
630 pm_lats = omap_default_latency;
631 pm_lats_cnt = ARRAY_SIZE(omap_default_latency);
632 }
633
634 od->pm_lats_cnt = pm_lats_cnt;
635 od->pm_lats = kmemdup(pm_lats,
636 sizeof(struct omap_device_pm_latency) * pm_lats_cnt,
637 GFP_KERNEL);
638 if (!od->pm_lats)
639 goto oda_exit3;
640
641 pdev->archdata.od = od; 456 pdev->archdata.od = od;
642 457
643 for (i = 0; i < oh_cnt; i++) { 458 for (i = 0; i < oh_cnt; i++) {
@@ -663,7 +478,6 @@ void omap_device_delete(struct omap_device *od)
663 return; 478 return;
664 479
665 od->pdev->archdata.od = NULL; 480 od->pdev->archdata.od = NULL;
666 kfree(od->pm_lats);
667 kfree(od->hwmods); 481 kfree(od->hwmods);
668 kfree(od); 482 kfree(od);
669} 483}
@@ -675,9 +489,6 @@ void omap_device_delete(struct omap_device *od)
675 * @oh: ptr to the single omap_hwmod that backs this omap_device 489 * @oh: ptr to the single omap_hwmod that backs this omap_device
676 * @pdata: platform_data ptr to associate with the platform_device 490 * @pdata: platform_data ptr to associate with the platform_device
677 * @pdata_len: amount of memory pointed to by @pdata 491 * @pdata_len: amount of memory pointed to by @pdata
678 * @pm_lats: pointer to a omap_device_pm_latency array for this device
679 * @pm_lats_cnt: ARRAY_SIZE() of @pm_lats
680 * @is_early_device: should the device be registered as an early device or not
681 * 492 *
682 * Convenience function for building and registering a single 493 * Convenience function for building and registering a single
683 * omap_device record, which in turn builds and registers a 494 * omap_device record, which in turn builds and registers a
@@ -685,11 +496,10 @@ void omap_device_delete(struct omap_device *od)
685 * information. Returns ERR_PTR(-EINVAL) if @oh is NULL; otherwise, 496 * information. Returns ERR_PTR(-EINVAL) if @oh is NULL; otherwise,
686 * passes along the return value of omap_device_build_ss(). 497 * passes along the return value of omap_device_build_ss().
687 */ 498 */
688struct platform_device __init *omap_device_build(const char *pdev_name, int pdev_id, 499struct platform_device __init *omap_device_build(const char *pdev_name,
689 struct omap_hwmod *oh, void *pdata, 500 int pdev_id,
690 int pdata_len, 501 struct omap_hwmod *oh,
691 struct omap_device_pm_latency *pm_lats, 502 void *pdata, int pdata_len)
692 int pm_lats_cnt, int is_early_device)
693{ 503{
694 struct omap_hwmod *ohs[] = { oh }; 504 struct omap_hwmod *ohs[] = { oh };
695 505
@@ -697,8 +507,7 @@ struct platform_device __init *omap_device_build(const char *pdev_name, int pdev
697 return ERR_PTR(-EINVAL); 507 return ERR_PTR(-EINVAL);
698 508
699 return omap_device_build_ss(pdev_name, pdev_id, ohs, 1, pdata, 509 return omap_device_build_ss(pdev_name, pdev_id, ohs, 1, pdata,
700 pdata_len, pm_lats, pm_lats_cnt, 510 pdata_len);
701 is_early_device);
702} 511}
703 512
704/** 513/**
@@ -708,9 +517,6 @@ struct platform_device __init *omap_device_build(const char *pdev_name, int pdev
708 * @oh: ptr to the single omap_hwmod that backs this omap_device 517 * @oh: ptr to the single omap_hwmod that backs this omap_device
709 * @pdata: platform_data ptr to associate with the platform_device 518 * @pdata: platform_data ptr to associate with the platform_device
710 * @pdata_len: amount of memory pointed to by @pdata 519 * @pdata_len: amount of memory pointed to by @pdata
711 * @pm_lats: pointer to a omap_device_pm_latency array for this device
712 * @pm_lats_cnt: ARRAY_SIZE() of @pm_lats
713 * @is_early_device: should the device be registered as an early device or not
714 * 520 *
715 * Convenience function for building and registering an omap_device 521 * Convenience function for building and registering an omap_device
716 * subsystem record. Subsystem records consist of multiple 522 * subsystem record. Subsystem records consist of multiple
@@ -718,11 +524,11 @@ struct platform_device __init *omap_device_build(const char *pdev_name, int pdev
718 * platform_device record. Returns an ERR_PTR() on error, or passes 524 * platform_device record. Returns an ERR_PTR() on error, or passes
719 * along the return value of omap_device_register(). 525 * along the return value of omap_device_register().
720 */ 526 */
721struct platform_device __init *omap_device_build_ss(const char *pdev_name, int pdev_id, 527struct platform_device __init *omap_device_build_ss(const char *pdev_name,
722 struct omap_hwmod **ohs, int oh_cnt, 528 int pdev_id,
723 void *pdata, int pdata_len, 529 struct omap_hwmod **ohs,
724 struct omap_device_pm_latency *pm_lats, 530 int oh_cnt, void *pdata,
725 int pm_lats_cnt, int is_early_device) 531 int pdata_len)
726{ 532{
727 int ret = -ENOMEM; 533 int ret = -ENOMEM;
728 struct platform_device *pdev; 534 struct platform_device *pdev;
@@ -746,7 +552,7 @@ struct platform_device __init *omap_device_build_ss(const char *pdev_name, int p
746 else 552 else
747 dev_set_name(&pdev->dev, "%s", pdev->name); 553 dev_set_name(&pdev->dev, "%s", pdev->name);
748 554
749 od = omap_device_alloc(pdev, ohs, oh_cnt, pm_lats, pm_lats_cnt); 555 od = omap_device_alloc(pdev, ohs, oh_cnt);
750 if (IS_ERR(od)) 556 if (IS_ERR(od))
751 goto odbs_exit1; 557 goto odbs_exit1;
752 558
@@ -754,10 +560,7 @@ struct platform_device __init *omap_device_build_ss(const char *pdev_name, int p
754 if (ret) 560 if (ret)
755 goto odbs_exit2; 561 goto odbs_exit2;
756 562
757 if (is_early_device) 563 ret = omap_device_register(pdev);
758 ret = omap_early_device_register(pdev);
759 else
760 ret = omap_device_register(pdev);
761 if (ret) 564 if (ret)
762 goto odbs_exit2; 565 goto odbs_exit2;
763 566
@@ -774,24 +577,6 @@ odbs_exit:
774 return ERR_PTR(ret); 577 return ERR_PTR(ret);
775} 578}
776 579
777/**
778 * omap_early_device_register - register an omap_device as an early platform
779 * device.
780 * @od: struct omap_device * to register
781 *
782 * Register the omap_device structure. This currently just calls
783 * platform_early_add_device() on the underlying platform_device.
784 * Returns 0 by default.
785 */
786static int __init omap_early_device_register(struct platform_device *pdev)
787{
788 struct platform_device *devices[1];
789
790 devices[0] = pdev;
791 early_platform_add_devices(devices, 1);
792 return 0;
793}
794
795#ifdef CONFIG_PM_RUNTIME 580#ifdef CONFIG_PM_RUNTIME
796static int _od_runtime_suspend(struct device *dev) 581static int _od_runtime_suspend(struct device *dev)
797{ 582{
@@ -902,10 +687,9 @@ int omap_device_register(struct platform_device *pdev)
902 * to be accessible and ready to operate. This generally involves 687 * to be accessible and ready to operate. This generally involves
903 * enabling clocks, setting SYSCONFIG registers; and in the future may 688 * enabling clocks, setting SYSCONFIG registers; and in the future may
904 * involve remuxing pins. Device drivers should call this function 689 * involve remuxing pins. Device drivers should call this function
905 * (through platform_data function pointers) where they would normally 690 * indirectly via pm_runtime_get*(). Returns -EINVAL if called when
906 * enable clocks, etc. Returns -EINVAL if called when the omap_device 691 * the omap_device is already enabled, or passes along the return
907 * is already enabled, or passes along the return value of 692 * value of _omap_device_enable_hwmods().
908 * _omap_device_activate().
909 */ 693 */
910int omap_device_enable(struct platform_device *pdev) 694int omap_device_enable(struct platform_device *pdev)
911{ 695{
@@ -921,14 +705,8 @@ int omap_device_enable(struct platform_device *pdev)
921 return -EINVAL; 705 return -EINVAL;
922 } 706 }
923 707
924 /* Enable everything if we're enabling this device from scratch */ 708 ret = _omap_device_enable_hwmods(od);
925 if (od->_state == OMAP_DEVICE_STATE_UNKNOWN)
926 od->pm_lat_level = od->pm_lats_cnt;
927
928 ret = _omap_device_activate(od, IGNORE_WAKEUP_LAT);
929 709
930 od->dev_wakeup_lat = 0;
931 od->_dev_wakeup_lat_limit = UINT_MAX;
932 od->_state = OMAP_DEVICE_STATE_ENABLED; 710 od->_state = OMAP_DEVICE_STATE_ENABLED;
933 711
934 return ret; 712 return ret;
@@ -938,14 +716,10 @@ int omap_device_enable(struct platform_device *pdev)
938 * omap_device_idle - idle an omap_device 716 * omap_device_idle - idle an omap_device
939 * @od: struct omap_device * to idle 717 * @od: struct omap_device * to idle
940 * 718 *
941 * Idle omap_device @od by calling as many .deactivate_func() entries 719 * Idle omap_device @od. Device drivers call this function indirectly
942 * in the omap_device's pm_lats table as is possible without exceeding 720 * via pm_runtime_put*(). Returns -EINVAL if the omap_device is not
943 * the device's maximum wakeup latency limit, pm_lat_limit. Device
944 * drivers should call this function (through platform_data function
945 * pointers) where they would normally disable clocks after operations
946 * complete, etc.. Returns -EINVAL if the omap_device is not
947 * currently enabled, or passes along the return value of 721 * currently enabled, or passes along the return value of
948 * _omap_device_deactivate(). 722 * _omap_device_idle_hwmods().
949 */ 723 */
950int omap_device_idle(struct platform_device *pdev) 724int omap_device_idle(struct platform_device *pdev)
951{ 725{
@@ -961,7 +735,7 @@ int omap_device_idle(struct platform_device *pdev)
961 return -EINVAL; 735 return -EINVAL;
962 } 736 }
963 737
964 ret = _omap_device_deactivate(od, USE_WAKEUP_LAT); 738 ret = _omap_device_idle_hwmods(od);
965 739
966 od->_state = OMAP_DEVICE_STATE_IDLE; 740 od->_state = OMAP_DEVICE_STATE_IDLE;
967 741
@@ -969,42 +743,6 @@ int omap_device_idle(struct platform_device *pdev)
969} 743}
970 744
971/** 745/**
972 * omap_device_shutdown - shut down an omap_device
973 * @od: struct omap_device * to shut down
974 *
975 * Shut down omap_device @od by calling all .deactivate_func() entries
976 * in the omap_device's pm_lats table and then shutting down all of
977 * the underlying omap_hwmods. Used when a device is being "removed"
978 * or a device driver is being unloaded. Returns -EINVAL if the
979 * omap_device is not currently enabled or idle, or passes along the
980 * return value of _omap_device_deactivate().
981 */
982int omap_device_shutdown(struct platform_device *pdev)
983{
984 int ret, i;
985 struct omap_device *od;
986
987 od = to_omap_device(pdev);
988
989 if (od->_state != OMAP_DEVICE_STATE_ENABLED &&
990 od->_state != OMAP_DEVICE_STATE_IDLE) {
991 dev_warn(&pdev->dev,
992 "omap_device: %s() called from invalid state %d\n",
993 __func__, od->_state);
994 return -EINVAL;
995 }
996
997 ret = _omap_device_deactivate(od, IGNORE_WAKEUP_LAT);
998
999 for (i = 0; i < od->hwmods_cnt; i++)
1000 omap_hwmod_shutdown(od->hwmods[i]);
1001
1002 od->_state = OMAP_DEVICE_STATE_SHUTDOWN;
1003
1004 return ret;
1005}
1006
1007/**
1008 * omap_device_assert_hardreset - set a device's hardreset line 746 * omap_device_assert_hardreset - set a device's hardreset line
1009 * @pdev: struct platform_device * to reset 747 * @pdev: struct platform_device * to reset
1010 * @name: const char * name of the reset line 748 * @name: const char * name of the reset line
@@ -1060,86 +798,6 @@ int omap_device_deassert_hardreset(struct platform_device *pdev,
1060} 798}
1061 799
1062/** 800/**
1063 * omap_device_align_pm_lat - activate/deactivate device to match wakeup lat lim
1064 * @od: struct omap_device *
1065 *
1066 * When a device's maximum wakeup latency limit changes, call some of
1067 * the .activate_func or .deactivate_func function pointers in the
1068 * omap_device's pm_lats array to ensure that the device's maximum
1069 * wakeup latency is less than or equal to the new latency limit.
1070 * Intended to be called by OMAP PM code whenever a device's maximum
1071 * wakeup latency limit changes (e.g., via
1072 * omap_pm_set_dev_wakeup_lat()). Returns 0 if nothing needs to be
1073 * done (e.g., if the omap_device is not currently idle, or if the
1074 * wakeup latency is already current with the new limit) or passes
1075 * along the return value of _omap_device_deactivate() or
1076 * _omap_device_activate().
1077 */
1078int omap_device_align_pm_lat(struct platform_device *pdev,
1079 u32 new_wakeup_lat_limit)
1080{
1081 int ret = -EINVAL;
1082 struct omap_device *od;
1083
1084 od = to_omap_device(pdev);
1085
1086 if (new_wakeup_lat_limit == od->dev_wakeup_lat)
1087 return 0;
1088
1089 od->_dev_wakeup_lat_limit = new_wakeup_lat_limit;
1090
1091 if (od->_state != OMAP_DEVICE_STATE_IDLE)
1092 return 0;
1093 else if (new_wakeup_lat_limit > od->dev_wakeup_lat)
1094 ret = _omap_device_deactivate(od, USE_WAKEUP_LAT);
1095 else if (new_wakeup_lat_limit < od->dev_wakeup_lat)
1096 ret = _omap_device_activate(od, USE_WAKEUP_LAT);
1097
1098 return ret;
1099}
1100
1101/**
1102 * omap_device_get_pwrdm - return the powerdomain * associated with @od
1103 * @od: struct omap_device *
1104 *
1105 * Return the powerdomain associated with the first underlying
1106 * omap_hwmod for this omap_device. Intended for use by core OMAP PM
1107 * code. Returns NULL on error or a struct powerdomain * upon
1108 * success.
1109 */
1110struct powerdomain *omap_device_get_pwrdm(struct omap_device *od)
1111{
1112 /*
1113 * XXX Assumes that all omap_hwmod powerdomains are identical.
1114 * This may not necessarily be true. There should be a sanity
1115 * check in here to WARN() if any difference appears.
1116 */
1117 if (!od->hwmods_cnt)
1118 return NULL;
1119
1120 return omap_hwmod_get_pwrdm(od->hwmods[0]);
1121}
1122
1123/**
1124 * omap_device_get_mpu_rt_va - return the MPU's virtual addr for the hwmod base
1125 * @od: struct omap_device *
1126 *
1127 * Return the MPU's virtual address for the base of the hwmod, from
1128 * the ioremap() that the hwmod code does. Only valid if there is one
1129 * hwmod associated with this device. Returns NULL if there are zero
1130 * or more than one hwmods associated with this omap_device;
1131 * otherwise, passes along the return value from
1132 * omap_hwmod_get_mpu_rt_va().
1133 */
1134void __iomem *omap_device_get_rt_va(struct omap_device *od)
1135{
1136 if (od->hwmods_cnt != 1)
1137 return NULL;
1138
1139 return omap_hwmod_get_mpu_rt_va(od->hwmods[0]);
1140}
1141
1142/**
1143 * omap_device_get_by_hwmod_name() - convert a hwmod name to 801 * omap_device_get_by_hwmod_name() - convert a hwmod name to
1144 * device pointer. 802 * device pointer.
1145 * @oh_name: name of the hwmod device 803 * @oh_name: name of the hwmod device
@@ -1173,82 +831,6 @@ struct device *omap_device_get_by_hwmod_name(const char *oh_name)
1173 831
1174 return &oh->od->pdev->dev; 832 return &oh->od->pdev->dev;
1175} 833}
1176EXPORT_SYMBOL(omap_device_get_by_hwmod_name);
1177
1178/*
1179 * Public functions intended for use in omap_device_pm_latency
1180 * .activate_func and .deactivate_func function pointers
1181 */
1182
1183/**
1184 * omap_device_enable_hwmods - call omap_hwmod_enable() on all hwmods
1185 * @od: struct omap_device *od
1186 *
1187 * Enable all underlying hwmods. Returns 0.
1188 */
1189int omap_device_enable_hwmods(struct omap_device *od)
1190{
1191 int i;
1192
1193 for (i = 0; i < od->hwmods_cnt; i++)
1194 omap_hwmod_enable(od->hwmods[i]);
1195
1196 /* XXX pass along return value here? */
1197 return 0;
1198}
1199
1200/**
1201 * omap_device_idle_hwmods - call omap_hwmod_idle() on all hwmods
1202 * @od: struct omap_device *od
1203 *
1204 * Idle all underlying hwmods. Returns 0.
1205 */
1206int omap_device_idle_hwmods(struct omap_device *od)
1207{
1208 int i;
1209
1210 for (i = 0; i < od->hwmods_cnt; i++)
1211 omap_hwmod_idle(od->hwmods[i]);
1212
1213 /* XXX pass along return value here? */
1214 return 0;
1215}
1216
1217/**
1218 * omap_device_disable_clocks - disable all main and interface clocks
1219 * @od: struct omap_device *od
1220 *
1221 * Disable the main functional clock and interface clock for all of the
1222 * omap_hwmods associated with the omap_device. Returns 0.
1223 */
1224int omap_device_disable_clocks(struct omap_device *od)
1225{
1226 int i;
1227
1228 for (i = 0; i < od->hwmods_cnt; i++)
1229 omap_hwmod_disable_clocks(od->hwmods[i]);
1230
1231 /* XXX pass along return value here? */
1232 return 0;
1233}
1234
1235/**
1236 * omap_device_enable_clocks - enable all main and interface clocks
1237 * @od: struct omap_device *od
1238 *
1239 * Enable the main functional clock and interface clock for all of the
1240 * omap_hwmods associated with the omap_device. Returns 0.
1241 */
1242int omap_device_enable_clocks(struct omap_device *od)
1243{
1244 int i;
1245
1246 for (i = 0; i < od->hwmods_cnt; i++)
1247 omap_hwmod_enable_clocks(od->hwmods[i]);
1248
1249 /* XXX pass along return value here? */
1250 return 0;
1251}
1252 834
1253static struct notifier_block platform_nb = { 835static struct notifier_block platform_nb = {
1254 .notifier_call = _omap_device_notifier_call, 836 .notifier_call = _omap_device_notifier_call,
@@ -1259,7 +841,7 @@ static int __init omap_device_init(void)
1259 bus_register_notifier(&platform_bus_type, &platform_nb); 841 bus_register_notifier(&platform_bus_type, &platform_nb);
1260 return 0; 842 return 0;
1261} 843}
1262core_initcall(omap_device_init); 844omap_core_initcall(omap_device_init);
1263 845
1264/** 846/**
1265 * omap_device_late_idle - idle devices without drivers 847 * omap_device_late_idle - idle devices without drivers
@@ -1297,4 +879,4 @@ static int __init omap_device_late_init(void)
1297 bus_for_each_dev(&platform_bus_type, NULL, NULL, omap_device_late_idle); 879 bus_for_each_dev(&platform_bus_type, NULL, NULL, omap_device_late_idle);
1298 return 0; 880 return 0;
1299} 881}
1300late_initcall(omap_device_late_init); 882omap_late_initcall(omap_device_late_init);
diff --git a/arch/arm/mach-omap2/omap_device.h b/arch/arm/mach-omap2/omap_device.h
index 0933c599bf89..044c31d50e5b 100644
--- a/arch/arm/mach-omap2/omap_device.h
+++ b/arch/arm/mach-omap2/omap_device.h
@@ -13,20 +13,12 @@
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
14 * published by the Free Software Foundation. 14 * published by the Free Software Foundation.
15 * 15 *
16 * Eventually this type of functionality should either be 16 * This type of functionality should be implemented as a proper
17 * a) implemented via arch-specific pointers in platform_device 17 * omap_bus/omap_device in Linux.
18 * or
19 * b) implemented as a proper omap_bus/omap_device in Linux, no more
20 * platform_device
21 * 18 *
22 * omap_device differs from omap_hwmod in that it includes external 19 * omap_device differs from omap_hwmod in that it includes external
23 * (e.g., board- and system-level) integration details. omap_hwmod 20 * (e.g., board- and system-level) integration details. omap_hwmod
24 * stores hardware data that is invariant for a given OMAP chip. 21 * stores hardware data that is invariant for a given OMAP chip.
25 *
26 * To do:
27 * - GPIO integration
28 * - regulator integration
29 *
30 */ 22 */
31#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_DEVICE_H 23#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_DEVICE_H
32#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_DEVICE_H 24#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_DEVICE_H
@@ -45,19 +37,14 @@ extern struct dev_pm_domain omap_device_pm_domain;
45#define OMAP_DEVICE_STATE_SHUTDOWN 3 37#define OMAP_DEVICE_STATE_SHUTDOWN 3
46 38
47/* omap_device.flags values */ 39/* omap_device.flags values */
48#define OMAP_DEVICE_SUSPENDED BIT(0) 40#define OMAP_DEVICE_SUSPENDED BIT(0)
49#define OMAP_DEVICE_NO_IDLE_ON_SUSPEND BIT(1) 41#define OMAP_DEVICE_NO_IDLE_ON_SUSPEND BIT(1)
50 42
51/** 43/**
52 * struct omap_device - omap_device wrapper for platform_devices 44 * struct omap_device - omap_device wrapper for platform_devices
53 * @pdev: platform_device 45 * @pdev: platform_device
54 * @hwmods: (one .. many per omap_device) 46 * @hwmods: (one .. many per omap_device)
55 * @hwmods_cnt: ARRAY_SIZE() of @hwmods 47 * @hwmods_cnt: ARRAY_SIZE() of @hwmods
56 * @pm_lats: ptr to an omap_device_pm_latency table
57 * @pm_lats_cnt: ARRAY_SIZE() of what is passed to @pm_lats
58 * @pm_lat_level: array index of the last odpl entry executed - -1 if never
59 * @dev_wakeup_lat: dev wakeup latency in nanoseconds
60 * @_dev_wakeup_lat_limit: dev wakeup latency limit in nsec - set by OMAP PM
61 * @_state: one of OMAP_DEVICE_STATE_* (see above) 48 * @_state: one of OMAP_DEVICE_STATE_* (see above)
62 * @flags: device flags 49 * @flags: device flags
63 * @_driver_status: one of BUS_NOTIFY_*_DRIVER from <linux/device.h> 50 * @_driver_status: one of BUS_NOTIFY_*_DRIVER from <linux/device.h>
@@ -71,12 +58,7 @@ extern struct dev_pm_domain omap_device_pm_domain;
71struct omap_device { 58struct omap_device {
72 struct platform_device *pdev; 59 struct platform_device *pdev;
73 struct omap_hwmod **hwmods; 60 struct omap_hwmod **hwmods;
74 struct omap_device_pm_latency *pm_lats;
75 u32 dev_wakeup_lat;
76 u32 _dev_wakeup_lat_limit;
77 unsigned long _driver_status; 61 unsigned long _driver_status;
78 u8 pm_lats_cnt;
79 s8 pm_lat_level;
80 u8 hwmods_cnt; 62 u8 hwmods_cnt;
81 u8 _state; 63 u8 _state;
82 u8 flags; 64 u8 flags;
@@ -86,36 +68,25 @@ struct omap_device {
86 68
87int omap_device_enable(struct platform_device *pdev); 69int omap_device_enable(struct platform_device *pdev);
88int omap_device_idle(struct platform_device *pdev); 70int omap_device_idle(struct platform_device *pdev);
89int omap_device_shutdown(struct platform_device *pdev);
90 71
91/* Core code interface */ 72/* Core code interface */
92 73
93struct platform_device *omap_device_build(const char *pdev_name, int pdev_id, 74struct platform_device *omap_device_build(const char *pdev_name, int pdev_id,
94 struct omap_hwmod *oh, void *pdata, 75 struct omap_hwmod *oh, void *pdata,
95 int pdata_len, 76 int pdata_len);
96 struct omap_device_pm_latency *pm_lats,
97 int pm_lats_cnt, int is_early_device);
98 77
99struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id, 78struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
100 struct omap_hwmod **oh, int oh_cnt, 79 struct omap_hwmod **oh, int oh_cnt,
101 void *pdata, int pdata_len, 80 void *pdata, int pdata_len);
102 struct omap_device_pm_latency *pm_lats,
103 int pm_lats_cnt, int is_early_device);
104 81
105struct omap_device *omap_device_alloc(struct platform_device *pdev, 82struct omap_device *omap_device_alloc(struct platform_device *pdev,
106 struct omap_hwmod **ohs, int oh_cnt, 83 struct omap_hwmod **ohs, int oh_cnt);
107 struct omap_device_pm_latency *pm_lats,
108 int pm_lats_cnt);
109void omap_device_delete(struct omap_device *od); 84void omap_device_delete(struct omap_device *od);
110int omap_device_register(struct platform_device *pdev); 85int omap_device_register(struct platform_device *pdev);
111 86
112void __iomem *omap_device_get_rt_va(struct omap_device *od);
113struct device *omap_device_get_by_hwmod_name(const char *oh_name); 87struct device *omap_device_get_by_hwmod_name(const char *oh_name);
114 88
115/* OMAP PM interface */ 89/* OMAP PM interface */
116int omap_device_align_pm_lat(struct platform_device *pdev,
117 u32 new_wakeup_lat_limit);
118struct powerdomain *omap_device_get_pwrdm(struct omap_device *od);
119int omap_device_get_context_loss_count(struct platform_device *pdev); 90int omap_device_get_context_loss_count(struct platform_device *pdev);
120 91
121/* Other */ 92/* Other */
@@ -124,40 +95,6 @@ int omap_device_assert_hardreset(struct platform_device *pdev,
124 const char *name); 95 const char *name);
125int omap_device_deassert_hardreset(struct platform_device *pdev, 96int omap_device_deassert_hardreset(struct platform_device *pdev,
126 const char *name); 97 const char *name);
127int omap_device_idle_hwmods(struct omap_device *od);
128int omap_device_enable_hwmods(struct omap_device *od);
129
130int omap_device_disable_clocks(struct omap_device *od);
131int omap_device_enable_clocks(struct omap_device *od);
132
133/*
134 * Entries should be kept in latency order ascending
135 *
136 * deact_lat is the maximum number of microseconds required to complete
137 * deactivate_func() at the device's slowest OPP.
138 *
139 * act_lat is the maximum number of microseconds required to complete
140 * activate_func() at the device's slowest OPP.
141 *
142 * This will result in some suboptimal power management decisions at fast
143 * OPPs, but avoids having to recompute all device power management decisions
144 * if the system shifts from a fast OPP to a slow OPP (in order to meet
145 * latency requirements).
146 *
147 * XXX should deactivate_func/activate_func() take platform_device pointers
148 * rather than omap_device pointers?
149 */
150struct omap_device_pm_latency {
151 u32 deactivate_lat;
152 u32 deactivate_lat_worst;
153 int (*deactivate_func)(struct omap_device *od);
154 u32 activate_lat;
155 u32 activate_lat_worst;
156 int (*activate_func)(struct omap_device *od);
157 u32 flags;
158};
159
160#define OMAP_DEVICE_LATENCY_AUTO_ADJUST BIT(1)
161 98
162/* Get omap_device pointer from platform_device pointer */ 99/* Get omap_device pointer from platform_device pointer */
163static inline struct omap_device *to_omap_device(struct platform_device *pdev) 100static inline struct omap_device *to_omap_device(struct platform_device *pdev)
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 4653efb87a27..c2c798c08c2b 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -139,6 +139,8 @@
139#include <linux/slab.h> 139#include <linux/slab.h>
140#include <linux/bootmem.h> 140#include <linux/bootmem.h>
141 141
142#include <asm/system_misc.h>
143
142#include "clock.h" 144#include "clock.h"
143#include "omap_hwmod.h" 145#include "omap_hwmod.h"
144 146
@@ -2053,6 +2055,23 @@ static int _omap4_get_context_lost(struct omap_hwmod *oh)
2053} 2055}
2054 2056
2055/** 2057/**
2058 * _enable_preprogram - Pre-program an IP block during the _enable() process
2059 * @oh: struct omap_hwmod *
2060 *
2061 * Some IP blocks (such as AESS) require some additional programming
2062 * after enable before they can enter idle. If a function pointer to
2063 * do so is present in the hwmod data, then call it and pass along the
2064 * return value; otherwise, return 0.
2065 */
2066static int __init _enable_preprogram(struct omap_hwmod *oh)
2067{
2068 if (!oh->class->enable_preprogram)
2069 return 0;
2070
2071 return oh->class->enable_preprogram(oh);
2072}
2073
2074/**
2056 * _enable - enable an omap_hwmod 2075 * _enable - enable an omap_hwmod
2057 * @oh: struct omap_hwmod * 2076 * @oh: struct omap_hwmod *
2058 * 2077 *
@@ -2134,6 +2153,8 @@ static int _enable(struct omap_hwmod *oh)
2134 _enable_clocks(oh); 2153 _enable_clocks(oh);
2135 if (soc_ops.enable_module) 2154 if (soc_ops.enable_module)
2136 soc_ops.enable_module(oh); 2155 soc_ops.enable_module(oh);
2156 if (oh->flags & HWMOD_BLOCK_WFI)
2157 disable_hlt();
2137 2158
2138 if (soc_ops.update_context_lost) 2159 if (soc_ops.update_context_lost)
2139 soc_ops.update_context_lost(oh); 2160 soc_ops.update_context_lost(oh);
@@ -2156,6 +2177,7 @@ static int _enable(struct omap_hwmod *oh)
2156 _update_sysc_cache(oh); 2177 _update_sysc_cache(oh);
2157 _enable_sysc(oh); 2178 _enable_sysc(oh);
2158 } 2179 }
2180 r = _enable_preprogram(oh);
2159 } else { 2181 } else {
2160 if (soc_ops.disable_module) 2182 if (soc_ops.disable_module)
2161 soc_ops.disable_module(oh); 2183 soc_ops.disable_module(oh);
@@ -2195,6 +2217,8 @@ static int _idle(struct omap_hwmod *oh)
2195 _idle_sysc(oh); 2217 _idle_sysc(oh);
2196 _del_initiator_dep(oh, mpu_oh); 2218 _del_initiator_dep(oh, mpu_oh);
2197 2219
2220 if (oh->flags & HWMOD_BLOCK_WFI)
2221 enable_hlt();
2198 if (soc_ops.disable_module) 2222 if (soc_ops.disable_module)
2199 soc_ops.disable_module(oh); 2223 soc_ops.disable_module(oh);
2200 2224
@@ -2303,6 +2327,8 @@ static int _shutdown(struct omap_hwmod *oh)
2303 if (oh->_state == _HWMOD_STATE_ENABLED) { 2327 if (oh->_state == _HWMOD_STATE_ENABLED) {
2304 _del_initiator_dep(oh, mpu_oh); 2328 _del_initiator_dep(oh, mpu_oh);
2305 /* XXX what about the other system initiators here? dma, dsp */ 2329 /* XXX what about the other system initiators here? dma, dsp */
2330 if (oh->flags & HWMOD_BLOCK_WFI)
2331 enable_hlt();
2306 if (soc_ops.disable_module) 2332 if (soc_ops.disable_module)
2307 soc_ops.disable_module(oh); 2333 soc_ops.disable_module(oh);
2308 _disable_clocks(oh); 2334 _disable_clocks(oh);
@@ -3041,11 +3067,8 @@ static int _am33xx_assert_hardreset(struct omap_hwmod *oh,
3041static int _am33xx_deassert_hardreset(struct omap_hwmod *oh, 3067static int _am33xx_deassert_hardreset(struct omap_hwmod *oh,
3042 struct omap_hwmod_rst_info *ohri) 3068 struct omap_hwmod_rst_info *ohri)
3043{ 3069{
3044 if (ohri->st_shift)
3045 pr_err("omap_hwmod: %s: %s: hwmod data error: OMAP4 does not support st_shift\n",
3046 oh->name, ohri->name);
3047
3048 return am33xx_prm_deassert_hardreset(ohri->rst_shift, 3070 return am33xx_prm_deassert_hardreset(ohri->rst_shift,
3071 ohri->st_shift,
3049 oh->clkdm->pwrdm.ptr->prcm_offs, 3072 oh->clkdm->pwrdm.ptr->prcm_offs,
3050 oh->prcm.omap4.rstctrl_offs, 3073 oh->prcm.omap4.rstctrl_offs,
3051 oh->prcm.omap4.rstst_offs); 3074 oh->prcm.omap4.rstst_offs);
@@ -3303,7 +3326,7 @@ static int __init omap_hwmod_setup_all(void)
3303 3326
3304 return 0; 3327 return 0;
3305} 3328}
3306core_initcall(omap_hwmod_setup_all); 3329omap_core_initcall(omap_hwmod_setup_all);
3307 3330
3308/** 3331/**
3309 * omap_hwmod_enable - enable an omap_hwmod 3332 * omap_hwmod_enable - enable an omap_hwmod
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index 3ae852a522f9..d43d9b608eda 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -451,6 +451,14 @@ struct omap_hwmod_omap4_prcm {
451 * enabled. This prevents the hwmod code from being able to 451 * enabled. This prevents the hwmod code from being able to
452 * enable and reset the IP block early. XXX Eventually it should 452 * enable and reset the IP block early. XXX Eventually it should
453 * be possible to query the clock framework for this information. 453 * be possible to query the clock framework for this information.
454 * HWMOD_BLOCK_WFI: Some OMAP peripherals apparently don't work
455 * correctly if the MPU is allowed to go idle while the
456 * peripherals are active. This is apparently true for the I2C on
457 * OMAP2420, and also the EMAC on AM3517/3505. It's unlikely that
458 * this is really true -- we're probably not configuring something
459 * correctly, or this is being abused to deal with some PM latency
460 * issues -- but we're currently suffering from a shortage of
461 * folks who are able to track these issues down properly.
454 */ 462 */
455#define HWMOD_SWSUP_SIDLE (1 << 0) 463#define HWMOD_SWSUP_SIDLE (1 << 0)
456#define HWMOD_SWSUP_MSTANDBY (1 << 1) 464#define HWMOD_SWSUP_MSTANDBY (1 << 1)
@@ -462,6 +470,7 @@ struct omap_hwmod_omap4_prcm {
462#define HWMOD_CONTROL_OPT_CLKS_IN_RESET (1 << 7) 470#define HWMOD_CONTROL_OPT_CLKS_IN_RESET (1 << 7)
463#define HWMOD_16BIT_REG (1 << 8) 471#define HWMOD_16BIT_REG (1 << 8)
464#define HWMOD_EXT_OPT_MAIN_CLK (1 << 9) 472#define HWMOD_EXT_OPT_MAIN_CLK (1 << 9)
473#define HWMOD_BLOCK_WFI (1 << 10)
465 474
466/* 475/*
467 * omap_hwmod._int_flags definitions 476 * omap_hwmod._int_flags definitions
@@ -501,6 +510,7 @@ struct omap_hwmod_omap4_prcm {
501 * @rev: revision of the IP class 510 * @rev: revision of the IP class
502 * @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown 511 * @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown
503 * @reset: ptr to fn to be executed in place of the standard hwmod reset fn 512 * @reset: ptr to fn to be executed in place of the standard hwmod reset fn
513 * @enable_preprogram: ptr to fn to be executed during device enable
504 * 514 *
505 * Represent the class of a OMAP hardware "modules" (e.g. timer, 515 * Represent the class of a OMAP hardware "modules" (e.g. timer,
506 * smartreflex, gpio, uart...) 516 * smartreflex, gpio, uart...)
@@ -524,6 +534,7 @@ struct omap_hwmod_class {
524 u32 rev; 534 u32 rev;
525 int (*pre_shutdown)(struct omap_hwmod *oh); 535 int (*pre_shutdown)(struct omap_hwmod *oh);
526 int (*reset)(struct omap_hwmod *oh); 536 int (*reset)(struct omap_hwmod *oh);
537 int (*enable_preprogram)(struct omap_hwmod *oh);
527}; 538};
528 539
529/** 540/**
@@ -671,6 +682,12 @@ extern void __init omap_hwmod_init(void);
671const char *omap_hwmod_get_main_clk(struct omap_hwmod *oh); 682const char *omap_hwmod_get_main_clk(struct omap_hwmod *oh);
672 683
673/* 684/*
685 *
686 */
687
688extern int omap_hwmod_aess_preprogram(struct omap_hwmod *oh);
689
690/*
674 * Chip variant-specific hwmod init routines - XXX should be converted 691 * Chip variant-specific hwmod init routines - XXX should be converted
675 * to use initcalls once the initial boot ordering is straightened out 692 * to use initcalls once the initial boot ordering is straightened out
676 */ 693 */
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index b5efe58c0be0..6a764af6c6d3 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -121,7 +121,12 @@ static struct omap_hwmod omap2420_i2c1_hwmod = {
121 }, 121 },
122 .class = &i2c_class, 122 .class = &i2c_class,
123 .dev_attr = &i2c_dev_attr, 123 .dev_attr = &i2c_dev_attr,
124 .flags = HWMOD_16BIT_REG, 124 /*
125 * From mach-omap2/pm24xx.c: "Putting MPU into the WFI state
126 * while a transfer is active seems to cause the I2C block to
127 * timeout. Why? Good question."
128 */
129 .flags = (HWMOD_16BIT_REG | HWMOD_BLOCK_WFI),
125}; 130};
126 131
127/* I2C2 */ 132/* I2C2 */
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
index 646c14d9fdb9..26eee4a556ad 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
@@ -262,13 +262,15 @@ static struct omap_hwmod am33xx_wkup_m3_hwmod = {
262 .name = "wkup_m3", 262 .name = "wkup_m3",
263 .class = &am33xx_wkup_m3_hwmod_class, 263 .class = &am33xx_wkup_m3_hwmod_class,
264 .clkdm_name = "l4_wkup_aon_clkdm", 264 .clkdm_name = "l4_wkup_aon_clkdm",
265 .flags = HWMOD_INIT_NO_RESET, /* Keep hardreset asserted */ 265 /* Keep hardreset asserted */
266 .flags = HWMOD_INIT_NO_RESET | HWMOD_NO_IDLEST,
266 .mpu_irqs = am33xx_wkup_m3_irqs, 267 .mpu_irqs = am33xx_wkup_m3_irqs,
267 .main_clk = "dpll_core_m4_div2_ck", 268 .main_clk = "dpll_core_m4_div2_ck",
268 .prcm = { 269 .prcm = {
269 .omap4 = { 270 .omap4 = {
270 .clkctrl_offs = AM33XX_CM_WKUP_WKUP_M3_CLKCTRL_OFFSET, 271 .clkctrl_offs = AM33XX_CM_WKUP_WKUP_M3_CLKCTRL_OFFSET,
271 .rstctrl_offs = AM33XX_RM_WKUP_RSTCTRL_OFFSET, 272 .rstctrl_offs = AM33XX_RM_WKUP_RSTCTRL_OFFSET,
273 .rstst_offs = AM33XX_RM_WKUP_RSTST_OFFSET,
272 .modulemode = MODULEMODE_SWCTRL, 274 .modulemode = MODULEMODE_SWCTRL,
273 }, 275 },
274 }, 276 },
@@ -414,7 +416,6 @@ static struct omap_hwmod am33xx_adc_tsc_hwmod = {
414 * - cEFUSE (doesn't fall under any ocp_if) 416 * - cEFUSE (doesn't fall under any ocp_if)
415 * - clkdiv32k 417 * - clkdiv32k
416 * - debugss 418 * - debugss
417 * - ocmc ram
418 * - ocp watch point 419 * - ocp watch point
419 * - aes0 420 * - aes0
420 * - sha0 421 * - sha0
@@ -481,25 +482,6 @@ static struct omap_hwmod am33xx_debugss_hwmod = {
481 }, 482 },
482}; 483};
483 484
484/* ocmcram */
485static struct omap_hwmod_class am33xx_ocmcram_hwmod_class = {
486 .name = "ocmcram",
487};
488
489static struct omap_hwmod am33xx_ocmcram_hwmod = {
490 .name = "ocmcram",
491 .class = &am33xx_ocmcram_hwmod_class,
492 .clkdm_name = "l3_clkdm",
493 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),
494 .main_clk = "l3_gclk",
495 .prcm = {
496 .omap4 = {
497 .clkctrl_offs = AM33XX_CM_PER_OCMCRAM_CLKCTRL_OFFSET,
498 .modulemode = MODULEMODE_SWCTRL,
499 },
500 },
501};
502
503/* ocpwp */ 485/* ocpwp */
504static struct omap_hwmod_class am33xx_ocpwp_hwmod_class = { 486static struct omap_hwmod_class am33xx_ocpwp_hwmod_class = {
505 .name = "ocpwp", 487 .name = "ocpwp",
@@ -570,6 +552,25 @@ static struct omap_hwmod am33xx_sha0_hwmod = {
570 552
571#endif 553#endif
572 554
555/* ocmcram */
556static struct omap_hwmod_class am33xx_ocmcram_hwmod_class = {
557 .name = "ocmcram",
558};
559
560static struct omap_hwmod am33xx_ocmcram_hwmod = {
561 .name = "ocmcram",
562 .class = &am33xx_ocmcram_hwmod_class,
563 .clkdm_name = "l3_clkdm",
564 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),
565 .main_clk = "l3_gclk",
566 .prcm = {
567 .omap4 = {
568 .clkctrl_offs = AM33XX_CM_PER_OCMCRAM_CLKCTRL_OFFSET,
569 .modulemode = MODULEMODE_SWCTRL,
570 },
571 },
572};
573
573/* 'smartreflex' class */ 574/* 'smartreflex' class */
574static struct omap_hwmod_class am33xx_smartreflex_hwmod_class = { 575static struct omap_hwmod_class am33xx_smartreflex_hwmod_class = {
575 .name = "smartreflex", 576 .name = "smartreflex",
@@ -783,9 +784,7 @@ static struct omap_hwmod am33xx_elm_hwmod = {
783 }, 784 },
784}; 785};
785 786
786/* 787/* pwmss */
787 * 'epwmss' class: ecap0,1,2, ehrpwm0,1,2
788 */
789static struct omap_hwmod_class_sysconfig am33xx_epwmss_sysc = { 788static struct omap_hwmod_class_sysconfig am33xx_epwmss_sysc = {
790 .rev_offs = 0x0, 789 .rev_offs = 0x0,
791 .sysc_offs = 0x4, 790 .sysc_offs = 0x4,
@@ -801,18 +800,23 @@ static struct omap_hwmod_class am33xx_epwmss_hwmod_class = {
801 .sysc = &am33xx_epwmss_sysc, 800 .sysc = &am33xx_epwmss_sysc,
802}; 801};
803 802
804/* ehrpwm0 */ 803static struct omap_hwmod_class am33xx_ecap_hwmod_class = {
805static struct omap_hwmod_irq_info am33xx_ehrpwm0_irqs[] = { 804 .name = "ecap",
806 { .name = "int", .irq = 86 + OMAP_INTC_START, },
807 { .name = "tzint", .irq = 58 + OMAP_INTC_START, },
808 { .irq = -1 },
809}; 805};
810 806
811static struct omap_hwmod am33xx_ehrpwm0_hwmod = { 807static struct omap_hwmod_class am33xx_eqep_hwmod_class = {
812 .name = "ehrpwm0", 808 .name = "eqep",
809};
810
811static struct omap_hwmod_class am33xx_ehrpwm_hwmod_class = {
812 .name = "ehrpwm",
813};
814
815/* epwmss0 */
816static struct omap_hwmod am33xx_epwmss0_hwmod = {
817 .name = "epwmss0",
813 .class = &am33xx_epwmss_hwmod_class, 818 .class = &am33xx_epwmss_hwmod_class,
814 .clkdm_name = "l4ls_clkdm", 819 .clkdm_name = "l4ls_clkdm",
815 .mpu_irqs = am33xx_ehrpwm0_irqs,
816 .main_clk = "l4ls_gclk", 820 .main_clk = "l4ls_gclk",
817 .prcm = { 821 .prcm = {
818 .omap4 = { 822 .omap4 = {
@@ -822,63 +826,58 @@ static struct omap_hwmod am33xx_ehrpwm0_hwmod = {
822 }, 826 },
823}; 827};
824 828
825/* ehrpwm1 */ 829/* ecap0 */
826static struct omap_hwmod_irq_info am33xx_ehrpwm1_irqs[] = { 830static struct omap_hwmod_irq_info am33xx_ecap0_irqs[] = {
827 { .name = "int", .irq = 87 + OMAP_INTC_START, }, 831 { .irq = 31 + OMAP_INTC_START, },
828 { .name = "tzint", .irq = 59 + OMAP_INTC_START, },
829 { .irq = -1 }, 832 { .irq = -1 },
830}; 833};
831 834
832static struct omap_hwmod am33xx_ehrpwm1_hwmod = { 835static struct omap_hwmod am33xx_ecap0_hwmod = {
833 .name = "ehrpwm1", 836 .name = "ecap0",
834 .class = &am33xx_epwmss_hwmod_class, 837 .class = &am33xx_ecap_hwmod_class,
835 .clkdm_name = "l4ls_clkdm", 838 .clkdm_name = "l4ls_clkdm",
836 .mpu_irqs = am33xx_ehrpwm1_irqs, 839 .mpu_irqs = am33xx_ecap0_irqs,
837 .main_clk = "l4ls_gclk", 840 .main_clk = "l4ls_gclk",
838 .prcm = {
839 .omap4 = {
840 .clkctrl_offs = AM33XX_CM_PER_EPWMSS1_CLKCTRL_OFFSET,
841 .modulemode = MODULEMODE_SWCTRL,
842 },
843 },
844}; 841};
845 842
846/* ehrpwm2 */ 843/* eqep0 */
847static struct omap_hwmod_irq_info am33xx_ehrpwm2_irqs[] = { 844static struct omap_hwmod_irq_info am33xx_eqep0_irqs[] = {
848 { .name = "int", .irq = 39 + OMAP_INTC_START, }, 845 { .irq = 79 + OMAP_INTC_START, },
849 { .name = "tzint", .irq = 60 + OMAP_INTC_START, },
850 { .irq = -1 }, 846 { .irq = -1 },
851}; 847};
852 848
853static struct omap_hwmod am33xx_ehrpwm2_hwmod = { 849static struct omap_hwmod am33xx_eqep0_hwmod = {
854 .name = "ehrpwm2", 850 .name = "eqep0",
855 .class = &am33xx_epwmss_hwmod_class, 851 .class = &am33xx_eqep_hwmod_class,
856 .clkdm_name = "l4ls_clkdm", 852 .clkdm_name = "l4ls_clkdm",
857 .mpu_irqs = am33xx_ehrpwm2_irqs, 853 .mpu_irqs = am33xx_eqep0_irqs,
858 .main_clk = "l4ls_gclk", 854 .main_clk = "l4ls_gclk",
859 .prcm = {
860 .omap4 = {
861 .clkctrl_offs = AM33XX_CM_PER_EPWMSS2_CLKCTRL_OFFSET,
862 .modulemode = MODULEMODE_SWCTRL,
863 },
864 },
865}; 855};
866 856
867/* ecap0 */ 857/* ehrpwm0 */
868static struct omap_hwmod_irq_info am33xx_ecap0_irqs[] = { 858static struct omap_hwmod_irq_info am33xx_ehrpwm0_irqs[] = {
869 { .irq = 31 + OMAP_INTC_START, }, 859 { .name = "int", .irq = 86 + OMAP_INTC_START, },
860 { .name = "tzint", .irq = 58 + OMAP_INTC_START, },
870 { .irq = -1 }, 861 { .irq = -1 },
871}; 862};
872 863
873static struct omap_hwmod am33xx_ecap0_hwmod = { 864static struct omap_hwmod am33xx_ehrpwm0_hwmod = {
874 .name = "ecap0", 865 .name = "ehrpwm0",
866 .class = &am33xx_ehrpwm_hwmod_class,
867 .clkdm_name = "l4ls_clkdm",
868 .mpu_irqs = am33xx_ehrpwm0_irqs,
869 .main_clk = "l4ls_gclk",
870};
871
872/* epwmss1 */
873static struct omap_hwmod am33xx_epwmss1_hwmod = {
874 .name = "epwmss1",
875 .class = &am33xx_epwmss_hwmod_class, 875 .class = &am33xx_epwmss_hwmod_class,
876 .clkdm_name = "l4ls_clkdm", 876 .clkdm_name = "l4ls_clkdm",
877 .mpu_irqs = am33xx_ecap0_irqs,
878 .main_clk = "l4ls_gclk", 877 .main_clk = "l4ls_gclk",
879 .prcm = { 878 .prcm = {
880 .omap4 = { 879 .omap4 = {
881 .clkctrl_offs = AM33XX_CM_PER_EPWMSS0_CLKCTRL_OFFSET, 880 .clkctrl_offs = AM33XX_CM_PER_EPWMSS1_CLKCTRL_OFFSET,
882 .modulemode = MODULEMODE_SWCTRL, 881 .modulemode = MODULEMODE_SWCTRL,
883 }, 882 },
884 }, 883 },
@@ -892,13 +891,50 @@ static struct omap_hwmod_irq_info am33xx_ecap1_irqs[] = {
892 891
893static struct omap_hwmod am33xx_ecap1_hwmod = { 892static struct omap_hwmod am33xx_ecap1_hwmod = {
894 .name = "ecap1", 893 .name = "ecap1",
895 .class = &am33xx_epwmss_hwmod_class, 894 .class = &am33xx_ecap_hwmod_class,
896 .clkdm_name = "l4ls_clkdm", 895 .clkdm_name = "l4ls_clkdm",
897 .mpu_irqs = am33xx_ecap1_irqs, 896 .mpu_irqs = am33xx_ecap1_irqs,
898 .main_clk = "l4ls_gclk", 897 .main_clk = "l4ls_gclk",
898};
899
900/* eqep1 */
901static struct omap_hwmod_irq_info am33xx_eqep1_irqs[] = {
902 { .irq = 88 + OMAP_INTC_START, },
903 { .irq = -1 },
904};
905
906static struct omap_hwmod am33xx_eqep1_hwmod = {
907 .name = "eqep1",
908 .class = &am33xx_eqep_hwmod_class,
909 .clkdm_name = "l4ls_clkdm",
910 .mpu_irqs = am33xx_eqep1_irqs,
911 .main_clk = "l4ls_gclk",
912};
913
914/* ehrpwm1 */
915static struct omap_hwmod_irq_info am33xx_ehrpwm1_irqs[] = {
916 { .name = "int", .irq = 87 + OMAP_INTC_START, },
917 { .name = "tzint", .irq = 59 + OMAP_INTC_START, },
918 { .irq = -1 },
919};
920
921static struct omap_hwmod am33xx_ehrpwm1_hwmod = {
922 .name = "ehrpwm1",
923 .class = &am33xx_ehrpwm_hwmod_class,
924 .clkdm_name = "l4ls_clkdm",
925 .mpu_irqs = am33xx_ehrpwm1_irqs,
926 .main_clk = "l4ls_gclk",
927};
928
929/* epwmss2 */
930static struct omap_hwmod am33xx_epwmss2_hwmod = {
931 .name = "epwmss2",
932 .class = &am33xx_epwmss_hwmod_class,
933 .clkdm_name = "l4ls_clkdm",
934 .main_clk = "l4ls_gclk",
899 .prcm = { 935 .prcm = {
900 .omap4 = { 936 .omap4 = {
901 .clkctrl_offs = AM33XX_CM_PER_EPWMSS1_CLKCTRL_OFFSET, 937 .clkctrl_offs = AM33XX_CM_PER_EPWMSS2_CLKCTRL_OFFSET,
902 .modulemode = MODULEMODE_SWCTRL, 938 .modulemode = MODULEMODE_SWCTRL,
903 }, 939 },
904 }, 940 },
@@ -912,16 +948,39 @@ static struct omap_hwmod_irq_info am33xx_ecap2_irqs[] = {
912 948
913static struct omap_hwmod am33xx_ecap2_hwmod = { 949static struct omap_hwmod am33xx_ecap2_hwmod = {
914 .name = "ecap2", 950 .name = "ecap2",
951 .class = &am33xx_ecap_hwmod_class,
952 .clkdm_name = "l4ls_clkdm",
915 .mpu_irqs = am33xx_ecap2_irqs, 953 .mpu_irqs = am33xx_ecap2_irqs,
916 .class = &am33xx_epwmss_hwmod_class, 954 .main_clk = "l4ls_gclk",
955};
956
957/* eqep2 */
958static struct omap_hwmod_irq_info am33xx_eqep2_irqs[] = {
959 { .irq = 89 + OMAP_INTC_START, },
960 { .irq = -1 },
961};
962
963static struct omap_hwmod am33xx_eqep2_hwmod = {
964 .name = "eqep2",
965 .class = &am33xx_eqep_hwmod_class,
917 .clkdm_name = "l4ls_clkdm", 966 .clkdm_name = "l4ls_clkdm",
967 .mpu_irqs = am33xx_eqep2_irqs,
968 .main_clk = "l4ls_gclk",
969};
970
971/* ehrpwm2 */
972static struct omap_hwmod_irq_info am33xx_ehrpwm2_irqs[] = {
973 { .name = "int", .irq = 39 + OMAP_INTC_START, },
974 { .name = "tzint", .irq = 60 + OMAP_INTC_START, },
975 { .irq = -1 },
976};
977
978static struct omap_hwmod am33xx_ehrpwm2_hwmod = {
979 .name = "ehrpwm2",
980 .class = &am33xx_ehrpwm_hwmod_class,
981 .clkdm_name = "l4ls_clkdm",
982 .mpu_irqs = am33xx_ehrpwm2_irqs,
918 .main_clk = "l4ls_gclk", 983 .main_clk = "l4ls_gclk",
919 .prcm = {
920 .omap4 = {
921 .clkctrl_offs = AM33XX_CM_PER_EPWMSS2_CLKCTRL_OFFSET,
922 .modulemode = MODULEMODE_SWCTRL,
923 },
924 },
925}; 984};
926 985
927/* 986/*
@@ -1824,6 +1883,7 @@ static struct omap_hwmod am33xx_tptc0_hwmod = {
1824 .class = &am33xx_tptc_hwmod_class, 1883 .class = &am33xx_tptc_hwmod_class,
1825 .clkdm_name = "l3_clkdm", 1884 .clkdm_name = "l3_clkdm",
1826 .mpu_irqs = am33xx_tptc0_irqs, 1885 .mpu_irqs = am33xx_tptc0_irqs,
1886 .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY,
1827 .main_clk = "l3_gclk", 1887 .main_clk = "l3_gclk",
1828 .prcm = { 1888 .prcm = {
1829 .omap4 = { 1889 .omap4 = {
@@ -2496,7 +2556,6 @@ static struct omap_hwmod_addr_space am33xx_cpgmac0_addr_space[] = {
2496 { 2556 {
2497 .pa_start = 0x4a100000, 2557 .pa_start = 0x4a100000,
2498 .pa_end = 0x4a100000 + SZ_2K - 1, 2558 .pa_end = 0x4a100000 + SZ_2K - 1,
2499 .flags = ADDR_TYPE_RT,
2500 }, 2559 },
2501 /* cpsw wr */ 2560 /* cpsw wr */
2502 { 2561 {
@@ -2547,162 +2606,202 @@ static struct omap_hwmod_ocp_if am33xx_l4_ls__elm = {
2547 .user = OCP_USER_MPU, 2606 .user = OCP_USER_MPU,
2548}; 2607};
2549 2608
2550/* 2609static struct omap_hwmod_addr_space am33xx_epwmss0_addr_space[] = {
2551 * Splitting the resources to handle access of PWMSS config space
2552 * and module specific part independently
2553 */
2554static struct omap_hwmod_addr_space am33xx_ehrpwm0_addr_space[] = {
2555 { 2610 {
2556 .pa_start = 0x48300000, 2611 .pa_start = 0x48300000,
2557 .pa_end = 0x48300000 + SZ_16 - 1, 2612 .pa_end = 0x48300000 + SZ_16 - 1,
2558 .flags = ADDR_TYPE_RT 2613 .flags = ADDR_TYPE_RT
2559 }, 2614 },
2560 {
2561 .pa_start = 0x48300200,
2562 .pa_end = 0x48300200 + SZ_256 - 1,
2563 .flags = ADDR_TYPE_RT
2564 },
2565 { } 2615 { }
2566}; 2616};
2567 2617
2568static struct omap_hwmod_ocp_if am33xx_l4_ls__ehrpwm0 = { 2618static struct omap_hwmod_ocp_if am33xx_l4_ls__epwmss0 = {
2569 .master = &am33xx_l4_ls_hwmod, 2619 .master = &am33xx_l4_ls_hwmod,
2570 .slave = &am33xx_ehrpwm0_hwmod, 2620 .slave = &am33xx_epwmss0_hwmod,
2571 .clk = "l4ls_gclk", 2621 .clk = "l4ls_gclk",
2572 .addr = am33xx_ehrpwm0_addr_space, 2622 .addr = am33xx_epwmss0_addr_space,
2573 .user = OCP_USER_MPU, 2623 .user = OCP_USER_MPU,
2574}; 2624};
2575 2625
2576/* 2626static struct omap_hwmod_addr_space am33xx_ecap0_addr_space[] = {
2577 * Splitting the resources to handle access of PWMSS config space
2578 * and module specific part independently
2579 */
2580static struct omap_hwmod_addr_space am33xx_ehrpwm1_addr_space[] = {
2581 {
2582 .pa_start = 0x48302000,
2583 .pa_end = 0x48302000 + SZ_16 - 1,
2584 .flags = ADDR_TYPE_RT
2585 },
2586 { 2627 {
2587 .pa_start = 0x48302200, 2628 .pa_start = 0x48300100,
2588 .pa_end = 0x48302200 + SZ_256 - 1, 2629 .pa_end = 0x48300100 + SZ_128 - 1,
2589 .flags = ADDR_TYPE_RT
2590 }, 2630 },
2591 { } 2631 { }
2592}; 2632};
2593 2633
2594static struct omap_hwmod_ocp_if am33xx_l4_ls__ehrpwm1 = { 2634static struct omap_hwmod_ocp_if am33xx_epwmss0__ecap0 = {
2595 .master = &am33xx_l4_ls_hwmod, 2635 .master = &am33xx_epwmss0_hwmod,
2596 .slave = &am33xx_ehrpwm1_hwmod, 2636 .slave = &am33xx_ecap0_hwmod,
2597 .clk = "l4ls_gclk", 2637 .clk = "l4ls_gclk",
2598 .addr = am33xx_ehrpwm1_addr_space, 2638 .addr = am33xx_ecap0_addr_space,
2599 .user = OCP_USER_MPU, 2639 .user = OCP_USER_MPU,
2600}; 2640};
2601 2641
2602/* 2642static struct omap_hwmod_addr_space am33xx_eqep0_addr_space[] = {
2603 * Splitting the resources to handle access of PWMSS config space
2604 * and module specific part independently
2605 */
2606static struct omap_hwmod_addr_space am33xx_ehrpwm2_addr_space[] = {
2607 { 2643 {
2608 .pa_start = 0x48304000, 2644 .pa_start = 0x48300180,
2609 .pa_end = 0x48304000 + SZ_16 - 1, 2645 .pa_end = 0x48300180 + SZ_128 - 1,
2610 .flags = ADDR_TYPE_RT
2611 },
2612 {
2613 .pa_start = 0x48304200,
2614 .pa_end = 0x48304200 + SZ_256 - 1,
2615 .flags = ADDR_TYPE_RT
2616 }, 2646 },
2617 { } 2647 { }
2618}; 2648};
2619 2649
2620static struct omap_hwmod_ocp_if am33xx_l4_ls__ehrpwm2 = { 2650static struct omap_hwmod_ocp_if am33xx_epwmss0__eqep0 = {
2621 .master = &am33xx_l4_ls_hwmod, 2651 .master = &am33xx_epwmss0_hwmod,
2622 .slave = &am33xx_ehrpwm2_hwmod, 2652 .slave = &am33xx_eqep0_hwmod,
2623 .clk = "l4ls_gclk", 2653 .clk = "l4ls_gclk",
2624 .addr = am33xx_ehrpwm2_addr_space, 2654 .addr = am33xx_eqep0_addr_space,
2625 .user = OCP_USER_MPU, 2655 .user = OCP_USER_MPU,
2626}; 2656};
2627 2657
2628/* 2658static struct omap_hwmod_addr_space am33xx_ehrpwm0_addr_space[] = {
2629 * Splitting the resources to handle access of PWMSS config space
2630 * and module specific part independently
2631 */
2632static struct omap_hwmod_addr_space am33xx_ecap0_addr_space[] = {
2633 {
2634 .pa_start = 0x48300000,
2635 .pa_end = 0x48300000 + SZ_16 - 1,
2636 .flags = ADDR_TYPE_RT
2637 },
2638 { 2659 {
2639 .pa_start = 0x48300100, 2660 .pa_start = 0x48300200,
2640 .pa_end = 0x48300100 + SZ_256 - 1, 2661 .pa_end = 0x48300200 + SZ_128 - 1,
2641 .flags = ADDR_TYPE_RT
2642 }, 2662 },
2643 { } 2663 { }
2644}; 2664};
2645 2665
2646static struct omap_hwmod_ocp_if am33xx_l4_ls__ecap0 = { 2666static struct omap_hwmod_ocp_if am33xx_epwmss0__ehrpwm0 = {
2647 .master = &am33xx_l4_ls_hwmod, 2667 .master = &am33xx_epwmss0_hwmod,
2648 .slave = &am33xx_ecap0_hwmod, 2668 .slave = &am33xx_ehrpwm0_hwmod,
2649 .clk = "l4ls_gclk", 2669 .clk = "l4ls_gclk",
2650 .addr = am33xx_ecap0_addr_space, 2670 .addr = am33xx_ehrpwm0_addr_space,
2651 .user = OCP_USER_MPU, 2671 .user = OCP_USER_MPU,
2652}; 2672};
2653 2673
2654/* 2674
2655 * Splitting the resources to handle access of PWMSS config space 2675static struct omap_hwmod_addr_space am33xx_epwmss1_addr_space[] = {
2656 * and module specific part independently
2657 */
2658static struct omap_hwmod_addr_space am33xx_ecap1_addr_space[] = {
2659 { 2676 {
2660 .pa_start = 0x48302000, 2677 .pa_start = 0x48302000,
2661 .pa_end = 0x48302000 + SZ_16 - 1, 2678 .pa_end = 0x48302000 + SZ_16 - 1,
2662 .flags = ADDR_TYPE_RT 2679 .flags = ADDR_TYPE_RT
2663 }, 2680 },
2681 { }
2682};
2683
2684static struct omap_hwmod_ocp_if am33xx_l4_ls__epwmss1 = {
2685 .master = &am33xx_l4_ls_hwmod,
2686 .slave = &am33xx_epwmss1_hwmod,
2687 .clk = "l4ls_gclk",
2688 .addr = am33xx_epwmss1_addr_space,
2689 .user = OCP_USER_MPU,
2690};
2691
2692static struct omap_hwmod_addr_space am33xx_ecap1_addr_space[] = {
2664 { 2693 {
2665 .pa_start = 0x48302100, 2694 .pa_start = 0x48302100,
2666 .pa_end = 0x48302100 + SZ_256 - 1, 2695 .pa_end = 0x48302100 + SZ_128 - 1,
2667 .flags = ADDR_TYPE_RT
2668 }, 2696 },
2669 { } 2697 { }
2670}; 2698};
2671 2699
2672static struct omap_hwmod_ocp_if am33xx_l4_ls__ecap1 = { 2700static struct omap_hwmod_ocp_if am33xx_epwmss1__ecap1 = {
2673 .master = &am33xx_l4_ls_hwmod, 2701 .master = &am33xx_epwmss1_hwmod,
2674 .slave = &am33xx_ecap1_hwmod, 2702 .slave = &am33xx_ecap1_hwmod,
2675 .clk = "l4ls_gclk", 2703 .clk = "l4ls_gclk",
2676 .addr = am33xx_ecap1_addr_space, 2704 .addr = am33xx_ecap1_addr_space,
2677 .user = OCP_USER_MPU, 2705 .user = OCP_USER_MPU,
2678}; 2706};
2679 2707
2680/* 2708static struct omap_hwmod_addr_space am33xx_eqep1_addr_space[] = {
2681 * Splitting the resources to handle access of PWMSS config space 2709 {
2682 * and module specific part independently 2710 .pa_start = 0x48302180,
2683 */ 2711 .pa_end = 0x48302180 + SZ_128 - 1,
2684static struct omap_hwmod_addr_space am33xx_ecap2_addr_space[] = { 2712 },
2713 { }
2714};
2715
2716static struct omap_hwmod_ocp_if am33xx_epwmss1__eqep1 = {
2717 .master = &am33xx_epwmss1_hwmod,
2718 .slave = &am33xx_eqep1_hwmod,
2719 .clk = "l4ls_gclk",
2720 .addr = am33xx_eqep1_addr_space,
2721 .user = OCP_USER_MPU,
2722};
2723
2724static struct omap_hwmod_addr_space am33xx_ehrpwm1_addr_space[] = {
2725 {
2726 .pa_start = 0x48302200,
2727 .pa_end = 0x48302200 + SZ_128 - 1,
2728 },
2729 { }
2730};
2731
2732static struct omap_hwmod_ocp_if am33xx_epwmss1__ehrpwm1 = {
2733 .master = &am33xx_epwmss1_hwmod,
2734 .slave = &am33xx_ehrpwm1_hwmod,
2735 .clk = "l4ls_gclk",
2736 .addr = am33xx_ehrpwm1_addr_space,
2737 .user = OCP_USER_MPU,
2738};
2739
2740static struct omap_hwmod_addr_space am33xx_epwmss2_addr_space[] = {
2685 { 2741 {
2686 .pa_start = 0x48304000, 2742 .pa_start = 0x48304000,
2687 .pa_end = 0x48304000 + SZ_16 - 1, 2743 .pa_end = 0x48304000 + SZ_16 - 1,
2688 .flags = ADDR_TYPE_RT 2744 .flags = ADDR_TYPE_RT
2689 }, 2745 },
2746 { }
2747};
2748
2749static struct omap_hwmod_ocp_if am33xx_l4_ls__epwmss2 = {
2750 .master = &am33xx_l4_ls_hwmod,
2751 .slave = &am33xx_epwmss2_hwmod,
2752 .clk = "l4ls_gclk",
2753 .addr = am33xx_epwmss2_addr_space,
2754 .user = OCP_USER_MPU,
2755};
2756
2757static struct omap_hwmod_addr_space am33xx_ecap2_addr_space[] = {
2690 { 2758 {
2691 .pa_start = 0x48304100, 2759 .pa_start = 0x48304100,
2692 .pa_end = 0x48304100 + SZ_256 - 1, 2760 .pa_end = 0x48304100 + SZ_128 - 1,
2693 .flags = ADDR_TYPE_RT
2694 }, 2761 },
2695 { } 2762 { }
2696}; 2763};
2697 2764
2698static struct omap_hwmod_ocp_if am33xx_l4_ls__ecap2 = { 2765static struct omap_hwmod_ocp_if am33xx_epwmss2__ecap2 = {
2699 .master = &am33xx_l4_ls_hwmod, 2766 .master = &am33xx_epwmss2_hwmod,
2700 .slave = &am33xx_ecap2_hwmod, 2767 .slave = &am33xx_ecap2_hwmod,
2701 .clk = "l4ls_gclk", 2768 .clk = "l4ls_gclk",
2702 .addr = am33xx_ecap2_addr_space, 2769 .addr = am33xx_ecap2_addr_space,
2703 .user = OCP_USER_MPU, 2770 .user = OCP_USER_MPU,
2704}; 2771};
2705 2772
2773static struct omap_hwmod_addr_space am33xx_eqep2_addr_space[] = {
2774 {
2775 .pa_start = 0x48304180,
2776 .pa_end = 0x48304180 + SZ_128 - 1,
2777 },
2778 { }
2779};
2780
2781static struct omap_hwmod_ocp_if am33xx_epwmss2__eqep2 = {
2782 .master = &am33xx_epwmss2_hwmod,
2783 .slave = &am33xx_eqep2_hwmod,
2784 .clk = "l4ls_gclk",
2785 .addr = am33xx_eqep2_addr_space,
2786 .user = OCP_USER_MPU,
2787};
2788
2789static struct omap_hwmod_addr_space am33xx_ehrpwm2_addr_space[] = {
2790 {
2791 .pa_start = 0x48304200,
2792 .pa_end = 0x48304200 + SZ_128 - 1,
2793 },
2794 { }
2795};
2796
2797static struct omap_hwmod_ocp_if am33xx_epwmss2__ehrpwm2 = {
2798 .master = &am33xx_epwmss2_hwmod,
2799 .slave = &am33xx_ehrpwm2_hwmod,
2800 .clk = "l4ls_gclk",
2801 .addr = am33xx_ehrpwm2_addr_space,
2802 .user = OCP_USER_MPU,
2803};
2804
2706/* l3s cfg -> gpmc */ 2805/* l3s cfg -> gpmc */
2707static struct omap_hwmod_addr_space am33xx_gpmc_addr_space[] = { 2806static struct omap_hwmod_addr_space am33xx_gpmc_addr_space[] = {
2708 { 2807 {
@@ -3328,6 +3427,13 @@ static struct omap_hwmod_ocp_if am33xx_l3_s__usbss = {
3328 .flags = OCPIF_SWSUP_IDLE, 3427 .flags = OCPIF_SWSUP_IDLE,
3329}; 3428};
3330 3429
3430/* l3 main -> ocmc */
3431static struct omap_hwmod_ocp_if am33xx_l3_main__ocmc = {
3432 .master = &am33xx_l3_main_hwmod,
3433 .slave = &am33xx_ocmcram_hwmod,
3434 .user = OCP_USER_MPU | OCP_USER_SDMA,
3435};
3436
3331static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = { 3437static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = {
3332 &am33xx_l4_fw__emif_fw, 3438 &am33xx_l4_fw__emif_fw,
3333 &am33xx_l3_main__emif, 3439 &am33xx_l3_main__emif,
@@ -3385,12 +3491,18 @@ static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = {
3385 &am33xx_l4_ls__uart6, 3491 &am33xx_l4_ls__uart6,
3386 &am33xx_l4_ls__spinlock, 3492 &am33xx_l4_ls__spinlock,
3387 &am33xx_l4_ls__elm, 3493 &am33xx_l4_ls__elm,
3388 &am33xx_l4_ls__ehrpwm0, 3494 &am33xx_l4_ls__epwmss0,
3389 &am33xx_l4_ls__ehrpwm1, 3495 &am33xx_epwmss0__ecap0,
3390 &am33xx_l4_ls__ehrpwm2, 3496 &am33xx_epwmss0__eqep0,
3391 &am33xx_l4_ls__ecap0, 3497 &am33xx_epwmss0__ehrpwm0,
3392 &am33xx_l4_ls__ecap1, 3498 &am33xx_l4_ls__epwmss1,
3393 &am33xx_l4_ls__ecap2, 3499 &am33xx_epwmss1__ecap1,
3500 &am33xx_epwmss1__eqep1,
3501 &am33xx_epwmss1__ehrpwm1,
3502 &am33xx_l4_ls__epwmss2,
3503 &am33xx_epwmss2__ecap2,
3504 &am33xx_epwmss2__eqep2,
3505 &am33xx_epwmss2__ehrpwm2,
3394 &am33xx_l3_s__gpmc, 3506 &am33xx_l3_s__gpmc,
3395 &am33xx_l3_main__lcdc, 3507 &am33xx_l3_main__lcdc,
3396 &am33xx_l4_ls__mcspi0, 3508 &am33xx_l4_ls__mcspi0,
@@ -3398,6 +3510,7 @@ static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = {
3398 &am33xx_l3_main__tptc0, 3510 &am33xx_l3_main__tptc0,
3399 &am33xx_l3_main__tptc1, 3511 &am33xx_l3_main__tptc1,
3400 &am33xx_l3_main__tptc2, 3512 &am33xx_l3_main__tptc2,
3513 &am33xx_l3_main__ocmc,
3401 &am33xx_l3_s__usbss, 3514 &am33xx_l3_s__usbss,
3402 &am33xx_l4_hs__cpgmac0, 3515 &am33xx_l4_hs__cpgmac0,
3403 &am33xx_cpgmac0__mdio, 3516 &am33xx_cpgmac0__mdio,
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 8bb2628df34e..ac7e03ec952f 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -3493,7 +3493,12 @@ static struct omap_hwmod am35xx_emac_hwmod = {
3493 .name = "davinci_emac", 3493 .name = "davinci_emac",
3494 .mpu_irqs = am35xx_emac_mpu_irqs, 3494 .mpu_irqs = am35xx_emac_mpu_irqs,
3495 .class = &am35xx_emac_class, 3495 .class = &am35xx_emac_class,
3496 .flags = HWMOD_NO_IDLEST, 3496 /*
3497 * According to Mark Greer, the MPU will not return from WFI
3498 * when the EMAC signals an interrupt.
3499 * http://www.spinics.net/lists/arm-kernel/msg174734.html
3500 */
3501 .flags = (HWMOD_NO_IDLEST | HWMOD_BLOCK_WFI),
3497}; 3502};
3498 3503
3499/* l3_core -> davinci emac interface */ 3504/* l3_core -> davinci emac interface */
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 793f54ac7d14..0e47d2e1687c 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -322,6 +322,7 @@ static struct omap_hwmod_class_sysconfig omap44xx_aess_sysc = {
322static struct omap_hwmod_class omap44xx_aess_hwmod_class = { 322static struct omap_hwmod_class omap44xx_aess_hwmod_class = {
323 .name = "aess", 323 .name = "aess",
324 .sysc = &omap44xx_aess_sysc, 324 .sysc = &omap44xx_aess_sysc,
325 .enable_preprogram = omap_hwmod_aess_preprogram,
325}; 326};
326 327
327/* aess */ 328/* aess */
@@ -348,7 +349,7 @@ static struct omap_hwmod omap44xx_aess_hwmod = {
348 .clkdm_name = "abe_clkdm", 349 .clkdm_name = "abe_clkdm",
349 .mpu_irqs = omap44xx_aess_irqs, 350 .mpu_irqs = omap44xx_aess_irqs,
350 .sdma_reqs = omap44xx_aess_sdma_reqs, 351 .sdma_reqs = omap44xx_aess_sdma_reqs,
351 .main_clk = "aess_fck", 352 .main_clk = "aess_fclk",
352 .prcm = { 353 .prcm = {
353 .omap4 = { 354 .omap4 = {
354 .clkctrl_offs = OMAP4_CM1_ABE_AESS_CLKCTRL_OFFSET, 355 .clkctrl_offs = OMAP4_CM1_ABE_AESS_CLKCTRL_OFFSET,
@@ -616,7 +617,7 @@ static struct omap_hwmod omap44xx_dmic_hwmod = {
616 .clkdm_name = "abe_clkdm", 617 .clkdm_name = "abe_clkdm",
617 .mpu_irqs = omap44xx_dmic_irqs, 618 .mpu_irqs = omap44xx_dmic_irqs,
618 .sdma_reqs = omap44xx_dmic_sdma_reqs, 619 .sdma_reqs = omap44xx_dmic_sdma_reqs,
619 .main_clk = "dmic_fck", 620 .main_clk = "func_dmic_abe_gfclk",
620 .prcm = { 621 .prcm = {
621 .omap4 = { 622 .omap4 = {
622 .clkctrl_offs = OMAP4_CM1_ABE_DMIC_CLKCTRL_OFFSET, 623 .clkctrl_offs = OMAP4_CM1_ABE_DMIC_CLKCTRL_OFFSET,
@@ -1161,7 +1162,7 @@ static struct omap_hwmod omap44xx_gpio1_hwmod = {
1161 .class = &omap44xx_gpio_hwmod_class, 1162 .class = &omap44xx_gpio_hwmod_class,
1162 .clkdm_name = "l4_wkup_clkdm", 1163 .clkdm_name = "l4_wkup_clkdm",
1163 .mpu_irqs = omap44xx_gpio1_irqs, 1164 .mpu_irqs = omap44xx_gpio1_irqs,
1164 .main_clk = "gpio1_ick", 1165 .main_clk = "l4_wkup_clk_mux_ck",
1165 .prcm = { 1166 .prcm = {
1166 .omap4 = { 1167 .omap4 = {
1167 .clkctrl_offs = OMAP4_CM_WKUP_GPIO1_CLKCTRL_OFFSET, 1168 .clkctrl_offs = OMAP4_CM_WKUP_GPIO1_CLKCTRL_OFFSET,
@@ -1190,7 +1191,7 @@ static struct omap_hwmod omap44xx_gpio2_hwmod = {
1190 .clkdm_name = "l4_per_clkdm", 1191 .clkdm_name = "l4_per_clkdm",
1191 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 1192 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
1192 .mpu_irqs = omap44xx_gpio2_irqs, 1193 .mpu_irqs = omap44xx_gpio2_irqs,
1193 .main_clk = "gpio2_ick", 1194 .main_clk = "l4_div_ck",
1194 .prcm = { 1195 .prcm = {
1195 .omap4 = { 1196 .omap4 = {
1196 .clkctrl_offs = OMAP4_CM_L4PER_GPIO2_CLKCTRL_OFFSET, 1197 .clkctrl_offs = OMAP4_CM_L4PER_GPIO2_CLKCTRL_OFFSET,
@@ -1219,7 +1220,7 @@ static struct omap_hwmod omap44xx_gpio3_hwmod = {
1219 .clkdm_name = "l4_per_clkdm", 1220 .clkdm_name = "l4_per_clkdm",
1220 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 1221 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
1221 .mpu_irqs = omap44xx_gpio3_irqs, 1222 .mpu_irqs = omap44xx_gpio3_irqs,
1222 .main_clk = "gpio3_ick", 1223 .main_clk = "l4_div_ck",
1223 .prcm = { 1224 .prcm = {
1224 .omap4 = { 1225 .omap4 = {
1225 .clkctrl_offs = OMAP4_CM_L4PER_GPIO3_CLKCTRL_OFFSET, 1226 .clkctrl_offs = OMAP4_CM_L4PER_GPIO3_CLKCTRL_OFFSET,
@@ -1248,7 +1249,7 @@ static struct omap_hwmod omap44xx_gpio4_hwmod = {
1248 .clkdm_name = "l4_per_clkdm", 1249 .clkdm_name = "l4_per_clkdm",
1249 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 1250 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
1250 .mpu_irqs = omap44xx_gpio4_irqs, 1251 .mpu_irqs = omap44xx_gpio4_irqs,
1251 .main_clk = "gpio4_ick", 1252 .main_clk = "l4_div_ck",
1252 .prcm = { 1253 .prcm = {
1253 .omap4 = { 1254 .omap4 = {
1254 .clkctrl_offs = OMAP4_CM_L4PER_GPIO4_CLKCTRL_OFFSET, 1255 .clkctrl_offs = OMAP4_CM_L4PER_GPIO4_CLKCTRL_OFFSET,
@@ -1277,7 +1278,7 @@ static struct omap_hwmod omap44xx_gpio5_hwmod = {
1277 .clkdm_name = "l4_per_clkdm", 1278 .clkdm_name = "l4_per_clkdm",
1278 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 1279 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
1279 .mpu_irqs = omap44xx_gpio5_irqs, 1280 .mpu_irqs = omap44xx_gpio5_irqs,
1280 .main_clk = "gpio5_ick", 1281 .main_clk = "l4_div_ck",
1281 .prcm = { 1282 .prcm = {
1282 .omap4 = { 1283 .omap4 = {
1283 .clkctrl_offs = OMAP4_CM_L4PER_GPIO5_CLKCTRL_OFFSET, 1284 .clkctrl_offs = OMAP4_CM_L4PER_GPIO5_CLKCTRL_OFFSET,
@@ -1306,7 +1307,7 @@ static struct omap_hwmod omap44xx_gpio6_hwmod = {
1306 .clkdm_name = "l4_per_clkdm", 1307 .clkdm_name = "l4_per_clkdm",
1307 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 1308 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
1308 .mpu_irqs = omap44xx_gpio6_irqs, 1309 .mpu_irqs = omap44xx_gpio6_irqs,
1309 .main_clk = "gpio6_ick", 1310 .main_clk = "l4_div_ck",
1310 .prcm = { 1311 .prcm = {
1311 .omap4 = { 1312 .omap4 = {
1312 .clkctrl_offs = OMAP4_CM_L4PER_GPIO6_CLKCTRL_OFFSET, 1313 .clkctrl_offs = OMAP4_CM_L4PER_GPIO6_CLKCTRL_OFFSET,
@@ -1405,7 +1406,7 @@ static struct omap_hwmod omap44xx_gpu_hwmod = {
1405 .class = &omap44xx_gpu_hwmod_class, 1406 .class = &omap44xx_gpu_hwmod_class,
1406 .clkdm_name = "l3_gfx_clkdm", 1407 .clkdm_name = "l3_gfx_clkdm",
1407 .mpu_irqs = omap44xx_gpu_irqs, 1408 .mpu_irqs = omap44xx_gpu_irqs,
1408 .main_clk = "gpu_fck", 1409 .main_clk = "sgx_clk_mux",
1409 .prcm = { 1410 .prcm = {
1410 .omap4 = { 1411 .omap4 = {
1411 .clkctrl_offs = OMAP4_CM_GFX_GFX_CLKCTRL_OFFSET, 1412 .clkctrl_offs = OMAP4_CM_GFX_GFX_CLKCTRL_OFFSET,
@@ -1446,7 +1447,7 @@ static struct omap_hwmod omap44xx_hdq1w_hwmod = {
1446 .clkdm_name = "l4_per_clkdm", 1447 .clkdm_name = "l4_per_clkdm",
1447 .flags = HWMOD_INIT_NO_RESET, /* XXX temporary */ 1448 .flags = HWMOD_INIT_NO_RESET, /* XXX temporary */
1448 .mpu_irqs = omap44xx_hdq1w_irqs, 1449 .mpu_irqs = omap44xx_hdq1w_irqs,
1449 .main_clk = "hdq1w_fck", 1450 .main_clk = "func_12m_fclk",
1450 .prcm = { 1451 .prcm = {
1451 .omap4 = { 1452 .omap4 = {
1452 .clkctrl_offs = OMAP4_CM_L4PER_HDQ1W_CLKCTRL_OFFSET, 1453 .clkctrl_offs = OMAP4_CM_L4PER_HDQ1W_CLKCTRL_OFFSET,
@@ -1550,7 +1551,7 @@ static struct omap_hwmod omap44xx_i2c1_hwmod = {
1550 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, 1551 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
1551 .mpu_irqs = omap44xx_i2c1_irqs, 1552 .mpu_irqs = omap44xx_i2c1_irqs,
1552 .sdma_reqs = omap44xx_i2c1_sdma_reqs, 1553 .sdma_reqs = omap44xx_i2c1_sdma_reqs,
1553 .main_clk = "i2c1_fck", 1554 .main_clk = "func_96m_fclk",
1554 .prcm = { 1555 .prcm = {
1555 .omap4 = { 1556 .omap4 = {
1556 .clkctrl_offs = OMAP4_CM_L4PER_I2C1_CLKCTRL_OFFSET, 1557 .clkctrl_offs = OMAP4_CM_L4PER_I2C1_CLKCTRL_OFFSET,
@@ -1580,7 +1581,7 @@ static struct omap_hwmod omap44xx_i2c2_hwmod = {
1580 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, 1581 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
1581 .mpu_irqs = omap44xx_i2c2_irqs, 1582 .mpu_irqs = omap44xx_i2c2_irqs,
1582 .sdma_reqs = omap44xx_i2c2_sdma_reqs, 1583 .sdma_reqs = omap44xx_i2c2_sdma_reqs,
1583 .main_clk = "i2c2_fck", 1584 .main_clk = "func_96m_fclk",
1584 .prcm = { 1585 .prcm = {
1585 .omap4 = { 1586 .omap4 = {
1586 .clkctrl_offs = OMAP4_CM_L4PER_I2C2_CLKCTRL_OFFSET, 1587 .clkctrl_offs = OMAP4_CM_L4PER_I2C2_CLKCTRL_OFFSET,
@@ -1610,7 +1611,7 @@ static struct omap_hwmod omap44xx_i2c3_hwmod = {
1610 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, 1611 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
1611 .mpu_irqs = omap44xx_i2c3_irqs, 1612 .mpu_irqs = omap44xx_i2c3_irqs,
1612 .sdma_reqs = omap44xx_i2c3_sdma_reqs, 1613 .sdma_reqs = omap44xx_i2c3_sdma_reqs,
1613 .main_clk = "i2c3_fck", 1614 .main_clk = "func_96m_fclk",
1614 .prcm = { 1615 .prcm = {
1615 .omap4 = { 1616 .omap4 = {
1616 .clkctrl_offs = OMAP4_CM_L4PER_I2C3_CLKCTRL_OFFSET, 1617 .clkctrl_offs = OMAP4_CM_L4PER_I2C3_CLKCTRL_OFFSET,
@@ -1640,7 +1641,7 @@ static struct omap_hwmod omap44xx_i2c4_hwmod = {
1640 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, 1641 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
1641 .mpu_irqs = omap44xx_i2c4_irqs, 1642 .mpu_irqs = omap44xx_i2c4_irqs,
1642 .sdma_reqs = omap44xx_i2c4_sdma_reqs, 1643 .sdma_reqs = omap44xx_i2c4_sdma_reqs,
1643 .main_clk = "i2c4_fck", 1644 .main_clk = "func_96m_fclk",
1644 .prcm = { 1645 .prcm = {
1645 .omap4 = { 1646 .omap4 = {
1646 .clkctrl_offs = OMAP4_CM_L4PER_I2C4_CLKCTRL_OFFSET, 1647 .clkctrl_offs = OMAP4_CM_L4PER_I2C4_CLKCTRL_OFFSET,
@@ -1743,7 +1744,7 @@ static struct omap_hwmod omap44xx_iss_hwmod = {
1743 .clkdm_name = "iss_clkdm", 1744 .clkdm_name = "iss_clkdm",
1744 .mpu_irqs = omap44xx_iss_irqs, 1745 .mpu_irqs = omap44xx_iss_irqs,
1745 .sdma_reqs = omap44xx_iss_sdma_reqs, 1746 .sdma_reqs = omap44xx_iss_sdma_reqs,
1746 .main_clk = "iss_fck", 1747 .main_clk = "ducati_clk_mux_ck",
1747 .prcm = { 1748 .prcm = {
1748 .omap4 = { 1749 .omap4 = {
1749 .clkctrl_offs = OMAP4_CM_CAM_ISS_CLKCTRL_OFFSET, 1750 .clkctrl_offs = OMAP4_CM_CAM_ISS_CLKCTRL_OFFSET,
@@ -1785,7 +1786,7 @@ static struct omap_hwmod omap44xx_iva_hwmod = {
1785 .mpu_irqs = omap44xx_iva_irqs, 1786 .mpu_irqs = omap44xx_iva_irqs,
1786 .rst_lines = omap44xx_iva_resets, 1787 .rst_lines = omap44xx_iva_resets,
1787 .rst_lines_cnt = ARRAY_SIZE(omap44xx_iva_resets), 1788 .rst_lines_cnt = ARRAY_SIZE(omap44xx_iva_resets),
1788 .main_clk = "iva_fck", 1789 .main_clk = "dpll_iva_m5x2_ck",
1789 .prcm = { 1790 .prcm = {
1790 .omap4 = { 1791 .omap4 = {
1791 .clkctrl_offs = OMAP4_CM_IVAHD_IVAHD_CLKCTRL_OFFSET, 1792 .clkctrl_offs = OMAP4_CM_IVAHD_IVAHD_CLKCTRL_OFFSET,
@@ -1829,7 +1830,7 @@ static struct omap_hwmod omap44xx_kbd_hwmod = {
1829 .class = &omap44xx_kbd_hwmod_class, 1830 .class = &omap44xx_kbd_hwmod_class,
1830 .clkdm_name = "l4_wkup_clkdm", 1831 .clkdm_name = "l4_wkup_clkdm",
1831 .mpu_irqs = omap44xx_kbd_irqs, 1832 .mpu_irqs = omap44xx_kbd_irqs,
1832 .main_clk = "kbd_fck", 1833 .main_clk = "sys_32k_ck",
1833 .prcm = { 1834 .prcm = {
1834 .omap4 = { 1835 .omap4 = {
1835 .clkctrl_offs = OMAP4_CM_WKUP_KEYBOARD_CLKCTRL_OFFSET, 1836 .clkctrl_offs = OMAP4_CM_WKUP_KEYBOARD_CLKCTRL_OFFSET,
@@ -1920,7 +1921,7 @@ static struct omap_hwmod omap44xx_mcasp_hwmod = {
1920 .clkdm_name = "abe_clkdm", 1921 .clkdm_name = "abe_clkdm",
1921 .mpu_irqs = omap44xx_mcasp_irqs, 1922 .mpu_irqs = omap44xx_mcasp_irqs,
1922 .sdma_reqs = omap44xx_mcasp_sdma_reqs, 1923 .sdma_reqs = omap44xx_mcasp_sdma_reqs,
1923 .main_clk = "mcasp_fck", 1924 .main_clk = "func_mcasp_abe_gfclk",
1924 .prcm = { 1925 .prcm = {
1925 .omap4 = { 1926 .omap4 = {
1926 .clkctrl_offs = OMAP4_CM1_ABE_MCASP_CLKCTRL_OFFSET, 1927 .clkctrl_offs = OMAP4_CM1_ABE_MCASP_CLKCTRL_OFFSET,
@@ -1972,7 +1973,7 @@ static struct omap_hwmod omap44xx_mcbsp1_hwmod = {
1972 .clkdm_name = "abe_clkdm", 1973 .clkdm_name = "abe_clkdm",
1973 .mpu_irqs = omap44xx_mcbsp1_irqs, 1974 .mpu_irqs = omap44xx_mcbsp1_irqs,
1974 .sdma_reqs = omap44xx_mcbsp1_sdma_reqs, 1975 .sdma_reqs = omap44xx_mcbsp1_sdma_reqs,
1975 .main_clk = "mcbsp1_fck", 1976 .main_clk = "func_mcbsp1_gfclk",
1976 .prcm = { 1977 .prcm = {
1977 .omap4 = { 1978 .omap4 = {
1978 .clkctrl_offs = OMAP4_CM1_ABE_MCBSP1_CLKCTRL_OFFSET, 1979 .clkctrl_offs = OMAP4_CM1_ABE_MCBSP1_CLKCTRL_OFFSET,
@@ -2007,7 +2008,7 @@ static struct omap_hwmod omap44xx_mcbsp2_hwmod = {
2007 .clkdm_name = "abe_clkdm", 2008 .clkdm_name = "abe_clkdm",
2008 .mpu_irqs = omap44xx_mcbsp2_irqs, 2009 .mpu_irqs = omap44xx_mcbsp2_irqs,
2009 .sdma_reqs = omap44xx_mcbsp2_sdma_reqs, 2010 .sdma_reqs = omap44xx_mcbsp2_sdma_reqs,
2010 .main_clk = "mcbsp2_fck", 2011 .main_clk = "func_mcbsp2_gfclk",
2011 .prcm = { 2012 .prcm = {
2012 .omap4 = { 2013 .omap4 = {
2013 .clkctrl_offs = OMAP4_CM1_ABE_MCBSP2_CLKCTRL_OFFSET, 2014 .clkctrl_offs = OMAP4_CM1_ABE_MCBSP2_CLKCTRL_OFFSET,
@@ -2042,7 +2043,7 @@ static struct omap_hwmod omap44xx_mcbsp3_hwmod = {
2042 .clkdm_name = "abe_clkdm", 2043 .clkdm_name = "abe_clkdm",
2043 .mpu_irqs = omap44xx_mcbsp3_irqs, 2044 .mpu_irqs = omap44xx_mcbsp3_irqs,
2044 .sdma_reqs = omap44xx_mcbsp3_sdma_reqs, 2045 .sdma_reqs = omap44xx_mcbsp3_sdma_reqs,
2045 .main_clk = "mcbsp3_fck", 2046 .main_clk = "func_mcbsp3_gfclk",
2046 .prcm = { 2047 .prcm = {
2047 .omap4 = { 2048 .omap4 = {
2048 .clkctrl_offs = OMAP4_CM1_ABE_MCBSP3_CLKCTRL_OFFSET, 2049 .clkctrl_offs = OMAP4_CM1_ABE_MCBSP3_CLKCTRL_OFFSET,
@@ -2077,7 +2078,7 @@ static struct omap_hwmod omap44xx_mcbsp4_hwmod = {
2077 .clkdm_name = "l4_per_clkdm", 2078 .clkdm_name = "l4_per_clkdm",
2078 .mpu_irqs = omap44xx_mcbsp4_irqs, 2079 .mpu_irqs = omap44xx_mcbsp4_irqs,
2079 .sdma_reqs = omap44xx_mcbsp4_sdma_reqs, 2080 .sdma_reqs = omap44xx_mcbsp4_sdma_reqs,
2080 .main_clk = "mcbsp4_fck", 2081 .main_clk = "per_mcbsp4_gfclk",
2081 .prcm = { 2082 .prcm = {
2082 .omap4 = { 2083 .omap4 = {
2083 .clkctrl_offs = OMAP4_CM_L4PER_MCBSP4_CLKCTRL_OFFSET, 2084 .clkctrl_offs = OMAP4_CM_L4PER_MCBSP4_CLKCTRL_OFFSET,
@@ -2140,7 +2141,7 @@ static struct omap_hwmod omap44xx_mcpdm_hwmod = {
2140 .flags = HWMOD_EXT_OPT_MAIN_CLK | HWMOD_SWSUP_SIDLE, 2141 .flags = HWMOD_EXT_OPT_MAIN_CLK | HWMOD_SWSUP_SIDLE,
2141 .mpu_irqs = omap44xx_mcpdm_irqs, 2142 .mpu_irqs = omap44xx_mcpdm_irqs,
2142 .sdma_reqs = omap44xx_mcpdm_sdma_reqs, 2143 .sdma_reqs = omap44xx_mcpdm_sdma_reqs,
2143 .main_clk = "mcpdm_fck", 2144 .main_clk = "pad_clks_ck",
2144 .prcm = { 2145 .prcm = {
2145 .omap4 = { 2146 .omap4 = {
2146 .clkctrl_offs = OMAP4_CM1_ABE_PDM_CLKCTRL_OFFSET, 2147 .clkctrl_offs = OMAP4_CM1_ABE_PDM_CLKCTRL_OFFSET,
@@ -2201,7 +2202,7 @@ static struct omap_hwmod omap44xx_mcspi1_hwmod = {
2201 .clkdm_name = "l4_per_clkdm", 2202 .clkdm_name = "l4_per_clkdm",
2202 .mpu_irqs = omap44xx_mcspi1_irqs, 2203 .mpu_irqs = omap44xx_mcspi1_irqs,
2203 .sdma_reqs = omap44xx_mcspi1_sdma_reqs, 2204 .sdma_reqs = omap44xx_mcspi1_sdma_reqs,
2204 .main_clk = "mcspi1_fck", 2205 .main_clk = "func_48m_fclk",
2205 .prcm = { 2206 .prcm = {
2206 .omap4 = { 2207 .omap4 = {
2207 .clkctrl_offs = OMAP4_CM_L4PER_MCSPI1_CLKCTRL_OFFSET, 2208 .clkctrl_offs = OMAP4_CM_L4PER_MCSPI1_CLKCTRL_OFFSET,
@@ -2237,7 +2238,7 @@ static struct omap_hwmod omap44xx_mcspi2_hwmod = {
2237 .clkdm_name = "l4_per_clkdm", 2238 .clkdm_name = "l4_per_clkdm",
2238 .mpu_irqs = omap44xx_mcspi2_irqs, 2239 .mpu_irqs = omap44xx_mcspi2_irqs,
2239 .sdma_reqs = omap44xx_mcspi2_sdma_reqs, 2240 .sdma_reqs = omap44xx_mcspi2_sdma_reqs,
2240 .main_clk = "mcspi2_fck", 2241 .main_clk = "func_48m_fclk",
2241 .prcm = { 2242 .prcm = {
2242 .omap4 = { 2243 .omap4 = {
2243 .clkctrl_offs = OMAP4_CM_L4PER_MCSPI2_CLKCTRL_OFFSET, 2244 .clkctrl_offs = OMAP4_CM_L4PER_MCSPI2_CLKCTRL_OFFSET,
@@ -2273,7 +2274,7 @@ static struct omap_hwmod omap44xx_mcspi3_hwmod = {
2273 .clkdm_name = "l4_per_clkdm", 2274 .clkdm_name = "l4_per_clkdm",
2274 .mpu_irqs = omap44xx_mcspi3_irqs, 2275 .mpu_irqs = omap44xx_mcspi3_irqs,
2275 .sdma_reqs = omap44xx_mcspi3_sdma_reqs, 2276 .sdma_reqs = omap44xx_mcspi3_sdma_reqs,
2276 .main_clk = "mcspi3_fck", 2277 .main_clk = "func_48m_fclk",
2277 .prcm = { 2278 .prcm = {
2278 .omap4 = { 2279 .omap4 = {
2279 .clkctrl_offs = OMAP4_CM_L4PER_MCSPI3_CLKCTRL_OFFSET, 2280 .clkctrl_offs = OMAP4_CM_L4PER_MCSPI3_CLKCTRL_OFFSET,
@@ -2307,7 +2308,7 @@ static struct omap_hwmod omap44xx_mcspi4_hwmod = {
2307 .clkdm_name = "l4_per_clkdm", 2308 .clkdm_name = "l4_per_clkdm",
2308 .mpu_irqs = omap44xx_mcspi4_irqs, 2309 .mpu_irqs = omap44xx_mcspi4_irqs,
2309 .sdma_reqs = omap44xx_mcspi4_sdma_reqs, 2310 .sdma_reqs = omap44xx_mcspi4_sdma_reqs,
2310 .main_clk = "mcspi4_fck", 2311 .main_clk = "func_48m_fclk",
2311 .prcm = { 2312 .prcm = {
2312 .omap4 = { 2313 .omap4 = {
2313 .clkctrl_offs = OMAP4_CM_L4PER_MCSPI4_CLKCTRL_OFFSET, 2314 .clkctrl_offs = OMAP4_CM_L4PER_MCSPI4_CLKCTRL_OFFSET,
@@ -2363,7 +2364,7 @@ static struct omap_hwmod omap44xx_mmc1_hwmod = {
2363 .clkdm_name = "l3_init_clkdm", 2364 .clkdm_name = "l3_init_clkdm",
2364 .mpu_irqs = omap44xx_mmc1_irqs, 2365 .mpu_irqs = omap44xx_mmc1_irqs,
2365 .sdma_reqs = omap44xx_mmc1_sdma_reqs, 2366 .sdma_reqs = omap44xx_mmc1_sdma_reqs,
2366 .main_clk = "mmc1_fck", 2367 .main_clk = "hsmmc1_fclk",
2367 .prcm = { 2368 .prcm = {
2368 .omap4 = { 2369 .omap4 = {
2369 .clkctrl_offs = OMAP4_CM_L3INIT_MMC1_CLKCTRL_OFFSET, 2370 .clkctrl_offs = OMAP4_CM_L3INIT_MMC1_CLKCTRL_OFFSET,
@@ -2392,7 +2393,7 @@ static struct omap_hwmod omap44xx_mmc2_hwmod = {
2392 .clkdm_name = "l3_init_clkdm", 2393 .clkdm_name = "l3_init_clkdm",
2393 .mpu_irqs = omap44xx_mmc2_irqs, 2394 .mpu_irqs = omap44xx_mmc2_irqs,
2394 .sdma_reqs = omap44xx_mmc2_sdma_reqs, 2395 .sdma_reqs = omap44xx_mmc2_sdma_reqs,
2395 .main_clk = "mmc2_fck", 2396 .main_clk = "hsmmc2_fclk",
2396 .prcm = { 2397 .prcm = {
2397 .omap4 = { 2398 .omap4 = {
2398 .clkctrl_offs = OMAP4_CM_L3INIT_MMC2_CLKCTRL_OFFSET, 2399 .clkctrl_offs = OMAP4_CM_L3INIT_MMC2_CLKCTRL_OFFSET,
@@ -2420,7 +2421,7 @@ static struct omap_hwmod omap44xx_mmc3_hwmod = {
2420 .clkdm_name = "l4_per_clkdm", 2421 .clkdm_name = "l4_per_clkdm",
2421 .mpu_irqs = omap44xx_mmc3_irqs, 2422 .mpu_irqs = omap44xx_mmc3_irqs,
2422 .sdma_reqs = omap44xx_mmc3_sdma_reqs, 2423 .sdma_reqs = omap44xx_mmc3_sdma_reqs,
2423 .main_clk = "mmc3_fck", 2424 .main_clk = "func_48m_fclk",
2424 .prcm = { 2425 .prcm = {
2425 .omap4 = { 2426 .omap4 = {
2426 .clkctrl_offs = OMAP4_CM_L4PER_MMCSD3_CLKCTRL_OFFSET, 2427 .clkctrl_offs = OMAP4_CM_L4PER_MMCSD3_CLKCTRL_OFFSET,
@@ -2448,7 +2449,7 @@ static struct omap_hwmod omap44xx_mmc4_hwmod = {
2448 .clkdm_name = "l4_per_clkdm", 2449 .clkdm_name = "l4_per_clkdm",
2449 .mpu_irqs = omap44xx_mmc4_irqs, 2450 .mpu_irqs = omap44xx_mmc4_irqs,
2450 .sdma_reqs = omap44xx_mmc4_sdma_reqs, 2451 .sdma_reqs = omap44xx_mmc4_sdma_reqs,
2451 .main_clk = "mmc4_fck", 2452 .main_clk = "func_48m_fclk",
2452 .prcm = { 2453 .prcm = {
2453 .omap4 = { 2454 .omap4 = {
2454 .clkctrl_offs = OMAP4_CM_L4PER_MMCSD4_CLKCTRL_OFFSET, 2455 .clkctrl_offs = OMAP4_CM_L4PER_MMCSD4_CLKCTRL_OFFSET,
@@ -2476,7 +2477,7 @@ static struct omap_hwmod omap44xx_mmc5_hwmod = {
2476 .clkdm_name = "l4_per_clkdm", 2477 .clkdm_name = "l4_per_clkdm",
2477 .mpu_irqs = omap44xx_mmc5_irqs, 2478 .mpu_irqs = omap44xx_mmc5_irqs,
2478 .sdma_reqs = omap44xx_mmc5_sdma_reqs, 2479 .sdma_reqs = omap44xx_mmc5_sdma_reqs,
2479 .main_clk = "mmc5_fck", 2480 .main_clk = "func_48m_fclk",
2480 .prcm = { 2481 .prcm = {
2481 .omap4 = { 2482 .omap4 = {
2482 .clkctrl_offs = OMAP4_CM_L4PER_MMCSD5_CLKCTRL_OFFSET, 2483 .clkctrl_offs = OMAP4_CM_L4PER_MMCSD5_CLKCTRL_OFFSET,
@@ -2702,13 +2703,6 @@ static struct resource omap44xx_usb_phy_and_pll_addrs[] = {
2702 .end = 0x4a0ae000, 2703 .end = 0x4a0ae000,
2703 .flags = IORESOURCE_MEM, 2704 .flags = IORESOURCE_MEM,
2704 }, 2705 },
2705 {
2706 /* XXX: Remove this once control module driver is in place */
2707 .name = "ctrl_dev",
2708 .start = 0x4a002300,
2709 .end = 0x4a002303,
2710 .flags = IORESOURCE_MEM,
2711 },
2712 { } 2706 { }
2713}; 2707};
2714 2708
@@ -2725,7 +2719,7 @@ static struct omap_hwmod omap44xx_ocp2scp_usb_phy_hwmod = {
2725 .name = "ocp2scp_usb_phy", 2719 .name = "ocp2scp_usb_phy",
2726 .class = &omap44xx_ocp2scp_hwmod_class, 2720 .class = &omap44xx_ocp2scp_hwmod_class,
2727 .clkdm_name = "l3_init_clkdm", 2721 .clkdm_name = "l3_init_clkdm",
2728 .main_clk = "ocp2scp_usb_phy_phy_48m", 2722 .main_clk = "func_48m_fclk",
2729 .prcm = { 2723 .prcm = {
2730 .omap4 = { 2724 .omap4 = {
2731 .clkctrl_offs = OMAP4_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL_OFFSET, 2725 .clkctrl_offs = OMAP4_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL_OFFSET,
@@ -3162,7 +3156,7 @@ static struct omap_hwmod omap44xx_timer1_hwmod = {
3162 .clkdm_name = "l4_wkup_clkdm", 3156 .clkdm_name = "l4_wkup_clkdm",
3163 .flags = HWMOD_SET_DEFAULT_CLOCKACT, 3157 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
3164 .mpu_irqs = omap44xx_timer1_irqs, 3158 .mpu_irqs = omap44xx_timer1_irqs,
3165 .main_clk = "timer1_fck", 3159 .main_clk = "dmt1_clk_mux",
3166 .prcm = { 3160 .prcm = {
3167 .omap4 = { 3161 .omap4 = {
3168 .clkctrl_offs = OMAP4_CM_WKUP_TIMER1_CLKCTRL_OFFSET, 3162 .clkctrl_offs = OMAP4_CM_WKUP_TIMER1_CLKCTRL_OFFSET,
@@ -3185,7 +3179,7 @@ static struct omap_hwmod omap44xx_timer2_hwmod = {
3185 .clkdm_name = "l4_per_clkdm", 3179 .clkdm_name = "l4_per_clkdm",
3186 .flags = HWMOD_SET_DEFAULT_CLOCKACT, 3180 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
3187 .mpu_irqs = omap44xx_timer2_irqs, 3181 .mpu_irqs = omap44xx_timer2_irqs,
3188 .main_clk = "timer2_fck", 3182 .main_clk = "cm2_dm2_mux",
3189 .prcm = { 3183 .prcm = {
3190 .omap4 = { 3184 .omap4 = {
3191 .clkctrl_offs = OMAP4_CM_L4PER_DMTIMER2_CLKCTRL_OFFSET, 3185 .clkctrl_offs = OMAP4_CM_L4PER_DMTIMER2_CLKCTRL_OFFSET,
@@ -3206,7 +3200,7 @@ static struct omap_hwmod omap44xx_timer3_hwmod = {
3206 .class = &omap44xx_timer_hwmod_class, 3200 .class = &omap44xx_timer_hwmod_class,
3207 .clkdm_name = "l4_per_clkdm", 3201 .clkdm_name = "l4_per_clkdm",
3208 .mpu_irqs = omap44xx_timer3_irqs, 3202 .mpu_irqs = omap44xx_timer3_irqs,
3209 .main_clk = "timer3_fck", 3203 .main_clk = "cm2_dm3_mux",
3210 .prcm = { 3204 .prcm = {
3211 .omap4 = { 3205 .omap4 = {
3212 .clkctrl_offs = OMAP4_CM_L4PER_DMTIMER3_CLKCTRL_OFFSET, 3206 .clkctrl_offs = OMAP4_CM_L4PER_DMTIMER3_CLKCTRL_OFFSET,
@@ -3227,7 +3221,7 @@ static struct omap_hwmod omap44xx_timer4_hwmod = {
3227 .class = &omap44xx_timer_hwmod_class, 3221 .class = &omap44xx_timer_hwmod_class,
3228 .clkdm_name = "l4_per_clkdm", 3222 .clkdm_name = "l4_per_clkdm",
3229 .mpu_irqs = omap44xx_timer4_irqs, 3223 .mpu_irqs = omap44xx_timer4_irqs,
3230 .main_clk = "timer4_fck", 3224 .main_clk = "cm2_dm4_mux",
3231 .prcm = { 3225 .prcm = {
3232 .omap4 = { 3226 .omap4 = {
3233 .clkctrl_offs = OMAP4_CM_L4PER_DMTIMER4_CLKCTRL_OFFSET, 3227 .clkctrl_offs = OMAP4_CM_L4PER_DMTIMER4_CLKCTRL_OFFSET,
@@ -3248,7 +3242,7 @@ static struct omap_hwmod omap44xx_timer5_hwmod = {
3248 .class = &omap44xx_timer_hwmod_class, 3242 .class = &omap44xx_timer_hwmod_class,
3249 .clkdm_name = "abe_clkdm", 3243 .clkdm_name = "abe_clkdm",
3250 .mpu_irqs = omap44xx_timer5_irqs, 3244 .mpu_irqs = omap44xx_timer5_irqs,
3251 .main_clk = "timer5_fck", 3245 .main_clk = "timer5_sync_mux",
3252 .prcm = { 3246 .prcm = {
3253 .omap4 = { 3247 .omap4 = {
3254 .clkctrl_offs = OMAP4_CM1_ABE_TIMER5_CLKCTRL_OFFSET, 3248 .clkctrl_offs = OMAP4_CM1_ABE_TIMER5_CLKCTRL_OFFSET,
@@ -3270,8 +3264,7 @@ static struct omap_hwmod omap44xx_timer6_hwmod = {
3270 .class = &omap44xx_timer_hwmod_class, 3264 .class = &omap44xx_timer_hwmod_class,
3271 .clkdm_name = "abe_clkdm", 3265 .clkdm_name = "abe_clkdm",
3272 .mpu_irqs = omap44xx_timer6_irqs, 3266 .mpu_irqs = omap44xx_timer6_irqs,
3273 3267 .main_clk = "timer6_sync_mux",
3274 .main_clk = "timer6_fck",
3275 .prcm = { 3268 .prcm = {
3276 .omap4 = { 3269 .omap4 = {
3277 .clkctrl_offs = OMAP4_CM1_ABE_TIMER6_CLKCTRL_OFFSET, 3270 .clkctrl_offs = OMAP4_CM1_ABE_TIMER6_CLKCTRL_OFFSET,
@@ -3293,7 +3286,7 @@ static struct omap_hwmod omap44xx_timer7_hwmod = {
3293 .class = &omap44xx_timer_hwmod_class, 3286 .class = &omap44xx_timer_hwmod_class,
3294 .clkdm_name = "abe_clkdm", 3287 .clkdm_name = "abe_clkdm",
3295 .mpu_irqs = omap44xx_timer7_irqs, 3288 .mpu_irqs = omap44xx_timer7_irqs,
3296 .main_clk = "timer7_fck", 3289 .main_clk = "timer7_sync_mux",
3297 .prcm = { 3290 .prcm = {
3298 .omap4 = { 3291 .omap4 = {
3299 .clkctrl_offs = OMAP4_CM1_ABE_TIMER7_CLKCTRL_OFFSET, 3292 .clkctrl_offs = OMAP4_CM1_ABE_TIMER7_CLKCTRL_OFFSET,
@@ -3315,7 +3308,7 @@ static struct omap_hwmod omap44xx_timer8_hwmod = {
3315 .class = &omap44xx_timer_hwmod_class, 3308 .class = &omap44xx_timer_hwmod_class,
3316 .clkdm_name = "abe_clkdm", 3309 .clkdm_name = "abe_clkdm",
3317 .mpu_irqs = omap44xx_timer8_irqs, 3310 .mpu_irqs = omap44xx_timer8_irqs,
3318 .main_clk = "timer8_fck", 3311 .main_clk = "timer8_sync_mux",
3319 .prcm = { 3312 .prcm = {
3320 .omap4 = { 3313 .omap4 = {
3321 .clkctrl_offs = OMAP4_CM1_ABE_TIMER8_CLKCTRL_OFFSET, 3314 .clkctrl_offs = OMAP4_CM1_ABE_TIMER8_CLKCTRL_OFFSET,
@@ -3337,7 +3330,7 @@ static struct omap_hwmod omap44xx_timer9_hwmod = {
3337 .class = &omap44xx_timer_hwmod_class, 3330 .class = &omap44xx_timer_hwmod_class,
3338 .clkdm_name = "l4_per_clkdm", 3331 .clkdm_name = "l4_per_clkdm",
3339 .mpu_irqs = omap44xx_timer9_irqs, 3332 .mpu_irqs = omap44xx_timer9_irqs,
3340 .main_clk = "timer9_fck", 3333 .main_clk = "cm2_dm9_mux",
3341 .prcm = { 3334 .prcm = {
3342 .omap4 = { 3335 .omap4 = {
3343 .clkctrl_offs = OMAP4_CM_L4PER_DMTIMER9_CLKCTRL_OFFSET, 3336 .clkctrl_offs = OMAP4_CM_L4PER_DMTIMER9_CLKCTRL_OFFSET,
@@ -3360,7 +3353,7 @@ static struct omap_hwmod omap44xx_timer10_hwmod = {
3360 .clkdm_name = "l4_per_clkdm", 3353 .clkdm_name = "l4_per_clkdm",
3361 .flags = HWMOD_SET_DEFAULT_CLOCKACT, 3354 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
3362 .mpu_irqs = omap44xx_timer10_irqs, 3355 .mpu_irqs = omap44xx_timer10_irqs,
3363 .main_clk = "timer10_fck", 3356 .main_clk = "cm2_dm10_mux",
3364 .prcm = { 3357 .prcm = {
3365 .omap4 = { 3358 .omap4 = {
3366 .clkctrl_offs = OMAP4_CM_L4PER_DMTIMER10_CLKCTRL_OFFSET, 3359 .clkctrl_offs = OMAP4_CM_L4PER_DMTIMER10_CLKCTRL_OFFSET,
@@ -3382,7 +3375,7 @@ static struct omap_hwmod omap44xx_timer11_hwmod = {
3382 .class = &omap44xx_timer_hwmod_class, 3375 .class = &omap44xx_timer_hwmod_class,
3383 .clkdm_name = "l4_per_clkdm", 3376 .clkdm_name = "l4_per_clkdm",
3384 .mpu_irqs = omap44xx_timer11_irqs, 3377 .mpu_irqs = omap44xx_timer11_irqs,
3385 .main_clk = "timer11_fck", 3378 .main_clk = "cm2_dm11_mux",
3386 .prcm = { 3379 .prcm = {
3387 .omap4 = { 3380 .omap4 = {
3388 .clkctrl_offs = OMAP4_CM_L4PER_DMTIMER11_CLKCTRL_OFFSET, 3381 .clkctrl_offs = OMAP4_CM_L4PER_DMTIMER11_CLKCTRL_OFFSET,
@@ -3433,7 +3426,7 @@ static struct omap_hwmod omap44xx_uart1_hwmod = {
3433 .clkdm_name = "l4_per_clkdm", 3426 .clkdm_name = "l4_per_clkdm",
3434 .mpu_irqs = omap44xx_uart1_irqs, 3427 .mpu_irqs = omap44xx_uart1_irqs,
3435 .sdma_reqs = omap44xx_uart1_sdma_reqs, 3428 .sdma_reqs = omap44xx_uart1_sdma_reqs,
3436 .main_clk = "uart1_fck", 3429 .main_clk = "func_48m_fclk",
3437 .prcm = { 3430 .prcm = {
3438 .omap4 = { 3431 .omap4 = {
3439 .clkctrl_offs = OMAP4_CM_L4PER_UART1_CLKCTRL_OFFSET, 3432 .clkctrl_offs = OMAP4_CM_L4PER_UART1_CLKCTRL_OFFSET,
@@ -3461,7 +3454,7 @@ static struct omap_hwmod omap44xx_uart2_hwmod = {
3461 .clkdm_name = "l4_per_clkdm", 3454 .clkdm_name = "l4_per_clkdm",
3462 .mpu_irqs = omap44xx_uart2_irqs, 3455 .mpu_irqs = omap44xx_uart2_irqs,
3463 .sdma_reqs = omap44xx_uart2_sdma_reqs, 3456 .sdma_reqs = omap44xx_uart2_sdma_reqs,
3464 .main_clk = "uart2_fck", 3457 .main_clk = "func_48m_fclk",
3465 .prcm = { 3458 .prcm = {
3466 .omap4 = { 3459 .omap4 = {
3467 .clkctrl_offs = OMAP4_CM_L4PER_UART2_CLKCTRL_OFFSET, 3460 .clkctrl_offs = OMAP4_CM_L4PER_UART2_CLKCTRL_OFFSET,
@@ -3490,7 +3483,7 @@ static struct omap_hwmod omap44xx_uart3_hwmod = {
3490 .flags = HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET, 3483 .flags = HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET,
3491 .mpu_irqs = omap44xx_uart3_irqs, 3484 .mpu_irqs = omap44xx_uart3_irqs,
3492 .sdma_reqs = omap44xx_uart3_sdma_reqs, 3485 .sdma_reqs = omap44xx_uart3_sdma_reqs,
3493 .main_clk = "uart3_fck", 3486 .main_clk = "func_48m_fclk",
3494 .prcm = { 3487 .prcm = {
3495 .omap4 = { 3488 .omap4 = {
3496 .clkctrl_offs = OMAP4_CM_L4PER_UART3_CLKCTRL_OFFSET, 3489 .clkctrl_offs = OMAP4_CM_L4PER_UART3_CLKCTRL_OFFSET,
@@ -3518,7 +3511,7 @@ static struct omap_hwmod omap44xx_uart4_hwmod = {
3518 .clkdm_name = "l4_per_clkdm", 3511 .clkdm_name = "l4_per_clkdm",
3519 .mpu_irqs = omap44xx_uart4_irqs, 3512 .mpu_irqs = omap44xx_uart4_irqs,
3520 .sdma_reqs = omap44xx_uart4_sdma_reqs, 3513 .sdma_reqs = omap44xx_uart4_sdma_reqs,
3521 .main_clk = "uart4_fck", 3514 .main_clk = "func_48m_fclk",
3522 .prcm = { 3515 .prcm = {
3523 .omap4 = { 3516 .omap4 = {
3524 .clkctrl_offs = OMAP4_CM_L4PER_UART4_CLKCTRL_OFFSET, 3517 .clkctrl_offs = OMAP4_CM_L4PER_UART4_CLKCTRL_OFFSET,
@@ -3797,7 +3790,7 @@ static struct omap_hwmod omap44xx_wd_timer2_hwmod = {
3797 .class = &omap44xx_wd_timer_hwmod_class, 3790 .class = &omap44xx_wd_timer_hwmod_class,
3798 .clkdm_name = "l4_wkup_clkdm", 3791 .clkdm_name = "l4_wkup_clkdm",
3799 .mpu_irqs = omap44xx_wd_timer2_irqs, 3792 .mpu_irqs = omap44xx_wd_timer2_irqs,
3800 .main_clk = "wd_timer2_fck", 3793 .main_clk = "sys_32k_ck",
3801 .prcm = { 3794 .prcm = {
3802 .omap4 = { 3795 .omap4 = {
3803 .clkctrl_offs = OMAP4_CM_WKUP_WDT2_CLKCTRL_OFFSET, 3796 .clkctrl_offs = OMAP4_CM_WKUP_WDT2_CLKCTRL_OFFSET,
@@ -3818,7 +3811,7 @@ static struct omap_hwmod omap44xx_wd_timer3_hwmod = {
3818 .class = &omap44xx_wd_timer_hwmod_class, 3811 .class = &omap44xx_wd_timer_hwmod_class,
3819 .clkdm_name = "abe_clkdm", 3812 .clkdm_name = "abe_clkdm",
3820 .mpu_irqs = omap44xx_wd_timer3_irqs, 3813 .mpu_irqs = omap44xx_wd_timer3_irqs,
3821 .main_clk = "wd_timer3_fck", 3814 .main_clk = "sys_32k_ck",
3822 .prcm = { 3815 .prcm = {
3823 .omap4 = { 3816 .omap4 = {
3824 .clkctrl_offs = OMAP4_CM1_ABE_WDT3_CLKCTRL_OFFSET, 3817 .clkctrl_offs = OMAP4_CM1_ABE_WDT3_CLKCTRL_OFFSET,
@@ -4249,6 +4242,27 @@ static struct omap_hwmod_ocp_if omap44xx_l4_cfg__ocp_wp_noc = {
4249 4242
4250static struct omap_hwmod_addr_space omap44xx_aess_addrs[] = { 4243static struct omap_hwmod_addr_space omap44xx_aess_addrs[] = {
4251 { 4244 {
4245 .name = "dmem",
4246 .pa_start = 0x40180000,
4247 .pa_end = 0x4018ffff
4248 },
4249 {
4250 .name = "cmem",
4251 .pa_start = 0x401a0000,
4252 .pa_end = 0x401a1fff
4253 },
4254 {
4255 .name = "smem",
4256 .pa_start = 0x401c0000,
4257 .pa_end = 0x401c5fff
4258 },
4259 {
4260 .name = "pmem",
4261 .pa_start = 0x401e0000,
4262 .pa_end = 0x401e1fff
4263 },
4264 {
4265 .name = "mpu",
4252 .pa_start = 0x401f1000, 4266 .pa_start = 0x401f1000,
4253 .pa_end = 0x401f13ff, 4267 .pa_end = 0x401f13ff,
4254 .flags = ADDR_TYPE_RT 4268 .flags = ADDR_TYPE_RT
@@ -4267,6 +4281,27 @@ static struct omap_hwmod_ocp_if __maybe_unused omap44xx_l4_abe__aess = {
4267 4281
4268static struct omap_hwmod_addr_space omap44xx_aess_dma_addrs[] = { 4282static struct omap_hwmod_addr_space omap44xx_aess_dma_addrs[] = {
4269 { 4283 {
4284 .name = "dmem_dma",
4285 .pa_start = 0x49080000,
4286 .pa_end = 0x4908ffff
4287 },
4288 {
4289 .name = "cmem_dma",
4290 .pa_start = 0x490a0000,
4291 .pa_end = 0x490a1fff
4292 },
4293 {
4294 .name = "smem_dma",
4295 .pa_start = 0x490c0000,
4296 .pa_end = 0x490c5fff
4297 },
4298 {
4299 .name = "pmem_dma",
4300 .pa_start = 0x490e0000,
4301 .pa_end = 0x490e1fff
4302 },
4303 {
4304 .name = "dma",
4270 .pa_start = 0x490f1000, 4305 .pa_start = 0x490f1000,
4271 .pa_end = 0x490f13ff, 4306 .pa_end = 0x490f13ff,
4272 .flags = ADDR_TYPE_RT 4307 .flags = ADDR_TYPE_RT
@@ -6156,12 +6191,6 @@ static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = {
6156 .pa_end = 0x4a0ab7ff, 6191 .pa_end = 0x4a0ab7ff,
6157 .flags = ADDR_TYPE_RT 6192 .flags = ADDR_TYPE_RT
6158 }, 6193 },
6159 {
6160 /* XXX: Remove this once control module driver is in place */
6161 .pa_start = 0x4a00233c,
6162 .pa_end = 0x4a00233f,
6163 .flags = ADDR_TYPE_RT
6164 },
6165 { } 6194 { }
6166}; 6195};
6167 6196
@@ -6282,7 +6311,7 @@ static struct omap_hwmod_ocp_if *omap44xx_hwmod_ocp_ifs[] __initdata = {
6282 &omap44xx_l3_main_1__l3_main_3, 6311 &omap44xx_l3_main_1__l3_main_3,
6283 &omap44xx_l3_main_2__l3_main_3, 6312 &omap44xx_l3_main_2__l3_main_3,
6284 &omap44xx_l4_cfg__l3_main_3, 6313 &omap44xx_l4_cfg__l3_main_3,
6285 /* &omap44xx_aess__l4_abe, */ 6314 &omap44xx_aess__l4_abe,
6286 &omap44xx_dsp__l4_abe, 6315 &omap44xx_dsp__l4_abe,
6287 &omap44xx_l3_main_1__l4_abe, 6316 &omap44xx_l3_main_1__l4_abe,
6288 &omap44xx_mpu__l4_abe, 6317 &omap44xx_mpu__l4_abe,
@@ -6291,8 +6320,8 @@ static struct omap_hwmod_ocp_if *omap44xx_hwmod_ocp_ifs[] __initdata = {
6291 &omap44xx_l4_cfg__l4_wkup, 6320 &omap44xx_l4_cfg__l4_wkup,
6292 &omap44xx_mpu__mpu_private, 6321 &omap44xx_mpu__mpu_private,
6293 &omap44xx_l4_cfg__ocp_wp_noc, 6322 &omap44xx_l4_cfg__ocp_wp_noc,
6294 /* &omap44xx_l4_abe__aess, */ 6323 &omap44xx_l4_abe__aess,
6295 /* &omap44xx_l4_abe__aess_dma, */ 6324 &omap44xx_l4_abe__aess_dma,
6296 &omap44xx_l3_main_2__c2c, 6325 &omap44xx_l3_main_2__c2c,
6297 &omap44xx_l4_wkup__counter_32k, 6326 &omap44xx_l4_wkup__counter_32k,
6298 &omap44xx_l4_cfg__ctrl_module_core, 6327 &omap44xx_l4_cfg__ctrl_module_core,
diff --git a/arch/arm/mach-omap2/omap_hwmod_reset.c b/arch/arm/mach-omap2/omap_hwmod_reset.c
new file mode 100644
index 000000000000..65e186c9df55
--- /dev/null
+++ b/arch/arm/mach-omap2/omap_hwmod_reset.c
@@ -0,0 +1,53 @@
1/*
2 * OMAP IP block custom reset and preprogramming stubs
3 *
4 * Copyright (C) 2012 Texas Instruments, Inc.
5 * Paul Walmsley
6 *
7 * A small number of IP blocks need custom reset and preprogramming
8 * functions. The stubs in this file provide a standard way for the
9 * hwmod code to call these functions, which are to be located under
10 * drivers/.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License as
14 * published by the Free Software Foundation version 2.
15 *
16 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
17 * kind, whether express or implied; without even the implied warranty
18 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
24 * 02110-1301 USA
25 */
26#include <linux/kernel.h>
27#include <linux/errno.h>
28
29#include <sound/aess.h>
30
31#include "omap_hwmod.h"
32
33/**
34 * omap_hwmod_aess_preprogram - enable AESS internal autogating
35 * @oh: struct omap_hwmod *
36 *
37 * The AESS will not IdleAck to the PRCM until its internal autogating
38 * is enabled. Since internal autogating is disabled by default after
39 * AESS reset, we must enable autogating after the hwmod code resets
40 * the AESS. Returns 0.
41 */
42int omap_hwmod_aess_preprogram(struct omap_hwmod *oh)
43{
44 void __iomem *va;
45
46 va = omap_hwmod_get_mpu_rt_va(oh);
47 if (!va)
48 return -EINVAL;
49
50 aess_enable_autogating(va);
51
52 return 0;
53}
diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c
index e237602e10ea..eb8a25de67ed 100644
--- a/arch/arm/mach-omap2/omap_phy_internal.c
+++ b/arch/arm/mach-omap2/omap_phy_internal.c
@@ -63,7 +63,7 @@ static int __init omap4430_phy_power_down(void)
63 63
64 return 0; 64 return 0;
65} 65}
66early_initcall(omap4430_phy_power_down); 66omap_early_initcall(omap4430_phy_power_down);
67 67
68void am35x_musb_reset(void) 68void am35x_musb_reset(void)
69{ 69{
diff --git a/arch/arm/mach-omap2/opp3xxx_data.c b/arch/arm/mach-omap2/opp3xxx_data.c
index 62772e0e0d69..fc67add76444 100644
--- a/arch/arm/mach-omap2/opp3xxx_data.c
+++ b/arch/arm/mach-omap2/opp3xxx_data.c
@@ -168,4 +168,4 @@ int __init omap3_opp_init(void)
168 168
169 return r; 169 return r;
170} 170}
171device_initcall(omap3_opp_init); 171omap_device_initcall(omap3_opp_init);
diff --git a/arch/arm/mach-omap2/opp4xxx_data.c b/arch/arm/mach-omap2/opp4xxx_data.c
index d470b728e720..1ef7a3e5ce4a 100644
--- a/arch/arm/mach-omap2/opp4xxx_data.c
+++ b/arch/arm/mach-omap2/opp4xxx_data.c
@@ -177,4 +177,4 @@ int __init omap4_opp_init(void)
177 ARRAY_SIZE(omap446x_opp_def_list)); 177 ARRAY_SIZE(omap446x_opp_def_list));
178 return r; 178 return r;
179} 179}
180device_initcall(omap4_opp_init); 180omap_device_initcall(omap4_opp_init);
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index e2c291f52f92..1edd000a8143 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -83,10 +83,8 @@ static int clkdm_dbg_show_counter(struct clockdomain *clkdm, void *user)
83 strncmp(clkdm->name, "dpll", 4) == 0) 83 strncmp(clkdm->name, "dpll", 4) == 0)
84 return 0; 84 return 0;
85 85
86 seq_printf(s, "%s->%s (%d)", clkdm->name, 86 seq_printf(s, "%s->%s (%d)\n", clkdm->name, clkdm->pwrdm.ptr->name,
87 clkdm->pwrdm.ptr->name, 87 clkdm->usecount);
88 atomic_read(&clkdm->usecount));
89 seq_printf(s, "\n");
90 88
91 return 0; 89 return 0;
92} 90}
@@ -279,6 +277,6 @@ static int __init pm_dbg_init(void)
279 277
280 return 0; 278 return 0;
281} 279}
282arch_initcall(pm_dbg_init); 280omap_arch_initcall(pm_dbg_init);
283 281
284#endif 282#endif
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index f4b3143a8b1d..673a4c1d1d76 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -32,8 +32,6 @@
32#include "pm.h" 32#include "pm.h"
33#include "twl-common.h" 33#include "twl-common.h"
34 34
35static struct omap_device_pm_latency *pm_lats;
36
37/* 35/*
38 * omap_pm_suspend: points to a function that does the SoC-specific 36 * omap_pm_suspend: points to a function that does the SoC-specific
39 * suspend work 37 * suspend work
@@ -82,7 +80,7 @@ static int __init _init_omap_device(char *name)
82 __func__, name)) 80 __func__, name))
83 return -ENODEV; 81 return -ENODEV;
84 82
85 pdev = omap_device_build(oh->name, 0, oh, NULL, 0, pm_lats, 0, false); 83 pdev = omap_device_build(oh->name, 0, oh, NULL, 0);
86 if (WARN(IS_ERR(pdev), "%s: could not build omap_device for %s\n", 84 if (WARN(IS_ERR(pdev), "%s: could not build omap_device for %s\n",
87 __func__, name)) 85 __func__, name))
88 return -ENODEV; 86 return -ENODEV;
@@ -108,80 +106,19 @@ static void __init omap2_init_processor_devices(void)
108 } 106 }
109} 107}
110 108
111/* Types of sleep_switch used in omap_set_pwrdm_state */
112#define FORCEWAKEUP_SWITCH 0
113#define LOWPOWERSTATE_SWITCH 1
114
115int __init omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused) 109int __init omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused)
116{ 110{
111 /* XXX The usecount test is racy */
117 if ((clkdm->flags & CLKDM_CAN_ENABLE_AUTO) && 112 if ((clkdm->flags & CLKDM_CAN_ENABLE_AUTO) &&
118 !(clkdm->flags & CLKDM_MISSING_IDLE_REPORTING)) 113 !(clkdm->flags & CLKDM_MISSING_IDLE_REPORTING))
119 clkdm_allow_idle(clkdm); 114 clkdm_allow_idle(clkdm);
120 else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP && 115 else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP &&
121 atomic_read(&clkdm->usecount) == 0) 116 clkdm->usecount == 0)
122 clkdm_sleep(clkdm); 117 clkdm_sleep(clkdm);
123 return 0; 118 return 0;
124} 119}
125 120
126/* 121/*
127 * This sets pwrdm state (other than mpu & core. Currently only ON &
128 * RET are supported.
129 */
130int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 pwrst)
131{
132 u8 curr_pwrst, next_pwrst;
133 int sleep_switch = -1, ret = 0, hwsup = 0;
134
135 if (!pwrdm || IS_ERR(pwrdm))
136 return -EINVAL;
137
138 while (!(pwrdm->pwrsts & (1 << pwrst))) {
139 if (pwrst == PWRDM_POWER_OFF)
140 return ret;
141 pwrst--;
142 }
143
144 next_pwrst = pwrdm_read_next_pwrst(pwrdm);
145 if (next_pwrst == pwrst)
146 return ret;
147
148 curr_pwrst = pwrdm_read_pwrst(pwrdm);
149 if (curr_pwrst < PWRDM_POWER_ON) {
150 if ((curr_pwrst > pwrst) &&
151 (pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE)) {
152 sleep_switch = LOWPOWERSTATE_SWITCH;
153 } else {
154 hwsup = clkdm_in_hwsup(pwrdm->pwrdm_clkdms[0]);
155 clkdm_wakeup(pwrdm->pwrdm_clkdms[0]);
156 sleep_switch = FORCEWAKEUP_SWITCH;
157 }
158 }
159
160 ret = pwrdm_set_next_pwrst(pwrdm, pwrst);
161 if (ret)
162 pr_err("%s: unable to set power state of powerdomain: %s\n",
163 __func__, pwrdm->name);
164
165 switch (sleep_switch) {
166 case FORCEWAKEUP_SWITCH:
167 if (hwsup)
168 clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]);
169 else
170 clkdm_sleep(pwrdm->pwrdm_clkdms[0]);
171 break;
172 case LOWPOWERSTATE_SWITCH:
173 pwrdm_set_lowpwrstchange(pwrdm);
174 pwrdm_wait_transition(pwrdm);
175 pwrdm_state_switch(pwrdm);
176 break;
177 }
178
179 return ret;
180}
181
182
183
184/*
185 * This API is to be called during init to set the various voltage 122 * This API is to be called during init to set the various voltage
186 * domains to the voltage as per the opp table. Typically we boot up 123 * domains to the voltage as per the opp table. Typically we boot up
187 * at the nominal voltage. So this function finds out the rate of 124 * at the nominal voltage. So this function finds out the rate of
@@ -336,7 +273,7 @@ static int __init omap2_common_pm_init(void)
336 273
337 return 0; 274 return 0;
338} 275}
339postcore_initcall(omap2_common_pm_init); 276omap_postcore_initcall(omap2_common_pm_init);
340 277
341int __init omap2_common_pm_late_init(void) 278int __init omap2_common_pm_late_init(void)
342{ 279{
@@ -345,19 +282,19 @@ int __init omap2_common_pm_late_init(void)
345 * a completely different mechanism. 282 * a completely different mechanism.
346 * Disable this part if a DT blob is available. 283 * Disable this part if a DT blob is available.
347 */ 284 */
348 if (of_have_populated_dt()) 285 if (!of_have_populated_dt()) {
349 return 0;
350 286
351 /* Init the voltage layer */ 287 /* Init the voltage layer */
352 omap_pmic_late_init(); 288 omap_pmic_late_init();
353 omap_voltage_late_init(); 289 omap_voltage_late_init();
354 290
355 /* Initialize the voltages */ 291 /* Initialize the voltages */
356 omap3_init_voltages(); 292 omap3_init_voltages();
357 omap4_init_voltages(); 293 omap4_init_voltages();
358 294
359 /* Smartreflex device init */ 295 /* Smartreflex device init */
360 omap_devinit_smartreflex(); 296 omap_devinit_smartreflex();
297 }
361 298
362#ifdef CONFIG_SUSPEND 299#ifdef CONFIG_SUSPEND
363 suspend_set_ops(&omap_pm_ops); 300 suspend_set_ops(&omap_pm_ops);
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index c22503b17abd..7bdd22afce69 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -33,7 +33,6 @@ static inline int omap4_idle_init(void)
33extern void *omap3_secure_ram_storage; 33extern void *omap3_secure_ram_storage;
34extern void omap3_pm_off_mode_enable(int); 34extern void omap3_pm_off_mode_enable(int);
35extern void omap_sram_idle(void); 35extern void omap_sram_idle(void);
36extern int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state);
37extern int omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused); 36extern int omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused);
38extern int (*omap_pm_suspend)(void); 37extern int (*omap_pm_suspend)(void);
39 38
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c
index c333fa6dffa8..b59d93908341 100644
--- a/arch/arm/mach-omap2/pm24xx.c
+++ b/arch/arm/mach-omap2/pm24xx.c
@@ -54,7 +54,6 @@
54#include "powerdomain.h" 54#include "powerdomain.h"
55#include "clockdomain.h" 55#include "clockdomain.h"
56 56
57static void (*omap2_sram_idle)(void);
58static void (*omap2_sram_suspend)(u32 dllctrl, void __iomem *sdrc_dlla_ctrl, 57static void (*omap2_sram_suspend)(u32 dllctrl, void __iomem *sdrc_dlla_ctrl,
59 void __iomem *sdrc_power); 58 void __iomem *sdrc_power);
60 59
@@ -90,11 +89,7 @@ static int omap2_enter_full_retention(void)
90 omap2_prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP24XX_PM_WKST2); 89 omap2_prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP24XX_PM_WKST2);
91 omap2_prm_write_mod_reg(0xffffffff, WKUP_MOD, PM_WKST); 90 omap2_prm_write_mod_reg(0xffffffff, WKUP_MOD, PM_WKST);
92 91
93 /* 92 pwrdm_set_next_pwrst(core_pwrdm, PWRDM_POWER_RET);
94 * Set MPU powerdomain's next power state to RETENTION;
95 * preserve logic state during retention
96 */
97 pwrdm_set_logic_retst(mpu_pwrdm, PWRDM_POWER_RET);
98 pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_RET); 93 pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_RET);
99 94
100 /* Workaround to kill USB */ 95 /* Workaround to kill USB */
@@ -137,15 +132,10 @@ no_sleep:
137 /* Mask future PRCM-to-MPU interrupts */ 132 /* Mask future PRCM-to-MPU interrupts */
138 omap2_prm_write_mod_reg(0x0, OCP_MOD, OMAP2_PRCM_IRQSTATUS_MPU_OFFSET); 133 omap2_prm_write_mod_reg(0x0, OCP_MOD, OMAP2_PRCM_IRQSTATUS_MPU_OFFSET);
139 134
140 return 0; 135 pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON);
141} 136 pwrdm_set_next_pwrst(core_pwrdm, PWRDM_POWER_ON);
142
143static int omap2_i2c_active(void)
144{
145 u32 l;
146 137
147 l = omap2_cm_read_mod_reg(CORE_MOD, CM_FCLKEN1); 138 return 0;
148 return l & (OMAP2420_EN_I2C2_MASK | OMAP2420_EN_I2C1_MASK);
149} 139}
150 140
151static int sti_console_enabled; 141static int sti_console_enabled;
@@ -172,10 +162,7 @@ static int omap2_allow_mpu_retention(void)
172 162
173static void omap2_enter_mpu_retention(void) 163static void omap2_enter_mpu_retention(void)
174{ 164{
175 /* Putting MPU into the WFI state while a transfer is active 165 const int zero = 0;
176 * seems to cause the I2C block to timeout. Why? Good question. */
177 if (omap2_i2c_active())
178 return;
179 166
180 /* The peripherals seem not to be able to wake up the MPU when 167 /* The peripherals seem not to be able to wake up the MPU when
181 * it is in retention mode. */ 168 * it is in retention mode. */
@@ -186,17 +173,17 @@ static void omap2_enter_mpu_retention(void)
186 omap2_prm_write_mod_reg(0xffffffff, WKUP_MOD, PM_WKST); 173 omap2_prm_write_mod_reg(0xffffffff, WKUP_MOD, PM_WKST);
187 174
188 /* Try to enter MPU retention */ 175 /* Try to enter MPU retention */
189 omap2_prm_write_mod_reg((0x01 << OMAP_POWERSTATE_SHIFT) | 176 pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_RET);
190 OMAP_LOGICRETSTATE_MASK, 177
191 MPU_MOD, OMAP2_PM_PWSTCTRL);
192 } else { 178 } else {
193 /* Block MPU retention */ 179 /* Block MPU retention */
194 180 pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON);
195 omap2_prm_write_mod_reg(OMAP_LOGICRETSTATE_MASK, MPU_MOD,
196 OMAP2_PM_PWSTCTRL);
197 } 181 }
198 182
199 omap2_sram_idle(); 183 /* WFI */
184 asm("mcr p15, 0, %0, c7, c0, 4" : : "r" (zero) : "memory", "cc");
185
186 pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON);
200} 187}
201 188
202static int omap2_can_sleep(void) 189static int omap2_can_sleep(void)
@@ -251,25 +238,17 @@ static void __init prcm_setup_regs(void)
251 for (i = 0; i < num_mem_banks; i++) 238 for (i = 0; i < num_mem_banks; i++)
252 pwrdm_set_mem_retst(core_pwrdm, i, PWRDM_POWER_RET); 239 pwrdm_set_mem_retst(core_pwrdm, i, PWRDM_POWER_RET);
253 240
254 /* Set CORE powerdomain's next power state to RETENTION */ 241 pwrdm_set_logic_retst(core_pwrdm, PWRDM_POWER_RET);
255 pwrdm_set_next_pwrst(core_pwrdm, PWRDM_POWER_RET);
256 242
257 /*
258 * Set MPU powerdomain's next power state to RETENTION;
259 * preserve logic state during retention
260 */
261 pwrdm_set_logic_retst(mpu_pwrdm, PWRDM_POWER_RET); 243 pwrdm_set_logic_retst(mpu_pwrdm, PWRDM_POWER_RET);
262 pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_RET);
263 244
264 /* Force-power down DSP, GFX powerdomains */ 245 /* Force-power down DSP, GFX powerdomains */
265 246
266 pwrdm = clkdm_get_pwrdm(dsp_clkdm); 247 pwrdm = clkdm_get_pwrdm(dsp_clkdm);
267 pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF); 248 pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF);
268 clkdm_sleep(dsp_clkdm);
269 249
270 pwrdm = clkdm_get_pwrdm(gfx_clkdm); 250 pwrdm = clkdm_get_pwrdm(gfx_clkdm);
271 pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF); 251 pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF);
272 clkdm_sleep(gfx_clkdm);
273 252
274 /* Enable hardware-supervised idle for all clkdms */ 253 /* Enable hardware-supervised idle for all clkdms */
275 clkdm_for_each(omap_pm_clkdms_setup, NULL); 254 clkdm_for_each(omap_pm_clkdms_setup, NULL);
@@ -356,11 +335,9 @@ int __init omap2_pm_init(void)
356 /* 335 /*
357 * We copy the assembler sleep/wakeup routines to SRAM. 336 * We copy the assembler sleep/wakeup routines to SRAM.
358 * These routines need to be in SRAM as that's the only 337 * These routines need to be in SRAM as that's the only
359 * memory the MPU can see when it wakes up. 338 * memory the MPU can see when it wakes up after the entire
339 * chip enters idle.
360 */ 340 */
361 omap2_sram_idle = omap_sram_push(omap24xx_idle_loop_suspend,
362 omap24xx_idle_loop_suspend_sz);
363
364 omap2_sram_suspend = omap_sram_push(omap24xx_cpu_suspend, 341 omap2_sram_suspend = omap_sram_push(omap24xx_cpu_suspend,
365 omap24xx_cpu_suspend_sz); 342 omap24xx_cpu_suspend_sz);
366 343
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 7be3622cfc85..2d93d8b23835 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -351,12 +351,10 @@ static void omap3_pm_idle(void)
351 if (omap_irq_pending()) 351 if (omap_irq_pending())
352 goto out; 352 goto out;
353 353
354 trace_power_start(POWER_CSTATE, 1, smp_processor_id());
355 trace_cpu_idle(1, smp_processor_id()); 354 trace_cpu_idle(1, smp_processor_id());
356 355
357 omap_sram_idle(); 356 omap_sram_idle();
358 357
359 trace_power_end(smp_processor_id());
360 trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id()); 358 trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
361 359
362out: 360out:
diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c
index aa6fd98f606e..ea62e75ef21d 100644
--- a/arch/arm/mach-omap2/pm44xx.c
+++ b/arch/arm/mach-omap2/pm44xx.c
@@ -77,10 +77,20 @@ static int omap4_pm_suspend(void)
77 omap_set_pwrdm_state(pwrst->pwrdm, pwrst->saved_state); 77 omap_set_pwrdm_state(pwrst->pwrdm, pwrst->saved_state);
78 pwrdm_set_logic_retst(pwrst->pwrdm, pwrst->saved_logic_state); 78 pwrdm_set_logic_retst(pwrst->pwrdm, pwrst->saved_logic_state);
79 } 79 }
80 if (ret) 80 if (ret) {
81 pr_crit("Could not enter target state in pm_suspend\n"); 81 pr_crit("Could not enter target state in pm_suspend\n");
82 else 82 /*
83 * OMAP4 chip PM currently works only with certain (newer)
84 * versions of bootloaders. This is due to missing code in the
85 * kernel to properly reset and initialize some devices.
86 * Warn the user about the bootloader version being one of the
87 * possible causes.
88 * http://www.spinics.net/lists/arm-kernel/msg218641.html
89 */
90 pr_warn("A possible cause could be an old bootloader - try u-boot >= v2012.07\n");
91 } else {
83 pr_info("Successfully put all powerdomains to target state\n"); 92 pr_info("Successfully put all powerdomains to target state\n");
93 }
84 94
85 return 0; 95 return 0;
86} 96}
@@ -146,6 +156,13 @@ int __init omap4_pm_init(void)
146 } 156 }
147 157
148 pr_err("Power Management for TI OMAP4.\n"); 158 pr_err("Power Management for TI OMAP4.\n");
159 /*
160 * OMAP4 chip PM currently works only with certain (newer)
161 * versions of bootloaders. This is due to missing code in the
162 * kernel to properly reset and initialize some devices.
163 * http://www.spinics.net/lists/arm-kernel/msg218641.html
164 */
165 pr_warn("OMAP4 PM: u-boot >= v2012.07 is required for full PM support\n");
149 166
150 ret = pwrdm_for_each(pwrdms_setup, NULL); 167 ret = pwrdm_for_each(pwrdms_setup, NULL);
151 if (ret) { 168 if (ret) {
diff --git a/arch/arm/mach-omap2/pmu.c b/arch/arm/mach-omap2/pmu.c
index eb78ae7a3464..9debf822687c 100644
--- a/arch/arm/mach-omap2/pmu.c
+++ b/arch/arm/mach-omap2/pmu.c
@@ -48,8 +48,7 @@ static int __init omap2_init_pmu(unsigned oh_num, char *oh_names[])
48 } 48 }
49 } 49 }
50 50
51 omap_pmu_dev = omap_device_build_ss(dev_name, -1, oh, oh_num, NULL, 0, 51 omap_pmu_dev = omap_device_build_ss(dev_name, -1, oh, oh_num, NULL, 0);
52 NULL, 0, 0);
53 WARN(IS_ERR(omap_pmu_dev), "Can't build omap_device for %s.\n", 52 WARN(IS_ERR(omap_pmu_dev), "Can't build omap_device for %s.\n",
54 dev_name); 53 dev_name);
55 54
@@ -89,4 +88,4 @@ static int __init omap_init_pmu(void)
89 88
90 return omap2_init_pmu(oh_num, oh_names); 89 return omap2_init_pmu(oh_num, oh_names);
91} 90}
92subsys_initcall(omap_init_pmu); 91omap_subsys_initcall(omap_init_pmu);
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index dea62a9aad07..8e61d80bf6b3 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -19,6 +19,7 @@
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 <linux/spinlock.h>
22#include <trace/events/power.h> 23#include <trace/events/power.h>
23 24
24#include "cm2xxx_3xxx.h" 25#include "cm2xxx_3xxx.h"
@@ -42,6 +43,16 @@ enum {
42 PWRDM_STATE_PREV, 43 PWRDM_STATE_PREV,
43}; 44};
44 45
46/*
47 * Types of sleep_switch used internally in omap_set_pwrdm_state()
48 * and its associated static functions
49 *
50 * XXX Better documentation is needed here
51 */
52#define ALREADYACTIVE_SWITCH 0
53#define FORCEWAKEUP_SWITCH 1
54#define LOWPOWERSTATE_SWITCH 2
55#define ERROR_SWITCH 3
45 56
46/* pwrdm_list contains all registered struct powerdomains */ 57/* pwrdm_list contains all registered struct powerdomains */
47static LIST_HEAD(pwrdm_list); 58static LIST_HEAD(pwrdm_list);
@@ -101,6 +112,7 @@ static int _pwrdm_register(struct powerdomain *pwrdm)
101 pwrdm->voltdm.ptr = voltdm; 112 pwrdm->voltdm.ptr = voltdm;
102 INIT_LIST_HEAD(&pwrdm->voltdm_node); 113 INIT_LIST_HEAD(&pwrdm->voltdm_node);
103 voltdm_add_pwrdm(voltdm, pwrdm); 114 voltdm_add_pwrdm(voltdm, pwrdm);
115 spin_lock_init(&pwrdm->_lock);
104 116
105 list_add(&pwrdm->node, &pwrdm_list); 117 list_add(&pwrdm->node, &pwrdm_list);
106 118
@@ -112,7 +124,7 @@ static int _pwrdm_register(struct powerdomain *pwrdm)
112 for (i = 0; i < pwrdm->banks; i++) 124 for (i = 0; i < pwrdm->banks; i++)
113 pwrdm->ret_mem_off_counter[i] = 0; 125 pwrdm->ret_mem_off_counter[i] = 0;
114 126
115 pwrdm_wait_transition(pwrdm); 127 arch_pwrdm->pwrdm_wait_transition(pwrdm);
116 pwrdm->state = pwrdm_read_pwrst(pwrdm); 128 pwrdm->state = pwrdm_read_pwrst(pwrdm);
117 pwrdm->state_counter[pwrdm->state] = 1; 129 pwrdm->state_counter[pwrdm->state] = 1;
118 130
@@ -143,7 +155,7 @@ static void _update_logic_membank_counters(struct powerdomain *pwrdm)
143static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag) 155static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
144{ 156{
145 157
146 int prev, state, trace_state = 0; 158 int prev, next, state, trace_state = 0;
147 159
148 if (pwrdm == NULL) 160 if (pwrdm == NULL)
149 return -EINVAL; 161 return -EINVAL;
@@ -164,9 +176,10 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
164 * If the power domain did not hit the desired state, 176 * If the power domain did not hit the desired state,
165 * generate a trace event with both the desired and hit states 177 * generate a trace event with both the desired and hit states
166 */ 178 */
167 if (state != prev) { 179 next = pwrdm_read_next_pwrst(pwrdm);
180 if (next != prev) {
168 trace_state = (PWRDM_TRACE_STATES_FLAG | 181 trace_state = (PWRDM_TRACE_STATES_FLAG |
169 ((state & OMAP_POWERSTATE_MASK) << 8) | 182 ((next & OMAP_POWERSTATE_MASK) << 8) |
170 ((prev & OMAP_POWERSTATE_MASK) << 0)); 183 ((prev & OMAP_POWERSTATE_MASK) << 0));
171 trace_power_domain_target(pwrdm->name, trace_state, 184 trace_power_domain_target(pwrdm->name, trace_state,
172 smp_processor_id()); 185 smp_processor_id());
@@ -199,6 +212,80 @@ static int _pwrdm_post_transition_cb(struct powerdomain *pwrdm, void *unused)
199 return 0; 212 return 0;
200} 213}
201 214
215/**
216 * _pwrdm_save_clkdm_state_and_activate - prepare for power state change
217 * @pwrdm: struct powerdomain * to operate on
218 * @curr_pwrst: current power state of @pwrdm
219 * @pwrst: power state to switch to
220 * @hwsup: ptr to a bool to return whether the clkdm is hardware-supervised
221 *
222 * Determine whether the powerdomain needs to be turned on before
223 * attempting to switch power states. Called by
224 * omap_set_pwrdm_state(). NOTE that if the powerdomain contains
225 * multiple clockdomains, this code assumes that the first clockdomain
226 * supports software-supervised wakeup mode - potentially a problem.
227 * Returns the power state switch mode currently in use (see the
228 * "Types of sleep_switch" comment above).
229 */
230static u8 _pwrdm_save_clkdm_state_and_activate(struct powerdomain *pwrdm,
231 u8 curr_pwrst, u8 pwrst,
232 bool *hwsup)
233{
234 u8 sleep_switch;
235
236 if (curr_pwrst < 0) {
237 WARN_ON(1);
238 sleep_switch = ERROR_SWITCH;
239 } else if (curr_pwrst < PWRDM_POWER_ON) {
240 if (curr_pwrst > pwrst &&
241 pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE &&
242 arch_pwrdm->pwrdm_set_lowpwrstchange) {
243 sleep_switch = LOWPOWERSTATE_SWITCH;
244 } else {
245 *hwsup = clkdm_in_hwsup(pwrdm->pwrdm_clkdms[0]);
246 clkdm_wakeup_nolock(pwrdm->pwrdm_clkdms[0]);
247 sleep_switch = FORCEWAKEUP_SWITCH;
248 }
249 } else {
250 sleep_switch = ALREADYACTIVE_SWITCH;
251 }
252
253 return sleep_switch;
254}
255
256/**
257 * _pwrdm_restore_clkdm_state - restore the clkdm hwsup state after pwrst change
258 * @pwrdm: struct powerdomain * to operate on
259 * @sleep_switch: return value from _pwrdm_save_clkdm_state_and_activate()
260 * @hwsup: should @pwrdm's first clockdomain be set to hardware-supervised mode?
261 *
262 * Restore the clockdomain state perturbed by
263 * _pwrdm_save_clkdm_state_and_activate(), and call the power state
264 * bookkeeping code. Called by omap_set_pwrdm_state(). NOTE that if
265 * the powerdomain contains multiple clockdomains, this assumes that
266 * the first associated clockdomain supports either
267 * hardware-supervised idle control in the register, or
268 * software-supervised sleep. No return value.
269 */
270static void _pwrdm_restore_clkdm_state(struct powerdomain *pwrdm,
271 u8 sleep_switch, bool hwsup)
272{
273 switch (sleep_switch) {
274 case FORCEWAKEUP_SWITCH:
275 if (hwsup)
276 clkdm_allow_idle_nolock(pwrdm->pwrdm_clkdms[0]);
277 else
278 clkdm_sleep_nolock(pwrdm->pwrdm_clkdms[0]);
279 break;
280 case LOWPOWERSTATE_SWITCH:
281 if (pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE &&
282 arch_pwrdm->pwrdm_set_lowpwrstchange)
283 arch_pwrdm->pwrdm_set_lowpwrstchange(pwrdm);
284 pwrdm_state_switch_nolock(pwrdm);
285 break;
286 }
287}
288
202/* Public functions */ 289/* Public functions */
203 290
204/** 291/**
@@ -275,6 +362,30 @@ int pwrdm_complete_init(void)
275} 362}
276 363
277/** 364/**
365 * pwrdm_lock - acquire a Linux spinlock on a powerdomain
366 * @pwrdm: struct powerdomain * to lock
367 *
368 * Acquire the powerdomain spinlock on @pwrdm. No return value.
369 */
370void pwrdm_lock(struct powerdomain *pwrdm)
371 __acquires(&pwrdm->_lock)
372{
373 spin_lock_irqsave(&pwrdm->_lock, pwrdm->_lock_flags);
374}
375
376/**
377 * pwrdm_unlock - release a Linux spinlock on a powerdomain
378 * @pwrdm: struct powerdomain * to unlock
379 *
380 * Release the powerdomain spinlock on @pwrdm. No return value.
381 */
382void pwrdm_unlock(struct powerdomain *pwrdm)
383 __releases(&pwrdm->_lock)
384{
385 spin_unlock_irqrestore(&pwrdm->_lock, pwrdm->_lock_flags);
386}
387
388/**
278 * pwrdm_lookup - look up a powerdomain by name, return a pointer 389 * pwrdm_lookup - look up a powerdomain by name, return a pointer
279 * @name: name of powerdomain 390 * @name: name of powerdomain
280 * 391 *
@@ -920,65 +1031,27 @@ bool pwrdm_has_hdwr_sar(struct powerdomain *pwrdm)
920 return (pwrdm && pwrdm->flags & PWRDM_HAS_HDWR_SAR) ? 1 : 0; 1031 return (pwrdm && pwrdm->flags & PWRDM_HAS_HDWR_SAR) ? 1 : 0;
921} 1032}
922 1033
923/** 1034int pwrdm_state_switch_nolock(struct powerdomain *pwrdm)
924 * pwrdm_set_lowpwrstchange - Request a low power state change
925 * @pwrdm: struct powerdomain *
926 *
927 * Allows a powerdomain to transtion to a lower power sleep state
928 * from an existing sleep state without waking up the powerdomain.
929 * Returns -EINVAL if the powerdomain pointer is null or if the
930 * powerdomain does not support LOWPOWERSTATECHANGE, or returns 0
931 * upon success.
932 */
933int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm)
934{
935 int ret = -EINVAL;
936
937 if (!pwrdm)
938 return -EINVAL;
939
940 if (!(pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE))
941 return -EINVAL;
942
943 pr_debug("powerdomain: %s: setting LOWPOWERSTATECHANGE bit\n",
944 pwrdm->name);
945
946 if (arch_pwrdm && arch_pwrdm->pwrdm_set_lowpwrstchange)
947 ret = arch_pwrdm->pwrdm_set_lowpwrstchange(pwrdm);
948
949 return ret;
950}
951
952/**
953 * pwrdm_wait_transition - wait for powerdomain power transition to finish
954 * @pwrdm: struct powerdomain * to wait for
955 *
956 * If the powerdomain @pwrdm is in the process of a state transition,
957 * spin until it completes the power transition, or until an iteration
958 * bailout value is reached. Returns -EINVAL if the powerdomain
959 * pointer is null, -EAGAIN if the bailout value was reached, or
960 * returns 0 upon success.
961 */
962int pwrdm_wait_transition(struct powerdomain *pwrdm)
963{ 1035{
964 int ret = -EINVAL; 1036 int ret;
965 1037
966 if (!pwrdm) 1038 if (!pwrdm || !arch_pwrdm)
967 return -EINVAL; 1039 return -EINVAL;
968 1040
969 if (arch_pwrdm && arch_pwrdm->pwrdm_wait_transition) 1041 ret = arch_pwrdm->pwrdm_wait_transition(pwrdm);
970 ret = arch_pwrdm->pwrdm_wait_transition(pwrdm); 1042 if (!ret)
1043 ret = _pwrdm_state_switch(pwrdm, PWRDM_STATE_NOW);
971 1044
972 return ret; 1045 return ret;
973} 1046}
974 1047
975int pwrdm_state_switch(struct powerdomain *pwrdm) 1048int __deprecated pwrdm_state_switch(struct powerdomain *pwrdm)
976{ 1049{
977 int ret; 1050 int ret;
978 1051
979 ret = pwrdm_wait_transition(pwrdm); 1052 pwrdm_lock(pwrdm);
980 if (!ret) 1053 ret = pwrdm_state_switch_nolock(pwrdm);
981 ret = _pwrdm_state_switch(pwrdm, PWRDM_STATE_NOW); 1054 pwrdm_unlock(pwrdm);
982 1055
983 return ret; 1056 return ret;
984} 1057}
@@ -1004,6 +1077,61 @@ int pwrdm_post_transition(struct powerdomain *pwrdm)
1004} 1077}
1005 1078
1006/** 1079/**
1080 * omap_set_pwrdm_state - change a powerdomain's current power state
1081 * @pwrdm: struct powerdomain * to change the power state of
1082 * @pwrst: power state to change to
1083 *
1084 * Change the current hardware power state of the powerdomain
1085 * represented by @pwrdm to the power state represented by @pwrst.
1086 * Returns -EINVAL if @pwrdm is null or invalid or if the
1087 * powerdomain's current power state could not be read, or returns 0
1088 * upon success or if @pwrdm does not support @pwrst or any
1089 * lower-power state. XXX Should not return 0 if the @pwrdm does not
1090 * support @pwrst or any lower-power state: this should be an error.
1091 */
1092int omap_set_pwrdm_state(struct powerdomain *pwrdm, u8 pwrst)
1093{
1094 u8 curr_pwrst, next_pwrst, sleep_switch;
1095 int ret = 0;
1096 bool hwsup = false;
1097
1098 if (!pwrdm || IS_ERR(pwrdm))
1099 return -EINVAL;
1100
1101 while (!(pwrdm->pwrsts & (1 << pwrst))) {
1102 if (pwrst == PWRDM_POWER_OFF)
1103 return ret;
1104 pwrst--;
1105 }
1106
1107 pwrdm_lock(pwrdm);
1108
1109 curr_pwrst = pwrdm_read_pwrst(pwrdm);
1110 next_pwrst = pwrdm_read_next_pwrst(pwrdm);
1111 if (curr_pwrst == pwrst && next_pwrst == pwrst)
1112 goto osps_out;
1113
1114 sleep_switch = _pwrdm_save_clkdm_state_and_activate(pwrdm, curr_pwrst,
1115 pwrst, &hwsup);
1116 if (sleep_switch == ERROR_SWITCH) {
1117 ret = -EINVAL;
1118 goto osps_out;
1119 }
1120
1121 ret = pwrdm_set_next_pwrst(pwrdm, pwrst);
1122 if (ret)
1123 pr_err("%s: unable to set power state of powerdomain: %s\n",
1124 __func__, pwrdm->name);
1125
1126 _pwrdm_restore_clkdm_state(pwrdm, sleep_switch, hwsup);
1127
1128osps_out:
1129 pwrdm_unlock(pwrdm);
1130
1131 return ret;
1132}
1133
1134/**
1007 * pwrdm_get_context_loss_count - get powerdomain's context loss count 1135 * pwrdm_get_context_loss_count - get powerdomain's context loss count
1008 * @pwrdm: struct powerdomain * to wait for 1136 * @pwrdm: struct powerdomain * to wait for
1009 * 1137 *
diff --git a/arch/arm/mach-omap2/powerdomain.h b/arch/arm/mach-omap2/powerdomain.h
index 5277d56eb37f..140c36074fed 100644
--- a/arch/arm/mach-omap2/powerdomain.h
+++ b/arch/arm/mach-omap2/powerdomain.h
@@ -19,8 +19,7 @@
19 19
20#include <linux/types.h> 20#include <linux/types.h>
21#include <linux/list.h> 21#include <linux/list.h>
22 22#include <linux/spinlock.h>
23#include <linux/atomic.h>
24 23
25#include "voltage.h" 24#include "voltage.h"
26 25
@@ -44,18 +43,20 @@
44#define PWRSTS_OFF_RET_ON (PWRSTS_OFF_RET | PWRSTS_ON) 43#define PWRSTS_OFF_RET_ON (PWRSTS_OFF_RET | PWRSTS_ON)
45 44
46 45
47/* Powerdomain flags */ 46/*
48#define PWRDM_HAS_HDWR_SAR (1 << 0) /* hardware save-and-restore support */ 47 * Powerdomain flags (struct powerdomain.flags)
49#define PWRDM_HAS_MPU_QUIRK (1 << 1) /* MPU pwr domain has MEM bank 0 bits 48 *
50 * in MEM bank 1 position. This is 49 * PWRDM_HAS_HDWR_SAR - powerdomain has hardware save-and-restore support
51 * true for OMAP3430 50 *
52 */ 51 * PWRDM_HAS_MPU_QUIRK - MPU pwr domain has MEM bank 0 bits in MEM
53#define PWRDM_HAS_LOWPOWERSTATECHANGE (1 << 2) /* 52 * bank 1 position. This is true for OMAP3430
54 * support to transition from a 53 *
55 * sleep state to a lower sleep 54 * PWRDM_HAS_LOWPOWERSTATECHANGE - can transition from a sleep state
56 * state without waking up the 55 * to a lower sleep state without waking up the powerdomain
57 * powerdomain 56 */
58 */ 57#define PWRDM_HAS_HDWR_SAR BIT(0)
58#define PWRDM_HAS_MPU_QUIRK BIT(1)
59#define PWRDM_HAS_LOWPOWERSTATECHANGE BIT(2)
59 60
60/* 61/*
61 * Number of memory banks that are power-controllable. On OMAP4430, the 62 * Number of memory banks that are power-controllable. On OMAP4430, the
@@ -103,6 +104,8 @@ struct powerdomain;
103 * @state_counter: 104 * @state_counter:
104 * @timer: 105 * @timer:
105 * @state_timer: 106 * @state_timer:
107 * @_lock: spinlock used to serialize powerdomain and some clockdomain ops
108 * @_lock_flags: stored flags when @_lock is taken
106 * 109 *
107 * @prcm_partition possible values are defined in mach-omap2/prcm44xx.h. 110 * @prcm_partition possible values are defined in mach-omap2/prcm44xx.h.
108 */ 111 */
@@ -127,7 +130,8 @@ struct powerdomain {
127 unsigned state_counter[PWRDM_MAX_PWRSTS]; 130 unsigned state_counter[PWRDM_MAX_PWRSTS];
128 unsigned ret_logic_off_counter; 131 unsigned ret_logic_off_counter;
129 unsigned ret_mem_off_counter[PWRDM_MAX_MEM_BANKS]; 132 unsigned ret_mem_off_counter[PWRDM_MAX_MEM_BANKS];
130 133 spinlock_t _lock;
134 unsigned long _lock_flags;
131 const u8 pwrstctrl_offs; 135 const u8 pwrstctrl_offs;
132 const u8 pwrstst_offs; 136 const u8 pwrstst_offs;
133 const u32 logicretstate_mask; 137 const u32 logicretstate_mask;
@@ -162,6 +166,16 @@ struct powerdomain {
162 * @pwrdm_disable_hdwr_sar: Disable Hardware Save-Restore feature for a pd 166 * @pwrdm_disable_hdwr_sar: Disable Hardware Save-Restore feature for a pd
163 * @pwrdm_set_lowpwrstchange: Enable pd transitions from a shallow to deep sleep 167 * @pwrdm_set_lowpwrstchange: Enable pd transitions from a shallow to deep sleep
164 * @pwrdm_wait_transition: Wait for a pd state transition to complete 168 * @pwrdm_wait_transition: Wait for a pd state transition to complete
169 *
170 * Regarding @pwrdm_set_lowpwrstchange: On the OMAP2 and 3-family
171 * chips, a powerdomain's power state is not allowed to directly
172 * transition from one low-power state (e.g., CSWR) to another
173 * low-power state (e.g., OFF) without first waking up the
174 * powerdomain. This wastes energy. So OMAP4 chips support the
175 * ability to transition a powerdomain power state directly from one
176 * low-power state to another. The function pointed to by
177 * @pwrdm_set_lowpwrstchange is intended to configure the OMAP4
178 * hardware powerdomain state machine to enable this feature.
165 */ 179 */
166struct pwrdm_ops { 180struct pwrdm_ops {
167 int (*pwrdm_set_next_pwrst)(struct powerdomain *pwrdm, u8 pwrst); 181 int (*pwrdm_set_next_pwrst)(struct powerdomain *pwrdm, u8 pwrst);
@@ -225,15 +239,15 @@ int pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm);
225int pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm); 239int pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm);
226bool pwrdm_has_hdwr_sar(struct powerdomain *pwrdm); 240bool pwrdm_has_hdwr_sar(struct powerdomain *pwrdm);
227 241
228int pwrdm_wait_transition(struct powerdomain *pwrdm); 242int pwrdm_state_switch_nolock(struct powerdomain *pwrdm);
229
230int pwrdm_state_switch(struct powerdomain *pwrdm); 243int pwrdm_state_switch(struct powerdomain *pwrdm);
231int pwrdm_pre_transition(struct powerdomain *pwrdm); 244int pwrdm_pre_transition(struct powerdomain *pwrdm);
232int pwrdm_post_transition(struct powerdomain *pwrdm); 245int pwrdm_post_transition(struct powerdomain *pwrdm);
233int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm);
234int pwrdm_get_context_loss_count(struct powerdomain *pwrdm); 246int pwrdm_get_context_loss_count(struct powerdomain *pwrdm);
235bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm); 247bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm);
236 248
249extern int omap_set_pwrdm_state(struct powerdomain *pwrdm, u8 state);
250
237extern void omap242x_powerdomains_init(void); 251extern void omap242x_powerdomains_init(void);
238extern void omap243x_powerdomains_init(void); 252extern void omap243x_powerdomains_init(void);
239extern void omap3xxx_powerdomains_init(void); 253extern void omap3xxx_powerdomains_init(void);
@@ -253,5 +267,7 @@ extern u32 omap2_pwrdm_get_mem_bank_stst_mask(u8 bank);
253extern struct powerdomain wkup_omap2_pwrdm; 267extern struct powerdomain wkup_omap2_pwrdm;
254extern struct powerdomain gfx_omap2_pwrdm; 268extern struct powerdomain gfx_omap2_pwrdm;
255 269
270extern void pwrdm_lock(struct powerdomain *pwrdm);
271extern void pwrdm_unlock(struct powerdomain *pwrdm);
256 272
257#endif 273#endif
diff --git a/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c
index d3a5399091ad..7b946f1005b1 100644
--- a/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c
+++ b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c
@@ -54,12 +54,12 @@ struct powerdomain gfx_omap2_pwrdm = {
54 .pwrsts_mem_on = { 54 .pwrsts_mem_on = {
55 [0] = PWRSTS_ON, /* MEMONSTATE */ 55 [0] = PWRSTS_ON, /* MEMONSTATE */
56 }, 56 },
57 .voltdm = { .name = "core" }, 57 .voltdm = { .name = "core" },
58}; 58};
59 59
60struct powerdomain wkup_omap2_pwrdm = { 60struct powerdomain wkup_omap2_pwrdm = {
61 .name = "wkup_pwrdm", 61 .name = "wkup_pwrdm",
62 .prcm_offs = WKUP_MOD, 62 .prcm_offs = WKUP_MOD,
63 .pwrsts = PWRSTS_ON, 63 .pwrsts = PWRSTS_ON,
64 .voltdm = { .name = "wakeup" }, 64 .voltdm = { .name = "wakeup" },
65}; 65};
diff --git a/arch/arm/mach-omap2/powerdomains2xxx_data.c b/arch/arm/mach-omap2/powerdomains2xxx_data.c
index ba520d4f7c7b..578eef86fcf2 100644
--- a/arch/arm/mach-omap2/powerdomains2xxx_data.c
+++ b/arch/arm/mach-omap2/powerdomains2xxx_data.c
@@ -38,7 +38,7 @@ static struct powerdomain dsp_pwrdm = {
38 .pwrsts_mem_on = { 38 .pwrsts_mem_on = {
39 [0] = PWRSTS_ON, 39 [0] = PWRSTS_ON,
40 }, 40 },
41 .voltdm = { .name = "core" }, 41 .voltdm = { .name = "core" },
42}; 42};
43 43
44static struct powerdomain mpu_24xx_pwrdm = { 44static struct powerdomain mpu_24xx_pwrdm = {
@@ -53,13 +53,14 @@ static struct powerdomain mpu_24xx_pwrdm = {
53 .pwrsts_mem_on = { 53 .pwrsts_mem_on = {
54 [0] = PWRSTS_ON, 54 [0] = PWRSTS_ON,
55 }, 55 },
56 .voltdm = { .name = "core" }, 56 .voltdm = { .name = "core" },
57}; 57};
58 58
59static struct powerdomain core_24xx_pwrdm = { 59static struct powerdomain core_24xx_pwrdm = {
60 .name = "core_pwrdm", 60 .name = "core_pwrdm",
61 .prcm_offs = CORE_MOD, 61 .prcm_offs = CORE_MOD,
62 .pwrsts = PWRSTS_OFF_RET_ON, 62 .pwrsts = PWRSTS_OFF_RET_ON,
63 .pwrsts_logic_ret = PWRSTS_RET,
63 .banks = 3, 64 .banks = 3,
64 .pwrsts_mem_ret = { 65 .pwrsts_mem_ret = {
65 [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */ 66 [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */
@@ -71,7 +72,7 @@ static struct powerdomain core_24xx_pwrdm = {
71 [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */ 72 [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */
72 [2] = PWRSTS_OFF_RET_ON, /* MEM3ONSTATE */ 73 [2] = PWRSTS_OFF_RET_ON, /* MEM3ONSTATE */
73 }, 74 },
74 .voltdm = { .name = "core" }, 75 .voltdm = { .name = "core" },
75}; 76};
76 77
77 78
@@ -93,7 +94,7 @@ static struct powerdomain mdm_pwrdm = {
93 .pwrsts_mem_on = { 94 .pwrsts_mem_on = {
94 [0] = PWRSTS_ON, /* MEMONSTATE */ 95 [0] = PWRSTS_ON, /* MEMONSTATE */
95 }, 96 },
96 .voltdm = { .name = "core" }, 97 .voltdm = { .name = "core" },
97}; 98};
98 99
99/* 100/*
diff --git a/arch/arm/mach-omap2/powerdomains3xxx_data.c b/arch/arm/mach-omap2/powerdomains3xxx_data.c
index 8b23d234fb55..f0e14e9efe5a 100644
--- a/arch/arm/mach-omap2/powerdomains3xxx_data.c
+++ b/arch/arm/mach-omap2/powerdomains3xxx_data.c
@@ -50,7 +50,7 @@ static struct powerdomain iva2_pwrdm = {
50 [2] = PWRSTS_OFF_ON, 50 [2] = PWRSTS_OFF_ON,
51 [3] = PWRSTS_ON, 51 [3] = PWRSTS_ON,
52 }, 52 },
53 .voltdm = { .name = "mpu_iva" }, 53 .voltdm = { .name = "mpu_iva" },
54}; 54};
55 55
56static struct powerdomain mpu_3xxx_pwrdm = { 56static struct powerdomain mpu_3xxx_pwrdm = {
@@ -66,7 +66,7 @@ static struct powerdomain mpu_3xxx_pwrdm = {
66 .pwrsts_mem_on = { 66 .pwrsts_mem_on = {
67 [0] = PWRSTS_OFF_ON, 67 [0] = PWRSTS_OFF_ON,
68 }, 68 },
69 .voltdm = { .name = "mpu_iva" }, 69 .voltdm = { .name = "mpu_iva" },
70}; 70};
71 71
72static struct powerdomain mpu_am35x_pwrdm = { 72static struct powerdomain mpu_am35x_pwrdm = {
@@ -82,7 +82,7 @@ static struct powerdomain mpu_am35x_pwrdm = {
82 .pwrsts_mem_on = { 82 .pwrsts_mem_on = {
83 [0] = PWRSTS_ON, 83 [0] = PWRSTS_ON,
84 }, 84 },
85 .voltdm = { .name = "mpu_iva" }, 85 .voltdm = { .name = "mpu_iva" },
86}; 86};
87 87
88/* 88/*
@@ -109,7 +109,7 @@ static struct powerdomain core_3xxx_pre_es3_1_pwrdm = {
109 [0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */ 109 [0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */
110 [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */ 110 [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */
111 }, 111 },
112 .voltdm = { .name = "core" }, 112 .voltdm = { .name = "core" },
113}; 113};
114 114
115static struct powerdomain core_3xxx_es3_1_pwrdm = { 115static struct powerdomain core_3xxx_es3_1_pwrdm = {
@@ -131,7 +131,7 @@ static struct powerdomain core_3xxx_es3_1_pwrdm = {
131 [0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */ 131 [0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */
132 [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */ 132 [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */
133 }, 133 },
134 .voltdm = { .name = "core" }, 134 .voltdm = { .name = "core" },
135}; 135};
136 136
137static struct powerdomain core_am35x_pwrdm = { 137static struct powerdomain core_am35x_pwrdm = {
@@ -148,7 +148,7 @@ static struct powerdomain core_am35x_pwrdm = {
148 [0] = PWRSTS_ON, /* MEM1ONSTATE */ 148 [0] = PWRSTS_ON, /* MEM1ONSTATE */
149 [1] = PWRSTS_ON, /* MEM2ONSTATE */ 149 [1] = PWRSTS_ON, /* MEM2ONSTATE */
150 }, 150 },
151 .voltdm = { .name = "core" }, 151 .voltdm = { .name = "core" },
152}; 152};
153 153
154static struct powerdomain dss_pwrdm = { 154static struct powerdomain dss_pwrdm = {
@@ -163,7 +163,7 @@ static struct powerdomain dss_pwrdm = {
163 .pwrsts_mem_on = { 163 .pwrsts_mem_on = {
164 [0] = PWRSTS_ON, /* MEMONSTATE */ 164 [0] = PWRSTS_ON, /* MEMONSTATE */
165 }, 165 },
166 .voltdm = { .name = "core" }, 166 .voltdm = { .name = "core" },
167}; 167};
168 168
169static struct powerdomain dss_am35x_pwrdm = { 169static struct powerdomain dss_am35x_pwrdm = {
@@ -178,7 +178,7 @@ static struct powerdomain dss_am35x_pwrdm = {
178 .pwrsts_mem_on = { 178 .pwrsts_mem_on = {
179 [0] = PWRSTS_ON, /* MEMONSTATE */ 179 [0] = PWRSTS_ON, /* MEMONSTATE */
180 }, 180 },
181 .voltdm = { .name = "core" }, 181 .voltdm = { .name = "core" },
182}; 182};
183 183
184/* 184/*
@@ -199,7 +199,7 @@ static struct powerdomain sgx_pwrdm = {
199 .pwrsts_mem_on = { 199 .pwrsts_mem_on = {
200 [0] = PWRSTS_ON, /* MEMONSTATE */ 200 [0] = PWRSTS_ON, /* MEMONSTATE */
201 }, 201 },
202 .voltdm = { .name = "core" }, 202 .voltdm = { .name = "core" },
203}; 203};
204 204
205static struct powerdomain sgx_am35x_pwrdm = { 205static struct powerdomain sgx_am35x_pwrdm = {
@@ -214,7 +214,7 @@ static struct powerdomain sgx_am35x_pwrdm = {
214 .pwrsts_mem_on = { 214 .pwrsts_mem_on = {
215 [0] = PWRSTS_ON, /* MEMONSTATE */ 215 [0] = PWRSTS_ON, /* MEMONSTATE */
216 }, 216 },
217 .voltdm = { .name = "core" }, 217 .voltdm = { .name = "core" },
218}; 218};
219 219
220static struct powerdomain cam_pwrdm = { 220static struct powerdomain cam_pwrdm = {
@@ -229,7 +229,7 @@ static struct powerdomain cam_pwrdm = {
229 .pwrsts_mem_on = { 229 .pwrsts_mem_on = {
230 [0] = PWRSTS_ON, /* MEMONSTATE */ 230 [0] = PWRSTS_ON, /* MEMONSTATE */
231 }, 231 },
232 .voltdm = { .name = "core" }, 232 .voltdm = { .name = "core" },
233}; 233};
234 234
235static struct powerdomain per_pwrdm = { 235static struct powerdomain per_pwrdm = {
@@ -244,7 +244,7 @@ static struct powerdomain per_pwrdm = {
244 .pwrsts_mem_on = { 244 .pwrsts_mem_on = {
245 [0] = PWRSTS_ON, /* MEMONSTATE */ 245 [0] = PWRSTS_ON, /* MEMONSTATE */
246 }, 246 },
247 .voltdm = { .name = "core" }, 247 .voltdm = { .name = "core" },
248}; 248};
249 249
250static struct powerdomain per_am35x_pwrdm = { 250static struct powerdomain per_am35x_pwrdm = {
@@ -259,13 +259,13 @@ static struct powerdomain per_am35x_pwrdm = {
259 .pwrsts_mem_on = { 259 .pwrsts_mem_on = {
260 [0] = PWRSTS_ON, /* MEMONSTATE */ 260 [0] = PWRSTS_ON, /* MEMONSTATE */
261 }, 261 },
262 .voltdm = { .name = "core" }, 262 .voltdm = { .name = "core" },
263}; 263};
264 264
265static struct powerdomain emu_pwrdm = { 265static struct powerdomain emu_pwrdm = {
266 .name = "emu_pwrdm", 266 .name = "emu_pwrdm",
267 .prcm_offs = OMAP3430_EMU_MOD, 267 .prcm_offs = OMAP3430_EMU_MOD,
268 .voltdm = { .name = "core" }, 268 .voltdm = { .name = "core" },
269}; 269};
270 270
271static struct powerdomain neon_pwrdm = { 271static struct powerdomain neon_pwrdm = {
@@ -273,7 +273,7 @@ static struct powerdomain neon_pwrdm = {
273 .prcm_offs = OMAP3430_NEON_MOD, 273 .prcm_offs = OMAP3430_NEON_MOD,
274 .pwrsts = PWRSTS_OFF_RET_ON, 274 .pwrsts = PWRSTS_OFF_RET_ON,
275 .pwrsts_logic_ret = PWRSTS_RET, 275 .pwrsts_logic_ret = PWRSTS_RET,
276 .voltdm = { .name = "mpu_iva" }, 276 .voltdm = { .name = "mpu_iva" },
277}; 277};
278 278
279static struct powerdomain neon_am35x_pwrdm = { 279static struct powerdomain neon_am35x_pwrdm = {
@@ -281,7 +281,7 @@ static struct powerdomain neon_am35x_pwrdm = {
281 .prcm_offs = OMAP3430_NEON_MOD, 281 .prcm_offs = OMAP3430_NEON_MOD,
282 .pwrsts = PWRSTS_ON, 282 .pwrsts = PWRSTS_ON,
283 .pwrsts_logic_ret = PWRSTS_ON, 283 .pwrsts_logic_ret = PWRSTS_ON,
284 .voltdm = { .name = "mpu_iva" }, 284 .voltdm = { .name = "mpu_iva" },
285}; 285};
286 286
287static struct powerdomain usbhost_pwrdm = { 287static struct powerdomain usbhost_pwrdm = {
@@ -303,37 +303,37 @@ static struct powerdomain usbhost_pwrdm = {
303 .pwrsts_mem_on = { 303 .pwrsts_mem_on = {
304 [0] = PWRSTS_ON, /* MEMONSTATE */ 304 [0] = PWRSTS_ON, /* MEMONSTATE */
305 }, 305 },
306 .voltdm = { .name = "core" }, 306 .voltdm = { .name = "core" },
307}; 307};
308 308
309static struct powerdomain dpll1_pwrdm = { 309static struct powerdomain dpll1_pwrdm = {
310 .name = "dpll1_pwrdm", 310 .name = "dpll1_pwrdm",
311 .prcm_offs = MPU_MOD, 311 .prcm_offs = MPU_MOD,
312 .voltdm = { .name = "mpu_iva" }, 312 .voltdm = { .name = "mpu_iva" },
313}; 313};
314 314
315static struct powerdomain dpll2_pwrdm = { 315static struct powerdomain dpll2_pwrdm = {
316 .name = "dpll2_pwrdm", 316 .name = "dpll2_pwrdm",
317 .prcm_offs = OMAP3430_IVA2_MOD, 317 .prcm_offs = OMAP3430_IVA2_MOD,
318 .voltdm = { .name = "mpu_iva" }, 318 .voltdm = { .name = "mpu_iva" },
319}; 319};
320 320
321static struct powerdomain dpll3_pwrdm = { 321static struct powerdomain dpll3_pwrdm = {
322 .name = "dpll3_pwrdm", 322 .name = "dpll3_pwrdm",
323 .prcm_offs = PLL_MOD, 323 .prcm_offs = PLL_MOD,
324 .voltdm = { .name = "core" }, 324 .voltdm = { .name = "core" },
325}; 325};
326 326
327static struct powerdomain dpll4_pwrdm = { 327static struct powerdomain dpll4_pwrdm = {
328 .name = "dpll4_pwrdm", 328 .name = "dpll4_pwrdm",
329 .prcm_offs = PLL_MOD, 329 .prcm_offs = PLL_MOD,
330 .voltdm = { .name = "core" }, 330 .voltdm = { .name = "core" },
331}; 331};
332 332
333static struct powerdomain dpll5_pwrdm = { 333static struct powerdomain dpll5_pwrdm = {
334 .name = "dpll5_pwrdm", 334 .name = "dpll5_pwrdm",
335 .prcm_offs = PLL_MOD, 335 .prcm_offs = PLL_MOD,
336 .voltdm = { .name = "core" }, 336 .voltdm = { .name = "core" },
337}; 337};
338 338
339/* As powerdomains are added or removed above, this list must also be changed */ 339/* As powerdomains are added or removed above, this list must also be changed */
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c
index a3e121f94a86..947f6adfed0c 100644
--- a/arch/arm/mach-omap2/prm2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c
@@ -210,6 +210,7 @@ int omap2_clkdm_read_wkdep(struct clockdomain *clkdm1,
210 PM_WKDEP, (1 << clkdm2->dep_bit)); 210 PM_WKDEP, (1 << clkdm2->dep_bit));
211} 211}
212 212
213/* XXX Caller must hold the clkdm's powerdomain lock */
213int omap2_clkdm_clear_all_wkdeps(struct clockdomain *clkdm) 214int omap2_clkdm_clear_all_wkdeps(struct clockdomain *clkdm)
214{ 215{
215 struct clkdm_dep *cd; 216 struct clkdm_dep *cd;
@@ -221,7 +222,7 @@ int omap2_clkdm_clear_all_wkdeps(struct clockdomain *clkdm)
221 222
222 /* PRM accesses are slow, so minimize them */ 223 /* PRM accesses are slow, so minimize them */
223 mask |= 1 << cd->clkdm->dep_bit; 224 mask |= 1 << cd->clkdm->dep_bit;
224 atomic_set(&cd->wkdep_usecount, 0); 225 cd->wkdep_usecount = 0;
225 } 226 }
226 227
227 omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs, 228 omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs,
diff --git a/arch/arm/mach-omap2/prm33xx.c b/arch/arm/mach-omap2/prm33xx.c
index 1ac73883f891..44c0d7216aa7 100644
--- a/arch/arm/mach-omap2/prm33xx.c
+++ b/arch/arm/mach-omap2/prm33xx.c
@@ -110,11 +110,11 @@ int am33xx_prm_assert_hardreset(u8 shift, s16 inst, u16 rstctrl_offs)
110 * -EINVAL upon an argument error, -EEXIST if the submodule was already out 110 * -EINVAL upon an argument error, -EEXIST if the submodule was already out
111 * of reset, or -EBUSY if the submodule did not exit reset promptly. 111 * of reset, or -EBUSY if the submodule did not exit reset promptly.
112 */ 112 */
113int am33xx_prm_deassert_hardreset(u8 shift, s16 inst, 113int am33xx_prm_deassert_hardreset(u8 shift, u8 st_shift, s16 inst,
114 u16 rstctrl_offs, u16 rstst_offs) 114 u16 rstctrl_offs, u16 rstst_offs)
115{ 115{
116 int c; 116 int c;
117 u32 mask = 1 << shift; 117 u32 mask = 1 << st_shift;
118 118
119 /* Check the current status to avoid de-asserting the line twice */ 119 /* Check the current status to avoid de-asserting the line twice */
120 if (am33xx_prm_is_hardreset_asserted(shift, inst, rstctrl_offs) == 0) 120 if (am33xx_prm_is_hardreset_asserted(shift, inst, rstctrl_offs) == 0)
@@ -122,11 +122,14 @@ int am33xx_prm_deassert_hardreset(u8 shift, s16 inst,
122 122
123 /* Clear the reset status by writing 1 to the status bit */ 123 /* Clear the reset status by writing 1 to the status bit */
124 am33xx_prm_rmw_reg_bits(0xffffffff, mask, inst, rstst_offs); 124 am33xx_prm_rmw_reg_bits(0xffffffff, mask, inst, rstst_offs);
125
125 /* de-assert the reset control line */ 126 /* de-assert the reset control line */
127 mask = 1 << shift;
128
126 am33xx_prm_rmw_reg_bits(mask, 0, inst, rstctrl_offs); 129 am33xx_prm_rmw_reg_bits(mask, 0, inst, rstctrl_offs);
127 /* wait the status to be set */
128 130
129 omap_test_timeout(am33xx_prm_is_hardreset_asserted(shift, inst, 131 /* wait the status to be set */
132 omap_test_timeout(am33xx_prm_is_hardreset_asserted(st_shift, inst,
130 rstst_offs), 133 rstst_offs),
131 MAX_MODULE_HARDRESET_WAIT, c); 134 MAX_MODULE_HARDRESET_WAIT, c);
132 135
diff --git a/arch/arm/mach-omap2/prm33xx.h b/arch/arm/mach-omap2/prm33xx.h
index 3f25c563a821..9b9918dfb119 100644
--- a/arch/arm/mach-omap2/prm33xx.h
+++ b/arch/arm/mach-omap2/prm33xx.h
@@ -117,6 +117,7 @@
117#define AM33XX_PM_CEFUSE_PWRSTST_OFFSET 0x0004 117#define AM33XX_PM_CEFUSE_PWRSTST_OFFSET 0x0004
118#define AM33XX_PM_CEFUSE_PWRSTST AM33XX_PRM_REGADDR(AM33XX_PRM_CEFUSE_MOD, 0x0004) 118#define AM33XX_PM_CEFUSE_PWRSTST AM33XX_PRM_REGADDR(AM33XX_PRM_CEFUSE_MOD, 0x0004)
119 119
120#ifndef __ASSEMBLER__
120extern u32 am33xx_prm_read_reg(s16 inst, u16 idx); 121extern u32 am33xx_prm_read_reg(s16 inst, u16 idx);
121extern void am33xx_prm_write_reg(u32 val, s16 inst, u16 idx); 122extern void am33xx_prm_write_reg(u32 val, s16 inst, u16 idx);
122extern u32 am33xx_prm_rmw_reg_bits(u32 mask, u32 bits, s16 inst, s16 idx); 123extern u32 am33xx_prm_rmw_reg_bits(u32 mask, u32 bits, s16 inst, s16 idx);
@@ -124,6 +125,7 @@ extern void am33xx_prm_global_warm_sw_reset(void);
124extern int am33xx_prm_is_hardreset_asserted(u8 shift, s16 inst, 125extern int am33xx_prm_is_hardreset_asserted(u8 shift, s16 inst,
125 u16 rstctrl_offs); 126 u16 rstctrl_offs);
126extern int am33xx_prm_assert_hardreset(u8 shift, s16 inst, u16 rstctrl_offs); 127extern int am33xx_prm_assert_hardreset(u8 shift, s16 inst, u16 rstctrl_offs);
127extern int am33xx_prm_deassert_hardreset(u8 shift, s16 inst, 128extern int am33xx_prm_deassert_hardreset(u8 shift, u8 st_shift, s16 inst,
128 u16 rstctrl_offs, u16 rstst_offs); 129 u16 rstctrl_offs, u16 rstst_offs);
130#endif /* ASSEMBLER */
129#endif 131#endif
diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c
index e648bd55b072..7721990d2006 100644
--- a/arch/arm/mach-omap2/prm3xxx.c
+++ b/arch/arm/mach-omap2/prm3xxx.c
@@ -427,7 +427,7 @@ static int __init omap3xxx_prm_late_init(void)
427 427
428 return ret; 428 return ret;
429} 429}
430subsys_initcall(omap3xxx_prm_late_init); 430omap_subsys_initcall(omap3xxx_prm_late_init);
431 431
432static void __exit omap3xxx_prm_exit(void) 432static void __exit omap3xxx_prm_exit(void)
433{ 433{
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index c05a343d465d..d35f98aabf7a 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -665,7 +665,7 @@ static int __init omap44xx_prm_late_init(void)
665 665
666 return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup); 666 return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup);
667} 667}
668subsys_initcall(omap44xx_prm_late_init); 668omap_subsys_initcall(omap44xx_prm_late_init);
669 669
670static void __exit omap44xx_prm_exit(void) 670static void __exit omap44xx_prm_exit(void)
671{ 671{
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 04fdbc4c499b..8396b5b7e912 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -254,7 +254,7 @@ static int __init omap_serial_early_init(void)
254 254
255 return 0; 255 return 0;
256} 256}
257core_initcall(omap_serial_early_init); 257omap_core_initcall(omap_serial_early_init);
258 258
259/** 259/**
260 * omap_serial_init_port() - initialize single serial port 260 * omap_serial_init_port() - initialize single serial port
@@ -316,8 +316,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata,
316 if (WARN_ON(!oh)) 316 if (WARN_ON(!oh))
317 return; 317 return;
318 318
319 pdev = omap_device_build(name, uart->num, oh, pdata, pdata_size, 319 pdev = omap_device_build(name, uart->num, oh, pdata, pdata_size);
320 NULL, 0, false);
321 if (IS_ERR(pdev)) { 320 if (IS_ERR(pdev)) {
322 WARN(1, "Could not build omap_device for %s: %s.\n", name, 321 WARN(1, "Could not build omap_device for %s: %s.\n", name,
323 oh->name); 322 oh->name);
diff --git a/arch/arm/mach-omap2/sleep24xx.S b/arch/arm/mach-omap2/sleep24xx.S
index ce0ccd26efbd..1d3cb25c9629 100644
--- a/arch/arm/mach-omap2/sleep24xx.S
+++ b/arch/arm/mach-omap2/sleep24xx.S
@@ -37,25 +37,6 @@
37 .text 37 .text
38 38
39/* 39/*
40 * Forces OMAP into idle state
41 *
42 * omap24xx_idle_loop_suspend() - This bit of code just executes the WFI
43 * for normal idles.
44 *
45 * Note: This code get's copied to internal SRAM at boot. When the OMAP
46 * wakes up it continues execution at the point it went to sleep.
47 */
48 .align 3
49ENTRY(omap24xx_idle_loop_suspend)
50 stmfd sp!, {r0, lr} @ save registers on stack
51 mov r0, #0 @ clear for mcr setup
52 mcr p15, 0, r0, c7, c0, 4 @ wait for interrupt
53 ldmfd sp!, {r0, pc} @ restore regs and return
54
55ENTRY(omap24xx_idle_loop_suspend_sz)
56 .word . - omap24xx_idle_loop_suspend
57
58/*
59 * omap24xx_cpu_suspend() - Forces OMAP into deep sleep state by completing 40 * omap24xx_cpu_suspend() - Forces OMAP into deep sleep state by completing
60 * SDRC shutdown then ARM shutdown. Upon wake MPU is back on so just restore 41 * SDRC shutdown then ARM shutdown. Upon wake MPU is back on so just restore
61 * SDRC. 42 * SDRC.
diff --git a/arch/arm/mach-omap2/smartreflex-class3.c b/arch/arm/mach-omap2/smartreflex-class3.c
index 1da8f03c479e..aee3c8940a30 100644
--- a/arch/arm/mach-omap2/smartreflex-class3.c
+++ b/arch/arm/mach-omap2/smartreflex-class3.c
@@ -12,6 +12,7 @@
12 */ 12 */
13 13
14#include <linux/power/smartreflex.h> 14#include <linux/power/smartreflex.h>
15#include "soc.h"
15#include "voltage.h" 16#include "voltage.h"
16 17
17static int sr_class3_enable(struct omap_sr *sr) 18static int sr_class3_enable(struct omap_sr *sr)
@@ -58,4 +59,4 @@ static int __init sr_class3_init(void)
58 pr_info("SmartReflex Class3 initialized\n"); 59 pr_info("SmartReflex Class3 initialized\n");
59 return sr_register_class(&class3_data); 60 return sr_register_class(&class3_data);
60} 61}
61late_initcall(sr_class3_init); 62omap_late_initcall(sr_class3_init);
diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
index f31d90774de0..c62116bbc760 100644
--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -42,6 +42,9 @@
42#undef MULTI_OMAP2 42#undef MULTI_OMAP2
43#undef OMAP_NAME 43#undef OMAP_NAME
44 44
45#ifdef CONFIG_ARCH_MULTIPLATFORM
46#define MULTI_OMAP2
47#endif
45#ifdef CONFIG_SOC_OMAP2420 48#ifdef CONFIG_SOC_OMAP2420
46# ifdef OMAP_NAME 49# ifdef OMAP_NAME
47# undef MULTI_OMAP2 50# undef MULTI_OMAP2
@@ -112,6 +115,11 @@ int omap_type(void);
112 */ 115 */
113unsigned int omap_rev(void); 116unsigned int omap_rev(void);
114 117
118static inline int soc_is_omap(void)
119{
120 return omap_rev() != 0;
121}
122
115/* 123/*
116 * Get the CPU revision for OMAP devices 124 * Get the CPU revision for OMAP devices
117 */ 125 */
@@ -387,6 +395,7 @@ IS_OMAP_TYPE(3430, 0x3430)
387 395
388#define AM335X_CLASS 0x33500033 396#define AM335X_CLASS 0x33500033
389#define AM335X_REV_ES1_0 AM335X_CLASS 397#define AM335X_REV_ES1_0 AM335X_CLASS
398#define AM335X_REV_ES2_0 (AM335X_CLASS | (0x1 << 8))
390 399
391#define OMAP443X_CLASS 0x44300044 400#define OMAP443X_CLASS 0x44300044
392#define OMAP4430_REV_ES1_0 (OMAP443X_CLASS | (0x10 << 8)) 401#define OMAP4430_REV_ES1_0 (OMAP443X_CLASS | (0x10 << 8))
@@ -465,5 +474,26 @@ static inline unsigned int omap4_has_ ##feat(void) \
465 474
466OMAP4_HAS_FEATURE(perf_silicon, PERF_SILICON) 475OMAP4_HAS_FEATURE(perf_silicon, PERF_SILICON)
467 476
477/*
478 * We need to make sure omap initcalls don't run when
479 * multiplatform kernels are booted on other SoCs.
480 */
481#define omap_initcall(level, fn) \
482static int __init __used __##fn(void) \
483{ \
484 if (!soc_is_omap()) \
485 return 0; \
486 return fn(); \
487} \
488level(__##fn);
489
490#define omap_early_initcall(fn) omap_initcall(early_initcall, fn)
491#define omap_core_initcall(fn) omap_initcall(core_initcall, fn)
492#define omap_postcore_initcall(fn) omap_initcall(postcore_initcall, fn)
493#define omap_arch_initcall(fn) omap_initcall(arch_initcall, fn)
494#define omap_subsys_initcall(fn) omap_initcall(subsys_initcall, fn)
495#define omap_device_initcall(fn) omap_initcall(device_initcall, fn)
496#define omap_late_initcall(fn) omap_initcall(late_initcall, fn)
497
468#endif /* __ASSEMBLY__ */ 498#endif /* __ASSEMBLY__ */
469 499
diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c
index b9753fe27232..d7bc33f15344 100644
--- a/arch/arm/mach-omap2/sr_device.c
+++ b/arch/arm/mach-omap2/sr_device.c
@@ -152,8 +152,7 @@ static int __init sr_dev_init(struct omap_hwmod *oh, void *user)
152 152
153 sr_data->enable_on_init = sr_enable_on_init; 153 sr_data->enable_on_init = sr_enable_on_init;
154 154
155 pdev = omap_device_build(name, i, oh, sr_data, sizeof(*sr_data), 155 pdev = omap_device_build(name, i, oh, sr_data, sizeof(*sr_data));
156 NULL, 0, 0);
157 if (IS_ERR(pdev)) 156 if (IS_ERR(pdev))
158 pr_warning("%s: Could not build omap_device for %s: %s.\n\n", 157 pr_warning("%s: Could not build omap_device for %s: %s.\n\n",
159 __func__, name, oh->name); 158 __func__, name, oh->name);
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index b8ad6e632bb8..2bdd4cf17a8f 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -131,7 +131,6 @@ static void omap2_gp_timer_set_mode(enum clock_event_mode mode,
131static struct clock_event_device clockevent_gpt = { 131static struct clock_event_device clockevent_gpt = {
132 .name = "gp_timer", 132 .name = "gp_timer",
133 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 133 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
134 .shift = 32,
135 .rating = 300, 134 .rating = 300,
136 .set_next_event = omap2_gp_timer_set_next_event, 135 .set_next_event = omap2_gp_timer_set_next_event,
137 .set_mode = omap2_gp_timer_set_mode, 136 .set_mode = omap2_gp_timer_set_mode,
@@ -228,7 +227,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
228 int r = 0; 227 int r = 0;
229 228
230 if (of_have_populated_dt()) { 229 if (of_have_populated_dt()) {
231 np = omap_get_timer_dt(omap_timer_match, NULL); 230 np = omap_get_timer_dt(omap_timer_match, property);
232 if (!np) 231 if (!np)
233 return -ENODEV; 232 return -ENODEV;
234 233
@@ -336,17 +335,11 @@ static void __init omap2_gp_clockevent_init(int gptimer_id,
336 335
337 __omap_dm_timer_int_enable(&clkev, OMAP_TIMER_INT_OVERFLOW); 336 __omap_dm_timer_int_enable(&clkev, OMAP_TIMER_INT_OVERFLOW);
338 337
339 clockevent_gpt.mult = div_sc(clkev.rate, NSEC_PER_SEC,
340 clockevent_gpt.shift);
341 clockevent_gpt.max_delta_ns =
342 clockevent_delta2ns(0xffffffff, &clockevent_gpt);
343 clockevent_gpt.min_delta_ns =
344 clockevent_delta2ns(3, &clockevent_gpt);
345 /* Timer internal resynch latency. */
346
347 clockevent_gpt.cpumask = cpu_possible_mask; 338 clockevent_gpt.cpumask = cpu_possible_mask;
348 clockevent_gpt.irq = omap_dm_timer_get_irq(&clkev); 339 clockevent_gpt.irq = omap_dm_timer_get_irq(&clkev);
349 clockevents_register_device(&clockevent_gpt); 340 clockevents_config_and_register(&clockevent_gpt, clkev.rate,
341 3, /* Timer internal resynch latency */
342 0xffffffff);
350 343
351 pr_info("OMAP clockevent source: GPTIMER%d at %lu Hz\n", 344 pr_info("OMAP clockevent source: GPTIMER%d at %lu Hz\n",
352 gptimer_id, clkev.rate); 345 gptimer_id, clkev.rate);
@@ -552,7 +545,7 @@ static inline void __init realtime_counter_init(void)
552 545
553#define OMAP_SYS_GP_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop, \ 546#define OMAP_SYS_GP_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop, \
554 clksrc_nr, clksrc_src) \ 547 clksrc_nr, clksrc_src) \
555static void __init omap##name##_gptimer_timer_init(void) \ 548void __init omap##name##_gptimer_timer_init(void) \
556{ \ 549{ \
557 omap_dmtimer_init(); \ 550 omap_dmtimer_init(); \
558 omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \ 551 omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \
@@ -561,7 +554,7 @@ static void __init omap##name##_gptimer_timer_init(void) \
561 554
562#define OMAP_SYS_32K_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop, \ 555#define OMAP_SYS_32K_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop, \
563 clksrc_nr, clksrc_src) \ 556 clksrc_nr, clksrc_src) \
564static void __init omap##name##_sync32k_timer_init(void) \ 557void __init omap##name##_sync32k_timer_init(void) \
565{ \ 558{ \
566 omap_dmtimer_init(); \ 559 omap_dmtimer_init(); \
567 omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \ 560 omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \
@@ -572,33 +565,23 @@ static void __init omap##name##_sync32k_timer_init(void) \
572 omap2_sync32k_clocksource_init(); \ 565 omap2_sync32k_clocksource_init(); \
573} 566}
574 567
575#define OMAP_SYS_TIMER(name, clksrc) \
576struct sys_timer omap##name##_timer = { \
577 .init = omap##name##_##clksrc##_timer_init, \
578};
579
580#ifdef CONFIG_ARCH_OMAP2 568#ifdef CONFIG_ARCH_OMAP2
581OMAP_SYS_32K_TIMER_INIT(2, 1, OMAP2_32K_SOURCE, "ti,timer-alwon", 569OMAP_SYS_32K_TIMER_INIT(2, 1, OMAP2_32K_SOURCE, "ti,timer-alwon",
582 2, OMAP2_MPU_SOURCE); 570 2, OMAP2_MPU_SOURCE);
583OMAP_SYS_TIMER(2, sync32k);
584#endif /* CONFIG_ARCH_OMAP2 */ 571#endif /* CONFIG_ARCH_OMAP2 */
585 572
586#ifdef CONFIG_ARCH_OMAP3 573#ifdef CONFIG_ARCH_OMAP3
587OMAP_SYS_32K_TIMER_INIT(3, 1, OMAP3_32K_SOURCE, "ti,timer-alwon", 574OMAP_SYS_32K_TIMER_INIT(3, 1, OMAP3_32K_SOURCE, "ti,timer-alwon",
588 2, OMAP3_MPU_SOURCE); 575 2, OMAP3_MPU_SOURCE);
589OMAP_SYS_TIMER(3, sync32k);
590OMAP_SYS_32K_TIMER_INIT(3_secure, 12, OMAP3_32K_SOURCE, "ti,timer-secure", 576OMAP_SYS_32K_TIMER_INIT(3_secure, 12, OMAP3_32K_SOURCE, "ti,timer-secure",
591 2, OMAP3_MPU_SOURCE); 577 2, OMAP3_MPU_SOURCE);
592OMAP_SYS_TIMER(3_secure, sync32k);
593OMAP_SYS_GP_TIMER_INIT(3_gp, 1, OMAP3_MPU_SOURCE, "ti,timer-alwon", 578OMAP_SYS_GP_TIMER_INIT(3_gp, 1, OMAP3_MPU_SOURCE, "ti,timer-alwon",
594 2, OMAP3_MPU_SOURCE); 579 2, OMAP3_MPU_SOURCE);
595OMAP_SYS_TIMER(3_gp, gptimer);
596#endif /* CONFIG_ARCH_OMAP3 */ 580#endif /* CONFIG_ARCH_OMAP3 */
597 581
598#ifdef CONFIG_SOC_AM33XX 582#ifdef CONFIG_SOC_AM33XX
599OMAP_SYS_GP_TIMER_INIT(3_am33xx, 1, OMAP4_MPU_SOURCE, "ti,timer-alwon", 583OMAP_SYS_GP_TIMER_INIT(3_am33xx, 1, OMAP4_MPU_SOURCE, "ti,timer-alwon",
600 2, OMAP4_MPU_SOURCE); 584 2, OMAP4_MPU_SOURCE);
601OMAP_SYS_TIMER(3_am33xx, gptimer);
602#endif /* CONFIG_SOC_AM33XX */ 585#endif /* CONFIG_SOC_AM33XX */
603 586
604#ifdef CONFIG_ARCH_OMAP4 587#ifdef CONFIG_ARCH_OMAP4
@@ -606,7 +589,7 @@ OMAP_SYS_32K_TIMER_INIT(4, 1, OMAP4_32K_SOURCE, "ti,timer-alwon",
606 2, OMAP4_MPU_SOURCE); 589 2, OMAP4_MPU_SOURCE);
607#ifdef CONFIG_LOCAL_TIMERS 590#ifdef CONFIG_LOCAL_TIMERS
608static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, OMAP44XX_LOCAL_TWD_BASE, 29); 591static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, OMAP44XX_LOCAL_TWD_BASE, 29);
609static void __init omap4_local_timer_init(void) 592void __init omap4_local_timer_init(void)
610{ 593{
611 omap4_sync32k_timer_init(); 594 omap4_sync32k_timer_init();
612 /* Local timers are not supprted on OMAP4430 ES1.0 */ 595 /* Local timers are not supprted on OMAP4430 ES1.0 */
@@ -624,18 +607,17 @@ static void __init omap4_local_timer_init(void)
624 } 607 }
625} 608}
626#else /* CONFIG_LOCAL_TIMERS */ 609#else /* CONFIG_LOCAL_TIMERS */
627static void __init omap4_local_timer_init(void) 610void __init omap4_local_timer_init(void)
628{ 611{
629 omap4_sync32k_timer_init(); 612 omap4_sync32k_timer_init();
630} 613}
631#endif /* CONFIG_LOCAL_TIMERS */ 614#endif /* CONFIG_LOCAL_TIMERS */
632OMAP_SYS_TIMER(4, local);
633#endif /* CONFIG_ARCH_OMAP4 */ 615#endif /* CONFIG_ARCH_OMAP4 */
634 616
635#ifdef CONFIG_SOC_OMAP5 617#ifdef CONFIG_SOC_OMAP5
636OMAP_SYS_32K_TIMER_INIT(5, 1, OMAP4_32K_SOURCE, "ti,timer-alwon", 618OMAP_SYS_32K_TIMER_INIT(5, 1, OMAP4_32K_SOURCE, "ti,timer-alwon",
637 2, OMAP4_MPU_SOURCE); 619 2, OMAP4_MPU_SOURCE);
638static void __init omap5_realtime_timer_init(void) 620void __init omap5_realtime_timer_init(void)
639{ 621{
640 int err; 622 int err;
641 623
@@ -646,7 +628,6 @@ static void __init omap5_realtime_timer_init(void)
646 if (err) 628 if (err)
647 pr_err("%s: arch_timer_register failed %d\n", __func__, err); 629 pr_err("%s: arch_timer_register failed %d\n", __func__, err);
648} 630}
649OMAP_SYS_TIMER(5, realtime);
650#endif /* CONFIG_SOC_OMAP5 */ 631#endif /* CONFIG_SOC_OMAP5 */
651 632
652/** 633/**
@@ -702,8 +683,7 @@ static int __init omap_timer_init(struct omap_hwmod *oh, void *unused)
702 pdata->timer_errata = omap_dm_timer_get_errata(); 683 pdata->timer_errata = omap_dm_timer_get_errata();
703 pdata->get_context_loss_count = omap_pm_get_dev_context_loss_count; 684 pdata->get_context_loss_count = omap_pm_get_dev_context_loss_count;
704 685
705 pdev = omap_device_build(name, id, oh, pdata, sizeof(*pdata), 686 pdev = omap_device_build(name, id, oh, pdata, sizeof(*pdata));
706 NULL, 0, 0);
707 687
708 if (IS_ERR(pdev)) { 688 if (IS_ERR(pdev)) {
709 pr_err("%s: Can't build omap_device for %s: %s.\n", 689 pr_err("%s: Can't build omap_device for %s: %s.\n",
@@ -738,7 +718,7 @@ static int __init omap2_dm_timer_init(void)
738 718
739 return 0; 719 return 0;
740} 720}
741arch_initcall(omap2_dm_timer_init); 721omap_arch_initcall(omap2_dm_timer_init);
742 722
743/** 723/**
744 * omap2_override_clocksource - clocksource override with user configuration 724 * omap2_override_clocksource - clocksource override with user configuration
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
index e49b40b4c90a..51e138cc5398 100644
--- a/arch/arm/mach-omap2/twl-common.c
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -23,6 +23,7 @@
23#include <linux/i2c.h> 23#include <linux/i2c.h>
24#include <linux/i2c/twl.h> 24#include <linux/i2c/twl.h>
25#include <linux/gpio.h> 25#include <linux/gpio.h>
26#include <linux/string.h>
26#include <linux/regulator/machine.h> 27#include <linux/regulator/machine.h>
27#include <linux/regulator/fixed.h> 28#include <linux/regulator/fixed.h>
28 29
@@ -56,7 +57,7 @@ void __init omap_pmic_init(int bus, u32 clkrate,
56 struct twl4030_platform_data *pmic_data) 57 struct twl4030_platform_data *pmic_data)
57{ 58{
58 omap_mux_init_signal("sys_nirq", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE); 59 omap_mux_init_signal("sys_nirq", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE);
59 strncpy(pmic_i2c_board_info.type, pmic_type, 60 strlcpy(pmic_i2c_board_info.type, pmic_type,
60 sizeof(pmic_i2c_board_info.type)); 61 sizeof(pmic_i2c_board_info.type));
61 pmic_i2c_board_info.irq = pmic_irq; 62 pmic_i2c_board_info.irq = pmic_irq;
62 pmic_i2c_board_info.platform_data = pmic_data; 63 pmic_i2c_board_info.platform_data = pmic_data;
@@ -528,24 +529,29 @@ void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data,
528 defined(CONFIG_SND_OMAP_SOC_OMAP_TWL4030_MODULE) 529 defined(CONFIG_SND_OMAP_SOC_OMAP_TWL4030_MODULE)
529#include <linux/platform_data/omap-twl4030.h> 530#include <linux/platform_data/omap-twl4030.h>
530 531
532/* Commonly used configuration */
531static struct omap_tw4030_pdata omap_twl4030_audio_data; 533static struct omap_tw4030_pdata omap_twl4030_audio_data;
532 534
533static struct platform_device audio_device = { 535static struct platform_device audio_device = {
534 .name = "omap-twl4030", 536 .name = "omap-twl4030",
535 .id = -1, 537 .id = -1,
536 .dev = {
537 .platform_data = &omap_twl4030_audio_data,
538 },
539}; 538};
540 539
541void __init omap_twl4030_audio_init(char *card_name) 540void omap_twl4030_audio_init(char *card_name,
541 struct omap_tw4030_pdata *pdata)
542{ 542{
543 omap_twl4030_audio_data.card_name = card_name; 543 if (!pdata)
544 pdata = &omap_twl4030_audio_data;
545
546 pdata->card_name = card_name;
547
548 audio_device.dev.platform_data = pdata;
544 platform_device_register(&audio_device); 549 platform_device_register(&audio_device);
545} 550}
546 551
547#else /* SOC_OMAP_TWL4030 */ 552#else /* SOC_OMAP_TWL4030 */
548void __init omap_twl4030_audio_init(char *card_name) 553void omap_twl4030_audio_init(char *card_name,
554 struct omap_tw4030_pdata *pdata)
549{ 555{
550 return; 556 return;
551} 557}
diff --git a/arch/arm/mach-omap2/twl-common.h b/arch/arm/mach-omap2/twl-common.h
index dcfbad5ac471..24b65d081b69 100644
--- a/arch/arm/mach-omap2/twl-common.h
+++ b/arch/arm/mach-omap2/twl-common.h
@@ -32,6 +32,7 @@
32 32
33struct twl4030_platform_data; 33struct twl4030_platform_data;
34struct twl6040_platform_data; 34struct twl6040_platform_data;
35struct omap_tw4030_pdata;
35struct i2c_board_info; 36struct i2c_board_info;
36 37
37void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq, 38void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq,
@@ -60,6 +61,6 @@ void omap3_pmic_get_config(struct twl4030_platform_data *pmic_data,
60void omap4_pmic_get_config(struct twl4030_platform_data *pmic_data, 61void omap4_pmic_get_config(struct twl4030_platform_data *pmic_data,
61 u32 pdata_flags, u32 regulators_flags); 62 u32 pdata_flags, u32 regulators_flags);
62 63
63void omap_twl4030_audio_init(char *card_name); 64void omap_twl4030_audio_init(char *card_name, struct omap_tw4030_pdata *pdata);
64 65
65#endif /* __OMAP_PMIC_COMMON__ */ 66#endif /* __OMAP_PMIC_COMMON__ */
diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c
index 2e44e8a22884..5706bdccf45e 100644
--- a/arch/arm/mach-omap2/usb-host.c
+++ b/arch/arm/mach-omap2/usb-host.c
@@ -37,19 +37,6 @@
37#define USBHS_UHH_HWMODNAME "usb_host_hs" 37#define USBHS_UHH_HWMODNAME "usb_host_hs"
38#define USBHS_TLL_HWMODNAME "usb_tll_hs" 38#define USBHS_TLL_HWMODNAME "usb_tll_hs"
39 39
40static struct usbhs_omap_platform_data usbhs_data;
41static struct usbtll_omap_platform_data usbtll_data;
42static struct ehci_hcd_omap_platform_data ehci_data;
43static struct ohci_hcd_omap_platform_data ohci_data;
44
45static struct omap_device_pm_latency omap_uhhtll_latency[] = {
46 {
47 .deactivate_func = omap_device_idle_hwmods,
48 .activate_func = omap_device_enable_hwmods,
49 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
50 },
51};
52
53/* MUX settings for EHCI pins */ 40/* MUX settings for EHCI pins */
54/* 41/*
55 * setup_ehci_io_mux - initialize IO pad mux for USBHOST 42 * setup_ehci_io_mux - initialize IO pad mux for USBHOST
@@ -485,32 +472,18 @@ void __init setup_4430ohci_io_mux(const enum usbhs_omap_port_mode *port_mode)
485 } 472 }
486} 473}
487 474
488void __init usbhs_init(const struct usbhs_omap_board_data *pdata) 475void __init usbhs_init(struct usbhs_omap_platform_data *pdata)
489{ 476{
490 struct omap_hwmod *uhh_hwm, *tll_hwm; 477 struct omap_hwmod *uhh_hwm, *tll_hwm;
491 struct platform_device *pdev; 478 struct platform_device *pdev;
492 int bus_id = -1; 479 int bus_id = -1;
493 int i;
494
495 for (i = 0; i < OMAP3_HS_USB_PORTS; i++) {
496 usbhs_data.port_mode[i] = pdata->port_mode[i];
497 usbtll_data.port_mode[i] = pdata->port_mode[i];
498 ohci_data.port_mode[i] = pdata->port_mode[i];
499 ehci_data.port_mode[i] = pdata->port_mode[i];
500 ehci_data.reset_gpio_port[i] = pdata->reset_gpio_port[i];
501 ehci_data.regulator[i] = pdata->regulator[i];
502 }
503 ehci_data.phy_reset = pdata->phy_reset;
504 ohci_data.es2_compatibility = pdata->es2_compatibility;
505 usbhs_data.ehci_data = &ehci_data;
506 usbhs_data.ohci_data = &ohci_data;
507 480
508 if (cpu_is_omap34xx()) { 481 if (cpu_is_omap34xx()) {
509 setup_ehci_io_mux(pdata->port_mode); 482 setup_ehci_io_mux(pdata->port_mode);
510 setup_ohci_io_mux(pdata->port_mode); 483 setup_ohci_io_mux(pdata->port_mode);
511 484
512 if (omap_rev() <= OMAP3430_REV_ES2_1) 485 if (omap_rev() <= OMAP3430_REV_ES2_1)
513 usbhs_data.single_ulpi_bypass = true; 486 pdata->single_ulpi_bypass = true;
514 487
515 } else if (cpu_is_omap44xx()) { 488 } else if (cpu_is_omap44xx()) {
516 setup_4430ehci_io_mux(pdata->port_mode); 489 setup_4430ehci_io_mux(pdata->port_mode);
@@ -530,9 +503,7 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
530 } 503 }
531 504
532 pdev = omap_device_build(OMAP_USBTLL_DEVICE, bus_id, tll_hwm, 505 pdev = omap_device_build(OMAP_USBTLL_DEVICE, bus_id, tll_hwm,
533 &usbtll_data, sizeof(usbtll_data), 506 pdata, sizeof(*pdata));
534 omap_uhhtll_latency,
535 ARRAY_SIZE(omap_uhhtll_latency), false);
536 if (IS_ERR(pdev)) { 507 if (IS_ERR(pdev)) {
537 pr_err("Could not build hwmod device %s\n", 508 pr_err("Could not build hwmod device %s\n",
538 USBHS_TLL_HWMODNAME); 509 USBHS_TLL_HWMODNAME);
@@ -540,9 +511,7 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
540 } 511 }
541 512
542 pdev = omap_device_build(OMAP_USBHS_DEVICE, bus_id, uhh_hwm, 513 pdev = omap_device_build(OMAP_USBHS_DEVICE, bus_id, uhh_hwm,
543 &usbhs_data, sizeof(usbhs_data), 514 pdata, sizeof(*pdata));
544 omap_uhhtll_latency,
545 ARRAY_SIZE(omap_uhhtll_latency), false);
546 if (IS_ERR(pdev)) { 515 if (IS_ERR(pdev)) {
547 pr_err("Could not build hwmod devices %s\n", 516 pr_err("Could not build hwmod devices %s\n",
548 USBHS_UHH_HWMODNAME); 517 USBHS_UHH_HWMODNAME);
@@ -552,7 +521,7 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
552 521
553#else 522#else
554 523
555void __init usbhs_init(const struct usbhs_omap_board_data *pdata) 524void __init usbhs_init(struct usbhs_omap_platform_data *pdata)
556{ 525{
557} 526}
558 527
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 7b33b375fe77..3242a554ad6b 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -85,6 +85,9 @@ void __init usb_musb_init(struct omap_musb_board_data *musb_board_data)
85 musb_plat.mode = board_data->mode; 85 musb_plat.mode = board_data->mode;
86 musb_plat.extvbus = board_data->extvbus; 86 musb_plat.extvbus = board_data->extvbus;
87 87
88 if (cpu_is_omap44xx())
89 musb_plat.has_mailbox = true;
90
88 if (soc_is_am35xx()) { 91 if (soc_is_am35xx()) {
89 oh_name = "am35x_otg_hs"; 92 oh_name = "am35x_otg_hs";
90 name = "musb-am35x"; 93 name = "musb-am35x";
@@ -102,7 +105,7 @@ void __init usb_musb_init(struct omap_musb_board_data *musb_board_data)
102 return; 105 return;
103 106
104 pdev = omap_device_build(name, bus_id, oh, &musb_plat, 107 pdev = omap_device_build(name, bus_id, oh, &musb_plat,
105 sizeof(musb_plat), NULL, 0, false); 108 sizeof(musb_plat));
106 if (IS_ERR(pdev)) { 109 if (IS_ERR(pdev)) {
107 pr_err("Could not build omap_device for %s %s\n", 110 pr_err("Could not build omap_device for %s %s\n",
108 name, oh_name); 111 name, oh_name);
diff --git a/arch/arm/mach-omap2/usb.h b/arch/arm/mach-omap2/usb.h
index 9b986ead7c45..3319f5cf47a3 100644
--- a/arch/arm/mach-omap2/usb.h
+++ b/arch/arm/mach-omap2/usb.h
@@ -53,26 +53,8 @@
53#define USBPHY_OTGSESSEND_EN (1 << 20) 53#define USBPHY_OTGSESSEND_EN (1 << 20)
54#define USBPHY_DATA_POLARITY (1 << 23) 54#define USBPHY_DATA_POLARITY (1 << 23)
55 55
56struct usbhs_omap_board_data {
57 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
58
59 /* have to be valid if phy_reset is true and portx is in phy mode */
60 int reset_gpio_port[OMAP3_HS_USB_PORTS];
61
62 /* Set this to true for ES2.x silicon */
63 unsigned es2_compatibility:1;
64
65 unsigned phy_reset:1;
66
67 /*
68 * Regulators for USB PHYs.
69 * Each PHY can have a separate regulator.
70 */
71 struct regulator *regulator[OMAP3_HS_USB_PORTS];
72};
73
74extern void usb_musb_init(struct omap_musb_board_data *board_data); 56extern void usb_musb_init(struct omap_musb_board_data *board_data);
75extern void usbhs_init(const struct usbhs_omap_board_data *pdata); 57extern void usbhs_init(struct usbhs_omap_platform_data *pdata);
76 58
77extern void am35x_musb_reset(void); 59extern void am35x_musb_reset(void);
78extern void am35x_musb_phy_power(u8 on); 60extern void am35x_musb_phy_power(u8 on);
diff --git a/arch/arm/mach-omap2/wd_timer.c b/arch/arm/mach-omap2/wd_timer.c
index 7c2b4ed38f02..d15c7bbab8e2 100644
--- a/arch/arm/mach-omap2/wd_timer.c
+++ b/arch/arm/mach-omap2/wd_timer.c
@@ -124,10 +124,9 @@ static int __init omap_init_wdt(void)
124 pdata.read_reset_sources = prm_read_reset_sources; 124 pdata.read_reset_sources = prm_read_reset_sources;
125 125
126 pdev = omap_device_build(dev_name, id, oh, &pdata, 126 pdev = omap_device_build(dev_name, id, oh, &pdata,
127 sizeof(struct omap_wd_timer_platform_data), 127 sizeof(struct omap_wd_timer_platform_data));
128 NULL, 0, 0);
129 WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s.\n", 128 WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s.\n",
130 dev_name, oh->name); 129 dev_name, oh->name);
131 return 0; 130 return 0;
132} 131}
133subsys_initcall(omap_init_wdt); 132omap_subsys_initcall(omap_init_wdt);
diff --git a/arch/arm/mach-orion5x/board-dt.c b/arch/arm/mach-orion5x/board-dt.c
index 32e5c211a89b..35a8014529ca 100644
--- a/arch/arm/mach-orion5x/board-dt.c
+++ b/arch/arm/mach-orion5x/board-dt.c
@@ -72,7 +72,7 @@ DT_MACHINE_START(ORION5X_DT, "Marvell Orion5x (Flattened Device Tree)")
72 .map_io = orion5x_map_io, 72 .map_io = orion5x_map_io,
73 .init_early = orion5x_init_early, 73 .init_early = orion5x_init_early,
74 .init_irq = orion_dt_init_irq, 74 .init_irq = orion_dt_init_irq,
75 .timer = &orion5x_timer, 75 .init_time = orion5x_timer_init,
76 .init_machine = orion5x_dt_init, 76 .init_machine = orion5x_dt_init,
77 .restart = orion5x_restart, 77 .restart = orion5x_restart,
78 .dt_compat = orion5x_dt_compat, 78 .dt_compat = orion5x_dt_compat,
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c
index 550f92320afb..d068f1431c40 100644
--- a/arch/arm/mach-orion5x/common.c
+++ b/arch/arm/mach-orion5x/common.c
@@ -217,7 +217,7 @@ int __init orion5x_find_tclk(void)
217 return 166666667; 217 return 166666667;
218} 218}
219 219
220static void __init orion5x_timer_init(void) 220void __init orion5x_timer_init(void)
221{ 221{
222 orion5x_tclk = orion5x_find_tclk(); 222 orion5x_tclk = orion5x_find_tclk();
223 223
@@ -225,10 +225,6 @@ static void __init orion5x_timer_init(void)
225 IRQ_ORION5X_BRIDGE, orion5x_tclk); 225 IRQ_ORION5X_BRIDGE, orion5x_tclk);
226} 226}
227 227
228struct sys_timer orion5x_timer = {
229 .init = orion5x_timer_init,
230};
231
232 228
233/***************************************************************************** 229/*****************************************************************************
234 * General 230 * General
diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h
index 7db5cdd9c4b7..e60345760283 100644
--- a/arch/arm/mach-orion5x/common.h
+++ b/arch/arm/mach-orion5x/common.h
@@ -15,7 +15,7 @@ void orion5x_init(void);
15void orion5x_id(u32 *dev, u32 *rev, char **dev_name); 15void orion5x_id(u32 *dev, u32 *rev, char **dev_name);
16void clk_init(void); 16void clk_init(void);
17extern int orion5x_tclk; 17extern int orion5x_tclk;
18extern struct sys_timer orion5x_timer; 18extern void orion5x_timer_init(void);
19 19
20/* 20/*
21 * Enumerations and functions for Orion windows mapping. Used by Orion core 21 * Enumerations and functions for Orion windows mapping. Used by Orion core
diff --git a/arch/arm/mach-orion5x/d2net-setup.c b/arch/arm/mach-orion5x/d2net-setup.c
index e3629c063df2..57d0af74874d 100644
--- a/arch/arm/mach-orion5x/d2net-setup.c
+++ b/arch/arm/mach-orion5x/d2net-setup.c
@@ -342,7 +342,7 @@ MACHINE_START(D2NET, "LaCie d2 Network")
342 .map_io = orion5x_map_io, 342 .map_io = orion5x_map_io,
343 .init_early = orion5x_init_early, 343 .init_early = orion5x_init_early,
344 .init_irq = orion5x_init_irq, 344 .init_irq = orion5x_init_irq,
345 .timer = &orion5x_timer, 345 .init_time = orion5x_timer_init,
346 .fixup = tag_fixup_mem32, 346 .fixup = tag_fixup_mem32,
347 .restart = orion5x_restart, 347 .restart = orion5x_restart,
348MACHINE_END 348MACHINE_END
@@ -355,7 +355,7 @@ MACHINE_START(BIGDISK, "LaCie Big Disk Network")
355 .map_io = orion5x_map_io, 355 .map_io = orion5x_map_io,
356 .init_early = orion5x_init_early, 356 .init_early = orion5x_init_early,
357 .init_irq = orion5x_init_irq, 357 .init_irq = orion5x_init_irq,
358 .timer = &orion5x_timer, 358 .init_time = orion5x_timer_init,
359 .fixup = tag_fixup_mem32, 359 .fixup = tag_fixup_mem32,
360 .restart = orion5x_restart, 360 .restart = orion5x_restart,
361MACHINE_END 361MACHINE_END
diff --git a/arch/arm/mach-orion5x/db88f5281-setup.c b/arch/arm/mach-orion5x/db88f5281-setup.c
index 41fe2b1ff47c..76665640087b 100644
--- a/arch/arm/mach-orion5x/db88f5281-setup.c
+++ b/arch/arm/mach-orion5x/db88f5281-setup.c
@@ -362,6 +362,6 @@ MACHINE_START(DB88F5281, "Marvell Orion-2 Development Board")
362 .map_io = orion5x_map_io, 362 .map_io = orion5x_map_io,
363 .init_early = orion5x_init_early, 363 .init_early = orion5x_init_early,
364 .init_irq = orion5x_init_irq, 364 .init_irq = orion5x_init_irq,
365 .timer = &orion5x_timer, 365 .init_time = orion5x_timer_init,
366 .restart = orion5x_restart, 366 .restart = orion5x_restart,
367MACHINE_END 367MACHINE_END
diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c
index e533588880ff..6eb1732757fd 100644
--- a/arch/arm/mach-orion5x/dns323-setup.c
+++ b/arch/arm/mach-orion5x/dns323-setup.c
@@ -714,7 +714,7 @@ MACHINE_START(DNS323, "D-Link DNS-323")
714 .map_io = orion5x_map_io, 714 .map_io = orion5x_map_io,
715 .init_early = orion5x_init_early, 715 .init_early = orion5x_init_early,
716 .init_irq = orion5x_init_irq, 716 .init_irq = orion5x_init_irq,
717 .timer = &orion5x_timer, 717 .init_time = orion5x_timer_init,
718 .fixup = tag_fixup_mem32, 718 .fixup = tag_fixup_mem32,
719 .restart = orion5x_restart, 719 .restart = orion5x_restart,
720MACHINE_END 720MACHINE_END
diff --git a/arch/arm/mach-orion5x/include/mach/uncompress.h b/arch/arm/mach-orion5x/include/mach/uncompress.h
index 4322dba468a4..abd26b542c3c 100644
--- a/arch/arm/mach-orion5x/include/mach/uncompress.h
+++ b/arch/arm/mach-orion5x/include/mach/uncompress.h
@@ -46,4 +46,3 @@ static void flush(void)
46 * nothing to do 46 * nothing to do
47 */ 47 */
48#define arch_decomp_setup() 48#define arch_decomp_setup()
49#define arch_decomp_wdog()
diff --git a/arch/arm/mach-orion5x/kurobox_pro-setup.c b/arch/arm/mach-orion5x/kurobox_pro-setup.c
index f1ae10ae5bd4..b98403526218 100644
--- a/arch/arm/mach-orion5x/kurobox_pro-setup.c
+++ b/arch/arm/mach-orion5x/kurobox_pro-setup.c
@@ -383,7 +383,7 @@ MACHINE_START(KUROBOX_PRO, "Buffalo/Revogear Kurobox Pro")
383 .map_io = orion5x_map_io, 383 .map_io = orion5x_map_io,
384 .init_early = orion5x_init_early, 384 .init_early = orion5x_init_early,
385 .init_irq = orion5x_init_irq, 385 .init_irq = orion5x_init_irq,
386 .timer = &orion5x_timer, 386 .init_time = orion5x_timer_init,
387 .fixup = tag_fixup_mem32, 387 .fixup = tag_fixup_mem32,
388 .restart = orion5x_restart, 388 .restart = orion5x_restart,
389MACHINE_END 389MACHINE_END
@@ -397,7 +397,7 @@ MACHINE_START(LINKSTATION_PRO, "Buffalo Linkstation Pro/Live")
397 .map_io = orion5x_map_io, 397 .map_io = orion5x_map_io,
398 .init_early = orion5x_init_early, 398 .init_early = orion5x_init_early,
399 .init_irq = orion5x_init_irq, 399 .init_irq = orion5x_init_irq,
400 .timer = &orion5x_timer, 400 .init_time = orion5x_timer_init,
401 .fixup = tag_fixup_mem32, 401 .fixup = tag_fixup_mem32,
402 .restart = orion5x_restart, 402 .restart = orion5x_restart,
403MACHINE_END 403MACHINE_END
diff --git a/arch/arm/mach-orion5x/ls-chl-setup.c b/arch/arm/mach-orion5x/ls-chl-setup.c
index 0c9e413b5805..044da5b6a6ae 100644
--- a/arch/arm/mach-orion5x/ls-chl-setup.c
+++ b/arch/arm/mach-orion5x/ls-chl-setup.c
@@ -322,7 +322,7 @@ MACHINE_START(LINKSTATION_LSCHL, "Buffalo Linkstation LiveV3 (LS-CHL)")
322 .map_io = orion5x_map_io, 322 .map_io = orion5x_map_io,
323 .init_early = orion5x_init_early, 323 .init_early = orion5x_init_early,
324 .init_irq = orion5x_init_irq, 324 .init_irq = orion5x_init_irq,
325 .timer = &orion5x_timer, 325 .init_time = orion5x_timer_init,
326 .fixup = tag_fixup_mem32, 326 .fixup = tag_fixup_mem32,
327 .restart = orion5x_restart, 327 .restart = orion5x_restart,
328MACHINE_END 328MACHINE_END
diff --git a/arch/arm/mach-orion5x/ls_hgl-setup.c b/arch/arm/mach-orion5x/ls_hgl-setup.c
index c1b5d8a58037..d49f93423f52 100644
--- a/arch/arm/mach-orion5x/ls_hgl-setup.c
+++ b/arch/arm/mach-orion5x/ls_hgl-setup.c
@@ -269,7 +269,7 @@ MACHINE_START(LINKSTATION_LS_HGL, "Buffalo Linkstation LS-HGL")
269 .map_io = orion5x_map_io, 269 .map_io = orion5x_map_io,
270 .init_early = orion5x_init_early, 270 .init_early = orion5x_init_early,
271 .init_irq = orion5x_init_irq, 271 .init_irq = orion5x_init_irq,
272 .timer = &orion5x_timer, 272 .init_time = orion5x_timer_init,
273 .fixup = tag_fixup_mem32, 273 .fixup = tag_fixup_mem32,
274 .restart = orion5x_restart, 274 .restart = orion5x_restart,
275MACHINE_END 275MACHINE_END
diff --git a/arch/arm/mach-orion5x/lsmini-setup.c b/arch/arm/mach-orion5x/lsmini-setup.c
index 949eaa8f12e3..8e3965c6c0fe 100644
--- a/arch/arm/mach-orion5x/lsmini-setup.c
+++ b/arch/arm/mach-orion5x/lsmini-setup.c
@@ -271,7 +271,7 @@ MACHINE_START(LINKSTATION_MINI, "Buffalo Linkstation Mini")
271 .map_io = orion5x_map_io, 271 .map_io = orion5x_map_io,
272 .init_early = orion5x_init_early, 272 .init_early = orion5x_init_early,
273 .init_irq = orion5x_init_irq, 273 .init_irq = orion5x_init_irq,
274 .timer = &orion5x_timer, 274 .init_time = orion5x_timer_init,
275 .fixup = tag_fixup_mem32, 275 .fixup = tag_fixup_mem32,
276 .restart = orion5x_restart, 276 .restart = orion5x_restart,
277MACHINE_END 277MACHINE_END
diff --git a/arch/arm/mach-orion5x/mss2-setup.c b/arch/arm/mach-orion5x/mss2-setup.c
index 1c16d045333e..0ec94a1f2b16 100644
--- a/arch/arm/mach-orion5x/mss2-setup.c
+++ b/arch/arm/mach-orion5x/mss2-setup.c
@@ -265,7 +265,7 @@ MACHINE_START(MSS2, "Maxtor Shared Storage II")
265 .map_io = orion5x_map_io, 265 .map_io = orion5x_map_io,
266 .init_early = orion5x_init_early, 266 .init_early = orion5x_init_early,
267 .init_irq = orion5x_init_irq, 267 .init_irq = orion5x_init_irq,
268 .timer = &orion5x_timer, 268 .init_time = orion5x_timer_init,
269 .fixup = tag_fixup_mem32, 269 .fixup = tag_fixup_mem32,
270 .restart = orion5x_restart, 270 .restart = orion5x_restart,
271MACHINE_END 271MACHINE_END
diff --git a/arch/arm/mach-orion5x/mv2120-setup.c b/arch/arm/mach-orion5x/mv2120-setup.c
index c87fde4deeca..18143f2a9093 100644
--- a/arch/arm/mach-orion5x/mv2120-setup.c
+++ b/arch/arm/mach-orion5x/mv2120-setup.c
@@ -233,7 +233,7 @@ MACHINE_START(MV2120, "HP Media Vault mv2120")
233 .map_io = orion5x_map_io, 233 .map_io = orion5x_map_io,
234 .init_early = orion5x_init_early, 234 .init_early = orion5x_init_early,
235 .init_irq = orion5x_init_irq, 235 .init_irq = orion5x_init_irq,
236 .timer = &orion5x_timer, 236 .init_time = orion5x_timer_init,
237 .fixup = tag_fixup_mem32, 237 .fixup = tag_fixup_mem32,
238 .restart = orion5x_restart, 238 .restart = orion5x_restart,
239MACHINE_END 239MACHINE_END
diff --git a/arch/arm/mach-orion5x/net2big-setup.c b/arch/arm/mach-orion5x/net2big-setup.c
index 3506f16c0bf2..282e503b003e 100644
--- a/arch/arm/mach-orion5x/net2big-setup.c
+++ b/arch/arm/mach-orion5x/net2big-setup.c
@@ -425,7 +425,7 @@ MACHINE_START(NET2BIG, "LaCie 2Big Network")
425 .map_io = orion5x_map_io, 425 .map_io = orion5x_map_io,
426 .init_early = orion5x_init_early, 426 .init_early = orion5x_init_early,
427 .init_irq = orion5x_init_irq, 427 .init_irq = orion5x_init_irq,
428 .timer = &orion5x_timer, 428 .init_time = orion5x_timer_init,
429 .fixup = tag_fixup_mem32, 429 .fixup = tag_fixup_mem32,
430 .restart = orion5x_restart, 430 .restart = orion5x_restart,
431MACHINE_END 431MACHINE_END
diff --git a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
index 9b1c95310291..d6e72f672afb 100644
--- a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
@@ -171,7 +171,7 @@ MACHINE_START(RD88F5181L_FXO, "Marvell Orion-VoIP FXO Reference Design")
171 .map_io = orion5x_map_io, 171 .map_io = orion5x_map_io,
172 .init_early = orion5x_init_early, 172 .init_early = orion5x_init_early,
173 .init_irq = orion5x_init_irq, 173 .init_irq = orion5x_init_irq,
174 .timer = &orion5x_timer, 174 .init_time = orion5x_timer_init,
175 .fixup = tag_fixup_mem32, 175 .fixup = tag_fixup_mem32,
176 .restart = orion5x_restart, 176 .restart = orion5x_restart,
177MACHINE_END 177MACHINE_END
diff --git a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
index 51ba2b81a10b..c8b7913310e5 100644
--- a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
@@ -183,7 +183,7 @@ MACHINE_START(RD88F5181L_GE, "Marvell Orion-VoIP GE Reference Design")
183 .map_io = orion5x_map_io, 183 .map_io = orion5x_map_io,
184 .init_early = orion5x_init_early, 184 .init_early = orion5x_init_early,
185 .init_irq = orion5x_init_irq, 185 .init_irq = orion5x_init_irq,
186 .timer = &orion5x_timer, 186 .init_time = orion5x_timer_init,
187 .fixup = tag_fixup_mem32, 187 .fixup = tag_fixup_mem32,
188 .restart = orion5x_restart, 188 .restart = orion5x_restart,
189MACHINE_END 189MACHINE_END
diff --git a/arch/arm/mach-orion5x/rd88f5182-setup.c b/arch/arm/mach-orion5x/rd88f5182-setup.c
index 0a56b9444f1b..f9e156725d7c 100644
--- a/arch/arm/mach-orion5x/rd88f5182-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5182-setup.c
@@ -281,6 +281,6 @@ MACHINE_START(RD88F5182, "Marvell Orion-NAS Reference Design")
281 .map_io = orion5x_map_io, 281 .map_io = orion5x_map_io,
282 .init_early = orion5x_init_early, 282 .init_early = orion5x_init_early,
283 .init_irq = orion5x_init_irq, 283 .init_irq = orion5x_init_irq,
284 .timer = &orion5x_timer, 284 .init_time = orion5x_timer_init,
285 .restart = orion5x_restart, 285 .restart = orion5x_restart,
286MACHINE_END 286MACHINE_END
diff --git a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
index ed50910b08a4..78a1e6ab1b9d 100644
--- a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
+++ b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
@@ -123,7 +123,7 @@ MACHINE_START(RD88F6183AP_GE, "Marvell Orion-1-90 AP GE Reference Design")
123 .map_io = orion5x_map_io, 123 .map_io = orion5x_map_io,
124 .init_early = orion5x_init_early, 124 .init_early = orion5x_init_early,
125 .init_irq = orion5x_init_irq, 125 .init_irq = orion5x_init_irq,
126 .timer = &orion5x_timer, 126 .init_time = orion5x_timer_init,
127 .fixup = tag_fixup_mem32, 127 .fixup = tag_fixup_mem32,
128 .restart = orion5x_restart, 128 .restart = orion5x_restart,
129MACHINE_END 129MACHINE_END
diff --git a/arch/arm/mach-orion5x/terastation_pro2-setup.c b/arch/arm/mach-orion5x/terastation_pro2-setup.c
index 90e571dc4deb..acc0877ec1c9 100644
--- a/arch/arm/mach-orion5x/terastation_pro2-setup.c
+++ b/arch/arm/mach-orion5x/terastation_pro2-setup.c
@@ -361,7 +361,7 @@ MACHINE_START(TERASTATION_PRO2, "Buffalo Terastation Pro II/Live")
361 .map_io = orion5x_map_io, 361 .map_io = orion5x_map_io,
362 .init_early = orion5x_init_early, 362 .init_early = orion5x_init_early,
363 .init_irq = orion5x_init_irq, 363 .init_irq = orion5x_init_irq,
364 .timer = &orion5x_timer, 364 .init_time = orion5x_timer_init,
365 .fixup = tag_fixup_mem32, 365 .fixup = tag_fixup_mem32,
366 .restart = orion5x_restart, 366 .restart = orion5x_restart,
367MACHINE_END 367MACHINE_END
diff --git a/arch/arm/mach-orion5x/ts209-setup.c b/arch/arm/mach-orion5x/ts209-setup.c
index b184f680e0db..9c17f0c2b488 100644
--- a/arch/arm/mach-orion5x/ts209-setup.c
+++ b/arch/arm/mach-orion5x/ts209-setup.c
@@ -326,7 +326,7 @@ MACHINE_START(TS209, "QNAP TS-109/TS-209")
326 .map_io = orion5x_map_io, 326 .map_io = orion5x_map_io,
327 .init_early = orion5x_init_early, 327 .init_early = orion5x_init_early,
328 .init_irq = orion5x_init_irq, 328 .init_irq = orion5x_init_irq,
329 .timer = &orion5x_timer, 329 .init_time = orion5x_timer_init,
330 .fixup = tag_fixup_mem32, 330 .fixup = tag_fixup_mem32,
331 .restart = orion5x_restart, 331 .restart = orion5x_restart,
332MACHINE_END 332MACHINE_END
diff --git a/arch/arm/mach-orion5x/ts409-setup.c b/arch/arm/mach-orion5x/ts409-setup.c
index a5c2e64c4ece..8cc5ab6c503e 100644
--- a/arch/arm/mach-orion5x/ts409-setup.c
+++ b/arch/arm/mach-orion5x/ts409-setup.c
@@ -315,7 +315,7 @@ MACHINE_START(TS409, "QNAP TS-409")
315 .map_io = orion5x_map_io, 315 .map_io = orion5x_map_io,
316 .init_early = orion5x_init_early, 316 .init_early = orion5x_init_early,
317 .init_irq = orion5x_init_irq, 317 .init_irq = orion5x_init_irq,
318 .timer = &orion5x_timer, 318 .init_time = orion5x_timer_init,
319 .fixup = tag_fixup_mem32, 319 .fixup = tag_fixup_mem32,
320 .restart = orion5x_restart, 320 .restart = orion5x_restart,
321MACHINE_END 321MACHINE_END
diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c
index b0727dcd1ef9..e960855d32ac 100644
--- a/arch/arm/mach-orion5x/ts78xx-setup.c
+++ b/arch/arm/mach-orion5x/ts78xx-setup.c
@@ -619,6 +619,6 @@ MACHINE_START(TS78XX, "Technologic Systems TS-78xx SBC")
619 .map_io = ts78xx_map_io, 619 .map_io = ts78xx_map_io,
620 .init_early = orion5x_init_early, 620 .init_early = orion5x_init_early,
621 .init_irq = orion5x_init_irq, 621 .init_irq = orion5x_init_irq,
622 .timer = &orion5x_timer, 622 .init_time = orion5x_timer_init,
623 .restart = orion5x_restart, 623 .restart = orion5x_restart,
624MACHINE_END 624MACHINE_END
diff --git a/arch/arm/mach-orion5x/wnr854t-setup.c b/arch/arm/mach-orion5x/wnr854t-setup.c
index 754c12b6abf0..66552ca7e05d 100644
--- a/arch/arm/mach-orion5x/wnr854t-setup.c
+++ b/arch/arm/mach-orion5x/wnr854t-setup.c
@@ -176,7 +176,7 @@ MACHINE_START(WNR854T, "Netgear WNR854T")
176 .map_io = orion5x_map_io, 176 .map_io = orion5x_map_io,
177 .init_early = orion5x_init_early, 177 .init_early = orion5x_init_early,
178 .init_irq = orion5x_init_irq, 178 .init_irq = orion5x_init_irq,
179 .timer = &orion5x_timer, 179 .init_time = orion5x_timer_init,
180 .fixup = tag_fixup_mem32, 180 .fixup = tag_fixup_mem32,
181 .restart = orion5x_restart, 181 .restart = orion5x_restart,
182MACHINE_END 182MACHINE_END
diff --git a/arch/arm/mach-orion5x/wrt350n-v2-setup.c b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
index 45c21251eb1e..2c5408e2e689 100644
--- a/arch/arm/mach-orion5x/wrt350n-v2-setup.c
+++ b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
@@ -264,7 +264,7 @@ MACHINE_START(WRT350N_V2, "Linksys WRT350N v2")
264 .map_io = orion5x_map_io, 264 .map_io = orion5x_map_io,
265 .init_early = orion5x_init_early, 265 .init_early = orion5x_init_early,
266 .init_irq = orion5x_init_irq, 266 .init_irq = orion5x_init_irq,
267 .timer = &orion5x_timer, 267 .init_time = orion5x_timer_init,
268 .fixup = tag_fixup_mem32, 268 .fixup = tag_fixup_mem32,
269 .restart = orion5x_restart, 269 .restart = orion5x_restart,
270MACHINE_END 270MACHINE_END
diff --git a/arch/arm/mach-picoxcell/Kconfig b/arch/arm/mach-picoxcell/Kconfig
index 868796f8085c..13bae78b215a 100644
--- a/arch/arm/mach-picoxcell/Kconfig
+++ b/arch/arm/mach-picoxcell/Kconfig
@@ -7,7 +7,6 @@ config ARCH_PICOXCELL
7 select DW_APB_TIMER 7 select DW_APB_TIMER
8 select DW_APB_TIMER_OF 8 select DW_APB_TIMER_OF
9 select GENERIC_CLOCKEVENTS 9 select GENERIC_CLOCKEVENTS
10 select GENERIC_GPIO
11 select HAVE_TCM 10 select HAVE_TCM
12 select NO_IOPORT 11 select NO_IOPORT
13 select SPARSE_IRQ 12 select SPARSE_IRQ
diff --git a/arch/arm/mach-picoxcell/common.c b/arch/arm/mach-picoxcell/common.c
index f6c0849af5e9..70b441ad1d18 100644
--- a/arch/arm/mach-picoxcell/common.c
+++ b/arch/arm/mach-picoxcell/common.c
@@ -9,6 +9,7 @@
9 */ 9 */
10#include <linux/delay.h> 10#include <linux/delay.h>
11#include <linux/irq.h> 11#include <linux/irq.h>
12#include <linux/irqchip.h>
12#include <linux/irqdomain.h> 13#include <linux/irqdomain.h>
13#include <linux/of.h> 14#include <linux/of.h>
14#include <linux/of_address.h> 15#include <linux/of_address.h>
@@ -17,7 +18,6 @@
17#include <linux/dw_apb_timer.h> 18#include <linux/dw_apb_timer.h>
18 19
19#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
20#include <asm/hardware/vic.h>
21#include <asm/mach/map.h> 21#include <asm/mach/map.h>
22 22
23#include "common.h" 23#include "common.h"
@@ -70,16 +70,6 @@ static const char *picoxcell_dt_match[] = {
70 NULL 70 NULL
71}; 71};
72 72
73static const struct of_device_id vic_of_match[] __initconst = {
74 { .compatible = "arm,pl192-vic", .data = vic_of_init, },
75 { /* Sentinel */ }
76};
77
78static void __init picoxcell_init_irq(void)
79{
80 of_irq_init(vic_of_match);
81}
82
83static void picoxcell_wdt_restart(char mode, const char *cmd) 73static void picoxcell_wdt_restart(char mode, const char *cmd)
84{ 74{
85 /* 75 /*
@@ -97,9 +87,8 @@ static void picoxcell_wdt_restart(char mode, const char *cmd)
97DT_MACHINE_START(PICOXCELL, "Picochip picoXcell") 87DT_MACHINE_START(PICOXCELL, "Picochip picoXcell")
98 .map_io = picoxcell_map_io, 88 .map_io = picoxcell_map_io,
99 .nr_irqs = NR_IRQS_LEGACY, 89 .nr_irqs = NR_IRQS_LEGACY,
100 .init_irq = picoxcell_init_irq, 90 .init_irq = irqchip_init,
101 .handle_irq = vic_handle_irq, 91 .init_time = dw_apb_timer_init,
102 .timer = &dw_apb_timer,
103 .init_machine = picoxcell_init_machine, 92 .init_machine = picoxcell_init_machine,
104 .dt_compat = picoxcell_dt_match, 93 .dt_compat = picoxcell_dt_match,
105 .restart = picoxcell_wdt_restart, 94 .restart = picoxcell_wdt_restart,
diff --git a/arch/arm/mach-picoxcell/common.h b/arch/arm/mach-picoxcell/common.h
index a65cb02f84c8..481b42a4ef15 100644
--- a/arch/arm/mach-picoxcell/common.h
+++ b/arch/arm/mach-picoxcell/common.h
@@ -12,6 +12,6 @@
12 12
13#include <asm/mach/time.h> 13#include <asm/mach/time.h>
14 14
15extern struct sys_timer dw_apb_timer; 15extern void dw_apb_timer_init(void);
16 16
17#endif /* __PICOXCELL_COMMON_H__ */ 17#endif /* __PICOXCELL_COMMON_H__ */
diff --git a/arch/arm/mach-prima2/Kconfig b/arch/arm/mach-prima2/Kconfig
index 558ccfb8d458..4f7379fe01e2 100644
--- a/arch/arm/mach-prima2/Kconfig
+++ b/arch/arm/mach-prima2/Kconfig
@@ -11,6 +11,16 @@ config ARCH_PRIMA2
11 help 11 help
12 Support for CSR SiRFSoC ARM Cortex A9 Platform 12 Support for CSR SiRFSoC ARM Cortex A9 Platform
13 13
14config ARCH_MARCO
15 bool "CSR SiRFSoC MARCO ARM Cortex A9 Platform"
16 default y
17 select ARM_GIC
18 select CPU_V7
19 select HAVE_SMP
20 select SMP_ON_UP
21 help
22 Support for CSR SiRFSoC ARM Cortex A9 Platform
23
14endmenu 24endmenu
15 25
16config SIRF_IRQ 26config SIRF_IRQ
diff --git a/arch/arm/mach-prima2/Makefile b/arch/arm/mach-prima2/Makefile
index fc9ce22e2b5a..bfe360cbd177 100644
--- a/arch/arm/mach-prima2/Makefile
+++ b/arch/arm/mach-prima2/Makefile
@@ -1,4 +1,3 @@
1obj-y := timer.o
2obj-y += rstc.o 1obj-y += rstc.o
3obj-y += common.o 2obj-y += common.o
4obj-y += rtciobrg.o 3obj-y += rtciobrg.o
@@ -6,3 +5,7 @@ obj-$(CONFIG_DEBUG_LL) += lluart.o
6obj-$(CONFIG_CACHE_L2X0) += l2x0.o 5obj-$(CONFIG_CACHE_L2X0) += l2x0.o
7obj-$(CONFIG_SUSPEND) += pm.o sleep.o 6obj-$(CONFIG_SUSPEND) += pm.o sleep.o
8obj-$(CONFIG_SIRF_IRQ) += irq.o 7obj-$(CONFIG_SIRF_IRQ) += irq.o
8obj-$(CONFIG_SMP) += platsmp.o headsmp.o
9obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
10obj-$(CONFIG_ARCH_PRIMA2) += timer-prima2.o
11obj-$(CONFIG_ARCH_MARCO) += timer-marco.o
diff --git a/arch/arm/mach-prima2/common.c b/arch/arm/mach-prima2/common.c
index f25a54194639..2d57aa479a7b 100644
--- a/arch/arm/mach-prima2/common.c
+++ b/arch/arm/mach-prima2/common.c
@@ -8,6 +8,7 @@
8 8
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/irqchip.h>
11#include <asm/sizes.h> 12#include <asm/sizes.h>
12#include <asm/mach-types.h> 13#include <asm/mach-types.h>
13#include <asm/mach/arch.h> 14#include <asm/mach/arch.h>
@@ -30,6 +31,12 @@ void __init sirfsoc_init_late(void)
30 sirfsoc_pm_init(); 31 sirfsoc_pm_init();
31} 32}
32 33
34static __init void sirfsoc_map_io(void)
35{
36 sirfsoc_map_lluart();
37 sirfsoc_map_scu();
38}
39
33#ifdef CONFIG_ARCH_PRIMA2 40#ifdef CONFIG_ARCH_PRIMA2
34static const char *prima2_dt_match[] __initdata = { 41static const char *prima2_dt_match[] __initdata = {
35 "sirf,prima2", 42 "sirf,prima2",
@@ -38,9 +45,12 @@ static const char *prima2_dt_match[] __initdata = {
38 45
39DT_MACHINE_START(PRIMA2_DT, "Generic PRIMA2 (Flattened Device Tree)") 46DT_MACHINE_START(PRIMA2_DT, "Generic PRIMA2 (Flattened Device Tree)")
40 /* Maintainer: Barry Song <baohua.song@csr.com> */ 47 /* Maintainer: Barry Song <baohua.song@csr.com> */
41 .map_io = sirfsoc_map_lluart, 48 .map_io = sirfsoc_map_io,
42 .init_irq = sirfsoc_of_irq_init, 49 .init_irq = sirfsoc_of_irq_init,
43 .timer = &sirfsoc_timer, 50 .init_time = sirfsoc_prima2_timer_init,
51#ifdef CONFIG_MULTI_IRQ_HANDLER
52 .handle_irq = sirfsoc_handle_irq,
53#endif
44 .dma_zone_size = SZ_256M, 54 .dma_zone_size = SZ_256M,
45 .init_machine = sirfsoc_mach_init, 55 .init_machine = sirfsoc_mach_init,
46 .init_late = sirfsoc_init_late, 56 .init_late = sirfsoc_init_late,
@@ -48,3 +58,22 @@ DT_MACHINE_START(PRIMA2_DT, "Generic PRIMA2 (Flattened Device Tree)")
48 .restart = sirfsoc_restart, 58 .restart = sirfsoc_restart,
49MACHINE_END 59MACHINE_END
50#endif 60#endif
61
62#ifdef CONFIG_ARCH_MARCO
63static const char *marco_dt_match[] __initdata = {
64 "sirf,marco",
65 NULL
66};
67
68DT_MACHINE_START(MARCO_DT, "Generic MARCO (Flattened Device Tree)")
69 /* Maintainer: Barry Song <baohua.song@csr.com> */
70 .smp = smp_ops(sirfsoc_smp_ops),
71 .map_io = sirfsoc_map_io,
72 .init_irq = irqchip_init,
73 .init_time = sirfsoc_marco_timer_init,
74 .init_machine = sirfsoc_mach_init,
75 .init_late = sirfsoc_init_late,
76 .dt_compat = marco_dt_match,
77 .restart = sirfsoc_restart,
78MACHINE_END
79#endif
diff --git a/arch/arm/mach-prima2/common.h b/arch/arm/mach-prima2/common.h
index 60d826fc2185..b7c26b62e4a7 100644
--- a/arch/arm/mach-prima2/common.h
+++ b/arch/arm/mach-prima2/common.h
@@ -11,12 +11,19 @@
11 11
12#include <linux/init.h> 12#include <linux/init.h>
13#include <asm/mach/time.h> 13#include <asm/mach/time.h>
14#include <asm/exception.h>
14 15
15extern struct sys_timer sirfsoc_timer; 16extern void sirfsoc_prima2_timer_init(void);
17extern void sirfsoc_marco_timer_init(void);
18
19extern struct smp_operations sirfsoc_smp_ops;
20extern void sirfsoc_secondary_startup(void);
21extern void sirfsoc_cpu_die(unsigned int cpu);
16 22
17extern void __init sirfsoc_of_irq_init(void); 23extern void __init sirfsoc_of_irq_init(void);
18extern void __init sirfsoc_of_clk_init(void); 24extern void __init sirfsoc_of_clk_init(void);
19extern void sirfsoc_restart(char, const char *); 25extern void sirfsoc_restart(char, const char *);
26extern asmlinkage void __exception_irq_entry sirfsoc_handle_irq(struct pt_regs *regs);
20 27
21#ifndef CONFIG_DEBUG_LL 28#ifndef CONFIG_DEBUG_LL
22static inline void sirfsoc_map_lluart(void) {} 29static inline void sirfsoc_map_lluart(void) {}
@@ -24,6 +31,12 @@ static inline void sirfsoc_map_lluart(void) {}
24extern void __init sirfsoc_map_lluart(void); 31extern void __init sirfsoc_map_lluart(void);
25#endif 32#endif
26 33
34#ifndef CONFIG_SMP
35static inline void sirfsoc_map_scu(void) {}
36#else
37extern void sirfsoc_map_scu(void);
38#endif
39
27#ifdef CONFIG_SUSPEND 40#ifdef CONFIG_SUSPEND
28extern int sirfsoc_pm_init(void); 41extern int sirfsoc_pm_init(void);
29#else 42#else
diff --git a/arch/arm/mach-prima2/headsmp.S b/arch/arm/mach-prima2/headsmp.S
new file mode 100644
index 000000000000..5b8a408d8921
--- /dev/null
+++ b/arch/arm/mach-prima2/headsmp.S
@@ -0,0 +1,40 @@
1/*
2 * Entry of the second core for CSR Marco dual-core SMP SoCs
3 *
4 * Copyright (c) 2012 Cambridge Silicon Radio Limited, a CSR plc group company.
5 *
6 * Licensed under GPLv2 or later.
7 */
8
9#include <linux/linkage.h>
10#include <linux/init.h>
11
12 __CPUINIT
13
14/*
15 * SIRFSOC specific entry point for secondary CPUs. This provides
16 * a "holding pen" into which all secondary cores are held until we're
17 * ready for them to initialise.
18 */
19ENTRY(sirfsoc_secondary_startup)
20 bl v7_invalidate_l1
21 mrc p15, 0, r0, c0, c0, 5
22 and r0, r0, #15
23 adr r4, 1f
24 ldmia r4, {r5, r6}
25 sub r4, r4, r5
26 add r6, r6, r4
27pen: ldr r7, [r6]
28 cmp r7, r0
29 bne pen
30
31 /*
32 * we've been released from the holding pen: secondary_stack
33 * should now contain the SVC stack for this core
34 */
35 b secondary_startup
36ENDPROC(sirfsoc_secondary_startup)
37
38 .align
391: .long .
40 .long pen_release
diff --git a/arch/arm/mach-prima2/hotplug.c b/arch/arm/mach-prima2/hotplug.c
new file mode 100644
index 000000000000..f4b17cbababd
--- /dev/null
+++ b/arch/arm/mach-prima2/hotplug.c
@@ -0,0 +1,41 @@
1/*
2 * CPU hotplug support for CSR Marco dual-core SMP SoCs
3 *
4 * Copyright (c) 2012 Cambridge Silicon Radio Limited, a CSR plc group company.
5 *
6 * Licensed under GPLv2 or later.
7 */
8
9#include <linux/kernel.h>
10#include <linux/errno.h>
11#include <linux/smp.h>
12
13#include <asm/cacheflush.h>
14#include <asm/smp_plat.h>
15
16static inline void platform_do_lowpower(unsigned int cpu)
17{
18 flush_cache_all();
19
20 /* we put the platform to just WFI */
21 for (;;) {
22 __asm__ __volatile__("dsb\n\t" "wfi\n\t"
23 : : : "memory");
24 if (pen_release == cpu_logical_map(cpu)) {
25 /*
26 * OK, proper wakeup, we're done
27 */
28 break;
29 }
30 }
31}
32
33/*
34 * platform-specific code to shutdown a CPU
35 *
36 * Called with IRQs disabled
37 */
38void __ref sirfsoc_cpu_die(unsigned int cpu)
39{
40 platform_do_lowpower(cpu);
41}
diff --git a/arch/arm/mach-prima2/include/mach/irqs.h b/arch/arm/mach-prima2/include/mach/irqs.h
index f6014a07541f..b778a0f248ed 100644
--- a/arch/arm/mach-prima2/include/mach/irqs.h
+++ b/arch/arm/mach-prima2/include/mach/irqs.h
@@ -10,8 +10,8 @@
10#define __ASM_ARCH_IRQS_H 10#define __ASM_ARCH_IRQS_H
11 11
12#define SIRFSOC_INTENAL_IRQ_START 0 12#define SIRFSOC_INTENAL_IRQ_START 0
13#define SIRFSOC_INTENAL_IRQ_END 59 13#define SIRFSOC_INTENAL_IRQ_END 127
14#define SIRFSOC_GPIO_IRQ_START (SIRFSOC_INTENAL_IRQ_END + 1) 14#define SIRFSOC_GPIO_IRQ_START (SIRFSOC_INTENAL_IRQ_END + 1)
15#define NR_IRQS 220 15#define NR_IRQS 288
16 16
17#endif 17#endif
diff --git a/arch/arm/mach-prima2/include/mach/uart.h b/arch/arm/mach-prima2/include/mach/uart.h
index c98b4d5ac24a..c10510d01a44 100644
--- a/arch/arm/mach-prima2/include/mach/uart.h
+++ b/arch/arm/mach-prima2/include/mach/uart.h
@@ -10,7 +10,13 @@
10#define __MACH_PRIMA2_SIRFSOC_UART_H 10#define __MACH_PRIMA2_SIRFSOC_UART_H
11 11
12/* UART-1: used as serial debug port */ 12/* UART-1: used as serial debug port */
13#if defined(CONFIG_DEBUG_SIRFPRIMA2_UART1)
13#define SIRFSOC_UART1_PA_BASE 0xb0060000 14#define SIRFSOC_UART1_PA_BASE 0xb0060000
15#elif defined(CONFIG_DEBUG_SIRFMARCO_UART1)
16#define SIRFSOC_UART1_PA_BASE 0xcc060000
17#else
18#define SIRFSOC_UART1_PA_BASE 0
19#endif
14#define SIRFSOC_UART1_VA_BASE SIRFSOC_VA(0x060000) 20#define SIRFSOC_UART1_VA_BASE SIRFSOC_VA(0x060000)
15#define SIRFSOC_UART1_SIZE SZ_4K 21#define SIRFSOC_UART1_SIZE SZ_4K
16 22
diff --git a/arch/arm/mach-prima2/include/mach/uncompress.h b/arch/arm/mach-prima2/include/mach/uncompress.h
index 0c898fcf909c..d1513a33709a 100644
--- a/arch/arm/mach-prima2/include/mach/uncompress.h
+++ b/arch/arm/mach-prima2/include/mach/uncompress.h
@@ -17,14 +17,15 @@ void arch_decomp_setup(void)
17{ 17{
18} 18}
19 19
20#define arch_decomp_wdog()
21
22static __inline__ void putc(char c) 20static __inline__ void putc(char c)
23{ 21{
24 /* 22 /*
25 * during kernel decompression, all mappings are flat: 23 * during kernel decompression, all mappings are flat:
26 * virt_addr == phys_addr 24 * virt_addr == phys_addr
27 */ 25 */
26 if (!SIRFSOC_UART1_PA_BASE)
27 return;
28
28 while (__raw_readl((void __iomem *)SIRFSOC_UART1_PA_BASE + SIRFSOC_UART_TXFIFO_STATUS) 29 while (__raw_readl((void __iomem *)SIRFSOC_UART1_PA_BASE + SIRFSOC_UART_TXFIFO_STATUS)
29 & SIRFSOC_UART1_TXFIFO_FULL) 30 & SIRFSOC_UART1_TXFIFO_FULL)
30 barrier(); 31 barrier();
diff --git a/arch/arm/mach-prima2/irq.c b/arch/arm/mach-prima2/irq.c
index 7dee9176e77a..6c0f3e9c43fb 100644
--- a/arch/arm/mach-prima2/irq.c
+++ b/arch/arm/mach-prima2/irq.c
@@ -9,17 +9,19 @@
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/io.h> 10#include <linux/io.h>
11#include <linux/irq.h> 11#include <linux/irq.h>
12#include <mach/hardware.h>
13#include <asm/mach/irq.h>
14#include <linux/of.h> 12#include <linux/of.h>
15#include <linux/of_address.h> 13#include <linux/of_address.h>
16#include <linux/irqdomain.h> 14#include <linux/irqdomain.h>
17#include <linux/syscore_ops.h> 15#include <linux/syscore_ops.h>
16#include <asm/mach/irq.h>
17#include <asm/exception.h>
18#include <mach/hardware.h>
18 19
19#define SIRFSOC_INT_RISC_MASK0 0x0018 20#define SIRFSOC_INT_RISC_MASK0 0x0018
20#define SIRFSOC_INT_RISC_MASK1 0x001C 21#define SIRFSOC_INT_RISC_MASK1 0x001C
21#define SIRFSOC_INT_RISC_LEVEL0 0x0020 22#define SIRFSOC_INT_RISC_LEVEL0 0x0020
22#define SIRFSOC_INT_RISC_LEVEL1 0x0024 23#define SIRFSOC_INT_RISC_LEVEL1 0x0024
24#define SIRFSOC_INIT_IRQ_ID 0x0038
23 25
24void __iomem *sirfsoc_intc_base; 26void __iomem *sirfsoc_intc_base;
25 27
@@ -52,6 +54,16 @@ static __init void sirfsoc_irq_init(void)
52 writel_relaxed(0, sirfsoc_intc_base + SIRFSOC_INT_RISC_MASK1); 54 writel_relaxed(0, sirfsoc_intc_base + SIRFSOC_INT_RISC_MASK1);
53} 55}
54 56
57asmlinkage void __exception_irq_entry sirfsoc_handle_irq(struct pt_regs *regs)
58{
59 u32 irqstat, irqnr;
60
61 irqstat = readl_relaxed(sirfsoc_intc_base + SIRFSOC_INIT_IRQ_ID);
62 irqnr = irqstat & 0xff;
63
64 handle_IRQ(irqnr, regs);
65}
66
55static struct of_device_id intc_ids[] = { 67static struct of_device_id intc_ids[] = {
56 { .compatible = "sirf,prima2-intc" }, 68 { .compatible = "sirf,prima2-intc" },
57 {}, 69 {},
diff --git a/arch/arm/mach-prima2/l2x0.c b/arch/arm/mach-prima2/l2x0.c
index c99837797d76..cbcbe9cb094c 100644
--- a/arch/arm/mach-prima2/l2x0.c
+++ b/arch/arm/mach-prima2/l2x0.c
@@ -11,19 +11,38 @@
11#include <linux/of.h> 11#include <linux/of.h>
12#include <asm/hardware/cache-l2x0.h> 12#include <asm/hardware/cache-l2x0.h>
13 13
14static struct of_device_id prima2_l2x0_ids[] = { 14struct l2x0_aux
15 { .compatible = "sirf,prima2-pl310-cache" }, 15{
16 u32 val;
17 u32 mask;
18};
19
20static struct l2x0_aux prima2_l2x0_aux __initconst = {
21 .val = 2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT,
22 .mask = 0,
23};
24
25static struct l2x0_aux marco_l2x0_aux __initconst = {
26 .val = (2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) |
27 (1 << L2X0_AUX_CTRL_ASSOCIATIVITY_SHIFT),
28 .mask = L2X0_AUX_CTRL_MASK,
29};
30
31static struct of_device_id sirf_l2x0_ids[] __initconst = {
32 { .compatible = "sirf,prima2-pl310-cache", .data = &prima2_l2x0_aux, },
33 { .compatible = "sirf,marco-pl310-cache", .data = &marco_l2x0_aux, },
16 {}, 34 {},
17}; 35};
18 36
19static int __init sirfsoc_l2x0_init(void) 37static int __init sirfsoc_l2x0_init(void)
20{ 38{
21 struct device_node *np; 39 struct device_node *np;
40 const struct l2x0_aux *aux;
22 41
23 np = of_find_matching_node(NULL, prima2_l2x0_ids); 42 np = of_find_matching_node(NULL, sirf_l2x0_ids);
24 if (np) { 43 if (np) {
25 pr_info("Initializing prima2 L2 cache\n"); 44 aux = of_match_node(sirf_l2x0_ids, np)->data;
26 return l2x0_of_init(0x40000, 0); 45 return l2x0_of_init(aux->val, aux->mask);
27 } 46 }
28 47
29 return 0; 48 return 0;
diff --git a/arch/arm/mach-prima2/platsmp.c b/arch/arm/mach-prima2/platsmp.c
new file mode 100644
index 000000000000..4b788310f6a6
--- /dev/null
+++ b/arch/arm/mach-prima2/platsmp.c
@@ -0,0 +1,157 @@
1/*
2 * plat smp support for CSR Marco dual-core SMP SoCs
3 *
4 * Copyright (c) 2012 Cambridge Silicon Radio Limited, a CSR plc group company.
5 *
6 * Licensed under GPLv2 or later.
7 */
8
9#include <linux/init.h>
10#include <linux/smp.h>
11#include <linux/delay.h>
12#include <linux/of.h>
13#include <linux/of_address.h>
14#include <linux/irqchip/arm-gic.h>
15#include <asm/page.h>
16#include <asm/mach/map.h>
17#include <asm/smp_plat.h>
18#include <asm/smp_scu.h>
19#include <asm/cacheflush.h>
20#include <asm/cputype.h>
21#include <mach/map.h>
22
23#include "common.h"
24
25static void __iomem *scu_base;
26static void __iomem *rsc_base;
27
28static DEFINE_SPINLOCK(boot_lock);
29
30static struct map_desc scu_io_desc __initdata = {
31 .length = SZ_4K,
32 .type = MT_DEVICE,
33};
34
35void __init sirfsoc_map_scu(void)
36{
37 unsigned long base;
38
39 /* Get SCU base */
40 asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (base));
41
42 scu_io_desc.virtual = SIRFSOC_VA(base);
43 scu_io_desc.pfn = __phys_to_pfn(base);
44 iotable_init(&scu_io_desc, 1);
45
46 scu_base = (void __iomem *)SIRFSOC_VA(base);
47}
48
49static void __cpuinit sirfsoc_secondary_init(unsigned int cpu)
50{
51 /*
52 * if any interrupts are already enabled for the primary
53 * core (e.g. timer irq), then they will not have been enabled
54 * for us: do so
55 */
56 gic_secondary_init(0);
57
58 /*
59 * let the primary processor know we're out of the
60 * pen, then head off into the C entry point
61 */
62 pen_release = -1;
63 smp_wmb();
64
65 /*
66 * Synchronise with the boot thread.
67 */
68 spin_lock(&boot_lock);
69 spin_unlock(&boot_lock);
70}
71
72static struct of_device_id rsc_ids[] = {
73 { .compatible = "sirf,marco-rsc" },
74 {},
75};
76
77static int __cpuinit sirfsoc_boot_secondary(unsigned int cpu, struct task_struct *idle)
78{
79 unsigned long timeout;
80 struct device_node *np;
81
82 np = of_find_matching_node(NULL, rsc_ids);
83 if (!np)
84 return -ENODEV;
85
86 rsc_base = of_iomap(np, 0);
87 if (!rsc_base)
88 return -ENOMEM;
89
90 /*
91 * write the address of secondary startup into the sram register
92 * at offset 0x2C, then write the magic number 0x3CAF5D62 to the
93 * RSC register at offset 0x28, which is what boot rom code is
94 * waiting for. This would wake up the secondary core from WFE
95 */
96#define SIRFSOC_CPU1_JUMPADDR_OFFSET 0x2C
97 __raw_writel(virt_to_phys(sirfsoc_secondary_startup),
98 rsc_base + SIRFSOC_CPU1_JUMPADDR_OFFSET);
99
100#define SIRFSOC_CPU1_WAKEMAGIC_OFFSET 0x28
101 __raw_writel(0x3CAF5D62,
102 rsc_base + SIRFSOC_CPU1_WAKEMAGIC_OFFSET);
103
104 /* make sure write buffer is drained */
105 mb();
106
107 spin_lock(&boot_lock);
108
109 /*
110 * The secondary processor is waiting to be released from
111 * the holding pen - release it, then wait for it to flag
112 * that it has been released by resetting pen_release.
113 *
114 * Note that "pen_release" is the hardware CPU ID, whereas
115 * "cpu" is Linux's internal ID.
116 */
117 pen_release = cpu_logical_map(cpu);
118 __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
119 outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
120
121 /*
122 * Send the secondary CPU SEV, thereby causing the boot monitor to read
123 * the JUMPADDR and WAKEMAGIC, and branch to the address found there.
124 */
125 dsb_sev();
126
127 timeout = jiffies + (1 * HZ);
128 while (time_before(jiffies, timeout)) {
129 smp_rmb();
130 if (pen_release == -1)
131 break;
132
133 udelay(10);
134 }
135
136 /*
137 * now the secondary core is starting up let it run its
138 * calibrations, then wait for it to finish
139 */
140 spin_unlock(&boot_lock);
141
142 return pen_release != -1 ? -ENOSYS : 0;
143}
144
145static void __init sirfsoc_smp_prepare_cpus(unsigned int max_cpus)
146{
147 scu_enable(scu_base);
148}
149
150struct smp_operations sirfsoc_smp_ops __initdata = {
151 .smp_prepare_cpus = sirfsoc_smp_prepare_cpus,
152 .smp_secondary_init = sirfsoc_secondary_init,
153 .smp_boot_secondary = sirfsoc_boot_secondary,
154#ifdef CONFIG_HOTPLUG_CPU
155 .cpu_die = sirfsoc_cpu_die,
156#endif
157};
diff --git a/arch/arm/mach-prima2/rstc.c b/arch/arm/mach-prima2/rstc.c
index 762adb73ab7c..435019ca0a48 100644
--- a/arch/arm/mach-prima2/rstc.c
+++ b/arch/arm/mach-prima2/rstc.c
@@ -19,6 +19,7 @@ static DEFINE_MUTEX(rstc_lock);
19 19
20static struct of_device_id rstc_ids[] = { 20static struct of_device_id rstc_ids[] = {
21 { .compatible = "sirf,prima2-rstc" }, 21 { .compatible = "sirf,prima2-rstc" },
22 { .compatible = "sirf,marco-rstc" },
22 {}, 23 {},
23}; 24};
24 25
@@ -42,27 +43,37 @@ early_initcall(sirfsoc_of_rstc_init);
42 43
43int sirfsoc_reset_device(struct device *dev) 44int sirfsoc_reset_device(struct device *dev)
44{ 45{
45 const unsigned int *prop = of_get_property(dev->of_node, "reset-bit", NULL); 46 u32 reset_bit;
46 unsigned int reset_bit;
47 47
48 if (!prop) 48 if (of_property_read_u32(dev->of_node, "reset-bit", &reset_bit))
49 return -ENODEV; 49 return -EINVAL;
50
51 reset_bit = be32_to_cpup(prop);
52 50
53 mutex_lock(&rstc_lock); 51 mutex_lock(&rstc_lock);
54 52
55 /* 53 if (of_device_is_compatible(dev->of_node, "sirf,prima2-rstc")) {
56 * Writing 1 to this bit resets corresponding block. Writing 0 to this 54 /*
57 * bit de-asserts reset signal of the corresponding block. 55 * Writing 1 to this bit resets corresponding block. Writing 0 to this
58 * datasheet doesn't require explicit delay between the set and clear 56 * bit de-asserts reset signal of the corresponding block.
59 * of reset bit. it could be shorter if tests pass. 57 * datasheet doesn't require explicit delay between the set and clear
60 */ 58 * of reset bit. it could be shorter if tests pass.
61 writel(readl(sirfsoc_rstc_base + (reset_bit / 32) * 4) | reset_bit, 59 */
62 sirfsoc_rstc_base + (reset_bit / 32) * 4); 60 writel(readl(sirfsoc_rstc_base + (reset_bit / 32) * 4) | reset_bit,
63 msleep(10); 61 sirfsoc_rstc_base + (reset_bit / 32) * 4);
64 writel(readl(sirfsoc_rstc_base + (reset_bit / 32) * 4) & ~reset_bit, 62 msleep(10);
65 sirfsoc_rstc_base + (reset_bit / 32) * 4); 63 writel(readl(sirfsoc_rstc_base + (reset_bit / 32) * 4) & ~reset_bit,
64 sirfsoc_rstc_base + (reset_bit / 32) * 4);
65 } else {
66 /*
67 * For MARCO and POLO
68 * Writing 1 to SET register resets corresponding block. Writing 1 to CLEAR
69 * register de-asserts reset signal of the corresponding block.
70 * datasheet doesn't require explicit delay between the set and clear
71 * of reset bit. it could be shorter if tests pass.
72 */
73 writel(reset_bit, sirfsoc_rstc_base + (reset_bit / 32) * 8);
74 msleep(10);
75 writel(reset_bit, sirfsoc_rstc_base + (reset_bit / 32) * 8 + 4);
76 }
66 77
67 mutex_unlock(&rstc_lock); 78 mutex_unlock(&rstc_lock);
68 79
diff --git a/arch/arm/mach-prima2/rtciobrg.c b/arch/arm/mach-prima2/rtciobrg.c
index 557353602130..9f2da2eec4dc 100644
--- a/arch/arm/mach-prima2/rtciobrg.c
+++ b/arch/arm/mach-prima2/rtciobrg.c
@@ -104,6 +104,7 @@ EXPORT_SYMBOL_GPL(sirfsoc_rtc_iobrg_writel);
104 104
105static const struct of_device_id rtciobrg_ids[] = { 105static const struct of_device_id rtciobrg_ids[] = {
106 { .compatible = "sirf,prima2-rtciobg" }, 106 { .compatible = "sirf,prima2-rtciobg" },
107 { .compatible = "sirf,marco-rtciobg" },
107 {} 108 {}
108}; 109};
109 110
diff --git a/arch/arm/mach-prima2/timer-marco.c b/arch/arm/mach-prima2/timer-marco.c
new file mode 100644
index 000000000000..f4eea2e97eb0
--- /dev/null
+++ b/arch/arm/mach-prima2/timer-marco.c
@@ -0,0 +1,316 @@
1/*
2 * System timer for CSR SiRFprimaII
3 *
4 * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
5 *
6 * Licensed under GPLv2 or later.
7 */
8
9#include <linux/kernel.h>
10#include <linux/interrupt.h>
11#include <linux/clockchips.h>
12#include <linux/clocksource.h>
13#include <linux/bitops.h>
14#include <linux/irq.h>
15#include <linux/clk.h>
16#include <linux/slab.h>
17#include <linux/of.h>
18#include <linux/of_irq.h>
19#include <linux/of_address.h>
20#include <asm/sched_clock.h>
21#include <asm/localtimer.h>
22#include <asm/mach/time.h>
23
24#include "common.h"
25
26#define SIRFSOC_TIMER_32COUNTER_0_CTRL 0x0000
27#define SIRFSOC_TIMER_32COUNTER_1_CTRL 0x0004
28#define SIRFSOC_TIMER_MATCH_0 0x0018
29#define SIRFSOC_TIMER_MATCH_1 0x001c
30#define SIRFSOC_TIMER_COUNTER_0 0x0048
31#define SIRFSOC_TIMER_COUNTER_1 0x004c
32#define SIRFSOC_TIMER_INTR_STATUS 0x0060
33#define SIRFSOC_TIMER_WATCHDOG_EN 0x0064
34#define SIRFSOC_TIMER_64COUNTER_CTRL 0x0068
35#define SIRFSOC_TIMER_64COUNTER_LO 0x006c
36#define SIRFSOC_TIMER_64COUNTER_HI 0x0070
37#define SIRFSOC_TIMER_64COUNTER_LOAD_LO 0x0074
38#define SIRFSOC_TIMER_64COUNTER_LOAD_HI 0x0078
39#define SIRFSOC_TIMER_64COUNTER_RLATCHED_LO 0x007c
40#define SIRFSOC_TIMER_64COUNTER_RLATCHED_HI 0x0080
41
42#define SIRFSOC_TIMER_REG_CNT 6
43
44static const u32 sirfsoc_timer_reg_list[SIRFSOC_TIMER_REG_CNT] = {
45 SIRFSOC_TIMER_WATCHDOG_EN,
46 SIRFSOC_TIMER_32COUNTER_0_CTRL,
47 SIRFSOC_TIMER_32COUNTER_1_CTRL,
48 SIRFSOC_TIMER_64COUNTER_CTRL,
49 SIRFSOC_TIMER_64COUNTER_RLATCHED_LO,
50 SIRFSOC_TIMER_64COUNTER_RLATCHED_HI,
51};
52
53static u32 sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT];
54
55static void __iomem *sirfsoc_timer_base;
56static void __init sirfsoc_of_timer_map(void);
57
58/* disable count and interrupt */
59static inline void sirfsoc_timer_count_disable(int idx)
60{
61 writel_relaxed(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL + 4 * idx) & ~0x7,
62 sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL + 4 * idx);
63}
64
65/* enable count and interrupt */
66static inline void sirfsoc_timer_count_enable(int idx)
67{
68 writel_relaxed(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL + 4 * idx) | 0x7,
69 sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL + 4 * idx);
70}
71
72/* timer interrupt handler */
73static irqreturn_t sirfsoc_timer_interrupt(int irq, void *dev_id)
74{
75 struct clock_event_device *ce = dev_id;
76 int cpu = smp_processor_id();
77
78 /* clear timer interrupt */
79 writel_relaxed(BIT(cpu), sirfsoc_timer_base + SIRFSOC_TIMER_INTR_STATUS);
80
81 if (ce->mode == CLOCK_EVT_MODE_ONESHOT)
82 sirfsoc_timer_count_disable(cpu);
83
84 ce->event_handler(ce);
85
86 return IRQ_HANDLED;
87}
88
89/* read 64-bit timer counter */
90static cycle_t sirfsoc_timer_read(struct clocksource *cs)
91{
92 u64 cycles;
93
94 writel_relaxed((readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL) |
95 BIT(0)) & ~BIT(1), sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL);
96
97 cycles = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_RLATCHED_HI);
98 cycles = (cycles << 32) | readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_RLATCHED_LO);
99
100 return cycles;
101}
102
103static int sirfsoc_timer_set_next_event(unsigned long delta,
104 struct clock_event_device *ce)
105{
106 int cpu = smp_processor_id();
107
108 writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_0 +
109 4 * cpu);
110 writel_relaxed(delta, sirfsoc_timer_base + SIRFSOC_TIMER_MATCH_0 +
111 4 * cpu);
112
113 /* enable the tick */
114 sirfsoc_timer_count_enable(cpu);
115
116 return 0;
117}
118
119static void sirfsoc_timer_set_mode(enum clock_event_mode mode,
120 struct clock_event_device *ce)
121{
122 switch (mode) {
123 case CLOCK_EVT_MODE_ONESHOT:
124 /* enable in set_next_event */
125 break;
126 default:
127 break;
128 }
129
130 sirfsoc_timer_count_disable(smp_processor_id());
131}
132
133static void sirfsoc_clocksource_suspend(struct clocksource *cs)
134{
135 int i;
136
137 for (i = 0; i < SIRFSOC_TIMER_REG_CNT; i++)
138 sirfsoc_timer_reg_val[i] = readl_relaxed(sirfsoc_timer_base + sirfsoc_timer_reg_list[i]);
139}
140
141static void sirfsoc_clocksource_resume(struct clocksource *cs)
142{
143 int i;
144
145 for (i = 0; i < SIRFSOC_TIMER_REG_CNT - 2; i++)
146 writel_relaxed(sirfsoc_timer_reg_val[i], sirfsoc_timer_base + sirfsoc_timer_reg_list[i]);
147
148 writel_relaxed(sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT - 2],
149 sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_LOAD_LO);
150 writel_relaxed(sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT - 1],
151 sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_LOAD_HI);
152
153 writel_relaxed(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL) |
154 BIT(1) | BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL);
155}
156
157static struct clock_event_device sirfsoc_clockevent = {
158 .name = "sirfsoc_clockevent",
159 .rating = 200,
160 .features = CLOCK_EVT_FEAT_ONESHOT,
161 .set_mode = sirfsoc_timer_set_mode,
162 .set_next_event = sirfsoc_timer_set_next_event,
163};
164
165static struct clocksource sirfsoc_clocksource = {
166 .name = "sirfsoc_clocksource",
167 .rating = 200,
168 .mask = CLOCKSOURCE_MASK(64),
169 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
170 .read = sirfsoc_timer_read,
171 .suspend = sirfsoc_clocksource_suspend,
172 .resume = sirfsoc_clocksource_resume,
173};
174
175static struct irqaction sirfsoc_timer_irq = {
176 .name = "sirfsoc_timer0",
177 .flags = IRQF_TIMER | IRQF_NOBALANCING,
178 .handler = sirfsoc_timer_interrupt,
179 .dev_id = &sirfsoc_clockevent,
180};
181
182#ifdef CONFIG_LOCAL_TIMERS
183
184static struct irqaction sirfsoc_timer1_irq = {
185 .name = "sirfsoc_timer1",
186 .flags = IRQF_TIMER | IRQF_NOBALANCING,
187 .handler = sirfsoc_timer_interrupt,
188};
189
190static int __cpuinit sirfsoc_local_timer_setup(struct clock_event_device *ce)
191{
192 /* Use existing clock_event for cpu 0 */
193 if (!smp_processor_id())
194 return 0;
195
196 ce->irq = sirfsoc_timer1_irq.irq;
197 ce->name = "local_timer";
198 ce->features = sirfsoc_clockevent.features;
199 ce->rating = sirfsoc_clockevent.rating;
200 ce->set_mode = sirfsoc_timer_set_mode;
201 ce->set_next_event = sirfsoc_timer_set_next_event;
202 ce->shift = sirfsoc_clockevent.shift;
203 ce->mult = sirfsoc_clockevent.mult;
204 ce->max_delta_ns = sirfsoc_clockevent.max_delta_ns;
205 ce->min_delta_ns = sirfsoc_clockevent.min_delta_ns;
206
207 sirfsoc_timer1_irq.dev_id = ce;
208 BUG_ON(setup_irq(ce->irq, &sirfsoc_timer1_irq));
209 irq_set_affinity(sirfsoc_timer1_irq.irq, cpumask_of(1));
210
211 clockevents_register_device(ce);
212 return 0;
213}
214
215static void sirfsoc_local_timer_stop(struct clock_event_device *ce)
216{
217 sirfsoc_timer_count_disable(1);
218
219 remove_irq(sirfsoc_timer1_irq.irq, &sirfsoc_timer1_irq);
220}
221
222static struct local_timer_ops sirfsoc_local_timer_ops __cpuinitdata = {
223 .setup = sirfsoc_local_timer_setup,
224 .stop = sirfsoc_local_timer_stop,
225};
226#endif /* CONFIG_LOCAL_TIMERS */
227
228static void __init sirfsoc_clockevent_init(void)
229{
230 clockevents_calc_mult_shift(&sirfsoc_clockevent, CLOCK_TICK_RATE, 60);
231
232 sirfsoc_clockevent.max_delta_ns =
233 clockevent_delta2ns(-2, &sirfsoc_clockevent);
234 sirfsoc_clockevent.min_delta_ns =
235 clockevent_delta2ns(2, &sirfsoc_clockevent);
236
237 sirfsoc_clockevent.cpumask = cpumask_of(0);
238 clockevents_register_device(&sirfsoc_clockevent);
239#ifdef CONFIG_LOCAL_TIMERS
240 local_timer_register(&sirfsoc_local_timer_ops);
241#endif
242}
243
244/* initialize the kernel jiffy timer source */
245void __init sirfsoc_marco_timer_init(void)
246{
247 unsigned long rate;
248 u32 timer_div;
249 struct clk *clk;
250
251 /* initialize clocking early, we want to set the OS timer */
252 sirfsoc_of_clk_init();
253
254 /* timer's input clock is io clock */
255 clk = clk_get_sys("io", NULL);
256
257 BUG_ON(IS_ERR(clk));
258 rate = clk_get_rate(clk);
259
260 BUG_ON(rate < CLOCK_TICK_RATE);
261 BUG_ON(rate % CLOCK_TICK_RATE);
262
263 sirfsoc_of_timer_map();
264
265 /* Initialize the timer dividers */
266 timer_div = rate / CLOCK_TICK_RATE - 1;
267 writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL);
268 writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL);
269 writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_1_CTRL);
270
271 /* Initialize timer counters to 0 */
272 writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_LOAD_LO);
273 writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_LOAD_HI);
274 writel_relaxed(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL) |
275 BIT(1) | BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL);
276 writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_0);
277 writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_1);
278
279 /* Clear all interrupts */
280 writel_relaxed(0xFFFF, sirfsoc_timer_base + SIRFSOC_TIMER_INTR_STATUS);
281
282 BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE));
283
284 BUG_ON(setup_irq(sirfsoc_timer_irq.irq, &sirfsoc_timer_irq));
285
286 sirfsoc_clockevent_init();
287}
288
289static struct of_device_id timer_ids[] = {
290 { .compatible = "sirf,marco-tick" },
291 {},
292};
293
294static void __init sirfsoc_of_timer_map(void)
295{
296 struct device_node *np;
297
298 np = of_find_matching_node(NULL, timer_ids);
299 if (!np)
300 return;
301 sirfsoc_timer_base = of_iomap(np, 0);
302 if (!sirfsoc_timer_base)
303 panic("unable to map timer cpu registers\n");
304
305 sirfsoc_timer_irq.irq = irq_of_parse_and_map(np, 0);
306 if (!sirfsoc_timer_irq.irq)
307 panic("No irq passed for timer0 via DT\n");
308
309#ifdef CONFIG_LOCAL_TIMERS
310 sirfsoc_timer1_irq.irq = irq_of_parse_and_map(np, 1);
311 if (!sirfsoc_timer1_irq.irq)
312 panic("No irq passed for timer1 via DT\n");
313#endif
314
315 of_node_put(np);
316}
diff --git a/arch/arm/mach-prima2/timer.c b/arch/arm/mach-prima2/timer-prima2.c
index d95bf252f694..6da584f8a949 100644
--- a/arch/arm/mach-prima2/timer.c
+++ b/arch/arm/mach-prima2/timer-prima2.c
@@ -175,19 +175,13 @@ static u32 notrace sirfsoc_read_sched_clock(void)
175 175
176static void __init sirfsoc_clockevent_init(void) 176static void __init sirfsoc_clockevent_init(void)
177{ 177{
178 clockevents_calc_mult_shift(&sirfsoc_clockevent, CLOCK_TICK_RATE, 60);
179
180 sirfsoc_clockevent.max_delta_ns =
181 clockevent_delta2ns(-2, &sirfsoc_clockevent);
182 sirfsoc_clockevent.min_delta_ns =
183 clockevent_delta2ns(2, &sirfsoc_clockevent);
184
185 sirfsoc_clockevent.cpumask = cpumask_of(0); 178 sirfsoc_clockevent.cpumask = cpumask_of(0);
186 clockevents_register_device(&sirfsoc_clockevent); 179 clockevents_config_and_register(&sirfsoc_clockevent, CLOCK_TICK_RATE,
180 2, -2);
187} 181}
188 182
189/* initialize the kernel jiffy timer source */ 183/* initialize the kernel jiffy timer source */
190static void __init sirfsoc_timer_init(void) 184void __init sirfsoc_prima2_timer_init(void)
191{ 185{
192 unsigned long rate; 186 unsigned long rate;
193 struct clk *clk; 187 struct clk *clk;
@@ -233,7 +227,7 @@ static void __init sirfsoc_of_timer_map(void)
233 227
234 np = of_find_matching_node(NULL, timer_ids); 228 np = of_find_matching_node(NULL, timer_ids);
235 if (!np) 229 if (!np)
236 panic("unable to find compatible timer node in dtb\n"); 230 return;
237 sirfsoc_timer_base = of_iomap(np, 0); 231 sirfsoc_timer_base = of_iomap(np, 0);
238 if (!sirfsoc_timer_base) 232 if (!sirfsoc_timer_base)
239 panic("unable to map timer cpu registers\n"); 233 panic("unable to map timer cpu registers\n");
@@ -245,7 +239,3 @@ static void __init sirfsoc_of_timer_map(void)
245 239
246 of_node_put(np); 240 of_node_put(np);
247} 241}
248
249struct sys_timer sirfsoc_timer = {
250 .init = sirfsoc_timer_init,
251};
diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c
index 208229342514..2f71b3fbd319 100644
--- a/arch/arm/mach-pxa/balloon3.c
+++ b/arch/arm/mach-pxa/balloon3.c
@@ -822,7 +822,7 @@ MACHINE_START(BALLOON3, "Balloon3")
822 .nr_irqs = BALLOON3_NR_IRQS, 822 .nr_irqs = BALLOON3_NR_IRQS,
823 .init_irq = balloon3_init_irq, 823 .init_irq = balloon3_init_irq,
824 .handle_irq = pxa27x_handle_irq, 824 .handle_irq = pxa27x_handle_irq,
825 .timer = &pxa_timer, 825 .init_time = pxa_timer_init,
826 .init_machine = balloon3_init, 826 .init_machine = balloon3_init,
827 .atag_offset = 0x100, 827 .atag_offset = 0x100,
828 .restart = pxa_restart, 828 .restart = pxa_restart,
diff --git a/arch/arm/mach-pxa/capc7117.c b/arch/arm/mach-pxa/capc7117.c
index 9a8760b72913..c092730749b9 100644
--- a/arch/arm/mach-pxa/capc7117.c
+++ b/arch/arm/mach-pxa/capc7117.c
@@ -153,7 +153,7 @@ MACHINE_START(CAPC7117,
153 .nr_irqs = PXA_NR_IRQS, 153 .nr_irqs = PXA_NR_IRQS,
154 .init_irq = pxa3xx_init_irq, 154 .init_irq = pxa3xx_init_irq,
155 .handle_irq = pxa3xx_handle_irq, 155 .handle_irq = pxa3xx_handle_irq,
156 .timer = &pxa_timer, 156 .init_time = pxa_timer_init,
157 .init_machine = capc7117_init, 157 .init_machine = capc7117_init,
158 .restart = pxa_restart, 158 .restart = pxa_restart,
159MACHINE_END 159MACHINE_END
diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c
index a103c8ffea9f..bb99f59a36d8 100644
--- a/arch/arm/mach-pxa/cm-x2xx.c
+++ b/arch/arm/mach-pxa/cm-x2xx.c
@@ -520,7 +520,7 @@ MACHINE_START(ARMCORE, "Compulab CM-X2XX")
520 .init_irq = cmx2xx_init_irq, 520 .init_irq = cmx2xx_init_irq,
521 /* NOTE: pxa25x_handle_irq() works on PXA27x w/o camera support */ 521 /* NOTE: pxa25x_handle_irq() works on PXA27x w/o camera support */
522 .handle_irq = pxa25x_handle_irq, 522 .handle_irq = pxa25x_handle_irq,
523 .timer = &pxa_timer, 523 .init_time = pxa_timer_init,
524 .init_machine = cmx2xx_init, 524 .init_machine = cmx2xx_init,
525#ifdef CONFIG_PCI 525#ifdef CONFIG_PCI
526 .dma_zone_size = SZ_64M, 526 .dma_zone_size = SZ_64M,
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index cc2b23afcaaf..8091aac89edf 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -854,7 +854,7 @@ MACHINE_START(CM_X300, "CM-X300 module")
854 .nr_irqs = PXA_NR_IRQS, 854 .nr_irqs = PXA_NR_IRQS,
855 .init_irq = pxa3xx_init_irq, 855 .init_irq = pxa3xx_init_irq,
856 .handle_irq = pxa3xx_handle_irq, 856 .handle_irq = pxa3xx_handle_irq,
857 .timer = &pxa_timer, 857 .init_time = pxa_timer_init,
858 .init_machine = cm_x300_init, 858 .init_machine = cm_x300_init,
859 .fixup = cm_x300_fixup, 859 .fixup = cm_x300_fixup,
860 .restart = pxa_restart, 860 .restart = pxa_restart,
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
index b2f227d36125..5f9d9303b346 100644
--- a/arch/arm/mach-pxa/colibri-pxa270.c
+++ b/arch/arm/mach-pxa/colibri-pxa270.c
@@ -313,7 +313,7 @@ MACHINE_START(COLIBRI, "Toradex Colibri PXA270")
313 .nr_irqs = PXA_NR_IRQS, 313 .nr_irqs = PXA_NR_IRQS,
314 .init_irq = pxa27x_init_irq, 314 .init_irq = pxa27x_init_irq,
315 .handle_irq = pxa27x_handle_irq, 315 .handle_irq = pxa27x_handle_irq,
316 .timer = &pxa_timer, 316 .init_time = pxa_timer_init,
317 .restart = pxa_restart, 317 .restart = pxa_restart,
318MACHINE_END 318MACHINE_END
319 319
@@ -324,7 +324,7 @@ MACHINE_START(INCOME, "Income s.r.o. SH-Dmaster PXA270 SBC")
324 .nr_irqs = PXA_NR_IRQS, 324 .nr_irqs = PXA_NR_IRQS,
325 .init_irq = pxa27x_init_irq, 325 .init_irq = pxa27x_init_irq,
326 .handle_irq = pxa27x_handle_irq, 326 .handle_irq = pxa27x_handle_irq,
327 .timer = &pxa_timer, 327 .init_time = pxa_timer_init,
328 .restart = pxa_restart, 328 .restart = pxa_restart,
329MACHINE_END 329MACHINE_END
330 330
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c
index a9c9c163dd95..f1a1ac1fbd85 100644
--- a/arch/arm/mach-pxa/colibri-pxa300.c
+++ b/arch/arm/mach-pxa/colibri-pxa300.c
@@ -189,7 +189,7 @@ MACHINE_START(COLIBRI300, "Toradex Colibri PXA300")
189 .nr_irqs = PXA_NR_IRQS, 189 .nr_irqs = PXA_NR_IRQS,
190 .init_irq = pxa3xx_init_irq, 190 .init_irq = pxa3xx_init_irq,
191 .handle_irq = pxa3xx_handle_irq, 191 .handle_irq = pxa3xx_handle_irq,
192 .timer = &pxa_timer, 192 .init_time = pxa_timer_init,
193 .restart = pxa_restart, 193 .restart = pxa_restart,
194MACHINE_END 194MACHINE_END
195 195
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c
index 25515cd7e68f..f6cc8b0ab82f 100644
--- a/arch/arm/mach-pxa/colibri-pxa320.c
+++ b/arch/arm/mach-pxa/colibri-pxa320.c
@@ -259,7 +259,7 @@ MACHINE_START(COLIBRI320, "Toradex Colibri PXA320")
259 .nr_irqs = PXA_NR_IRQS, 259 .nr_irqs = PXA_NR_IRQS,
260 .init_irq = pxa3xx_init_irq, 260 .init_irq = pxa3xx_init_irq,
261 .handle_irq = pxa3xx_handle_irq, 261 .handle_irq = pxa3xx_handle_irq,
262 .timer = &pxa_timer, 262 .init_time = pxa_timer_init,
263 .restart = pxa_restart, 263 .restart = pxa_restart,
264MACHINE_END 264MACHINE_END
265 265
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index 7c83f52c549c..a5b8fead7d61 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -733,7 +733,7 @@ MACHINE_START(CORGI, "SHARP Corgi")
733 .init_irq = pxa25x_init_irq, 733 .init_irq = pxa25x_init_irq,
734 .handle_irq = pxa25x_handle_irq, 734 .handle_irq = pxa25x_handle_irq,
735 .init_machine = corgi_init, 735 .init_machine = corgi_init,
736 .timer = &pxa_timer, 736 .init_time = pxa_timer_init,
737 .restart = corgi_restart, 737 .restart = corgi_restart,
738MACHINE_END 738MACHINE_END
739#endif 739#endif
@@ -746,7 +746,7 @@ MACHINE_START(SHEPHERD, "SHARP Shepherd")
746 .init_irq = pxa25x_init_irq, 746 .init_irq = pxa25x_init_irq,
747 .handle_irq = pxa25x_handle_irq, 747 .handle_irq = pxa25x_handle_irq,
748 .init_machine = corgi_init, 748 .init_machine = corgi_init,
749 .timer = &pxa_timer, 749 .init_time = pxa_timer_init,
750 .restart = corgi_restart, 750 .restart = corgi_restart,
751MACHINE_END 751MACHINE_END
752#endif 752#endif
@@ -759,7 +759,7 @@ MACHINE_START(HUSKY, "SHARP Husky")
759 .init_irq = pxa25x_init_irq, 759 .init_irq = pxa25x_init_irq,
760 .handle_irq = pxa25x_handle_irq, 760 .handle_irq = pxa25x_handle_irq,
761 .init_machine = corgi_init, 761 .init_machine = corgi_init,
762 .timer = &pxa_timer, 762 .init_time = pxa_timer_init,
763 .restart = corgi_restart, 763 .restart = corgi_restart,
764MACHINE_END 764MACHINE_END
765#endif 765#endif
diff --git a/arch/arm/mach-pxa/csb726.c b/arch/arm/mach-pxa/csb726.c
index 7039f44b3647..fadfff8feaef 100644
--- a/arch/arm/mach-pxa/csb726.c
+++ b/arch/arm/mach-pxa/csb726.c
@@ -278,6 +278,6 @@ MACHINE_START(CSB726, "Cogent CSB726")
278 .init_irq = pxa27x_init_irq, 278 .init_irq = pxa27x_init_irq,
279 .handle_irq = pxa27x_handle_irq, 279 .handle_irq = pxa27x_handle_irq,
280 .init_machine = csb726_init, 280 .init_machine = csb726_init,
281 .timer = &pxa_timer, 281 .init_time = pxa_timer_init,
282 .restart = pxa_restart, 282 .restart = pxa_restart,
283MACHINE_END 283MACHINE_END
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
index 1b6411439ec8..446563a7d1ad 100644
--- a/arch/arm/mach-pxa/em-x270.c
+++ b/arch/arm/mach-pxa/em-x270.c
@@ -1298,7 +1298,7 @@ MACHINE_START(EM_X270, "Compulab EM-X270")
1298 .nr_irqs = PXA_NR_IRQS, 1298 .nr_irqs = PXA_NR_IRQS,
1299 .init_irq = pxa27x_init_irq, 1299 .init_irq = pxa27x_init_irq,
1300 .handle_irq = pxa27x_handle_irq, 1300 .handle_irq = pxa27x_handle_irq,
1301 .timer = &pxa_timer, 1301 .init_time = pxa_timer_init,
1302 .init_machine = em_x270_init, 1302 .init_machine = em_x270_init,
1303 .restart = pxa_restart, 1303 .restart = pxa_restart,
1304MACHINE_END 1304MACHINE_END
@@ -1309,7 +1309,7 @@ MACHINE_START(EXEDA, "Compulab eXeda")
1309 .nr_irqs = PXA_NR_IRQS, 1309 .nr_irqs = PXA_NR_IRQS,
1310 .init_irq = pxa27x_init_irq, 1310 .init_irq = pxa27x_init_irq,
1311 .handle_irq = pxa27x_handle_irq, 1311 .handle_irq = pxa27x_handle_irq,
1312 .timer = &pxa_timer, 1312 .init_time = pxa_timer_init,
1313 .init_machine = em_x270_init, 1313 .init_machine = em_x270_init,
1314 .restart = pxa_restart, 1314 .restart = pxa_restart,
1315MACHINE_END 1315MACHINE_END
diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c
index be2ee9bf5c6e..8280ebcaab9f 100644
--- a/arch/arm/mach-pxa/eseries.c
+++ b/arch/arm/mach-pxa/eseries.c
@@ -195,7 +195,7 @@ MACHINE_START(E330, "Toshiba e330")
195 .handle_irq = pxa25x_handle_irq, 195 .handle_irq = pxa25x_handle_irq,
196 .fixup = eseries_fixup, 196 .fixup = eseries_fixup,
197 .init_machine = e330_init, 197 .init_machine = e330_init,
198 .timer = &pxa_timer, 198 .init_time = pxa_timer_init,
199 .restart = pxa_restart, 199 .restart = pxa_restart,
200MACHINE_END 200MACHINE_END
201#endif 201#endif
@@ -246,7 +246,7 @@ MACHINE_START(E350, "Toshiba e350")
246 .handle_irq = pxa25x_handle_irq, 246 .handle_irq = pxa25x_handle_irq,
247 .fixup = eseries_fixup, 247 .fixup = eseries_fixup,
248 .init_machine = e350_init, 248 .init_machine = e350_init,
249 .timer = &pxa_timer, 249 .init_time = pxa_timer_init,
250 .restart = pxa_restart, 250 .restart = pxa_restart,
251MACHINE_END 251MACHINE_END
252#endif 252#endif
@@ -370,7 +370,7 @@ MACHINE_START(E400, "Toshiba e400")
370 .handle_irq = pxa25x_handle_irq, 370 .handle_irq = pxa25x_handle_irq,
371 .fixup = eseries_fixup, 371 .fixup = eseries_fixup,
372 .init_machine = e400_init, 372 .init_machine = e400_init,
373 .timer = &pxa_timer, 373 .init_time = pxa_timer_init,
374 .restart = pxa_restart, 374 .restart = pxa_restart,
375MACHINE_END 375MACHINE_END
376#endif 376#endif
@@ -566,7 +566,7 @@ MACHINE_START(E740, "Toshiba e740")
566 .handle_irq = pxa25x_handle_irq, 566 .handle_irq = pxa25x_handle_irq,
567 .fixup = eseries_fixup, 567 .fixup = eseries_fixup,
568 .init_machine = e740_init, 568 .init_machine = e740_init,
569 .timer = &pxa_timer, 569 .init_time = pxa_timer_init,
570 .restart = pxa_restart, 570 .restart = pxa_restart,
571MACHINE_END 571MACHINE_END
572#endif 572#endif
@@ -765,7 +765,7 @@ MACHINE_START(E750, "Toshiba e750")
765 .handle_irq = pxa25x_handle_irq, 765 .handle_irq = pxa25x_handle_irq,
766 .fixup = eseries_fixup, 766 .fixup = eseries_fixup,
767 .init_machine = e750_init, 767 .init_machine = e750_init,
768 .timer = &pxa_timer, 768 .init_time = pxa_timer_init,
769 .restart = pxa_restart, 769 .restart = pxa_restart,
770MACHINE_END 770MACHINE_END
771#endif 771#endif
@@ -977,7 +977,7 @@ MACHINE_START(E800, "Toshiba e800")
977 .handle_irq = pxa25x_handle_irq, 977 .handle_irq = pxa25x_handle_irq,
978 .fixup = eseries_fixup, 978 .fixup = eseries_fixup,
979 .init_machine = e800_init, 979 .init_machine = e800_init,
980 .timer = &pxa_timer, 980 .init_time = pxa_timer_init,
981 .restart = pxa_restart, 981 .restart = pxa_restart,
982MACHINE_END 982MACHINE_END
983#endif 983#endif
diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index dc58fa0edb66..dca10709be8f 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -802,7 +802,7 @@ MACHINE_START(EZX_A780, "Motorola EZX A780")
802 .nr_irqs = EZX_NR_IRQS, 802 .nr_irqs = EZX_NR_IRQS,
803 .init_irq = pxa27x_init_irq, 803 .init_irq = pxa27x_init_irq,
804 .handle_irq = pxa27x_handle_irq, 804 .handle_irq = pxa27x_handle_irq,
805 .timer = &pxa_timer, 805 .init_time = pxa_timer_init,
806 .init_machine = a780_init, 806 .init_machine = a780_init,
807 .restart = pxa_restart, 807 .restart = pxa_restart,
808MACHINE_END 808MACHINE_END
@@ -869,7 +869,7 @@ MACHINE_START(EZX_E680, "Motorola EZX E680")
869 .nr_irqs = EZX_NR_IRQS, 869 .nr_irqs = EZX_NR_IRQS,
870 .init_irq = pxa27x_init_irq, 870 .init_irq = pxa27x_init_irq,
871 .handle_irq = pxa27x_handle_irq, 871 .handle_irq = pxa27x_handle_irq,
872 .timer = &pxa_timer, 872 .init_time = pxa_timer_init,
873 .init_machine = e680_init, 873 .init_machine = e680_init,
874 .restart = pxa_restart, 874 .restart = pxa_restart,
875MACHINE_END 875MACHINE_END
@@ -936,7 +936,7 @@ MACHINE_START(EZX_A1200, "Motorola EZX A1200")
936 .nr_irqs = EZX_NR_IRQS, 936 .nr_irqs = EZX_NR_IRQS,
937 .init_irq = pxa27x_init_irq, 937 .init_irq = pxa27x_init_irq,
938 .handle_irq = pxa27x_handle_irq, 938 .handle_irq = pxa27x_handle_irq,
939 .timer = &pxa_timer, 939 .init_time = pxa_timer_init,
940 .init_machine = a1200_init, 940 .init_machine = a1200_init,
941 .restart = pxa_restart, 941 .restart = pxa_restart,
942MACHINE_END 942MACHINE_END
@@ -1128,7 +1128,7 @@ MACHINE_START(EZX_A910, "Motorola EZX A910")
1128 .nr_irqs = EZX_NR_IRQS, 1128 .nr_irqs = EZX_NR_IRQS,
1129 .init_irq = pxa27x_init_irq, 1129 .init_irq = pxa27x_init_irq,
1130 .handle_irq = pxa27x_handle_irq, 1130 .handle_irq = pxa27x_handle_irq,
1131 .timer = &pxa_timer, 1131 .init_time = pxa_timer_init,
1132 .init_machine = a910_init, 1132 .init_machine = a910_init,
1133 .restart = pxa_restart, 1133 .restart = pxa_restart,
1134MACHINE_END 1134MACHINE_END
@@ -1195,7 +1195,7 @@ MACHINE_START(EZX_E6, "Motorola EZX E6")
1195 .nr_irqs = EZX_NR_IRQS, 1195 .nr_irqs = EZX_NR_IRQS,
1196 .init_irq = pxa27x_init_irq, 1196 .init_irq = pxa27x_init_irq,
1197 .handle_irq = pxa27x_handle_irq, 1197 .handle_irq = pxa27x_handle_irq,
1198 .timer = &pxa_timer, 1198 .init_time = pxa_timer_init,
1199 .init_machine = e6_init, 1199 .init_machine = e6_init,
1200 .restart = pxa_restart, 1200 .restart = pxa_restart,
1201MACHINE_END 1201MACHINE_END
@@ -1236,7 +1236,7 @@ MACHINE_START(EZX_E2, "Motorola EZX E2")
1236 .nr_irqs = EZX_NR_IRQS, 1236 .nr_irqs = EZX_NR_IRQS,
1237 .init_irq = pxa27x_init_irq, 1237 .init_irq = pxa27x_init_irq,
1238 .handle_irq = pxa27x_handle_irq, 1238 .handle_irq = pxa27x_handle_irq,
1239 .timer = &pxa_timer, 1239 .init_time = pxa_timer_init,
1240 .init_machine = e2_init, 1240 .init_machine = e2_init,
1241 .restart = pxa_restart, 1241 .restart = pxa_restart,
1242MACHINE_END 1242MACHINE_END
diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h
index 42d5cca66257..fd7ea39b78c0 100644
--- a/arch/arm/mach-pxa/generic.h
+++ b/arch/arm/mach-pxa/generic.h
@@ -10,9 +10,8 @@
10 */ 10 */
11 11
12struct irq_data; 12struct irq_data;
13struct sys_timer;
14 13
15extern struct sys_timer pxa_timer; 14extern void pxa_timer_init(void);
16 15
17extern void __init pxa_map_io(void); 16extern void __init pxa_map_io(void);
18 17
diff --git a/arch/arm/mach-pxa/gumstix.c b/arch/arm/mach-pxa/gumstix.c
index 60755a6bb1c6..00b92dad7b81 100644
--- a/arch/arm/mach-pxa/gumstix.c
+++ b/arch/arm/mach-pxa/gumstix.c
@@ -238,7 +238,7 @@ MACHINE_START(GUMSTIX, "Gumstix")
238 .nr_irqs = PXA_NR_IRQS, 238 .nr_irqs = PXA_NR_IRQS,
239 .init_irq = pxa25x_init_irq, 239 .init_irq = pxa25x_init_irq,
240 .handle_irq = pxa25x_handle_irq, 240 .handle_irq = pxa25x_handle_irq,
241 .timer = &pxa_timer, 241 .init_time = pxa_timer_init,
242 .init_machine = gumstix_init, 242 .init_machine = gumstix_init,
243 .restart = pxa_restart, 243 .restart = pxa_restart,
244MACHINE_END 244MACHINE_END
diff --git a/arch/arm/mach-pxa/h5000.c b/arch/arm/mach-pxa/h5000.c
index e7dec589f014..875ec3351499 100644
--- a/arch/arm/mach-pxa/h5000.c
+++ b/arch/arm/mach-pxa/h5000.c
@@ -208,7 +208,7 @@ MACHINE_START(H5400, "HP iPAQ H5000")
208 .nr_irqs = PXA_NR_IRQS, 208 .nr_irqs = PXA_NR_IRQS,
209 .init_irq = pxa25x_init_irq, 209 .init_irq = pxa25x_init_irq,
210 .handle_irq = pxa25x_handle_irq, 210 .handle_irq = pxa25x_handle_irq,
211 .timer = &pxa_timer, 211 .init_time = pxa_timer_init,
212 .init_machine = h5000_init, 212 .init_machine = h5000_init,
213 .restart = pxa_restart, 213 .restart = pxa_restart,
214MACHINE_END 214MACHINE_END
diff --git a/arch/arm/mach-pxa/himalaya.c b/arch/arm/mach-pxa/himalaya.c
index 2962de898da9..7a8d749a07b8 100644
--- a/arch/arm/mach-pxa/himalaya.c
+++ b/arch/arm/mach-pxa/himalaya.c
@@ -164,6 +164,6 @@ MACHINE_START(HIMALAYA, "HTC Himalaya")
164 .init_irq = pxa25x_init_irq, 164 .init_irq = pxa25x_init_irq,
165 .handle_irq = pxa25x_handle_irq, 165 .handle_irq = pxa25x_handle_irq,
166 .init_machine = himalaya_init, 166 .init_machine = himalaya_init,
167 .timer = &pxa_timer, 167 .init_time = pxa_timer_init,
168 .restart = pxa_restart, 168 .restart = pxa_restart,
169MACHINE_END 169MACHINE_END
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c
index e2c6391863fe..133109ec7332 100644
--- a/arch/arm/mach-pxa/hx4700.c
+++ b/arch/arm/mach-pxa/hx4700.c
@@ -900,6 +900,6 @@ MACHINE_START(H4700, "HP iPAQ HX4700")
900 .init_irq = pxa27x_init_irq, 900 .init_irq = pxa27x_init_irq,
901 .handle_irq = pxa27x_handle_irq, 901 .handle_irq = pxa27x_handle_irq,
902 .init_machine = hx4700_init, 902 .init_machine = hx4700_init,
903 .timer = &pxa_timer, 903 .init_time = pxa_timer_init,
904 .restart = pxa_restart, 904 .restart = pxa_restart,
905MACHINE_END 905MACHINE_END
diff --git a/arch/arm/mach-pxa/icontrol.c b/arch/arm/mach-pxa/icontrol.c
index 1d02eabc9c65..fe31bfcbb8df 100644
--- a/arch/arm/mach-pxa/icontrol.c
+++ b/arch/arm/mach-pxa/icontrol.c
@@ -196,7 +196,7 @@ MACHINE_START(ICONTROL, "iControl/SafeTcam boards using Embedian MXM-8x10 CoM")
196 .nr_irqs = PXA_NR_IRQS, 196 .nr_irqs = PXA_NR_IRQS,
197 .init_irq = pxa3xx_init_irq, 197 .init_irq = pxa3xx_init_irq,
198 .handle_irq = pxa3xx_handle_irq, 198 .handle_irq = pxa3xx_handle_irq,
199 .timer = &pxa_timer, 199 .init_time = pxa_timer_init,
200 .init_machine = icontrol_init, 200 .init_machine = icontrol_init,
201 .restart = pxa_restart, 201 .restart = pxa_restart,
202MACHINE_END 202MACHINE_END
diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c
index 64507cdd2e8f..343c4e3a7c5d 100644
--- a/arch/arm/mach-pxa/idp.c
+++ b/arch/arm/mach-pxa/idp.c
@@ -279,7 +279,7 @@ MACHINE_START(PXA_IDP, "Vibren PXA255 IDP")
279 .nr_irqs = PXA_NR_IRQS, 279 .nr_irqs = PXA_NR_IRQS,
280 .init_irq = pxa25x_init_irq, 280 .init_irq = pxa25x_init_irq,
281 .handle_irq = pxa25x_handle_irq, 281 .handle_irq = pxa25x_handle_irq,
282 .timer = &pxa_timer, 282 .init_time = pxa_timer_init,
283 .init_machine = idp_init, 283 .init_machine = idp_init,
284 .restart = pxa_restart, 284 .restart = pxa_restart,
285MACHINE_END 285MACHINE_END
diff --git a/arch/arm/mach-pxa/include/mach/palmtreo.h b/arch/arm/mach-pxa/include/mach/palmtreo.h
index 2d3f14e3be29..714b6574393e 100644
--- a/arch/arm/mach-pxa/include/mach/palmtreo.h
+++ b/arch/arm/mach-pxa/include/mach/palmtreo.h
@@ -38,13 +38,14 @@
38#define GPIO_NR_TREO_LCD_POWER 25 38#define GPIO_NR_TREO_LCD_POWER 25
39 39
40/* Treo680 specific GPIOs */ 40/* Treo680 specific GPIOs */
41#ifdef CONFIG_MACH_TREO680
42#define GPIO_NR_TREO680_SD_READONLY 33 41#define GPIO_NR_TREO680_SD_READONLY 33
43#define GPIO_NR_TREO680_SD_POWER 42 42#define GPIO_NR_TREO680_SD_POWER 42
44#define GPIO_NR_TREO680_VIBRATE_EN 44 43#define GPIO_NR_TREO680_VIBRATE_EN 44
45#define GPIO_NR_TREO680_KEYB_BL 24 44#define GPIO_NR_TREO680_KEYB_BL 24
46#define GPIO_NR_TREO680_BT_EN 43 45#define GPIO_NR_TREO680_BT_EN 43
47#endif /* CONFIG_MACH_TREO680 */ 46#define GPIO_NR_TREO680_LCD_POWER 77
47#define GPIO_NR_TREO680_LCD_EN 86
48#define GPIO_NR_TREO680_LCD_EN_N 25
48 49
49/* Centro685 specific GPIOs */ 50/* Centro685 specific GPIOs */
50#define GPIO_NR_CENTRO_SD_POWER 21 51#define GPIO_NR_CENTRO_SD_POWER 21
diff --git a/arch/arm/mach-pxa/include/mach/smemc.h b/arch/arm/mach-pxa/include/mach/smemc.h
index b7de471b273a..b802f285fe00 100644
--- a/arch/arm/mach-pxa/include/mach/smemc.h
+++ b/arch/arm/mach-pxa/include/mach/smemc.h
@@ -37,6 +37,7 @@
37#define CSADRCFG1 (SMEMC_VIRT + 0x84) /* Address Configuration Register for CS1 */ 37#define CSADRCFG1 (SMEMC_VIRT + 0x84) /* Address Configuration Register for CS1 */
38#define CSADRCFG2 (SMEMC_VIRT + 0x88) /* Address Configuration Register for CS2 */ 38#define CSADRCFG2 (SMEMC_VIRT + 0x88) /* Address Configuration Register for CS2 */
39#define CSADRCFG3 (SMEMC_VIRT + 0x8C) /* Address Configuration Register for CS3 */ 39#define CSADRCFG3 (SMEMC_VIRT + 0x8C) /* Address Configuration Register for CS3 */
40#define CSMSADRCFG (SMEMC_VIRT + 0xA0) /* Chip Select Configuration Register */
40 41
41/* 42/*
42 * More handy macros for PCMCIA 43 * More handy macros for PCMCIA
diff --git a/arch/arm/mach-pxa/include/mach/uncompress.h b/arch/arm/mach-pxa/include/mach/uncompress.h
index 5519a34b667f..8c27757e68ff 100644
--- a/arch/arm/mach-pxa/include/mach/uncompress.h
+++ b/arch/arm/mach-pxa/include/mach/uncompress.h
@@ -72,8 +72,3 @@ static inline void arch_decomp_setup(void)
72 uart_is_pxa = 0; 72 uart_is_pxa = 0;
73 } 73 }
74} 74}
75
76/*
77 * nothing to do
78 */
79#define arch_decomp_wdog()
diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c
index 402874f9021f..e848c4607baf 100644
--- a/arch/arm/mach-pxa/littleton.c
+++ b/arch/arm/mach-pxa/littleton.c
@@ -443,7 +443,7 @@ MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleto
443 .nr_irqs = LITTLETON_NR_IRQS, 443 .nr_irqs = LITTLETON_NR_IRQS,
444 .init_irq = pxa3xx_init_irq, 444 .init_irq = pxa3xx_init_irq,
445 .handle_irq = pxa3xx_handle_irq, 445 .handle_irq = pxa3xx_handle_irq,
446 .timer = &pxa_timer, 446 .init_time = pxa_timer_init,
447 .init_machine = littleton_init, 447 .init_machine = littleton_init,
448 .restart = pxa_restart, 448 .restart = pxa_restart,
449MACHINE_END 449MACHINE_END
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
index 1a63eaa89867..1255ee00f3d1 100644
--- a/arch/arm/mach-pxa/lpd270.c
+++ b/arch/arm/mach-pxa/lpd270.c
@@ -503,7 +503,7 @@ MACHINE_START(LOGICPD_PXA270, "LogicPD PXA270 Card Engine")
503 .nr_irqs = LPD270_NR_IRQS, 503 .nr_irqs = LPD270_NR_IRQS,
504 .init_irq = lpd270_init_irq, 504 .init_irq = lpd270_init_irq,
505 .handle_irq = pxa27x_handle_irq, 505 .handle_irq = pxa27x_handle_irq,
506 .timer = &pxa_timer, 506 .init_time = pxa_timer_init,
507 .init_machine = lpd270_init, 507 .init_machine = lpd270_init,
508 .restart = pxa_restart, 508 .restart = pxa_restart,
509MACHINE_END 509MACHINE_END
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index 553056d9a3c5..d8a1be619f21 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -650,7 +650,7 @@ MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform (aka Lubbock)")
650 .nr_irqs = LUBBOCK_NR_IRQS, 650 .nr_irqs = LUBBOCK_NR_IRQS,
651 .init_irq = lubbock_init_irq, 651 .init_irq = lubbock_init_irq,
652 .handle_irq = pxa25x_handle_irq, 652 .handle_irq = pxa25x_handle_irq,
653 .timer = &pxa_timer, 653 .init_time = pxa_timer_init,
654 .init_machine = lubbock_init, 654 .init_machine = lubbock_init,
655 .restart = pxa_restart, 655 .restart = pxa_restart,
656MACHINE_END 656MACHINE_END
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index f7922404d941..f44532fc648b 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -774,6 +774,6 @@ MACHINE_START(MAGICIAN, "HTC Magician")
774 .init_irq = pxa27x_init_irq, 774 .init_irq = pxa27x_init_irq,
775 .handle_irq = pxa27x_handle_irq, 775 .handle_irq = pxa27x_handle_irq,
776 .init_machine = magician_init, 776 .init_machine = magician_init,
777 .timer = &pxa_timer, 777 .init_time = pxa_timer_init,
778 .restart = pxa_restart, 778 .restart = pxa_restart,
779MACHINE_END 779MACHINE_END
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index f27a61ee7ac7..7a12c1ba90ff 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -714,7 +714,7 @@ MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)")
714 .nr_irqs = MAINSTONE_NR_IRQS, 714 .nr_irqs = MAINSTONE_NR_IRQS,
715 .init_irq = mainstone_init_irq, 715 .init_irq = mainstone_init_irq,
716 .handle_irq = pxa27x_handle_irq, 716 .handle_irq = pxa27x_handle_irq,
717 .timer = &pxa_timer, 717 .init_time = pxa_timer_init,
718 .init_machine = mainstone_init, 718 .init_machine = mainstone_init,
719 .restart = pxa_restart, 719 .restart = pxa_restart,
720MACHINE_END 720MACHINE_END
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
index 2831308dba68..f8979b943cbf 100644
--- a/arch/arm/mach-pxa/mioa701.c
+++ b/arch/arm/mach-pxa/mioa701.c
@@ -762,6 +762,6 @@ MACHINE_START(MIOA701, "MIO A701")
762 .init_irq = &pxa27x_init_irq, 762 .init_irq = &pxa27x_init_irq,
763 .handle_irq = &pxa27x_handle_irq, 763 .handle_irq = &pxa27x_handle_irq,
764 .init_machine = mioa701_machine_init, 764 .init_machine = mioa701_machine_init,
765 .timer = &pxa_timer, 765 .init_time = pxa_timer_init,
766 .restart = mioa701_restart, 766 .restart = mioa701_restart,
767MACHINE_END 767MACHINE_END
diff --git a/arch/arm/mach-pxa/mp900.c b/arch/arm/mach-pxa/mp900.c
index 152efbf093f6..854f1f562d6b 100644
--- a/arch/arm/mach-pxa/mp900.c
+++ b/arch/arm/mach-pxa/mp900.c
@@ -93,7 +93,7 @@ static void __init mp900c_init(void)
93/* Maintainer - Michael Petchkovsky <mkpetch@internode.on.net> */ 93/* Maintainer - Michael Petchkovsky <mkpetch@internode.on.net> */
94MACHINE_START(NEC_MP900, "MobilePro900/C") 94MACHINE_START(NEC_MP900, "MobilePro900/C")
95 .atag_offset = 0x220100, 95 .atag_offset = 0x220100,
96 .timer = &pxa_timer, 96 .init_time = pxa_timer_init,
97 .map_io = pxa25x_map_io, 97 .map_io = pxa25x_map_io,
98 .nr_irqs = PXA_NR_IRQS, 98 .nr_irqs = PXA_NR_IRQS,
99 .init_irq = pxa25x_init_irq, 99 .init_irq = pxa25x_init_irq,
diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c
index 8bcc96e3b0db..909b713e5789 100644
--- a/arch/arm/mach-pxa/palmld.c
+++ b/arch/arm/mach-pxa/palmld.c
@@ -347,7 +347,7 @@ MACHINE_START(PALMLD, "Palm LifeDrive")
347 .nr_irqs = PXA_NR_IRQS, 347 .nr_irqs = PXA_NR_IRQS,
348 .init_irq = pxa27x_init_irq, 348 .init_irq = pxa27x_init_irq,
349 .handle_irq = pxa27x_handle_irq, 349 .handle_irq = pxa27x_handle_irq,
350 .timer = &pxa_timer, 350 .init_time = pxa_timer_init,
351 .init_machine = palmld_init, 351 .init_machine = palmld_init,
352 .restart = pxa_restart, 352 .restart = pxa_restart,
353MACHINE_END 353MACHINE_END
diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c
index 5ca7b904a30e..5033fd07968f 100644
--- a/arch/arm/mach-pxa/palmt5.c
+++ b/arch/arm/mach-pxa/palmt5.c
@@ -208,7 +208,7 @@ MACHINE_START(PALMT5, "Palm Tungsten|T5")
208 .nr_irqs = PXA_NR_IRQS, 208 .nr_irqs = PXA_NR_IRQS,
209 .init_irq = pxa27x_init_irq, 209 .init_irq = pxa27x_init_irq,
210 .handle_irq = pxa27x_handle_irq, 210 .handle_irq = pxa27x_handle_irq,
211 .timer = &pxa_timer, 211 .init_time = pxa_timer_init,
212 .init_machine = palmt5_init, 212 .init_machine = palmt5_init,
213 .restart = pxa_restart, 213 .restart = pxa_restart,
214MACHINE_END 214MACHINE_END
diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c
index ca924cfedfc0..100b176f7e88 100644
--- a/arch/arm/mach-pxa/palmtc.c
+++ b/arch/arm/mach-pxa/palmtc.c
@@ -542,7 +542,7 @@ MACHINE_START(PALMTC, "Palm Tungsten|C")
542 .nr_irqs = PXA_NR_IRQS, 542 .nr_irqs = PXA_NR_IRQS,
543 .init_irq = pxa25x_init_irq, 543 .init_irq = pxa25x_init_irq,
544 .handle_irq = pxa25x_handle_irq, 544 .handle_irq = pxa25x_handle_irq,
545 .timer = &pxa_timer, 545 .init_time = pxa_timer_init,
546 .init_machine = palmtc_init, 546 .init_machine = palmtc_init,
547 .restart = pxa_restart, 547 .restart = pxa_restart,
548MACHINE_END 548MACHINE_END
diff --git a/arch/arm/mach-pxa/palmte2.c b/arch/arm/mach-pxa/palmte2.c
index 32e0d7998355..0742721ced2d 100644
--- a/arch/arm/mach-pxa/palmte2.c
+++ b/arch/arm/mach-pxa/palmte2.c
@@ -363,7 +363,7 @@ MACHINE_START(PALMTE2, "Palm Tungsten|E2")
363 .nr_irqs = PXA_NR_IRQS, 363 .nr_irqs = PXA_NR_IRQS,
364 .init_irq = pxa25x_init_irq, 364 .init_irq = pxa25x_init_irq,
365 .handle_irq = pxa25x_handle_irq, 365 .handle_irq = pxa25x_handle_irq,
366 .timer = &pxa_timer, 366 .init_time = pxa_timer_init,
367 .init_machine = palmte2_init, 367 .init_machine = palmte2_init,
368 .restart = pxa_restart, 368 .restart = pxa_restart,
369MACHINE_END 369MACHINE_END
diff --git a/arch/arm/mach-pxa/palmtreo.c b/arch/arm/mach-pxa/palmtreo.c
index 3f3c48f2f7ce..d82a50b4a803 100644
--- a/arch/arm/mach-pxa/palmtreo.c
+++ b/arch/arm/mach-pxa/palmtreo.c
@@ -98,9 +98,6 @@ static unsigned long treo_pin_config[] __initdata = {
98 GPIO96_KP_MKOUT_6, 98 GPIO96_KP_MKOUT_6,
99 GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH, /* Hotsync button */ 99 GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH, /* Hotsync button */
100 100
101 /* LCD */
102 GPIOxx_LCD_TFT_16BPP,
103
104 /* Quick Capture Interface */ 101 /* Quick Capture Interface */
105 GPIO84_CIF_FV, 102 GPIO84_CIF_FV,
106 GPIO85_CIF_LV, 103 GPIO85_CIF_LV,
@@ -140,6 +137,12 @@ static unsigned long treo680_pin_config[] __initdata = {
140 /* MATRIX KEYPAD - different wake up source */ 137 /* MATRIX KEYPAD - different wake up source */
141 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH, 138 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
142 GPIO99_KP_MKIN_5, 139 GPIO99_KP_MKIN_5,
140
141 /* LCD... L_BIAS alt fn not configured on Treo680; is GPIO instead */
142 GPIOxx_LCD_16BPP,
143 GPIO74_LCD_FCLK,
144 GPIO75_LCD_LCLK,
145 GPIO76_LCD_PCLK,
143}; 146};
144#endif /* CONFIG_MACH_TREO680 */ 147#endif /* CONFIG_MACH_TREO680 */
145 148
@@ -155,13 +158,16 @@ static unsigned long centro685_pin_config[] __initdata = {
155 /* MATRIX KEYPAD - different wake up source */ 158 /* MATRIX KEYPAD - different wake up source */
156 GPIO100_KP_MKIN_0, 159 GPIO100_KP_MKIN_0,
157 GPIO99_KP_MKIN_5 | WAKEUP_ON_LEVEL_HIGH, 160 GPIO99_KP_MKIN_5 | WAKEUP_ON_LEVEL_HIGH,
161
162 /* LCD */
163 GPIOxx_LCD_TFT_16BPP,
158}; 164};
159#endif /* CONFIG_MACH_CENTRO */ 165#endif /* CONFIG_MACH_CENTRO */
160 166
161/****************************************************************************** 167/******************************************************************************
162 * GPIO keyboard 168 * GPIO keyboard
163 ******************************************************************************/ 169 ******************************************************************************/
164#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE) 170#if IS_ENABLED(CONFIG_KEYBOARD_PXA27x)
165static unsigned int treo680_matrix_keys[] = { 171static unsigned int treo680_matrix_keys[] = {
166 KEY(0, 0, KEY_F8), /* Red/Off/Power */ 172 KEY(0, 0, KEY_F8), /* Red/Off/Power */
167 KEY(0, 1, KEY_LEFT), 173 KEY(0, 1, KEY_LEFT),
@@ -309,7 +315,7 @@ static inline void palmtreo_kpc_init(void) {}
309/****************************************************************************** 315/******************************************************************************
310 * USB host 316 * USB host
311 ******************************************************************************/ 317 ******************************************************************************/
312#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) 318#if IS_ENABLED(CONFIG_USB_OHCI_HCD)
313static struct pxaohci_platform_data treo680_ohci_info = { 319static struct pxaohci_platform_data treo680_ohci_info = {
314 .port_mode = PMM_PERPORT_MODE, 320 .port_mode = PMM_PERPORT_MODE,
315 .flags = ENABLE_PORT1 | ENABLE_PORT3, 321 .flags = ENABLE_PORT1 | ENABLE_PORT3,
@@ -328,7 +334,6 @@ static inline void palmtreo_uhc_init(void) {}
328/****************************************************************************** 334/******************************************************************************
329 * Vibra and LEDs 335 * Vibra and LEDs
330 ******************************************************************************/ 336 ******************************************************************************/
331#ifdef CONFIG_MACH_TREO680
332static struct gpio_led treo680_gpio_leds[] = { 337static struct gpio_led treo680_gpio_leds[] = {
333 { 338 {
334 .name = "treo680:vibra:vibra", 339 .name = "treo680:vibra:vibra",
@@ -379,20 +384,46 @@ static struct gpio_led_platform_data centro_gpio_led_info = {
379static struct platform_device palmtreo_leds = { 384static struct platform_device palmtreo_leds = {
380 .name = "leds-gpio", 385 .name = "leds-gpio",
381 .id = -1, 386 .id = -1,
382 .dev = {
383 .platform_data = &treo680_gpio_led_info,
384 }
385}; 387};
386 388
387static void __init palmtreo_leds_init(void) 389static void __init palmtreo_leds_init(void)
388{ 390{
389 if (machine_is_centro()) 391 if (machine_is_centro())
390 palmtreo_leds.dev.platform_data = &centro_gpio_led_info; 392 palmtreo_leds.dev.platform_data = &centro_gpio_led_info;
393 else if (machine_is_treo680())
394 palmtreo_leds.dev.platform_data = &treo680_gpio_led_info;
391 395
392 platform_device_register(&palmtreo_leds); 396 platform_device_register(&palmtreo_leds);
393} 397}
398
399/******************************************************************************
400 * diskonchip docg4 flash
401 ******************************************************************************/
402#if defined(CONFIG_MACH_TREO680)
403/* REVISIT: does the centro have this device also? */
404#if IS_ENABLED(CONFIG_MTD_NAND_DOCG4)
405static struct resource docg4_resources[] = {
406 {
407 .start = 0x00000000,
408 .end = 0x00001FFF,
409 .flags = IORESOURCE_MEM,
410 },
411};
412
413static struct platform_device treo680_docg4_flash = {
414 .name = "docg4",
415 .id = -1,
416 .resource = docg4_resources,
417 .num_resources = ARRAY_SIZE(docg4_resources),
418};
419
420static void __init treo680_docg4_flash_init(void)
421{
422 platform_device_register(&treo680_docg4_flash);
423}
394#else 424#else
395static inline void palmtreo_leds_init(void) {} 425static inline void treo680_docg4_flash_init(void) {}
426#endif
396#endif 427#endif
397 428
398/****************************************************************************** 429/******************************************************************************
@@ -424,12 +455,62 @@ static void __init palmphone_common_init(void)
424} 455}
425 456
426#ifdef CONFIG_MACH_TREO680 457#ifdef CONFIG_MACH_TREO680
458void __init treo680_gpio_init(void)
459{
460 unsigned int gpio;
461
462 /* drive all three lcd gpios high initially */
463 const unsigned long lcd_flags = GPIOF_INIT_HIGH | GPIOF_DIR_OUT;
464
465 /*
466 * LCD GPIO initialization...
467 */
468
469 /*
470 * This is likely the power to the lcd. Toggling it low/high appears to
471 * turn the lcd off/on. Can be toggled after lcd is initialized without
472 * any apparent adverse effects to the lcd operation. Note that this
473 * gpio line is used by the lcd controller as the L_BIAS signal, but
474 * treo680 configures it as gpio.
475 */
476 gpio = GPIO_NR_TREO680_LCD_POWER;
477 if (gpio_request_one(gpio, lcd_flags, "LCD power") < 0)
478 goto fail;
479
480 /*
481 * These two are called "enables", for lack of a better understanding.
482 * If either of these are toggled after the lcd is initialized, the
483 * image becomes degraded. N.B. The IPL shipped with the treo
484 * configures GPIO_NR_TREO680_LCD_EN_N as output and drives it high. If
485 * the IPL is ever reprogrammed, this initialization may be need to be
486 * revisited.
487 */
488 gpio = GPIO_NR_TREO680_LCD_EN;
489 if (gpio_request_one(gpio, lcd_flags, "LCD enable") < 0)
490 goto fail;
491 gpio = GPIO_NR_TREO680_LCD_EN_N;
492 if (gpio_request_one(gpio, lcd_flags, "LCD enable_n") < 0)
493 goto fail;
494
495 /* driving this low turns LCD on */
496 gpio_set_value(GPIO_NR_TREO680_LCD_EN_N, 0);
497
498 return;
499 fail:
500 pr_err("gpio %d initialization failed\n", gpio);
501 gpio_free(GPIO_NR_TREO680_LCD_POWER);
502 gpio_free(GPIO_NR_TREO680_LCD_EN);
503 gpio_free(GPIO_NR_TREO680_LCD_EN_N);
504}
505
427static void __init treo680_init(void) 506static void __init treo680_init(void)
428{ 507{
429 pxa2xx_mfp_config(ARRAY_AND_SIZE(treo680_pin_config)); 508 pxa2xx_mfp_config(ARRAY_AND_SIZE(treo680_pin_config));
430 palmphone_common_init(); 509 palmphone_common_init();
510 treo680_gpio_init();
431 palm27x_mmc_init(GPIO_NR_TREO_SD_DETECT_N, GPIO_NR_TREO680_SD_READONLY, 511 palm27x_mmc_init(GPIO_NR_TREO_SD_DETECT_N, GPIO_NR_TREO680_SD_READONLY,
432 GPIO_NR_TREO680_SD_POWER, 0); 512 GPIO_NR_TREO680_SD_POWER, 0);
513 treo680_docg4_flash_init();
433} 514}
434#endif 515#endif
435 516
@@ -451,7 +532,7 @@ MACHINE_START(TREO680, "Palm Treo 680")
451 .nr_irqs = PXA_NR_IRQS, 532 .nr_irqs = PXA_NR_IRQS,
452 .init_irq = pxa27x_init_irq, 533 .init_irq = pxa27x_init_irq,
453 .handle_irq = pxa27x_handle_irq, 534 .handle_irq = pxa27x_handle_irq,
454 .timer = &pxa_timer, 535 .init_time = pxa_timer_init,
455 .init_machine = treo680_init, 536 .init_machine = treo680_init,
456 .restart = pxa_restart, 537 .restart = pxa_restart,
457MACHINE_END 538MACHINE_END
@@ -465,7 +546,7 @@ MACHINE_START(CENTRO, "Palm Centro 685")
465 .nr_irqs = PXA_NR_IRQS, 546 .nr_irqs = PXA_NR_IRQS,
466 .init_irq = pxa27x_init_irq, 547 .init_irq = pxa27x_init_irq,
467 .handle_irq = pxa27x_handle_irq, 548 .handle_irq = pxa27x_handle_irq,
468 .timer = &pxa_timer, 549 .init_time = pxa_timer_init,
469 .init_machine = centro_init, 550 .init_machine = centro_init,
470 .restart = pxa_restart, 551 .restart = pxa_restart,
471MACHINE_END 552MACHINE_END
diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c
index 8b4366628a12..627c93a7364c 100644
--- a/arch/arm/mach-pxa/palmtx.c
+++ b/arch/arm/mach-pxa/palmtx.c
@@ -366,7 +366,7 @@ MACHINE_START(PALMTX, "Palm T|X")
366 .nr_irqs = PXA_NR_IRQS, 366 .nr_irqs = PXA_NR_IRQS,
367 .init_irq = pxa27x_init_irq, 367 .init_irq = pxa27x_init_irq,
368 .handle_irq = pxa27x_handle_irq, 368 .handle_irq = pxa27x_handle_irq,
369 .timer = &pxa_timer, 369 .init_time = pxa_timer_init,
370 .init_machine = palmtx_init, 370 .init_machine = palmtx_init,
371 .restart = pxa_restart, 371 .restart = pxa_restart,
372MACHINE_END 372MACHINE_END
diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c
index 8cdd4f58e253..18b7fcd98592 100644
--- a/arch/arm/mach-pxa/palmz72.c
+++ b/arch/arm/mach-pxa/palmz72.c
@@ -404,7 +404,7 @@ MACHINE_START(PALMZ72, "Palm Zire72")
404 .nr_irqs = PXA_NR_IRQS, 404 .nr_irqs = PXA_NR_IRQS,
405 .init_irq = pxa27x_init_irq, 405 .init_irq = pxa27x_init_irq,
406 .handle_irq = pxa27x_handle_irq, 406 .handle_irq = pxa27x_handle_irq,
407 .timer = &pxa_timer, 407 .init_time = pxa_timer_init,
408 .init_machine = palmz72_init, 408 .init_machine = palmz72_init,
409 .restart = pxa_restart, 409 .restart = pxa_restart,
410MACHINE_END 410MACHINE_END
diff --git a/arch/arm/mach-pxa/pcm027.c b/arch/arm/mach-pxa/pcm027.c
index fe9054435b6f..69918c7e3f1f 100644
--- a/arch/arm/mach-pxa/pcm027.c
+++ b/arch/arm/mach-pxa/pcm027.c
@@ -263,7 +263,7 @@ MACHINE_START(PCM027, "Phytec Messtechnik GmbH phyCORE-PXA270")
263 .nr_irqs = PCM027_NR_IRQS, 263 .nr_irqs = PCM027_NR_IRQS,
264 .init_irq = pxa27x_init_irq, 264 .init_irq = pxa27x_init_irq,
265 .handle_irq = pxa27x_handle_irq, 265 .handle_irq = pxa27x_handle_irq,
266 .timer = &pxa_timer, 266 .init_time = pxa_timer_init,
267 .init_machine = pcm027_init, 267 .init_machine = pcm027_init,
268 .restart = pxa_restart, 268 .restart = pxa_restart,
269MACHINE_END 269MACHINE_END
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index 2910bb935c75..50ccd5f1d560 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -469,7 +469,7 @@ MACHINE_START(POODLE, "SHARP Poodle")
469 .nr_irqs = POODLE_NR_IRQS, /* 4 for LoCoMo */ 469 .nr_irqs = POODLE_NR_IRQS, /* 4 for LoCoMo */
470 .init_irq = pxa25x_init_irq, 470 .init_irq = pxa25x_init_irq,
471 .handle_irq = pxa25x_handle_irq, 471 .handle_irq = pxa25x_handle_irq,
472 .timer = &pxa_timer, 472 .init_time = pxa_timer_init,
473 .init_machine = poodle_init, 473 .init_machine = poodle_init,
474 .restart = pxa_restart, 474 .restart = pxa_restart,
475MACHINE_END 475MACHINE_END
diff --git a/arch/arm/mach-pxa/pxa-dt.c b/arch/arm/mach-pxa/pxa-dt.c
index c9192cea0033..3835979a0dd3 100644
--- a/arch/arm/mach-pxa/pxa-dt.c
+++ b/arch/arm/mach-pxa/pxa-dt.c
@@ -55,7 +55,7 @@ DT_MACHINE_START(PXA_DT, "Marvell PXA3xx (Device Tree Support)")
55 .map_io = pxa3xx_map_io, 55 .map_io = pxa3xx_map_io,
56 .init_irq = pxa3xx_dt_init_irq, 56 .init_irq = pxa3xx_dt_init_irq,
57 .handle_irq = pxa3xx_handle_irq, 57 .handle_irq = pxa3xx_handle_irq,
58 .timer = &pxa_timer, 58 .init_time = pxa_timer_init,
59 .restart = pxa_restart, 59 .restart = pxa_restart,
60 .init_machine = pxa3xx_dt_init, 60 .init_machine = pxa3xx_dt_init,
61 .dt_compat = pxa3xx_dt_board_compat, 61 .dt_compat = pxa3xx_dt_board_compat,
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 616cb87b6179..3203a9f5b4a2 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -53,17 +53,25 @@ static unsigned long ac97_reset_config[] = {
53 GPIO95_AC97_nRESET, 53 GPIO95_AC97_nRESET,
54}; 54};
55 55
56void pxa27x_assert_ac97reset(int reset_gpio, int on) 56void pxa27x_configure_ac97reset(int reset_gpio, bool to_gpio)
57{ 57{
58 /*
59 * This helper function is used to work around a bug in the pxa27x's
60 * ac97 controller during a warm reset. The configuration of the
61 * reset_gpio is changed as follows:
62 * to_gpio == true: configured to generic output gpio and driven high
63 * to_gpio == false: configured to ac97 controller alt fn AC97_nRESET
64 */
65
58 if (reset_gpio == 113) 66 if (reset_gpio == 113)
59 pxa2xx_mfp_config(on ? &ac97_reset_config[0] : 67 pxa2xx_mfp_config(to_gpio ? &ac97_reset_config[0] :
60 &ac97_reset_config[1], 1); 68 &ac97_reset_config[1], 1);
61 69
62 if (reset_gpio == 95) 70 if (reset_gpio == 95)
63 pxa2xx_mfp_config(on ? &ac97_reset_config[2] : 71 pxa2xx_mfp_config(to_gpio ? &ac97_reset_config[2] :
64 &ac97_reset_config[3], 1); 72 &ac97_reset_config[3], 1);
65} 73}
66EXPORT_SYMBOL_GPL(pxa27x_assert_ac97reset); 74EXPORT_SYMBOL_GPL(pxa27x_configure_ac97reset);
67 75
68/* Crystal clock: 13MHz */ 76/* Crystal clock: 13MHz */
69#define BASE_CLK 13000000 77#define BASE_CLK 13000000
@@ -230,6 +238,7 @@ static struct clk_lookup pxa27x_clkregs[] = {
230 INIT_CLKREG(&clk_pxa27x_memc, NULL, "MEMCLK"), 238 INIT_CLKREG(&clk_pxa27x_memc, NULL, "MEMCLK"),
231 INIT_CLKREG(&clk_pxa27x_mem, "pxa2xx-pcmcia", NULL), 239 INIT_CLKREG(&clk_pxa27x_mem, "pxa2xx-pcmcia", NULL),
232 INIT_CLKREG(&clk_dummy, "pxa-gpio", NULL), 240 INIT_CLKREG(&clk_dummy, "pxa-gpio", NULL),
241 INIT_CLKREG(&clk_dummy, "sa1100-rtc", NULL),
233}; 242};
234 243
235#ifdef CONFIG_PM 244#ifdef CONFIG_PM
diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c
index 25b08bfa997b..af41888acbd6 100644
--- a/arch/arm/mach-pxa/raumfeld.c
+++ b/arch/arm/mach-pxa/raumfeld.c
@@ -1095,7 +1095,7 @@ MACHINE_START(RAUMFELD_RC, "Raumfeld Controller")
1095 .nr_irqs = PXA_NR_IRQS, 1095 .nr_irqs = PXA_NR_IRQS,
1096 .init_irq = pxa3xx_init_irq, 1096 .init_irq = pxa3xx_init_irq,
1097 .handle_irq = pxa3xx_handle_irq, 1097 .handle_irq = pxa3xx_handle_irq,
1098 .timer = &pxa_timer, 1098 .init_time = pxa_timer_init,
1099 .restart = pxa_restart, 1099 .restart = pxa_restart,
1100MACHINE_END 1100MACHINE_END
1101#endif 1101#endif
@@ -1108,7 +1108,7 @@ MACHINE_START(RAUMFELD_CONNECTOR, "Raumfeld Connector")
1108 .nr_irqs = PXA_NR_IRQS, 1108 .nr_irqs = PXA_NR_IRQS,
1109 .init_irq = pxa3xx_init_irq, 1109 .init_irq = pxa3xx_init_irq,
1110 .handle_irq = pxa3xx_handle_irq, 1110 .handle_irq = pxa3xx_handle_irq,
1111 .timer = &pxa_timer, 1111 .init_time = pxa_timer_init,
1112 .restart = pxa_restart, 1112 .restart = pxa_restart,
1113MACHINE_END 1113MACHINE_END
1114#endif 1114#endif
@@ -1121,7 +1121,7 @@ MACHINE_START(RAUMFELD_SPEAKER, "Raumfeld Speaker")
1121 .nr_irqs = PXA_NR_IRQS, 1121 .nr_irqs = PXA_NR_IRQS,
1122 .init_irq = pxa3xx_init_irq, 1122 .init_irq = pxa3xx_init_irq,
1123 .handle_irq = pxa3xx_handle_irq, 1123 .handle_irq = pxa3xx_handle_irq,
1124 .timer = &pxa_timer, 1124 .init_time = pxa_timer_init,
1125 .restart = pxa_restart, 1125 .restart = pxa_restart,
1126MACHINE_END 1126MACHINE_END
1127#endif 1127#endif
diff --git a/arch/arm/mach-pxa/saar.c b/arch/arm/mach-pxa/saar.c
index 08d87a5d2639..710c493eac89 100644
--- a/arch/arm/mach-pxa/saar.c
+++ b/arch/arm/mach-pxa/saar.c
@@ -601,7 +601,7 @@ MACHINE_START(SAAR, "PXA930 Handheld Platform (aka SAAR)")
601 .nr_irqs = PXA_NR_IRQS, 601 .nr_irqs = PXA_NR_IRQS,
602 .init_irq = pxa3xx_init_irq, 602 .init_irq = pxa3xx_init_irq,
603 .handle_irq = pxa3xx_handle_irq, 603 .handle_irq = pxa3xx_handle_irq,
604 .timer = &pxa_timer, 604 .init_time = pxa_timer_init,
605 .init_machine = saar_init, 605 .init_machine = saar_init,
606 .restart = pxa_restart, 606 .restart = pxa_restart,
607MACHINE_END 607MACHINE_END
diff --git a/arch/arm/mach-pxa/smemc.c b/arch/arm/mach-pxa/smemc.c
index 79923058d10f..f38aa890b2c9 100644
--- a/arch/arm/mach-pxa/smemc.c
+++ b/arch/arm/mach-pxa/smemc.c
@@ -40,6 +40,8 @@ static void pxa3xx_smemc_resume(void)
40 __raw_writel(csadrcfg[1], CSADRCFG1); 40 __raw_writel(csadrcfg[1], CSADRCFG1);
41 __raw_writel(csadrcfg[2], CSADRCFG2); 41 __raw_writel(csadrcfg[2], CSADRCFG2);
42 __raw_writel(csadrcfg[3], CSADRCFG3); 42 __raw_writel(csadrcfg[3], CSADRCFG3);
43 /* CSMSADRCFG wakes up in its default state (0), so we need to set it */
44 __raw_writel(0x2, CSMSADRCFG);
43} 45}
44 46
45static struct syscore_ops smemc_syscore_ops = { 47static struct syscore_ops smemc_syscore_ops = {
@@ -49,8 +51,19 @@ static struct syscore_ops smemc_syscore_ops = {
49 51
50static int __init smemc_init(void) 52static int __init smemc_init(void)
51{ 53{
52 if (cpu_is_pxa3xx()) 54 if (cpu_is_pxa3xx()) {
55 /*
56 * The only documentation we have on the
57 * Chip Select Configuration Register (CSMSADRCFG) is that
58 * it must be programmed to 0x2.
59 * Moreover, in the bit definitions, the second bit
60 * (CSMSADRCFG[1]) is called "SETALWAYS".
61 * Other bits are reserved in this register.
62 */
63 __raw_writel(0x2, CSMSADRCFG);
64
53 register_syscore_ops(&smemc_syscore_ops); 65 register_syscore_ops(&smemc_syscore_ops);
66 }
54 67
55 return 0; 68 return 0;
56} 69}
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 2073f0e6db0d..362726c49c70 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -732,7 +732,7 @@ static inline void spitz_lcd_init(void) {}
732#endif 732#endif
733 733
734/****************************************************************************** 734/******************************************************************************
735 * Framebuffer 735 * NAND Flash
736 ******************************************************************************/ 736 ******************************************************************************/
737#if defined(CONFIG_MTD_NAND_SHARPSL) || defined(CONFIG_MTD_NAND_SHARPSL_MODULE) 737#if defined(CONFIG_MTD_NAND_SHARPSL) || defined(CONFIG_MTD_NAND_SHARPSL_MODULE)
738static struct mtd_partition spitz_nand_partitions[] = { 738static struct mtd_partition spitz_nand_partitions[] = {
@@ -858,7 +858,7 @@ static inline void spitz_nor_init(void) {}
858#endif 858#endif
859 859
860/****************************************************************************** 860/******************************************************************************
861 * GPIO expander 861 * I2C devices
862 ******************************************************************************/ 862 ******************************************************************************/
863#if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE) 863#if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE)
864static struct pca953x_platform_data akita_pca953x_pdata = { 864static struct pca953x_platform_data akita_pca953x_pdata = {
@@ -986,7 +986,7 @@ MACHINE_START(SPITZ, "SHARP Spitz")
986 .init_irq = pxa27x_init_irq, 986 .init_irq = pxa27x_init_irq,
987 .handle_irq = pxa27x_handle_irq, 987 .handle_irq = pxa27x_handle_irq,
988 .init_machine = spitz_init, 988 .init_machine = spitz_init,
989 .timer = &pxa_timer, 989 .init_time = pxa_timer_init,
990 .restart = spitz_restart, 990 .restart = spitz_restart,
991MACHINE_END 991MACHINE_END
992#endif 992#endif
@@ -1000,7 +1000,7 @@ MACHINE_START(BORZOI, "SHARP Borzoi")
1000 .init_irq = pxa27x_init_irq, 1000 .init_irq = pxa27x_init_irq,
1001 .handle_irq = pxa27x_handle_irq, 1001 .handle_irq = pxa27x_handle_irq,
1002 .init_machine = spitz_init, 1002 .init_machine = spitz_init,
1003 .timer = &pxa_timer, 1003 .init_time = pxa_timer_init,
1004 .restart = spitz_restart, 1004 .restart = spitz_restart,
1005MACHINE_END 1005MACHINE_END
1006#endif 1006#endif
@@ -1014,7 +1014,7 @@ MACHINE_START(AKITA, "SHARP Akita")
1014 .init_irq = pxa27x_init_irq, 1014 .init_irq = pxa27x_init_irq,
1015 .handle_irq = pxa27x_handle_irq, 1015 .handle_irq = pxa27x_handle_irq,
1016 .init_machine = spitz_init, 1016 .init_machine = spitz_init,
1017 .timer = &pxa_timer, 1017 .init_time = pxa_timer_init,
1018 .restart = spitz_restart, 1018 .restart = spitz_restart,
1019MACHINE_END 1019MACHINE_END
1020#endif 1020#endif
diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c
index 456560b5aad4..88fde43c948c 100644
--- a/arch/arm/mach-pxa/stargate2.c
+++ b/arch/arm/mach-pxa/stargate2.c
@@ -1006,7 +1006,7 @@ MACHINE_START(INTELMOTE2, "IMOTE 2")
1006 .nr_irqs = PXA_NR_IRQS, 1006 .nr_irqs = PXA_NR_IRQS,
1007 .init_irq = pxa27x_init_irq, 1007 .init_irq = pxa27x_init_irq,
1008 .handle_irq = pxa27x_handle_irq, 1008 .handle_irq = pxa27x_handle_irq,
1009 .timer = &pxa_timer, 1009 .init_time = pxa_timer_init,
1010 .init_machine = imote2_init, 1010 .init_machine = imote2_init,
1011 .atag_offset = 0x100, 1011 .atag_offset = 0x100,
1012 .restart = pxa_restart, 1012 .restart = pxa_restart,
@@ -1019,7 +1019,7 @@ MACHINE_START(STARGATE2, "Stargate 2")
1019 .nr_irqs = STARGATE_NR_IRQS, 1019 .nr_irqs = STARGATE_NR_IRQS,
1020 .init_irq = pxa27x_init_irq, 1020 .init_irq = pxa27x_init_irq,
1021 .handle_irq = pxa27x_handle_irq, 1021 .handle_irq = pxa27x_handle_irq,
1022 .timer = &pxa_timer, 1022 .init_time = pxa_timer_init,
1023 .init_machine = stargate2_init, 1023 .init_machine = stargate2_init,
1024 .atag_offset = 0x100, 1024 .atag_offset = 0x100,
1025 .restart = pxa_restart, 1025 .restart = pxa_restart,
diff --git a/arch/arm/mach-pxa/tavorevb.c b/arch/arm/mach-pxa/tavorevb.c
index 1a25f8a7b0ce..f55979c09a5f 100644
--- a/arch/arm/mach-pxa/tavorevb.c
+++ b/arch/arm/mach-pxa/tavorevb.c
@@ -494,7 +494,7 @@ MACHINE_START(TAVOREVB, "PXA930 Evaluation Board (aka TavorEVB)")
494 .nr_irqs = PXA_NR_IRQS, 494 .nr_irqs = PXA_NR_IRQS,
495 .init_irq = pxa3xx_init_irq, 495 .init_irq = pxa3xx_init_irq,
496 .handle_irq = pxa3xx_handle_irq, 496 .handle_irq = pxa3xx_handle_irq,
497 .timer = &pxa_timer, 497 .init_time = pxa_timer_init,
498 .init_machine = tavorevb_init, 498 .init_machine = tavorevb_init,
499 .restart = pxa_restart, 499 .restart = pxa_restart,
500MACHINE_END 500MACHINE_END
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c
index 4bc47d63698b..8f1ee92aea30 100644
--- a/arch/arm/mach-pxa/time.c
+++ b/arch/arm/mach-pxa/time.c
@@ -89,48 +89,10 @@ pxa_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *dev)
89 } 89 }
90} 90}
91 91
92static struct clock_event_device ckevt_pxa_osmr0 = {
93 .name = "osmr0",
94 .features = CLOCK_EVT_FEAT_ONESHOT,
95 .rating = 200,
96 .set_next_event = pxa_osmr0_set_next_event,
97 .set_mode = pxa_osmr0_set_mode,
98};
99
100static struct irqaction pxa_ost0_irq = {
101 .name = "ost0",
102 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
103 .handler = pxa_ost0_interrupt,
104 .dev_id = &ckevt_pxa_osmr0,
105};
106
107static void __init pxa_timer_init(void)
108{
109 unsigned long clock_tick_rate = get_clock_tick_rate();
110
111 writel_relaxed(0, OIER);
112 writel_relaxed(OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3, OSSR);
113
114 setup_sched_clock(pxa_read_sched_clock, 32, clock_tick_rate);
115
116 clockevents_calc_mult_shift(&ckevt_pxa_osmr0, clock_tick_rate, 4);
117 ckevt_pxa_osmr0.max_delta_ns =
118 clockevent_delta2ns(0x7fffffff, &ckevt_pxa_osmr0);
119 ckevt_pxa_osmr0.min_delta_ns =
120 clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_pxa_osmr0) + 1;
121 ckevt_pxa_osmr0.cpumask = cpumask_of(0);
122
123 setup_irq(IRQ_OST0, &pxa_ost0_irq);
124
125 clocksource_mmio_init(OSCR, "oscr0", clock_tick_rate, 200, 32,
126 clocksource_mmio_readl_up);
127 clockevents_register_device(&ckevt_pxa_osmr0);
128}
129
130#ifdef CONFIG_PM 92#ifdef CONFIG_PM
131static unsigned long osmr[4], oier, oscr; 93static unsigned long osmr[4], oier, oscr;
132 94
133static void pxa_timer_suspend(void) 95static void pxa_timer_suspend(struct clock_event_device *cedev)
134{ 96{
135 osmr[0] = readl_relaxed(OSMR0); 97 osmr[0] = readl_relaxed(OSMR0);
136 osmr[1] = readl_relaxed(OSMR1); 98 osmr[1] = readl_relaxed(OSMR1);
@@ -140,7 +102,7 @@ static void pxa_timer_suspend(void)
140 oscr = readl_relaxed(OSCR); 102 oscr = readl_relaxed(OSCR);
141} 103}
142 104
143static void pxa_timer_resume(void) 105static void pxa_timer_resume(struct clock_event_device *cedev)
144{ 106{
145 /* 107 /*
146 * Ensure that we have at least MIN_OSCR_DELTA between match 108 * Ensure that we have at least MIN_OSCR_DELTA between match
@@ -163,8 +125,38 @@ static void pxa_timer_resume(void)
163#define pxa_timer_resume NULL 125#define pxa_timer_resume NULL
164#endif 126#endif
165 127
166struct sys_timer pxa_timer = { 128static struct clock_event_device ckevt_pxa_osmr0 = {
167 .init = pxa_timer_init, 129 .name = "osmr0",
130 .features = CLOCK_EVT_FEAT_ONESHOT,
131 .rating = 200,
132 .set_next_event = pxa_osmr0_set_next_event,
133 .set_mode = pxa_osmr0_set_mode,
168 .suspend = pxa_timer_suspend, 134 .suspend = pxa_timer_suspend,
169 .resume = pxa_timer_resume, 135 .resume = pxa_timer_resume,
170}; 136};
137
138static struct irqaction pxa_ost0_irq = {
139 .name = "ost0",
140 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
141 .handler = pxa_ost0_interrupt,
142 .dev_id = &ckevt_pxa_osmr0,
143};
144
145void __init pxa_timer_init(void)
146{
147 unsigned long clock_tick_rate = get_clock_tick_rate();
148
149 writel_relaxed(0, OIER);
150 writel_relaxed(OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3, OSSR);
151
152 setup_sched_clock(pxa_read_sched_clock, 32, clock_tick_rate);
153
154 ckevt_pxa_osmr0.cpumask = cpumask_of(0);
155
156 setup_irq(IRQ_OST0, &pxa_ost0_irq);
157
158 clocksource_mmio_init(OSCR, "oscr0", clock_tick_rate, 200, 32,
159 clocksource_mmio_readl_up);
160 clockevents_config_and_register(&ckevt_pxa_osmr0, clock_tick_rate,
161 MIN_OSCR_DELTA * 2, 0x7fffffff);
162}
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index 233629edf7ee..3d91d2e5bf3a 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -927,8 +927,6 @@ static void tosa_restart(char mode, const char *cmd)
927 927
928static void __init tosa_init(void) 928static void __init tosa_init(void)
929{ 929{
930 int dummy;
931
932 pxa2xx_mfp_config(ARRAY_AND_SIZE(tosa_pin_config)); 930 pxa2xx_mfp_config(ARRAY_AND_SIZE(tosa_pin_config));
933 931
934 pxa_set_ffuart_info(NULL); 932 pxa_set_ffuart_info(NULL);
@@ -947,10 +945,6 @@ static void __init tosa_init(void)
947 /* enable batt_fault */ 945 /* enable batt_fault */
948 PMCR = 0x01; 946 PMCR = 0x01;
949 947
950 dummy = gpiochip_reserve(TOSA_SCOOP_GPIO_BASE, 12);
951 dummy = gpiochip_reserve(TOSA_SCOOP_JC_GPIO_BASE, 12);
952 dummy = gpiochip_reserve(TOSA_TC6393XB_GPIO_BASE, 16);
953
954 pxa_set_mci_info(&tosa_mci_platform_data); 948 pxa_set_mci_info(&tosa_mci_platform_data);
955 pxa_set_ficp_info(&tosa_ficp_platform_data); 949 pxa_set_ficp_info(&tosa_ficp_platform_data);
956 pxa_set_i2c_info(NULL); 950 pxa_set_i2c_info(NULL);
@@ -982,6 +976,6 @@ MACHINE_START(TOSA, "SHARP Tosa")
982 .init_irq = pxa25x_init_irq, 976 .init_irq = pxa25x_init_irq,
983 .handle_irq = pxa25x_handle_irq, 977 .handle_irq = pxa25x_handle_irq,
984 .init_machine = tosa_init, 978 .init_machine = tosa_init,
985 .timer = &pxa_timer, 979 .init_time = pxa_timer_init,
986 .restart = tosa_restart, 980 .restart = tosa_restart,
987MACHINE_END 981MACHINE_END
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c
index fbbcbed4d1d4..c58043462acd 100644
--- a/arch/arm/mach-pxa/trizeps4.c
+++ b/arch/arm/mach-pxa/trizeps4.c
@@ -561,7 +561,7 @@ MACHINE_START(TRIZEPS4, "Keith und Koep Trizeps IV module")
561 .nr_irqs = PXA_NR_IRQS, 561 .nr_irqs = PXA_NR_IRQS,
562 .init_irq = pxa27x_init_irq, 562 .init_irq = pxa27x_init_irq,
563 .handle_irq = pxa27x_handle_irq, 563 .handle_irq = pxa27x_handle_irq,
564 .timer = &pxa_timer, 564 .init_time = pxa_timer_init,
565 .restart = pxa_restart, 565 .restart = pxa_restart,
566MACHINE_END 566MACHINE_END
567 567
@@ -573,6 +573,6 @@ MACHINE_START(TRIZEPS4WL, "Keith und Koep Trizeps IV-WL module")
573 .nr_irqs = PXA_NR_IRQS, 573 .nr_irqs = PXA_NR_IRQS,
574 .init_irq = pxa27x_init_irq, 574 .init_irq = pxa27x_init_irq,
575 .handle_irq = pxa27x_handle_irq, 575 .handle_irq = pxa27x_handle_irq,
576 .timer = &pxa_timer, 576 .init_time = pxa_timer_init,
577 .restart = pxa_restart, 577 .restart = pxa_restart,
578MACHINE_END 578MACHINE_END
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
index c773e4dded64..9c363c081d3f 100644
--- a/arch/arm/mach-pxa/viper.c
+++ b/arch/arm/mach-pxa/viper.c
@@ -997,7 +997,7 @@ MACHINE_START(VIPER, "Arcom/Eurotech VIPER SBC")
997 .nr_irqs = PXA_NR_IRQS, 997 .nr_irqs = PXA_NR_IRQS,
998 .init_irq = viper_init_irq, 998 .init_irq = viper_init_irq,
999 .handle_irq = pxa25x_handle_irq, 999 .handle_irq = pxa25x_handle_irq,
1000 .timer = &pxa_timer, 1000 .init_time = pxa_timer_init,
1001 .init_machine = viper_init, 1001 .init_machine = viper_init,
1002 .restart = pxa_restart, 1002 .restart = pxa_restart,
1003MACHINE_END 1003MACHINE_END
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c
index 491b6c9a2a9b..aa89488f961e 100644
--- a/arch/arm/mach-pxa/vpac270.c
+++ b/arch/arm/mach-pxa/vpac270.c
@@ -719,7 +719,7 @@ MACHINE_START(VPAC270, "Voipac PXA270")
719 .nr_irqs = PXA_NR_IRQS, 719 .nr_irqs = PXA_NR_IRQS,
720 .init_irq = pxa27x_init_irq, 720 .init_irq = pxa27x_init_irq,
721 .handle_irq = pxa27x_handle_irq, 721 .handle_irq = pxa27x_handle_irq,
722 .timer = &pxa_timer, 722 .init_time = pxa_timer_init,
723 .init_machine = vpac270_init, 723 .init_machine = vpac270_init,
724 .restart = pxa_restart, 724 .restart = pxa_restart,
725MACHINE_END 725MACHINE_END
diff --git a/arch/arm/mach-pxa/xcep.c b/arch/arm/mach-pxa/xcep.c
index 4275713ccd10..13b1d4586d7d 100644
--- a/arch/arm/mach-pxa/xcep.c
+++ b/arch/arm/mach-pxa/xcep.c
@@ -185,7 +185,7 @@ MACHINE_START(XCEP, "Iskratel XCEP")
185 .nr_irqs = PXA_NR_IRQS, 185 .nr_irqs = PXA_NR_IRQS,
186 .init_irq = pxa25x_init_irq, 186 .init_irq = pxa25x_init_irq,
187 .handle_irq = pxa25x_handle_irq, 187 .handle_irq = pxa25x_handle_irq,
188 .timer = &pxa_timer, 188 .init_time = pxa_timer_init,
189 .restart = pxa_restart, 189 .restart = pxa_restart,
190MACHINE_END 190MACHINE_END
191 191
diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c
index 97529face7aa..989903a7e467 100644
--- a/arch/arm/mach-pxa/z2.c
+++ b/arch/arm/mach-pxa/z2.c
@@ -722,7 +722,7 @@ MACHINE_START(ZIPIT2, "Zipit Z2")
722 .nr_irqs = PXA_NR_IRQS, 722 .nr_irqs = PXA_NR_IRQS,
723 .init_irq = pxa27x_init_irq, 723 .init_irq = pxa27x_init_irq,
724 .handle_irq = pxa27x_handle_irq, 724 .handle_irq = pxa27x_handle_irq,
725 .timer = &pxa_timer, 725 .init_time = pxa_timer_init,
726 .init_machine = z2_init, 726 .init_machine = z2_init,
727 .restart = pxa_restart, 727 .restart = pxa_restart,
728MACHINE_END 728MACHINE_END
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
index abd3aa145083..f5d436434566 100644
--- a/arch/arm/mach-pxa/zeus.c
+++ b/arch/arm/mach-pxa/zeus.c
@@ -910,7 +910,7 @@ MACHINE_START(ARCOM_ZEUS, "Arcom/Eurotech ZEUS")
910 .nr_irqs = ZEUS_NR_IRQS, 910 .nr_irqs = ZEUS_NR_IRQS,
911 .init_irq = zeus_init_irq, 911 .init_irq = zeus_init_irq,
912 .handle_irq = pxa27x_handle_irq, 912 .handle_irq = pxa27x_handle_irq,
913 .timer = &pxa_timer, 913 .init_time = pxa_timer_init,
914 .init_machine = zeus_init, 914 .init_machine = zeus_init,
915 .restart = pxa_restart, 915 .restart = pxa_restart,
916MACHINE_END 916MACHINE_END
diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c
index 226279fac9d4..1f00d650ac27 100644
--- a/arch/arm/mach-pxa/zylonite.c
+++ b/arch/arm/mach-pxa/zylonite.c
@@ -428,7 +428,7 @@ MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)")
428 .nr_irqs = ZYLONITE_NR_IRQS, 428 .nr_irqs = ZYLONITE_NR_IRQS,
429 .init_irq = pxa3xx_init_irq, 429 .init_irq = pxa3xx_init_irq,
430 .handle_irq = pxa3xx_handle_irq, 430 .handle_irq = pxa3xx_handle_irq,
431 .timer = &pxa_timer, 431 .init_time = pxa_timer_init,
432 .init_machine = zylonite_init, 432 .init_machine = zylonite_init,
433 .restart = pxa_restart, 433 .restart = pxa_restart,
434MACHINE_END 434MACHINE_END
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 682467480588..1d5ee5c9a1dc 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -42,7 +42,6 @@
42#include <asm/mach/irq.h> 42#include <asm/mach/irq.h>
43#include <asm/mach/map.h> 43#include <asm/mach/map.h>
44 44
45#include <asm/hardware/gic.h>
46 45
47#include <mach/platform.h> 46#include <mach/platform.h>
48#include <mach/irqs.h> 47#include <mach/irqs.h>
diff --git a/arch/arm/mach-realview/include/mach/irqs-eb.h b/arch/arm/mach-realview/include/mach/irqs-eb.h
index d6b5073692d2..44754230fdcc 100644
--- a/arch/arm/mach-realview/include/mach/irqs-eb.h
+++ b/arch/arm/mach-realview/include/mach/irqs-eb.h
@@ -115,7 +115,7 @@
115/* 115/*
116 * Only define NR_IRQS if less than NR_IRQS_EB 116 * Only define NR_IRQS if less than NR_IRQS_EB
117 */ 117 */
118#define NR_IRQS_EB (IRQ_EB_GIC_START + 96) 118#define NR_IRQS_EB (IRQ_EB_GIC_START + 128)
119 119
120#if defined(CONFIG_MACH_REALVIEW_EB) \ 120#if defined(CONFIG_MACH_REALVIEW_EB) \
121 && (!defined(NR_IRQS) || (NR_IRQS < NR_IRQS_EB)) 121 && (!defined(NR_IRQS) || (NR_IRQS < NR_IRQS_EB))
diff --git a/arch/arm/mach-realview/include/mach/uncompress.h b/arch/arm/mach-realview/include/mach/uncompress.h
index 83050378ffd2..cfa30d21783b 100644
--- a/arch/arm/mach-realview/include/mach/uncompress.h
+++ b/arch/arm/mach-realview/include/mach/uncompress.h
@@ -75,4 +75,3 @@ static inline void flush(void)
75 * nothing to do 75 * nothing to do
76 */ 76 */
77#define arch_decomp_setup() 77#define arch_decomp_setup()
78#define arch_decomp_wdog()
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c
index 300f7064465d..98e3052b7933 100644
--- a/arch/arm/mach-realview/platsmp.c
+++ b/arch/arm/mach-realview/platsmp.c
@@ -14,7 +14,6 @@
14#include <linux/io.h> 14#include <linux/io.h>
15 15
16#include <mach/hardware.h> 16#include <mach/hardware.h>
17#include <asm/hardware/gic.h>
18#include <asm/mach-types.h> 17#include <asm/mach-types.h>
19#include <asm/smp_scu.h> 18#include <asm/smp_scu.h>
20 19
@@ -59,8 +58,6 @@ static void __init realview_smp_init_cpus(void)
59 58
60 for (i = 0; i < ncores; i++) 59 for (i = 0; i < ncores; i++)
61 set_cpu_possible(i, true); 60 set_cpu_possible(i, true);
62
63 set_smp_cross_call(gic_raise_softirq);
64} 61}
65 62
66static void __init realview_smp_prepare_cpus(unsigned int max_cpus) 63static void __init realview_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c
index 28511d43637a..5b1c8bfe6fa9 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -27,13 +27,13 @@
27#include <linux/amba/mmci.h> 27#include <linux/amba/mmci.h>
28#include <linux/amba/pl022.h> 28#include <linux/amba/pl022.h>
29#include <linux/io.h> 29#include <linux/io.h>
30#include <linux/irqchip/arm-gic.h>
30#include <linux/platform_data/clk-realview.h> 31#include <linux/platform_data/clk-realview.h>
31 32
32#include <mach/hardware.h> 33#include <mach/hardware.h>
33#include <asm/irq.h> 34#include <asm/irq.h>
34#include <asm/mach-types.h> 35#include <asm/mach-types.h>
35#include <asm/pgtable.h> 36#include <asm/pgtable.h>
36#include <asm/hardware/gic.h>
37#include <asm/hardware/cache-l2x0.h> 37#include <asm/hardware/cache-l2x0.h>
38#include <asm/smp_twd.h> 38#include <asm/smp_twd.h>
39 39
@@ -418,10 +418,6 @@ static void __init realview_eb_timer_init(void)
418 realview_eb_twd_init(); 418 realview_eb_twd_init();
419} 419}
420 420
421static struct sys_timer realview_eb_timer = {
422 .init = realview_eb_timer_init,
423};
424
425static void realview_eb_restart(char mode, const char *cmd) 421static void realview_eb_restart(char mode, const char *cmd)
426{ 422{
427 void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL); 423 void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL);
@@ -472,8 +468,7 @@ MACHINE_START(REALVIEW_EB, "ARM-RealView EB")
472 .map_io = realview_eb_map_io, 468 .map_io = realview_eb_map_io,
473 .init_early = realview_init_early, 469 .init_early = realview_init_early,
474 .init_irq = gic_init_irq, 470 .init_irq = gic_init_irq,
475 .timer = &realview_eb_timer, 471 .init_time = realview_eb_timer_init,
476 .handle_irq = gic_handle_irq,
477 .init_machine = realview_eb_init, 472 .init_machine = realview_eb_init,
478#ifdef CONFIG_ZONE_DMA 473#ifdef CONFIG_ZONE_DMA
479 .dma_zone_size = SZ_256M, 474 .dma_zone_size = SZ_256M,
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c
index 07d6672ddae7..d5e83a1f6982 100644
--- a/arch/arm/mach-realview/realview_pb1176.c
+++ b/arch/arm/mach-realview/realview_pb1176.c
@@ -29,13 +29,13 @@
29#include <linux/mtd/physmap.h> 29#include <linux/mtd/physmap.h>
30#include <linux/mtd/partitions.h> 30#include <linux/mtd/partitions.h>
31#include <linux/io.h> 31#include <linux/io.h>
32#include <linux/irqchip/arm-gic.h>
32#include <linux/platform_data/clk-realview.h> 33#include <linux/platform_data/clk-realview.h>
33 34
34#include <mach/hardware.h> 35#include <mach/hardware.h>
35#include <asm/irq.h> 36#include <asm/irq.h>
36#include <asm/mach-types.h> 37#include <asm/mach-types.h>
37#include <asm/pgtable.h> 38#include <asm/pgtable.h>
38#include <asm/hardware/gic.h>
39#include <asm/hardware/cache-l2x0.h> 39#include <asm/hardware/cache-l2x0.h>
40 40
41#include <asm/mach/arch.h> 41#include <asm/mach/arch.h>
@@ -329,10 +329,6 @@ static void __init realview_pb1176_timer_init(void)
329 realview_timer_init(IRQ_DC1176_TIMER0); 329 realview_timer_init(IRQ_DC1176_TIMER0);
330} 330}
331 331
332static struct sys_timer realview_pb1176_timer = {
333 .init = realview_pb1176_timer_init,
334};
335
336static void realview_pb1176_restart(char mode, const char *cmd) 332static void realview_pb1176_restart(char mode, const char *cmd)
337{ 333{
338 void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL); 334 void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL);
@@ -384,8 +380,7 @@ MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176")
384 .map_io = realview_pb1176_map_io, 380 .map_io = realview_pb1176_map_io,
385 .init_early = realview_init_early, 381 .init_early = realview_init_early,
386 .init_irq = gic_init_irq, 382 .init_irq = gic_init_irq,
387 .timer = &realview_pb1176_timer, 383 .init_time = realview_pb1176_timer_init,
388 .handle_irq = gic_handle_irq,
389 .init_machine = realview_pb1176_init, 384 .init_machine = realview_pb1176_init,
390#ifdef CONFIG_ZONE_DMA 385#ifdef CONFIG_ZONE_DMA
391 .dma_zone_size = SZ_256M, 386 .dma_zone_size = SZ_256M,
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c
index 7ed53d75350f..c3cfe213b5e6 100644
--- a/arch/arm/mach-realview/realview_pb11mp.c
+++ b/arch/arm/mach-realview/realview_pb11mp.c
@@ -27,13 +27,13 @@
27#include <linux/amba/mmci.h> 27#include <linux/amba/mmci.h>
28#include <linux/amba/pl022.h> 28#include <linux/amba/pl022.h>
29#include <linux/io.h> 29#include <linux/io.h>
30#include <linux/irqchip/arm-gic.h>
30#include <linux/platform_data/clk-realview.h> 31#include <linux/platform_data/clk-realview.h>
31 32
32#include <mach/hardware.h> 33#include <mach/hardware.h>
33#include <asm/irq.h> 34#include <asm/irq.h>
34#include <asm/mach-types.h> 35#include <asm/mach-types.h>
35#include <asm/pgtable.h> 36#include <asm/pgtable.h>
36#include <asm/hardware/gic.h>
37#include <asm/hardware/cache-l2x0.h> 37#include <asm/hardware/cache-l2x0.h>
38#include <asm/smp_twd.h> 38#include <asm/smp_twd.h>
39 39
@@ -316,10 +316,6 @@ static void __init realview_pb11mp_timer_init(void)
316 realview_pb11mp_twd_init(); 316 realview_pb11mp_twd_init();
317} 317}
318 318
319static struct sys_timer realview_pb11mp_timer = {
320 .init = realview_pb11mp_timer_init,
321};
322
323static void realview_pb11mp_restart(char mode, const char *cmd) 319static void realview_pb11mp_restart(char mode, const char *cmd)
324{ 320{
325 void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL); 321 void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL);
@@ -367,8 +363,7 @@ MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore")
367 .map_io = realview_pb11mp_map_io, 363 .map_io = realview_pb11mp_map_io,
368 .init_early = realview_init_early, 364 .init_early = realview_init_early,
369 .init_irq = gic_init_irq, 365 .init_irq = gic_init_irq,
370 .timer = &realview_pb11mp_timer, 366 .init_time = realview_pb11mp_timer_init,
371 .handle_irq = gic_handle_irq,
372 .init_machine = realview_pb11mp_init, 367 .init_machine = realview_pb11mp_init,
373#ifdef CONFIG_ZONE_DMA 368#ifdef CONFIG_ZONE_DMA
374 .dma_zone_size = SZ_256M, 369 .dma_zone_size = SZ_256M,
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c
index 9992431b8a15..dde652a59620 100644
--- a/arch/arm/mach-realview/realview_pba8.c
+++ b/arch/arm/mach-realview/realview_pba8.c
@@ -27,12 +27,12 @@
27#include <linux/amba/mmci.h> 27#include <linux/amba/mmci.h>
28#include <linux/amba/pl022.h> 28#include <linux/amba/pl022.h>
29#include <linux/io.h> 29#include <linux/io.h>
30#include <linux/irqchip/arm-gic.h>
30#include <linux/platform_data/clk-realview.h> 31#include <linux/platform_data/clk-realview.h>
31 32
32#include <asm/irq.h> 33#include <asm/irq.h>
33#include <asm/mach-types.h> 34#include <asm/mach-types.h>
34#include <asm/pgtable.h> 35#include <asm/pgtable.h>
35#include <asm/hardware/gic.h>
36 36
37#include <asm/mach/arch.h> 37#include <asm/mach/arch.h>
38#include <asm/mach/map.h> 38#include <asm/mach/map.h>
@@ -264,10 +264,6 @@ static void __init realview_pba8_timer_init(void)
264 realview_timer_init(IRQ_PBA8_TIMER0_1); 264 realview_timer_init(IRQ_PBA8_TIMER0_1);
265} 265}
266 266
267static struct sys_timer realview_pba8_timer = {
268 .init = realview_pba8_timer_init,
269};
270
271static void realview_pba8_restart(char mode, const char *cmd) 267static void realview_pba8_restart(char mode, const char *cmd)
272{ 268{
273 void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL); 269 void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL);
@@ -308,8 +304,7 @@ MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8")
308 .map_io = realview_pba8_map_io, 304 .map_io = realview_pba8_map_io,
309 .init_early = realview_init_early, 305 .init_early = realview_init_early,
310 .init_irq = gic_init_irq, 306 .init_irq = gic_init_irq,
311 .timer = &realview_pba8_timer, 307 .init_time = realview_pba8_timer_init,
312 .handle_irq = gic_handle_irq,
313 .init_machine = realview_pba8_init, 308 .init_machine = realview_pba8_init,
314#ifdef CONFIG_ZONE_DMA 309#ifdef CONFIG_ZONE_DMA
315 .dma_zone_size = SZ_256M, 310 .dma_zone_size = SZ_256M,
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c
index 4f486f05108a..54f0185b01e3 100644
--- a/arch/arm/mach-realview/realview_pbx.c
+++ b/arch/arm/mach-realview/realview_pbx.c
@@ -26,13 +26,13 @@
26#include <linux/amba/mmci.h> 26#include <linux/amba/mmci.h>
27#include <linux/amba/pl022.h> 27#include <linux/amba/pl022.h>
28#include <linux/io.h> 28#include <linux/io.h>
29#include <linux/irqchip/arm-gic.h>
29#include <linux/platform_data/clk-realview.h> 30#include <linux/platform_data/clk-realview.h>
30 31
31#include <asm/irq.h> 32#include <asm/irq.h>
32#include <asm/mach-types.h> 33#include <asm/mach-types.h>
33#include <asm/smp_twd.h> 34#include <asm/smp_twd.h>
34#include <asm/pgtable.h> 35#include <asm/pgtable.h>
35#include <asm/hardware/gic.h>
36#include <asm/hardware/cache-l2x0.h> 36#include <asm/hardware/cache-l2x0.h>
37 37
38#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
@@ -324,10 +324,6 @@ static void __init realview_pbx_timer_init(void)
324 realview_pbx_twd_init(); 324 realview_pbx_twd_init();
325} 325}
326 326
327static struct sys_timer realview_pbx_timer = {
328 .init = realview_pbx_timer_init,
329};
330
331static void realview_pbx_fixup(struct tag *tags, char **from, 327static void realview_pbx_fixup(struct tag *tags, char **from,
332 struct meminfo *meminfo) 328 struct meminfo *meminfo)
333{ 329{
@@ -404,8 +400,7 @@ MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX")
404 .map_io = realview_pbx_map_io, 400 .map_io = realview_pbx_map_io,
405 .init_early = realview_init_early, 401 .init_early = realview_init_early,
406 .init_irq = gic_init_irq, 402 .init_irq = gic_init_irq,
407 .timer = &realview_pbx_timer, 403 .init_time = realview_pbx_timer_init,
408 .handle_irq = gic_handle_irq,
409 .init_machine = realview_pbx_init, 404 .init_machine = realview_pbx_init,
410#ifdef CONFIG_ZONE_DMA 405#ifdef CONFIG_ZONE_DMA
411 .dma_zone_size = SZ_256M, 406 .dma_zone_size = SZ_256M,
diff --git a/arch/arm/mach-rpc/include/mach/uncompress.h b/arch/arm/mach-rpc/include/mach/uncompress.h
index 9cd9bcdad6cc..0fd4b0b8ef22 100644
--- a/arch/arm/mach-rpc/include/mach/uncompress.h
+++ b/arch/arm/mach-rpc/include/mach/uncompress.h
@@ -189,8 +189,3 @@ static void arch_decomp_setup(void)
189 if (nr_pages * page_size < 4096*1024) error("<4M of mem\n"); 189 if (nr_pages * page_size < 4096*1024) error("<4M of mem\n");
190} 190}
191#endif 191#endif
192
193/*
194 * nothing to do
195 */
196#define arch_decomp_wdog()
diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c
index f3fa259ce01f..a302cf5e0fc7 100644
--- a/arch/arm/mach-rpc/riscpc.c
+++ b/arch/arm/mach-rpc/riscpc.c
@@ -211,7 +211,7 @@ static void rpc_restart(char mode, const char *cmd)
211 soft_restart(0); 211 soft_restart(0);
212} 212}
213 213
214extern struct sys_timer ioc_timer; 214void ioc_timer_init(void);
215 215
216MACHINE_START(RISCPC, "Acorn-RiscPC") 216MACHINE_START(RISCPC, "Acorn-RiscPC")
217 /* Maintainer: Russell King */ 217 /* Maintainer: Russell King */
@@ -220,6 +220,6 @@ MACHINE_START(RISCPC, "Acorn-RiscPC")
220 .reserve_lp1 = 1, 220 .reserve_lp1 = 1,
221 .map_io = rpc_map_io, 221 .map_io = rpc_map_io,
222 .init_irq = rpc_init_irq, 222 .init_irq = rpc_init_irq,
223 .timer = &ioc_timer, 223 .init_time = ioc_timer_init,
224 .restart = rpc_restart, 224 .restart = rpc_restart,
225MACHINE_END 225MACHINE_END
diff --git a/arch/arm/mach-rpc/time.c b/arch/arm/mach-rpc/time.c
index 581fca934bb3..9a6def14df01 100644
--- a/arch/arm/mach-rpc/time.c
+++ b/arch/arm/mach-rpc/time.c
@@ -24,7 +24,7 @@
24 24
25#include <asm/mach/time.h> 25#include <asm/mach/time.h>
26 26
27unsigned long ioc_timer_gettimeoffset(void) 27static u32 ioc_timer_gettimeoffset(void)
28{ 28{
29 unsigned int count1, count2, status; 29 unsigned int count1, count2, status;
30 long offset; 30 long offset;
@@ -56,7 +56,7 @@ unsigned long ioc_timer_gettimeoffset(void)
56 } 56 }
57 57
58 offset = (LATCH - offset) * (tick_nsec / 1000); 58 offset = (LATCH - offset) * (tick_nsec / 1000);
59 return (offset + LATCH/2) / LATCH; 59 return ((offset + LATCH/2) / LATCH) * 1000;
60} 60}
61 61
62void __init ioctime_init(void) 62void __init ioctime_init(void)
@@ -82,14 +82,9 @@ static struct irqaction ioc_timer_irq = {
82/* 82/*
83 * Set up timer interrupt. 83 * Set up timer interrupt.
84 */ 84 */
85static void __init ioc_timer_init(void) 85void __init ioc_timer_init(void)
86{ 86{
87 arch_gettimeoffset = ioc_timer_gettimeoffset;
87 ioctime_init(); 88 ioctime_init();
88 setup_irq(IRQ_TIMER0, &ioc_timer_irq); 89 setup_irq(IRQ_TIMER0, &ioc_timer_irq);
89} 90}
90
91struct sys_timer ioc_timer = {
92 .init = ioc_timer_init,
93 .offset = ioc_timer_gettimeoffset,
94};
95
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
deleted file mode 100644
index 68d89cb96af0..000000000000
--- a/arch/arm/mach-s3c2410/Kconfig
+++ /dev/null
@@ -1,20 +0,0 @@
1# Copyright 2007 Simtec Electronics
2#
3# Licensed under GPLv2
4
5# cpu frequency scaling support
6
7config S3C2410_CPUFREQ
8 bool
9 depends on CPU_FREQ_S3C24XX && CPU_S3C2410
10 select S3C2410_CPUFREQ_UTILS
11 help
12 CPU Frequency scaling support for S3C2410
13
14config S3C2410_PLLTABLE
15 bool
16 depends on S3C2410_CPUFREQ && CPU_FREQ_S3C24XX_PLL
17 default y
18 help
19 Select the PLL table for the S3C2410
20
diff --git a/arch/arm/mach-s3c2410/Makefile b/arch/arm/mach-s3c2410/Makefile
deleted file mode 100644
index 6b9a316e0041..000000000000
--- a/arch/arm/mach-s3c2410/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
1# arch/arm/mach-s3c2410/Makefile
2#
3# Copyright 2007 Simtec Electronics
4#
5# Licensed under GPLv2
6
7obj-y :=
8obj-m :=
9obj-n :=
10obj- :=
11
12obj-$(CONFIG_S3C2410_CPUFREQ) += cpu-freq.o
13obj-$(CONFIG_S3C2410_PLLTABLE) += pll.o
14
diff --git a/arch/arm/mach-s3c2412/Kconfig b/arch/arm/mach-s3c2412/Kconfig
deleted file mode 100644
index 495f6928cbaa..000000000000
--- a/arch/arm/mach-s3c2412/Kconfig
+++ /dev/null
@@ -1,13 +0,0 @@
1# Copyright 2007 Simtec Electronics
2#
3# Licensed under GPLv2
4
5# Note, the S3C2412 IOtiming support is in plat-s3c24xx
6
7config S3C2412_CPUFREQ
8 bool
9 depends on CPU_FREQ_S3C24XX && CPU_S3C2412
10 default y
11 select S3C2412_IOTIMING
12 help
13 CPU Frequency scaling support for S3C2412 and S3C2413 SoC CPUs.
diff --git a/arch/arm/mach-s3c2412/Makefile b/arch/arm/mach-s3c2412/Makefile
deleted file mode 100644
index 41a6c279fb2f..000000000000
--- a/arch/arm/mach-s3c2412/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
1# arch/arm/mach-s3c2412/Makefile
2#
3# Copyright 2007 Simtec Electronics
4#
5# Licensed under GPLv2
6
7obj-y :=
8obj-m :=
9obj-n :=
10obj- :=
11
12obj-$(CONFIG_S3C2412_CPUFREQ) += cpu-freq.o
diff --git a/arch/arm/mach-s3c2412/gpio.c b/arch/arm/mach-s3c2412/gpio.c
deleted file mode 100644
index 4526f6ba31a8..000000000000
--- a/arch/arm/mach-s3c2412/gpio.c
+++ /dev/null
@@ -1,62 +0,0 @@
1/* linux/arch/arm/mach-s3c2412/gpio.c
2 *
3 * Copyright (c) 2007 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * http://armlinux.simtec.co.uk/.
7 *
8 * S3C2412/S3C2413 specific GPIO support
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 <linux/types.h>
17#include <linux/module.h>
18#include <linux/interrupt.h>
19#include <linux/gpio.h>
20
21#include <asm/mach/arch.h>
22#include <asm/mach/map.h>
23
24#include <mach/regs-gpio.h>
25#include <mach/hardware.h>
26
27#include <plat/gpio-core.h>
28
29int s3c2412_gpio_set_sleepcfg(unsigned int pin, unsigned int state)
30{
31 struct samsung_gpio_chip *chip = samsung_gpiolib_getchip(pin);
32 unsigned long offs = pin - chip->chip.base;
33 unsigned long flags;
34 unsigned long slpcon;
35
36 offs *= 2;
37
38 if (pin < S3C2410_GPB(0))
39 return -EINVAL;
40
41 if (pin >= S3C2410_GPF(0) &&
42 pin <= S3C2410_GPG(16))
43 return -EINVAL;
44
45 if (pin > S3C2410_GPH(16))
46 return -EINVAL;
47
48 local_irq_save(flags);
49
50 slpcon = __raw_readl(chip->base + 0x0C);
51
52 slpcon &= ~(3 << offs);
53 slpcon |= state << offs;
54
55 __raw_writel(slpcon, chip->base + 0x0C);
56
57 local_irq_restore(flags);
58
59 return 0;
60}
61
62EXPORT_SYMBOL(s3c2412_gpio_set_sleepcfg);
diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig
deleted file mode 100644
index a4d7fd27bec5..000000000000
--- a/arch/arm/mach-s3c2440/Kconfig
+++ /dev/null
@@ -1,37 +0,0 @@
1# Copyright 2007 Simtec Electronics
2#
3# Licensed under GPLv2
4
5config S3C2440_CPUFREQ
6 bool "S3C2440/S3C2442 CPU Frequency scaling support"
7 depends on CPU_FREQ_S3C24XX && (CPU_S3C2440 || CPU_S3C2442)
8 default y
9 select S3C2410_CPUFREQ_UTILS
10 help
11 CPU Frequency scaling support for S3C2440 and S3C2442 SoC CPUs.
12
13config S3C2440_XTAL_12000000
14 bool
15 help
16 Indicate that the build needs to support 12MHz system
17 crystal.
18
19config S3C2440_XTAL_16934400
20 bool
21 help
22 Indicate that the build needs to support 16.9344MHz system
23 crystal.
24
25config S3C2440_PLL_12000000
26 bool
27 depends on S3C2440_CPUFREQ && S3C2440_XTAL_12000000
28 default y if CPU_FREQ_S3C24XX_PLL
29 help
30 PLL tables for S3C2440 or S3C2442 CPUs with 12MHz crystals.
31
32config S3C2440_PLL_16934400
33 bool
34 depends on S3C2440_CPUFREQ && S3C2440_XTAL_16934400
35 default y if CPU_FREQ_S3C24XX_PLL
36 help
37 PLL tables for S3C2440 or S3C2442 CPUs with 16.934MHz crystals.
diff --git a/arch/arm/mach-s3c2440/Makefile b/arch/arm/mach-s3c2440/Makefile
deleted file mode 100644
index c46092439814..000000000000
--- a/arch/arm/mach-s3c2440/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
1# arch/arm/mach-s3c2440/Makefile
2#
3# Copyright 2007 Simtec Electronics
4#
5# Licensed under GPLv2
6
7obj-y :=
8obj-m :=
9obj-n :=
10obj- :=
11
12obj-$(CONFIG_CPU_S3C2440) += dsc.o
13
14obj-$(CONFIG_S3C2440_CPUFREQ) += s3c2440-cpufreq.o
15
16obj-$(CONFIG_S3C2440_PLL_12000000) += s3c2440-pll-12000000.o
17obj-$(CONFIG_S3C2440_PLL_16934400) += s3c2440-pll-16934400.o
diff --git a/arch/arm/mach-s3c2440/dsc.c b/arch/arm/mach-s3c2440/dsc.c
deleted file mode 100644
index 9ea66e31f626..000000000000
--- a/arch/arm/mach-s3c2440/dsc.c
+++ /dev/null
@@ -1,54 +0,0 @@
1/* linux/arch/arm/mach-s3c2440/dsc.c
2 *
3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Samsung S3C2440 Drive Strength Control 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/types.h>
15#include <linux/interrupt.h>
16#include <linux/init.h>
17#include <linux/module.h>
18#include <linux/io.h>
19
20#include <asm/mach/arch.h>
21#include <asm/mach/map.h>
22#include <asm/mach/irq.h>
23
24#include <mach/hardware.h>
25#include <asm/irq.h>
26
27#include <mach/regs-gpio.h>
28#include <mach/regs-dsc.h>
29
30#include <plat/cpu.h>
31#include <plat/s3c244x.h>
32
33int s3c2440_set_dsc(unsigned int pin, unsigned int value)
34{
35 void __iomem *base;
36 unsigned long val;
37 unsigned long flags;
38 unsigned long mask;
39
40 base = (pin & S3C2440_SELECT_DSC1) ? S3C2440_DSC1 : S3C2440_DSC0;
41 mask = 3 << S3C2440_DSC_GETSHIFT(pin);
42
43 local_irq_save(flags);
44
45 val = __raw_readl(base);
46 val &= ~mask;
47 val |= value & mask;
48 __raw_writel(val, base);
49
50 local_irq_restore(flags);
51 return 0;
52}
53
54EXPORT_SYMBOL(s3c2440_set_dsc);
diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig
index 25df14a9e268..37f513d1588e 100644
--- a/arch/arm/mach-s3c24xx/Kconfig
+++ b/arch/arm/mach-s3c24xx/Kconfig
@@ -9,6 +9,15 @@
9 9
10if ARCH_S3C24XX 10if ARCH_S3C24XX
11 11
12config PLAT_S3C24XX
13 def_bool y
14 select ARCH_REQUIRE_GPIOLIB
15 select NO_IOPORT
16 select S3C_DEV_NAND
17 select IRQ_DOMAIN
18 help
19 Base platform code for any Samsung S3C24XX device
20
12menu "SAMSUNG S3C24XX SoCs Support" 21menu "SAMSUNG S3C24XX SoCs Support"
13 22
14comment "S3C24XX SoCs" 23comment "S3C24XX SoCs"
@@ -83,6 +92,17 @@ config CPU_S3C2443
83 92
84# common code 93# common code
85 94
95config S3C2410_CLOCK
96 bool
97 help
98 Clock code for the S3C2410, and similar processors which
99 is currently includes the S3C2410, S3C2440, S3C2442.
100
101config S3C24XX_DCLK
102 bool
103 help
104 Clock code for supporting DCLK/CLKOUT on S3C24XX architectures
105
86config S3C24XX_SMDK 106config S3C24XX_SMDK
87 bool 107 bool
88 help 108 help
@@ -111,6 +131,22 @@ config S3C24XX_SETUP_TS
111 help 131 help
112 Compile in platform device definition for Samsung TouchScreen. 132 Compile in platform device definition for Samsung TouchScreen.
113 133
134config S3C24XX_DMA
135 bool "S3C2410 DMA support"
136 depends on ARCH_S3C24XX
137 select S3C_DMA
138 help
139 S3C2410 DMA support. This is needed for drivers like sound which
140 use the S3C2410's DMA system to move data to and from the
141 peripheral blocks.
142
143config S3C2410_DMA_DEBUG
144 bool "S3C2410 DMA support debug"
145 depends on ARCH_S3C24XX && S3C2410_DMA
146 help
147 Enable debugging output for the DMA code. This option sends info
148 to the kernel log, at priority KERN_DEBUG.
149
114config S3C2410_DMA 150config S3C2410_DMA
115 bool 151 bool
116 depends on S3C24XX_DMA && (CPU_S3C2410 || CPU_S3C2442) 152 depends on S3C24XX_DMA && (CPU_S3C2410 || CPU_S3C2442)
@@ -123,10 +159,92 @@ config S3C2410_PM
123 help 159 help
124 Power Management code common to S3C2410 and better 160 Power Management code common to S3C2410 and better
125 161
162# low-level serial option nodes
163
164config CPU_LLSERIAL_S3C2410_ONLY
165 bool
166 default y if CPU_LLSERIAL_S3C2410 && !CPU_LLSERIAL_S3C2440
167
168config CPU_LLSERIAL_S3C2440_ONLY
169 bool
170 default y if CPU_LLSERIAL_S3C2440 && !CPU_LLSERIAL_S3C2410
171
172config CPU_LLSERIAL_S3C2410
173 bool
174 help
175 Selected if there is an S3C2410 (or register compatible) serial
176 low-level implementation needed
177
178config CPU_LLSERIAL_S3C2440
179 bool
180 help
181 Selected if there is an S3C2440 (or register compatible) serial
182 low-level implementation needed
183
184# gpio configurations
185
186config S3C24XX_GPIO_EXTRA
187 int
188 default 128 if S3C24XX_GPIO_EXTRA128
189 default 64 if S3C24XX_GPIO_EXTRA64
190 default 16 if ARCH_H1940
191 default 0
192
193config S3C24XX_GPIO_EXTRA64
194 bool
195 help
196 Add an extra 64 gpio numbers to the available GPIO pool. This is
197 available for boards that need extra gpios for external devices.
198
199config S3C24XX_GPIO_EXTRA128
200 bool
201 help
202 Add an extra 128 gpio numbers to the available GPIO pool. This is
203 available for boards that need extra gpios for external devices.
204
205# cpu frequency items common between s3c2410 and s3c2440/s3c2442
206
207config S3C2410_IOTIMING
208 bool
209 depends on CPU_FREQ_S3C24XX
210 help
211 Internal node to select io timing code that is common to the s3c2410
212 and s3c2440/s3c2442 cpu frequency support.
213
214config S3C2410_CPUFREQ_UTILS
215 bool
216 depends on CPU_FREQ_S3C24XX
217 help
218 Internal node to select timing code that is common to the s3c2410
219 and s3c2440/s3c244 cpu frequency support.
220
221# cpu frequency support common to s3c2412, s3c2413 and s3c2442
222
223config S3C2412_IOTIMING
224 bool
225 depends on CPU_FREQ_S3C24XX && (CPU_S3C2412 || CPU_S3C2443)
226 help
227 Intel node to select io timing code that is common to the s3c2412
228 and the s3c2443.
229
126# cpu-specific sections 230# cpu-specific sections
127 231
128if CPU_S3C2410 232if CPU_S3C2410
129 233
234config S3C2410_CPUFREQ
235 bool
236 depends on CPU_FREQ_S3C24XX && CPU_S3C2410
237 select S3C2410_CPUFREQ_UTILS
238 help
239 CPU Frequency scaling support for S3C2410
240
241config S3C2410_PLL
242 bool
243 depends on S3C2410_CPUFREQ && CPU_FREQ_S3C24XX_PLL
244 default y
245 help
246 Select the PLL table for the S3C2410
247
130config S3C24XX_SIMTEC_NOR 248config S3C24XX_SIMTEC_NOR
131 bool 249 bool
132 help 250 help
@@ -226,6 +344,7 @@ config MACH_QT2410
226config ARCH_SMDK2410 344config ARCH_SMDK2410
227 bool "SMDK2410/A9M2410" 345 bool "SMDK2410/A9M2410"
228 select S3C24XX_SMDK 346 select S3C24XX_SMDK
347 select S3C_DEV_USB_HOST
229 help 348 help
230 Say Y here if you are using the SMDK2410 or the derived module A9M2410 349 Say Y here if you are using the SMDK2410 or the derived module A9M2410
231 <http://www.fsforth.de> 350 <http://www.fsforth.de>
@@ -266,6 +385,14 @@ config CPU_S3C2412_ONLY
266 !CPU_S3C2443 && CPU_S3C2412 385 !CPU_S3C2443 && CPU_S3C2412
267 default y 386 default y
268 387
388config S3C2412_CPUFREQ
389 bool
390 depends on CPU_FREQ_S3C24XX && CPU_S3C2412
391 default y
392 select S3C2412_IOTIMING
393 help
394 CPU Frequency scaling support for S3C2412 and S3C2413 SoC CPUs.
395
269config S3C2412_DMA 396config S3C2412_DMA
270 bool 397 bool
271 help 398 help
@@ -273,6 +400,7 @@ config S3C2412_DMA
273 400
274config S3C2412_PM 401config S3C2412_PM
275 bool 402 bool
403 select S3C2412_PM_SLEEP
276 help 404 help
277 Internal config node to apply S3C2412 power management 405 Internal config node to apply S3C2412 power management
278 406
@@ -291,8 +419,8 @@ config MACH_JIVE
291 Say Y here if you are using the Logitech Jive. 419 Say Y here if you are using the Logitech Jive.
292 420
293config MACH_JIVE_SHOW_BOOTLOADER 421config MACH_JIVE_SHOW_BOOTLOADER
294 bool "Allow access to bootloader partitions in MTD (EXPERIMENTAL)" 422 bool "Allow access to bootloader partitions in MTD"
295 depends on MACH_JIVE && EXPERIMENTAL 423 depends on MACH_JIVE
296 424
297config MACH_S3C2413 425config MACH_S3C2413
298 bool 426 bool
@@ -365,11 +493,45 @@ endif # CPU_S3C2416
365 493
366if CPU_S3C2440 494if CPU_S3C2440
367 495
496config S3C2440_CPUFREQ
497 bool "S3C2440/S3C2442 CPU Frequency scaling support"
498 depends on CPU_FREQ_S3C24XX && (CPU_S3C2440 || CPU_S3C2442)
499 default y
500 select S3C2410_CPUFREQ_UTILS
501 help
502 CPU Frequency scaling support for S3C2440 and S3C2442 SoC CPUs.
503
368config S3C2440_DMA 504config S3C2440_DMA
369 bool 505 bool
370 help 506 help
371 Support for S3C2440 specific DMA code5A 507 Support for S3C2440 specific DMA code5A
372 508
509config S3C2440_XTAL_12000000
510 bool
511 help
512 Indicate that the build needs to support 12MHz system
513 crystal.
514
515config S3C2440_XTAL_16934400
516 bool
517 help
518 Indicate that the build needs to support 16.9344MHz system
519 crystal.
520
521config S3C2440_PLL_12000000
522 bool
523 depends on S3C2440_CPUFREQ && S3C2440_XTAL_12000000
524 default y if CPU_FREQ_S3C24XX_PLL
525 help
526 PLL tables for S3C2440 or S3C2442 CPUs with 12MHz crystals.
527
528config S3C2440_PLL_16934400
529 bool
530 depends on S3C2440_CPUFREQ && S3C2440_XTAL_16934400
531 default y if CPU_FREQ_S3C24XX_PLL
532 help
533 PLL tables for S3C2440 or S3C2442 CPUs with 16.934MHz crystals.
534
373comment "S3C2440 Boards" 535comment "S3C2440 Boards"
374 536
375# 537#
diff --git a/arch/arm/mach-s3c24xx/Makefile b/arch/arm/mach-s3c24xx/Makefile
index 0ab6ab15da4c..af53d27d5c36 100644
--- a/arch/arm/mach-s3c24xx/Makefile
+++ b/arch/arm/mach-s3c24xx/Makefile
@@ -14,26 +14,32 @@ obj- :=
14 14
15# core 15# core
16 16
17obj-y += common.o 17obj-y += common.o irq.o
18 18
19obj-$(CONFIG_CPU_S3C2410) += s3c2410.o 19obj-$(CONFIG_CPU_S3C2410) += s3c2410.o
20obj-$(CONFIG_S3C2410_CPUFREQ) += cpufreq-s3c2410.o
20obj-$(CONFIG_S3C2410_DMA) += dma-s3c2410.o 21obj-$(CONFIG_S3C2410_DMA) += dma-s3c2410.o
22obj-$(CONFIG_S3C2410_PLL) += pll-s3c2410.o
21obj-$(CONFIG_S3C2410_PM) += pm-s3c2410.o sleep-s3c2410.o 23obj-$(CONFIG_S3C2410_PM) += pm-s3c2410.o sleep-s3c2410.o
22 24
23obj-$(CONFIG_CPU_S3C2412) += s3c2412.o irq-s3c2412.o clock-s3c2412.o 25obj-$(CONFIG_CPU_S3C2412) += s3c2412.o irq-s3c2412.o clock-s3c2412.o
26obj-$(CONFIG_S3C2412_CPUFREQ) += cpufreq-s3c2412.o
24obj-$(CONFIG_S3C2412_DMA) += dma-s3c2412.o 27obj-$(CONFIG_S3C2412_DMA) += dma-s3c2412.o
25obj-$(CONFIG_S3C2412_PM) += pm-s3c2412.o 28obj-$(CONFIG_S3C2412_PM) += pm-s3c2412.o
26obj-$(CONFIG_S3C2412_PM_SLEEP) += sleep-s3c2412.o 29obj-$(CONFIG_S3C2412_PM_SLEEP) += sleep-s3c2412.o
27 30
28obj-$(CONFIG_CPU_S3C2416) += s3c2416.o irq-s3c2416.o clock-s3c2416.o 31obj-$(CONFIG_CPU_S3C2416) += s3c2416.o clock-s3c2416.o
29obj-$(CONFIG_S3C2416_PM) += pm-s3c2416.o 32obj-$(CONFIG_S3C2416_PM) += pm-s3c2416.o
30 33
31obj-$(CONFIG_CPU_S3C2440) += s3c2440.o irq-s3c2440.o clock-s3c2440.o 34obj-$(CONFIG_CPU_S3C2440) += s3c2440.o irq-s3c2440.o clock-s3c2440.o
32obj-$(CONFIG_CPU_S3C2442) += s3c2442.o 35obj-$(CONFIG_CPU_S3C2442) += s3c2442.o
33obj-$(CONFIG_CPU_S3C244X) += s3c244x.o irq-s3c244x.o clock-s3c244x.o 36obj-$(CONFIG_CPU_S3C244X) += s3c244x.o irq-s3c244x.o clock-s3c244x.o
37obj-$(CONFIG_S3C2440_CPUFREQ) += cpufreq-s3c2440.o
34obj-$(CONFIG_S3C2440_DMA) += dma-s3c2440.o 38obj-$(CONFIG_S3C2440_DMA) += dma-s3c2440.o
39obj-$(CONFIG_S3C2440_PLL_12000000) += pll-s3c2440-12000000.o
40obj-$(CONFIG_S3C2440_PLL_16934400) += pll-s3c2440-16934400.o
35 41
36obj-$(CONFIG_CPU_S3C2443) += s3c2443.o irq-s3c2443.o clock-s3c2443.o 42obj-$(CONFIG_CPU_S3C2443) += s3c2443.o clock-s3c2443.o
37 43
38# PM 44# PM
39 45
@@ -41,9 +47,21 @@ obj-$(CONFIG_PM) += pm.o irq-pm.o sleep.o
41 47
42# common code 48# common code
43 49
50obj-$(CONFIG_S3C24XX_DCLK) += clock-dclk.o
51obj-$(CONFIG_S3C24XX_DMA) += dma.o
52
53obj-$(CONFIG_S3C2410_CLOCK) += clock-s3c2410.o
54obj-$(CONFIG_S3C2410_CPUFREQ_UTILS) += cpufreq-utils.o
55
56obj-$(CONFIG_S3C2410_IOTIMING) += iotiming-s3c2410.o
57obj-$(CONFIG_S3C2412_IOTIMING) += iotiming-s3c2412.o
58
44obj-$(CONFIG_S3C2443_COMMON) += common-s3c2443.o 59obj-$(CONFIG_S3C2443_COMMON) += common-s3c2443.o
45obj-$(CONFIG_S3C2443_DMA) += dma-s3c2443.o 60obj-$(CONFIG_S3C2443_DMA) += dma-s3c2443.o
46 61
62obj-$(CONFIG_CPU_FREQ_S3C24XX) += cpufreq.o
63obj-$(CONFIG_CPU_FREQ_S3C24XX_DEBUGFS) += cpufreq-debugfs.o
64
47# 65#
48# machine support 66# machine support
49# following is ordered alphabetically by option text. 67# following is ordered alphabetically by option text.
diff --git a/arch/arm/mach-s3c24xx/anubis.h b/arch/arm/mach-s3c24xx/anubis.h
new file mode 100644
index 000000000000..2691665f27d9
--- /dev/null
+++ b/arch/arm/mach-s3c24xx/anubis.h
@@ -0,0 +1,53 @@
1/*
2 * Copyright (c) 2005 Simtec Electronics
3 * http://www.simtec.co.uk/products/
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * ANUBIS - CPLD control constants
7 * ANUBIS - IRQ Number definitions
8 * ANUBIS - Memory map definitions
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#ifndef __MACH_S3C24XX_ANUBIS_H
16#define __MACH_S3C24XX_ANUBIS_H __FILE__
17
18/* CTRL2 - NAND WP control, IDE Reset assert/check */
19
20#define ANUBIS_CTRL1_NANDSEL (0x3)
21
22/* IDREG - revision */
23
24#define ANUBIS_IDREG_REVMASK (0x7)
25
26/* irq */
27
28#define ANUBIS_IRQ_IDE0 IRQ_EINT2
29#define ANUBIS_IRQ_IDE1 IRQ_EINT3
30#define ANUBIS_IRQ_ASIX IRQ_EINT1
31
32/* map */
33
34/* start peripherals off after the S3C2410 */
35
36#define ANUBIS_IOADDR(x) (S3C2410_ADDR((x) + 0x01800000))
37
38#define ANUBIS_PA_CPLD (S3C2410_CS1 | (1<<26))
39
40/* we put the CPLD registers next, to get them out of the way */
41
42#define ANUBIS_VA_CTRL1 ANUBIS_IOADDR(0x00000000)
43#define ANUBIS_PA_CTRL1 ANUBIS_PA_CPLD
44
45#define ANUBIS_VA_IDREG ANUBIS_IOADDR(0x00300000)
46#define ANUBIS_PA_IDREG (ANUBIS_PA_CPLD + (3 << 23))
47
48#define ANUBIS_IDEPRI ANUBIS_IOADDR(0x01000000)
49#define ANUBIS_IDEPRIAUX ANUBIS_IOADDR(0x01100000)
50#define ANUBIS_IDESEC ANUBIS_IOADDR(0x01200000)
51#define ANUBIS_IDESECAUX ANUBIS_IOADDR(0x01300000)
52
53#endif /* __MACH_S3C24XX_ANUBIS_H */
diff --git a/arch/arm/mach-s3c24xx/bast-ide.c b/arch/arm/mach-s3c24xx/bast-ide.c
index ba02cf8d80a2..3f0288f2f542 100644
--- a/arch/arm/mach-s3c24xx/bast-ide.c
+++ b/arch/arm/mach-s3c24xx/bast-ide.c
@@ -25,8 +25,8 @@
25#include <asm/mach/irq.h> 25#include <asm/mach/irq.h>
26 26
27#include <mach/map.h> 27#include <mach/map.h>
28#include <mach/bast-map.h> 28
29#include <mach/bast-irq.h> 29#include "bast.h"
30 30
31/* IDE ports */ 31/* IDE ports */
32 32
@@ -34,12 +34,10 @@ static struct pata_platform_info bast_ide_platdata = {
34 .ioport_shift = 5, 34 .ioport_shift = 5,
35}; 35};
36 36
37#define IDE_CS S3C2410_CS5
38
39static struct resource bast_ide0_resource[] = { 37static struct resource bast_ide0_resource[] = {
40 [0] = DEFINE_RES_MEM(IDE_CS + BAST_PA_IDEPRI, 8 * 0x20), 38 [0] = DEFINE_RES_MEM(BAST_IDE_CS + BAST_PA_IDEPRI, 8 * 0x20),
41 [1] = DEFINE_RES_MEM(IDE_CS + BAST_PA_IDEPRIAUX + (6 * 0x20), 0x20), 39 [1] = DEFINE_RES_MEM(BAST_IDE_CS + BAST_PA_IDEPRIAUX + (6 * 0x20), 0x20),
42 [2] = DEFINE_RES_IRQ(IRQ_IDE0), 40 [2] = DEFINE_RES_IRQ(BAST_IRQ_IDE0),
43}; 41};
44 42
45static struct platform_device bast_device_ide0 = { 43static struct platform_device bast_device_ide0 = {
@@ -55,9 +53,9 @@ static struct platform_device bast_device_ide0 = {
55}; 53};
56 54
57static struct resource bast_ide1_resource[] = { 55static struct resource bast_ide1_resource[] = {
58 [0] = DEFINE_RES_MEM(IDE_CS + BAST_PA_IDESEC, 8 * 0x20), 56 [0] = DEFINE_RES_MEM(BAST_IDE_CS + BAST_PA_IDESEC, 8 * 0x20),
59 [1] = DEFINE_RES_MEM(IDE_CS + BAST_PA_IDESECAUX + (6 * 0x20), 0x20), 57 [1] = DEFINE_RES_MEM(BAST_IDE_CS + BAST_PA_IDESECAUX + (6 * 0x20), 0x20),
60 [2] = DEFINE_RES_IRQ(IRQ_IDE1), 58 [2] = DEFINE_RES_IRQ(BAST_IRQ_IDE1),
61}; 59};
62 60
63static struct platform_device bast_device_ide1 = { 61static struct platform_device bast_device_ide1 = {
diff --git a/arch/arm/mach-s3c24xx/bast-irq.c b/arch/arm/mach-s3c24xx/bast-irq.c
index ac7b2ad5c405..c0daa9590b4c 100644
--- a/arch/arm/mach-s3c24xx/bast-irq.c
+++ b/arch/arm/mach-s3c24xx/bast-irq.c
@@ -27,27 +27,20 @@
27#include <linux/device.h> 27#include <linux/device.h>
28#include <linux/io.h> 28#include <linux/io.h>
29 29
30#include <asm/mach-types.h>
31
32#include <mach/hardware.h>
33#include <asm/irq.h> 30#include <asm/irq.h>
34 31#include <asm/mach-types.h>
35#include <asm/mach/irq.h> 32#include <asm/mach/irq.h>
36 33
34#include <mach/hardware.h>
37#include <mach/regs-irq.h> 35#include <mach/regs-irq.h>
38#include <mach/bast-map.h>
39#include <mach/bast-irq.h>
40 36
41#include <plat/irq.h> 37#include <plat/irq.h>
42 38
43#if 0 39#include "bast.h"
44#include <asm/debug-ll.h>
45#endif
46 40
47#define irqdbf(x...) 41#define irqdbf(x...)
48#define irqdbf2(x...) 42#define irqdbf2(x...)
49 43
50
51/* handle PC104 ISA interrupts from the system CPLD */ 44/* handle PC104 ISA interrupts from the system CPLD */
52 45
53/* table of ISA irq nos to the relevant mask... zero means 46/* table of ISA irq nos to the relevant mask... zero means
@@ -87,7 +80,7 @@ bast_pc104_mask(struct irq_data *data)
87static void 80static void
88bast_pc104_maskack(struct irq_data *data) 81bast_pc104_maskack(struct irq_data *data)
89{ 82{
90 struct irq_desc *desc = irq_desc + IRQ_ISA; 83 struct irq_desc *desc = irq_desc + BAST_IRQ_ISA;
91 84
92 bast_pc104_mask(data); 85 bast_pc104_mask(data);
93 desc->irq_data.chip->irq_ack(&desc->irq_data); 86 desc->irq_data.chip->irq_ack(&desc->irq_data);
@@ -122,7 +115,7 @@ bast_irq_pc104_demux(unsigned int irq,
122 if (unlikely(stat == 0)) { 115 if (unlikely(stat == 0)) {
123 /* ack if we get an irq with nothing (ie, startup) */ 116 /* ack if we get an irq with nothing (ie, startup) */
124 117
125 desc = irq_desc + IRQ_ISA; 118 desc = irq_desc + BAST_IRQ_ISA;
126 desc->irq_data.chip->irq_ack(&desc->irq_data); 119 desc->irq_data.chip->irq_ack(&desc->irq_data);
127 } else { 120 } else {
128 /* handle the IRQ */ 121 /* handle the IRQ */
@@ -147,7 +140,7 @@ static __init int bast_irq_init(void)
147 140
148 __raw_writeb(0x0, BAST_VA_PC104_IRQMASK); 141 __raw_writeb(0x0, BAST_VA_PC104_IRQMASK);
149 142
150 irq_set_chained_handler(IRQ_ISA, bast_irq_pc104_demux); 143 irq_set_chained_handler(BAST_IRQ_ISA, bast_irq_pc104_demux);
151 144
152 /* register our IRQs */ 145 /* register our IRQs */
153 146
diff --git a/arch/arm/mach-s3c24xx/bast.h b/arch/arm/mach-s3c24xx/bast.h
new file mode 100644
index 000000000000..5c7534bae92d
--- /dev/null
+++ b/arch/arm/mach-s3c24xx/bast.h
@@ -0,0 +1,197 @@
1/*
2 * Copyright (c) 2003-2004 Simtec Electronics
3 * Ben Dooks <ben@simtec.co.uk>
4 *
5 * BAST - CPLD control constants
6 * BAST - IRQ Number definitions
7 * BAST - Memory map definitions
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 version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#ifndef __MACH_S3C24XX_BAST_H
15#define __MACH_S3C24XX_BAST_H __FILE__
16
17/* CTRL1 - Audio LR routing */
18
19#define BAST_CPLD_CTRL1_LRCOFF (0x00)
20#define BAST_CPLD_CTRL1_LRCADC (0x01)
21#define BAST_CPLD_CTRL1_LRCDAC (0x02)
22#define BAST_CPLD_CTRL1_LRCARM (0x03)
23#define BAST_CPLD_CTRL1_LRMASK (0x03)
24
25/* CTRL2 - NAND WP control, IDE Reset assert/check */
26
27#define BAST_CPLD_CTRL2_WNAND (0x04)
28#define BAST_CPLD_CTLR2_IDERST (0x08)
29
30/* CTRL3 - rom write control, CPLD identity */
31
32#define BAST_CPLD_CTRL3_IDMASK (0x0e)
33#define BAST_CPLD_CTRL3_ROMWEN (0x01)
34
35/* CTRL4 - 8bit LCD interface control/status */
36
37#define BAST_CPLD_CTRL4_LLAT (0x01)
38#define BAST_CPLD_CTRL4_LCDRW (0x02)
39#define BAST_CPLD_CTRL4_LCDCMD (0x04)
40#define BAST_CPLD_CTRL4_LCDE2 (0x01)
41
42/* CTRL5 - DMA routing */
43
44#define BAST_CPLD_DMA0_PRIIDE (0)
45#define BAST_CPLD_DMA0_SECIDE (1)
46#define BAST_CPLD_DMA0_ISA15 (2)
47#define BAST_CPLD_DMA0_ISA36 (3)
48
49#define BAST_CPLD_DMA1_PRIIDE (0 << 2)
50#define BAST_CPLD_DMA1_SECIDE (1 << 2)
51#define BAST_CPLD_DMA1_ISA15 (2 << 2)
52#define BAST_CPLD_DMA1_ISA36 (3 << 2)
53
54/* irq numbers to onboard peripherals */
55
56#define BAST_IRQ_USBOC IRQ_EINT18
57#define BAST_IRQ_IDE0 IRQ_EINT16
58#define BAST_IRQ_IDE1 IRQ_EINT17
59#define BAST_IRQ_PCSERIAL1 IRQ_EINT15
60#define BAST_IRQ_PCSERIAL2 IRQ_EINT14
61#define BAST_IRQ_PCPARALLEL IRQ_EINT13
62#define BAST_IRQ_ASIX IRQ_EINT11
63#define BAST_IRQ_DM9000 IRQ_EINT10
64#define BAST_IRQ_ISA IRQ_EINT9
65#define BAST_IRQ_SMALERT IRQ_EINT8
66
67/* map */
68
69/*
70 * ok, we've used up to 0x13000000, now we need to find space for the
71 * peripherals that live in the nGCS[x] areas, which are quite numerous
72 * in their space. We also have the board's CPLD to find register space
73 * for.
74 */
75
76#define BAST_IOADDR(x) (S3C2410_ADDR((x) + 0x01300000))
77
78/* we put the CPLD registers next, to get them out of the way */
79
80#define BAST_VA_CTRL1 BAST_IOADDR(0x00000000)
81#define BAST_PA_CTRL1 (S3C2410_CS5 | 0x7800000)
82
83#define BAST_VA_CTRL2 BAST_IOADDR(0x00100000)
84#define BAST_PA_CTRL2 (S3C2410_CS1 | 0x6000000)
85
86#define BAST_VA_CTRL3 BAST_IOADDR(0x00200000)
87#define BAST_PA_CTRL3 (S3C2410_CS1 | 0x6800000)
88
89#define BAST_VA_CTRL4 BAST_IOADDR(0x00300000)
90#define BAST_PA_CTRL4 (S3C2410_CS1 | 0x7000000)
91
92/* next, we have the PC104 ISA interrupt registers */
93
94#define BAST_PA_PC104_IRQREQ (S3C2410_CS5 | 0x6000000)
95#define BAST_VA_PC104_IRQREQ BAST_IOADDR(0x00400000)
96
97#define BAST_PA_PC104_IRQRAW (S3C2410_CS5 | 0x6800000)
98#define BAST_VA_PC104_IRQRAW BAST_IOADDR(0x00500000)
99
100#define BAST_PA_PC104_IRQMASK (S3C2410_CS5 | 0x7000000)
101#define BAST_VA_PC104_IRQMASK BAST_IOADDR(0x00600000)
102
103#define BAST_PA_LCD_RCMD1 (0x8800000)
104#define BAST_VA_LCD_RCMD1 BAST_IOADDR(0x00700000)
105
106#define BAST_PA_LCD_WCMD1 (0x8000000)
107#define BAST_VA_LCD_WCMD1 BAST_IOADDR(0x00800000)
108
109#define BAST_PA_LCD_RDATA1 (0x9800000)
110#define BAST_VA_LCD_RDATA1 BAST_IOADDR(0x00900000)
111
112#define BAST_PA_LCD_WDATA1 (0x9000000)
113#define BAST_VA_LCD_WDATA1 BAST_IOADDR(0x00A00000)
114
115#define BAST_PA_LCD_RCMD2 (0xA800000)
116#define BAST_VA_LCD_RCMD2 BAST_IOADDR(0x00B00000)
117
118#define BAST_PA_LCD_WCMD2 (0xA000000)
119#define BAST_VA_LCD_WCMD2 BAST_IOADDR(0x00C00000)
120
121#define BAST_PA_LCD_RDATA2 (0xB800000)
122#define BAST_VA_LCD_RDATA2 BAST_IOADDR(0x00D00000)
123
124#define BAST_PA_LCD_WDATA2 (0xB000000)
125#define BAST_VA_LCD_WDATA2 BAST_IOADDR(0x00E00000)
126
127
128/*
129 * 0xE0000000 contains the IO space that is split by speed and
130 * whether the access is for 8 or 16bit IO... this ensures that
131 * the correct access is made
132 *
133 * 0x10000000 of space, partitioned as so:
134 *
135 * 0x00000000 to 0x04000000 8bit, slow
136 * 0x04000000 to 0x08000000 16bit, slow
137 * 0x08000000 to 0x0C000000 16bit, net
138 * 0x0C000000 to 0x10000000 16bit, fast
139 *
140 * each of these spaces has the following in:
141 *
142 * 0x00000000 to 0x01000000 16MB ISA IO space
143 * 0x01000000 to 0x02000000 16MB ISA memory space
144 * 0x02000000 to 0x02100000 1MB IDE primary channel
145 * 0x02100000 to 0x02200000 1MB IDE primary channel aux
146 * 0x02200000 to 0x02400000 1MB IDE secondary channel
147 * 0x02300000 to 0x02400000 1MB IDE secondary channel aux
148 * 0x02400000 to 0x02500000 1MB ASIX ethernet controller
149 * 0x02500000 to 0x02600000 1MB Davicom DM9000 ethernet controller
150 * 0x02600000 to 0x02700000 1MB PC SuperIO controller
151 *
152 * the phyiscal layout of the zones are:
153 * nGCS2 - 8bit, slow
154 * nGCS3 - 16bit, slow
155 * nGCS4 - 16bit, net
156 * nGCS5 - 16bit, fast
157 */
158
159#define BAST_VA_MULTISPACE (0xE0000000)
160
161#define BAST_VA_ISAIO (BAST_VA_MULTISPACE + 0x00000000)
162#define BAST_VA_ISAMEM (BAST_VA_MULTISPACE + 0x01000000)
163#define BAST_VA_IDEPRI (BAST_VA_MULTISPACE + 0x02000000)
164#define BAST_VA_IDEPRIAUX (BAST_VA_MULTISPACE + 0x02100000)
165#define BAST_VA_IDESEC (BAST_VA_MULTISPACE + 0x02200000)
166#define BAST_VA_IDESECAUX (BAST_VA_MULTISPACE + 0x02300000)
167#define BAST_VA_ASIXNET (BAST_VA_MULTISPACE + 0x02400000)
168#define BAST_VA_DM9000 (BAST_VA_MULTISPACE + 0x02500000)
169#define BAST_VA_SUPERIO (BAST_VA_MULTISPACE + 0x02600000)
170
171#define BAST_VAM_CS2 (0x00000000)
172#define BAST_VAM_CS3 (0x04000000)
173#define BAST_VAM_CS4 (0x08000000)
174#define BAST_VAM_CS5 (0x0C000000)
175
176/* physical offset addresses for the peripherals */
177
178#define BAST_PA_ISAIO (0x00000000)
179#define BAST_PA_ASIXNET (0x01000000)
180#define BAST_PA_SUPERIO (0x01800000)
181#define BAST_PA_IDEPRI (0x02000000)
182#define BAST_PA_IDEPRIAUX (0x02800000)
183#define BAST_PA_IDESEC (0x03000000)
184#define BAST_PA_IDESECAUX (0x03800000)
185#define BAST_PA_ISAMEM (0x04000000)
186#define BAST_PA_DM9000 (0x05000000)
187
188/* some configurations for the peripherals */
189
190#define BAST_PCSIO (BAST_VA_SUPERIO + BAST_VAM_CS2)
191
192#define BAST_ASIXNET_CS BAST_VAM_CS5
193#define BAST_DM9000_CS BAST_VAM_CS4
194
195#define BAST_IDE_CS S3C2410_CS5
196
197#endif /* __MACH_S3C24XX_BAST_H */
diff --git a/arch/arm/plat-s3c24xx/clock-dclk.c b/arch/arm/mach-s3c24xx/clock-dclk.c
index f95d3268ae1f..1edd9b2369c5 100644
--- a/arch/arm/plat-s3c24xx/clock-dclk.c
+++ b/arch/arm/mach-s3c24xx/clock-dclk.c
@@ -1,5 +1,4 @@
1/* linux/arch/arm/plat-s3c24xx/clock-dclk.c 1/*
2 *
3 * Copyright (c) 2004-2008 Simtec Electronics 2 * Copyright (c) 2004-2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 3 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
diff --git a/arch/arm/plat-s3c24xx/s3c2410-clock.c b/arch/arm/mach-s3c24xx/clock-s3c2410.c
index 25dc4d4397b1..641266f3d152 100644
--- a/arch/arm/plat-s3c24xx/s3c2410-clock.c
+++ b/arch/arm/mach-s3c24xx/clock-s3c2410.c
@@ -1,5 +1,4 @@
1/* linux/arch/arm/mach-s3c2410/clock.c 1/*
2 *
3 * Copyright (c) 2006 Simtec Electronics 2 * Copyright (c) 2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 3 * Ben Dooks <ben@simtec.co.uk>
5 * 4 *
diff --git a/arch/arm/mach-s3c24xx/common-s3c2443.c b/arch/arm/mach-s3c24xx/common-s3c2443.c
index aeb4a24ff3ed..f6b9f2ef01bd 100644
--- a/arch/arm/mach-s3c24xx/common-s3c2443.c
+++ b/arch/arm/mach-s3c24xx/common-s3c2443.c
@@ -132,7 +132,7 @@ static struct clk *clk_msysclk_sources[] = {
132 [3] = &clk_mpllref, 132 [3] = &clk_mpllref,
133}; 133};
134 134
135struct clksrc_clk clk_msysclk = { 135static struct clksrc_clk clk_msysclk = {
136 .clk = { 136 .clk = {
137 .name = "msysclk", 137 .name = "msysclk",
138 .parent = &clk_xtal, 138 .parent = &clk_xtal,
diff --git a/arch/arm/mach-s3c24xx/common.c b/arch/arm/mach-s3c24xx/common.c
index 0c9e9a785ef6..6bcf87f65f9e 100644
--- a/arch/arm/mach-s3c24xx/common.c
+++ b/arch/arm/mach-s3c24xx/common.c
@@ -197,7 +197,7 @@ static unsigned long s3c24xx_read_idcode_v4(void)
197 197
198static void s3c24xx_default_idle(void) 198static void s3c24xx_default_idle(void)
199{ 199{
200 unsigned long tmp; 200 unsigned long tmp = 0;
201 int i; 201 int i;
202 202
203 /* idle the system by using the idle mode which will wait for an 203 /* idle the system by using the idle mode which will wait for an
diff --git a/arch/arm/mach-s3c24xx/common.h b/arch/arm/mach-s3c24xx/common.h
index c2f596e7bc2d..ed6276fcaa3b 100644
--- a/arch/arm/mach-s3c24xx/common.h
+++ b/arch/arm/mach-s3c24xx/common.h
@@ -15,4 +15,6 @@
15void s3c2410_restart(char mode, const char *cmd); 15void s3c2410_restart(char mode, const char *cmd);
16void s3c244x_restart(char mode, const char *cmd); 16void s3c244x_restart(char mode, const char *cmd);
17 17
18extern struct syscore_ops s3c24xx_irq_syscore_ops;
19
18#endif /* __ARCH_ARM_MACH_S3C24XX_COMMON_H */ 20#endif /* __ARCH_ARM_MACH_S3C24XX_COMMON_H */
diff --git a/arch/arm/plat-s3c24xx/cpu-freq-debugfs.c b/arch/arm/mach-s3c24xx/cpufreq-debugfs.c
index c7adad0e8de0..9b7b4289d66c 100644
--- a/arch/arm/plat-s3c24xx/cpu-freq-debugfs.c
+++ b/arch/arm/mach-s3c24xx/cpufreq-debugfs.c
@@ -1,5 +1,4 @@
1/* linux/arch/arm/plat-s3c24xx/cpu-freq-debugfs.c 1/*
2 *
3 * Copyright (c) 2009 Simtec Electronics 2 * Copyright (c) 2009 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 3 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
diff --git a/arch/arm/mach-s3c2410/cpu-freq.c b/arch/arm/mach-s3c24xx/cpufreq-s3c2410.c
index 5404535da1a5..cfa0dd8723ec 100644
--- a/arch/arm/mach-s3c2410/cpu-freq.c
+++ b/arch/arm/mach-s3c24xx/cpufreq-s3c2410.c
@@ -1,5 +1,4 @@
1/* linux/arch/arm/mach-s3c2410/cpu-freq.c 1/*
2 *
3 * Copyright (c) 2006-2008 Simtec Electronics 2 * Copyright (c) 2006-2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 3 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
@@ -81,7 +80,7 @@ static int s3c2410_cpufreq_calcdivs(struct s3c_cpufreq_config *cfg)
81 cfg->divs.p_divisor = pdiv; 80 cfg->divs.p_divisor = pdiv;
82 cfg->divs.h_divisor = hdiv; 81 cfg->divs.h_divisor = hdiv;
83 82
84 return 0 ; 83 return 0;
85} 84}
86 85
87static struct s3c_cpufreq_info s3c2410_cpufreq_info = { 86static struct s3c_cpufreq_info s3c2410_cpufreq_info = {
@@ -131,7 +130,6 @@ static int __init s3c2410_cpufreq_init(void)
131{ 130{
132 return subsys_interface_register(&s3c2410_cpufreq_interface); 131 return subsys_interface_register(&s3c2410_cpufreq_interface);
133} 132}
134
135arch_initcall(s3c2410_cpufreq_init); 133arch_initcall(s3c2410_cpufreq_init);
136 134
137static int s3c2410a_cpufreq_add(struct device *dev, 135static int s3c2410a_cpufreq_add(struct device *dev,
@@ -159,5 +157,4 @@ static int __init s3c2410a_cpufreq_init(void)
159{ 157{
160 return subsys_interface_register(&s3c2410a_cpufreq_interface); 158 return subsys_interface_register(&s3c2410a_cpufreq_interface);
161} 159}
162
163arch_initcall(s3c2410a_cpufreq_init); 160arch_initcall(s3c2410a_cpufreq_init);
diff --git a/arch/arm/mach-s3c2412/cpu-freq.c b/arch/arm/mach-s3c24xx/cpufreq-s3c2412.c
index 125be7d5fa60..8bf0f3a77476 100644
--- a/arch/arm/mach-s3c2412/cpu-freq.c
+++ b/arch/arm/mach-s3c24xx/cpufreq-s3c2412.c
@@ -1,5 +1,4 @@
1/* linux/arch/arm/mach-s3c2412/cpu-freq.c 1/*
2 *
3 * Copyright 2008 Simtec Electronics 2 * Copyright 2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 3 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
@@ -26,12 +25,13 @@
26#include <asm/mach/map.h> 25#include <asm/mach/map.h>
27 26
28#include <mach/regs-clock.h> 27#include <mach/regs-clock.h>
29#include <mach/regs-s3c2412-mem.h>
30 28
31#include <plat/cpu.h> 29#include <plat/cpu.h>
32#include <plat/clock.h> 30#include <plat/clock.h>
33#include <plat/cpu-freq-core.h> 31#include <plat/cpu-freq-core.h>
34 32
33#include "s3c2412.h"
34
35/* our clock resources. */ 35/* our clock resources. */
36static struct clk *xtal; 36static struct clk *xtal;
37static struct clk *fclk; 37static struct clk *fclk;
@@ -111,7 +111,7 @@ static int s3c2412_cpufreq_calcdivs(struct s3c_cpufreq_config *cfg)
111 111
112 return 0; 112 return 0;
113 113
114 invalid: 114invalid:
115 return -EINVAL; 115 return -EINVAL;
116} 116}
117 117
@@ -255,5 +255,4 @@ static int s3c2412_cpufreq_init(void)
255{ 255{
256 return subsys_interface_register(&s3c2412_cpufreq_interface); 256 return subsys_interface_register(&s3c2412_cpufreq_interface);
257} 257}
258
259arch_initcall(s3c2412_cpufreq_init); 258arch_initcall(s3c2412_cpufreq_init);
diff --git a/arch/arm/mach-s3c2440/s3c2440-cpufreq.c b/arch/arm/mach-s3c24xx/cpufreq-s3c2440.c
index 61776764d9f4..72b2cc8a5a85 100644
--- a/arch/arm/mach-s3c2440/s3c2440-cpufreq.c
+++ b/arch/arm/mach-s3c24xx/cpufreq-s3c2440.c
@@ -1,5 +1,4 @@
1/* linux/arch/arm/plat-s3c24xx/s3c2440-cpufreq.c 1/*
2 *
3 * Copyright (c) 2006-2009 Simtec Electronics 2 * Copyright (c) 2006-2009 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 3 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
@@ -310,5 +309,4 @@ static int s3c2442_cpufreq_init(void)
310{ 309{
311 return subsys_interface_register(&s3c2442_cpufreq_interface); 310 return subsys_interface_register(&s3c2442_cpufreq_interface);
312} 311}
313
314subsys_initcall(s3c2442_cpufreq_init); 312subsys_initcall(s3c2442_cpufreq_init);
diff --git a/arch/arm/plat-s3c24xx/s3c2410-cpufreq-utils.c b/arch/arm/mach-s3c24xx/cpufreq-utils.c
index 43ea80190d87..ddd8280e3875 100644
--- a/arch/arm/plat-s3c24xx/s3c2410-cpufreq-utils.c
+++ b/arch/arm/mach-s3c24xx/cpufreq-utils.c
@@ -1,5 +1,4 @@
1/* linux/arch/arm/plat-s3c24xx/s3c2410-cpufreq-utils.c 1/*
2 *
3 * Copyright (c) 2009 Simtec Electronics 2 * Copyright (c) 2009 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 3 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
@@ -17,11 +16,12 @@
17#include <linux/io.h> 16#include <linux/io.h>
18 17
19#include <mach/map.h> 18#include <mach/map.h>
20#include <mach/regs-mem.h>
21#include <mach/regs-clock.h> 19#include <mach/regs-clock.h>
22 20
23#include <plat/cpu-freq-core.h> 21#include <plat/cpu-freq-core.h>
24 22
23#include "regs-mem.h"
24
25/** 25/**
26 * s3c2410_cpufreq_setrefresh - set SDRAM refresh value 26 * s3c2410_cpufreq_setrefresh - set SDRAM refresh value
27 * @cfg: The frequency configuration 27 * @cfg: The frequency configuration
diff --git a/arch/arm/plat-s3c24xx/cpu-freq.c b/arch/arm/mach-s3c24xx/cpufreq.c
index 468079938884..5f181e733eee 100644
--- a/arch/arm/plat-s3c24xx/cpu-freq.c
+++ b/arch/arm/mach-s3c24xx/cpufreq.c
@@ -1,5 +1,4 @@
1/* linux/arch/arm/plat-s3c24xx/cpu-freq.c 1/*
2 *
3 * Copyright (c) 2006-2008 Simtec Electronics 2 * Copyright (c) 2006-2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 3 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
diff --git a/arch/arm/mach-s3c24xx/dma-s3c2410.c b/arch/arm/mach-s3c24xx/dma-s3c2410.c
index 4803338cf56e..25d085adc93c 100644
--- a/arch/arm/mach-s3c24xx/dma-s3c2410.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2410.c
@@ -27,7 +27,6 @@
27#include <mach/regs-gpio.h> 27#include <mach/regs-gpio.h>
28#include <plat/regs-ac97.h> 28#include <plat/regs-ac97.h>
29#include <plat/regs-dma.h> 29#include <plat/regs-dma.h>
30#include <mach/regs-mem.h>
31#include <mach/regs-lcd.h> 30#include <mach/regs-lcd.h>
32#include <mach/regs-sdi.h> 31#include <mach/regs-sdi.h>
33#include <plat/regs-iis.h> 32#include <plat/regs-iis.h>
diff --git a/arch/arm/mach-s3c24xx/dma-s3c2412.c b/arch/arm/mach-s3c24xx/dma-s3c2412.c
index 38472ac920ff..d2408ba372cb 100644
--- a/arch/arm/mach-s3c24xx/dma-s3c2412.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2412.c
@@ -27,7 +27,6 @@
27#include <mach/regs-gpio.h> 27#include <mach/regs-gpio.h>
28#include <plat/regs-ac97.h> 28#include <plat/regs-ac97.h>
29#include <plat/regs-dma.h> 29#include <plat/regs-dma.h>
30#include <mach/regs-mem.h>
31#include <mach/regs-lcd.h> 30#include <mach/regs-lcd.h>
32#include <mach/regs-sdi.h> 31#include <mach/regs-sdi.h>
33#include <plat/regs-iis.h> 32#include <plat/regs-iis.h>
diff --git a/arch/arm/mach-s3c24xx/dma-s3c2440.c b/arch/arm/mach-s3c24xx/dma-s3c2440.c
index 5f0a0c8ef84f..0b86e74d104f 100644
--- a/arch/arm/mach-s3c24xx/dma-s3c2440.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2440.c
@@ -27,7 +27,6 @@
27#include <mach/regs-gpio.h> 27#include <mach/regs-gpio.h>
28#include <plat/regs-ac97.h> 28#include <plat/regs-ac97.h>
29#include <plat/regs-dma.h> 29#include <plat/regs-dma.h>
30#include <mach/regs-mem.h>
31#include <mach/regs-lcd.h> 30#include <mach/regs-lcd.h>
32#include <mach/regs-sdi.h> 31#include <mach/regs-sdi.h>
33#include <plat/regs-iis.h> 32#include <plat/regs-iis.h>
diff --git a/arch/arm/mach-s3c24xx/dma-s3c2443.c b/arch/arm/mach-s3c24xx/dma-s3c2443.c
index 2d94228d2866..05536254a3f8 100644
--- a/arch/arm/mach-s3c24xx/dma-s3c2443.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2443.c
@@ -27,7 +27,6 @@
27#include <mach/regs-gpio.h> 27#include <mach/regs-gpio.h>
28#include <plat/regs-ac97.h> 28#include <plat/regs-ac97.h>
29#include <plat/regs-dma.h> 29#include <plat/regs-dma.h>
30#include <mach/regs-mem.h>
31#include <mach/regs-lcd.h> 30#include <mach/regs-lcd.h>
32#include <mach/regs-sdi.h> 31#include <mach/regs-sdi.h>
33#include <plat/regs-iis.h> 32#include <plat/regs-iis.h>
diff --git a/arch/arm/plat-s3c24xx/dma.c b/arch/arm/mach-s3c24xx/dma.c
index ba3e76c95504..aab64909e9a3 100644
--- a/arch/arm/plat-s3c24xx/dma.c
+++ b/arch/arm/mach-s3c24xx/dma.c
@@ -1,5 +1,4 @@
1/* linux/arch/arm/plat-s3c24xx/dma.c 1/*
2 *
3 * Copyright 2003-2006 Simtec Electronics 2 * Copyright 2003-2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 3 * Ben Dooks <ben@simtec.co.uk>
5 * 4 *
diff --git a/arch/arm/mach-s3c24xx/include/mach/gta02.h b/arch/arm/mach-s3c24xx/gta02.h
index 217393482153..9430a71e9184 100644
--- a/arch/arm/mach-s3c24xx/include/mach/gta02.h
+++ b/arch/arm/mach-s3c24xx/gta02.h
@@ -1,5 +1,13 @@
1#ifndef _GTA02_H 1/*
2#define _GTA02_H 2 * GTA02 header
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_S3C24XX_GTA02_H
10#define __MACH_S3C24XX_GTA02_H __FILE__
3 11
4#include <mach/regs-gpio.h> 12#include <mach/regs-gpio.h>
5 13
@@ -12,4 +20,4 @@
12 20
13#define GTA02_IRQ_PCF50633 IRQ_EINT9 21#define GTA02_IRQ_PCF50633 IRQ_EINT9
14 22
15#endif /* _GTA02_H */ 23#endif /* __MACH_S3C24XX_GTA02_H */
diff --git a/arch/arm/mach-s3c24xx/h1940-bluetooth.c b/arch/arm/mach-s3c24xx/h1940-bluetooth.c
index 3f40c61b6e02..5b98bfd1df43 100644
--- a/arch/arm/mach-s3c24xx/h1940-bluetooth.c
+++ b/arch/arm/mach-s3c24xx/h1940-bluetooth.c
@@ -19,10 +19,10 @@
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/rfkill.h> 20#include <linux/rfkill.h>
21 21
22#include <mach/regs-gpio.h>
23#include <mach/hardware.h> 22#include <mach/hardware.h>
24#include <mach/h1940-latch.h> 23#include <mach/regs-gpio.h>
25#include <mach/h1940.h> 24
25#include "h1940.h"
26 26
27#define DRV_NAME "h1940-bt" 27#define DRV_NAME "h1940-bt"
28 28
diff --git a/arch/arm/mach-s3c24xx/include/mach/h1940-latch.h b/arch/arm/mach-s3c24xx/h1940.h
index fc897d3a056c..2950cc466840 100644
--- a/arch/arm/mach-s3c24xx/include/mach/h1940-latch.h
+++ b/arch/arm/mach-s3c24xx/h1940.h
@@ -1,20 +1,30 @@
1/* arch/arm/mach-s3c2410/include/mach/h1940-latch.h 1/*
2 * Copyright 2006 Ben Dooks <ben-linux@fluff.org>
2 * 3 *
3 * Copyright (c) 2005 Simtec Electronics 4 * Copyright (c) 2005 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 5 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 6 * Ben Dooks <ben@simtec.co.uk>
6 * 7 *
7 * iPAQ H1940 series - latch definitions 8 * iPAQ H1940 series definitions
8 * 9 *
9 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
12*/ 13*/
13 14
14#ifndef __ASM_ARCH_H1940_LATCH_H 15#ifndef __MACH_S3C24XX_H1940_H
15#define __ASM_ARCH_H1940_LATCH_H 16#define __MACH_S3C24XX_H1940_H __FILE__
16 17
17#include <asm/gpio.h> 18#define H1940_SUSPEND_CHECKSUM (0x30003ff8)
19#define H1940_SUSPEND_RESUMEAT (0x30081000)
20#define H1940_SUSPEND_CHECK (0x30080000)
21
22extern void h1940_pm_return(void);
23extern int h1940_led_blink_set(unsigned gpio, int state,
24 unsigned long *delay_on,
25 unsigned long *delay_off);
26
27#include <linux/gpio.h>
18 28
19#define H1940_LATCH_GPIO(x) (S3C_GPIO_END + (x)) 29#define H1940_LATCH_GPIO(x) (S3C_GPIO_END + (x))
20 30
@@ -40,4 +50,4 @@
40#define H1940_LATCH_LED_GREEN H1940_LATCH_GPIO(14) 50#define H1940_LATCH_LED_GREEN H1940_LATCH_GPIO(14)
41#define H1940_LATCH_LED_FLASH H1940_LATCH_GPIO(15) 51#define H1940_LATCH_LED_FLASH H1940_LATCH_GPIO(15)
42 52
43#endif /* __ASM_ARCH_H1940_LATCH_H */ 53#endif /* __MACH_S3C24XX_H1940_H */
diff --git a/arch/arm/mach-s3c24xx/include/mach/anubis-cpld.h b/arch/arm/mach-s3c24xx/include/mach/anubis-cpld.h
deleted file mode 100644
index 1b614d5a81f3..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/anubis-cpld.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/anubis-cpld.h
2 *
3 * Copyright (c) 2005 Simtec Electronics
4 * http://www.simtec.co.uk/products/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * ANUBIS - CPLD control constants
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 version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#ifndef __ASM_ARCH_ANUBISCPLD_H
15#define __ASM_ARCH_ANUBISCPLD_H
16
17/* CTRL2 - NAND WP control, IDE Reset assert/check */
18
19#define ANUBIS_CTRL1_NANDSEL (0x3)
20
21/* IDREG - revision */
22
23#define ANUBIS_IDREG_REVMASK (0x7)
24
25#endif /* __ASM_ARCH_ANUBISCPLD_H */
diff --git a/arch/arm/mach-s3c24xx/include/mach/anubis-irq.h b/arch/arm/mach-s3c24xx/include/mach/anubis-irq.h
deleted file mode 100644
index a2a328134e34..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/anubis-irq.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/anubis-irq.h
2 *
3 * Copyright (c) 2005 Simtec Electronics
4 * http://www.simtec.co.uk/products/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * ANUBIS - IRQ Number definitions
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 version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#ifndef __ASM_ARCH_ANUBISIRQ_H
15#define __ASM_ARCH_ANUBISIRQ_H
16
17#define IRQ_IDE0 IRQ_EINT2
18#define IRQ_IDE1 IRQ_EINT3
19#define IRQ_ASIX IRQ_EINT1
20
21#endif /* __ASM_ARCH_ANUBISIRQ_H */
diff --git a/arch/arm/mach-s3c24xx/include/mach/anubis-map.h b/arch/arm/mach-s3c24xx/include/mach/anubis-map.h
deleted file mode 100644
index c9deb3a5b2c3..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/anubis-map.h
+++ /dev/null
@@ -1,38 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/anubis-map.h
2 *
3 * Copyright (c) 2005 Simtec Electronics
4 * http://www.simtec.co.uk/products/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * ANUBIS - Memory map definitions
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 version 2 as
11 * published by the Free Software Foundation.
12*/
13
14/* needs arch/map.h including with this */
15
16#ifndef __ASM_ARCH_ANUBISMAP_H
17#define __ASM_ARCH_ANUBISMAP_H
18
19/* start peripherals off after the S3C2410 */
20
21#define ANUBIS_IOADDR(x) (S3C2410_ADDR((x) + 0x01800000))
22
23#define ANUBIS_PA_CPLD (S3C2410_CS1 | (1<<26))
24
25/* we put the CPLD registers next, to get them out of the way */
26
27#define ANUBIS_VA_CTRL1 ANUBIS_IOADDR(0x00000000) /* 0x01800000 */
28#define ANUBIS_PA_CTRL1 (ANUBIS_PA_CPLD)
29
30#define ANUBIS_VA_IDREG ANUBIS_IOADDR(0x00300000) /* 0x01B00000 */
31#define ANUBIS_PA_IDREG (ANUBIS_PA_CPLD + (3<<23))
32
33#define ANUBIS_IDEPRI ANUBIS_IOADDR(0x01000000)
34#define ANUBIS_IDEPRIAUX ANUBIS_IOADDR(0x01100000)
35#define ANUBIS_IDESEC ANUBIS_IOADDR(0x01200000)
36#define ANUBIS_IDESECAUX ANUBIS_IOADDR(0x01300000)
37
38#endif /* __ASM_ARCH_ANUBISMAP_H */
diff --git a/arch/arm/mach-s3c24xx/include/mach/bast-cpld.h b/arch/arm/mach-s3c24xx/include/mach/bast-cpld.h
deleted file mode 100644
index bee2a7a932a0..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/bast-cpld.h
+++ /dev/null
@@ -1,53 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/bast-cpld.h
2 *
3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * BAST - CPLD control constants
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_BASTCPLD_H
14#define __ASM_ARCH_BASTCPLD_H
15
16/* CTRL1 - Audio LR routing */
17
18#define BAST_CPLD_CTRL1_LRCOFF (0x00)
19#define BAST_CPLD_CTRL1_LRCADC (0x01)
20#define BAST_CPLD_CTRL1_LRCDAC (0x02)
21#define BAST_CPLD_CTRL1_LRCARM (0x03)
22#define BAST_CPLD_CTRL1_LRMASK (0x03)
23
24/* CTRL2 - NAND WP control, IDE Reset assert/check */
25
26#define BAST_CPLD_CTRL2_WNAND (0x04)
27#define BAST_CPLD_CTLR2_IDERST (0x08)
28
29/* CTRL3 - rom write control, CPLD identity */
30
31#define BAST_CPLD_CTRL3_IDMASK (0x0e)
32#define BAST_CPLD_CTRL3_ROMWEN (0x01)
33
34/* CTRL4 - 8bit LCD interface control/status */
35
36#define BAST_CPLD_CTRL4_LLAT (0x01)
37#define BAST_CPLD_CTRL4_LCDRW (0x02)
38#define BAST_CPLD_CTRL4_LCDCMD (0x04)
39#define BAST_CPLD_CTRL4_LCDE2 (0x01)
40
41/* CTRL5 - DMA routing */
42
43#define BAST_CPLD_DMA0_PRIIDE (0<<0)
44#define BAST_CPLD_DMA0_SECIDE (1<<0)
45#define BAST_CPLD_DMA0_ISA15 (2<<0)
46#define BAST_CPLD_DMA0_ISA36 (3<<0)
47
48#define BAST_CPLD_DMA1_PRIIDE (0<<2)
49#define BAST_CPLD_DMA1_SECIDE (1<<2)
50#define BAST_CPLD_DMA1_ISA15 (2<<2)
51#define BAST_CPLD_DMA1_ISA36 (3<<2)
52
53#endif /* __ASM_ARCH_BASTCPLD_H */
diff --git a/arch/arm/mach-s3c24xx/include/mach/bast-irq.h b/arch/arm/mach-s3c24xx/include/mach/bast-irq.h
deleted file mode 100644
index cac428c42e7f..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/bast-irq.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/bast-irq.h
2 *
3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Machine BAST - IRQ Number 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_BASTIRQ_H
14#define __ASM_ARCH_BASTIRQ_H
15
16/* irq numbers to onboard peripherals */
17
18#define IRQ_USBOC IRQ_EINT18
19#define IRQ_IDE0 IRQ_EINT16
20#define IRQ_IDE1 IRQ_EINT17
21#define IRQ_PCSERIAL1 IRQ_EINT15
22#define IRQ_PCSERIAL2 IRQ_EINT14
23#define IRQ_PCPARALLEL IRQ_EINT13
24#define IRQ_ASIX IRQ_EINT11
25#define IRQ_DM9000 IRQ_EINT10
26#define IRQ_ISA IRQ_EINT9
27#define IRQ_SMALERT IRQ_EINT8
28
29#endif /* __ASM_ARCH_BASTIRQ_H */
diff --git a/arch/arm/mach-s3c24xx/include/mach/bast-map.h b/arch/arm/mach-s3c24xx/include/mach/bast-map.h
deleted file mode 100644
index eecea2a50f8f..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/bast-map.h
+++ /dev/null
@@ -1,146 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/bast-map.h
2 *
3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Machine BAST - 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/* needs arch/map.h including with this */
14
15/* ok, we've used up to 0x13000000, now we need to find space for the
16 * peripherals that live in the nGCS[x] areas, which are quite numerous
17 * in their space. We also have the board's CPLD to find register space
18 * for.
19 */
20
21#ifndef __ASM_ARCH_BASTMAP_H
22#define __ASM_ARCH_BASTMAP_H
23
24#define BAST_IOADDR(x) (S3C2410_ADDR((x) + 0x01300000))
25
26/* we put the CPLD registers next, to get them out of the way */
27
28#define BAST_VA_CTRL1 BAST_IOADDR(0x00000000) /* 0x01300000 */
29#define BAST_PA_CTRL1 (S3C2410_CS5 | 0x7800000)
30
31#define BAST_VA_CTRL2 BAST_IOADDR(0x00100000) /* 0x01400000 */
32#define BAST_PA_CTRL2 (S3C2410_CS1 | 0x6000000)
33
34#define BAST_VA_CTRL3 BAST_IOADDR(0x00200000) /* 0x01500000 */
35#define BAST_PA_CTRL3 (S3C2410_CS1 | 0x6800000)
36
37#define BAST_VA_CTRL4 BAST_IOADDR(0x00300000) /* 0x01600000 */
38#define BAST_PA_CTRL4 (S3C2410_CS1 | 0x7000000)
39
40/* next, we have the PC104 ISA interrupt registers */
41
42#define BAST_PA_PC104_IRQREQ (S3C2410_CS5 | 0x6000000) /* 0x01700000 */
43#define BAST_VA_PC104_IRQREQ BAST_IOADDR(0x00400000)
44
45#define BAST_PA_PC104_IRQRAW (S3C2410_CS5 | 0x6800000) /* 0x01800000 */
46#define BAST_VA_PC104_IRQRAW BAST_IOADDR(0x00500000)
47
48#define BAST_PA_PC104_IRQMASK (S3C2410_CS5 | 0x7000000) /* 0x01900000 */
49#define BAST_VA_PC104_IRQMASK BAST_IOADDR(0x00600000)
50
51#define BAST_PA_LCD_RCMD1 (0x8800000)
52#define BAST_VA_LCD_RCMD1 BAST_IOADDR(0x00700000)
53
54#define BAST_PA_LCD_WCMD1 (0x8000000)
55#define BAST_VA_LCD_WCMD1 BAST_IOADDR(0x00800000)
56
57#define BAST_PA_LCD_RDATA1 (0x9800000)
58#define BAST_VA_LCD_RDATA1 BAST_IOADDR(0x00900000)
59
60#define BAST_PA_LCD_WDATA1 (0x9000000)
61#define BAST_VA_LCD_WDATA1 BAST_IOADDR(0x00A00000)
62
63#define BAST_PA_LCD_RCMD2 (0xA800000)
64#define BAST_VA_LCD_RCMD2 BAST_IOADDR(0x00B00000)
65
66#define BAST_PA_LCD_WCMD2 (0xA000000)
67#define BAST_VA_LCD_WCMD2 BAST_IOADDR(0x00C00000)
68
69#define BAST_PA_LCD_RDATA2 (0xB800000)
70#define BAST_VA_LCD_RDATA2 BAST_IOADDR(0x00D00000)
71
72#define BAST_PA_LCD_WDATA2 (0xB000000)
73#define BAST_VA_LCD_WDATA2 BAST_IOADDR(0x00E00000)
74
75
76/* 0xE0000000 contains the IO space that is split by speed and
77 * whether the access is for 8 or 16bit IO... this ensures that
78 * the correct access is made
79 *
80 * 0x10000000 of space, partitioned as so:
81 *
82 * 0x00000000 to 0x04000000 8bit, slow
83 * 0x04000000 to 0x08000000 16bit, slow
84 * 0x08000000 to 0x0C000000 16bit, net
85 * 0x0C000000 to 0x10000000 16bit, fast
86 *
87 * each of these spaces has the following in:
88 *
89 * 0x00000000 to 0x01000000 16MB ISA IO space
90 * 0x01000000 to 0x02000000 16MB ISA memory space
91 * 0x02000000 to 0x02100000 1MB IDE primary channel
92 * 0x02100000 to 0x02200000 1MB IDE primary channel aux
93 * 0x02200000 to 0x02400000 1MB IDE secondary channel
94 * 0x02300000 to 0x02400000 1MB IDE secondary channel aux
95 * 0x02400000 to 0x02500000 1MB ASIX ethernet controller
96 * 0x02500000 to 0x02600000 1MB Davicom DM9000 ethernet controller
97 * 0x02600000 to 0x02700000 1MB PC SuperIO controller
98 *
99 * the phyiscal layout of the zones are:
100 * nGCS2 - 8bit, slow
101 * nGCS3 - 16bit, slow
102 * nGCS4 - 16bit, net
103 * nGCS5 - 16bit, fast
104 */
105
106#define BAST_VA_MULTISPACE (0xE0000000)
107
108#define BAST_VA_ISAIO (BAST_VA_MULTISPACE + 0x00000000)
109#define BAST_VA_ISAMEM (BAST_VA_MULTISPACE + 0x01000000)
110#define BAST_VA_IDEPRI (BAST_VA_MULTISPACE + 0x02000000)
111#define BAST_VA_IDEPRIAUX (BAST_VA_MULTISPACE + 0x02100000)
112#define BAST_VA_IDESEC (BAST_VA_MULTISPACE + 0x02200000)
113#define BAST_VA_IDESECAUX (BAST_VA_MULTISPACE + 0x02300000)
114#define BAST_VA_ASIXNET (BAST_VA_MULTISPACE + 0x02400000)
115#define BAST_VA_DM9000 (BAST_VA_MULTISPACE + 0x02500000)
116#define BAST_VA_SUPERIO (BAST_VA_MULTISPACE + 0x02600000)
117
118#define BAST_VA_MULTISPACE (0xE0000000)
119
120#define BAST_VAM_CS2 (0x00000000)
121#define BAST_VAM_CS3 (0x04000000)
122#define BAST_VAM_CS4 (0x08000000)
123#define BAST_VAM_CS5 (0x0C000000)
124
125/* physical offset addresses for the peripherals */
126
127#define BAST_PA_ISAIO (0x00000000)
128#define BAST_PA_ASIXNET (0x01000000)
129#define BAST_PA_SUPERIO (0x01800000)
130#define BAST_PA_IDEPRI (0x02000000)
131#define BAST_PA_IDEPRIAUX (0x02800000)
132#define BAST_PA_IDESEC (0x03000000)
133#define BAST_PA_IDESECAUX (0x03800000)
134#define BAST_PA_ISAMEM (0x04000000)
135#define BAST_PA_DM9000 (0x05000000)
136
137/* some configurations for the peripherals */
138
139#define BAST_PCSIO (BAST_VA_SUPERIO + BAST_VAM_CS2)
140/* */
141
142#define BAST_ASIXNET_CS BAST_VAM_CS5
143#define BAST_IDE_CS BAST_VAM_CS5
144#define BAST_DM9000_CS BAST_VAM_CS4
145
146#endif /* __ASM_ARCH_BASTMAP_H */
diff --git a/arch/arm/mach-s3c24xx/include/mach/debug-macro.S b/arch/arm/mach-s3c24xx/include/mach/debug-macro.S
index 4135de87d1f7..13ed33c69113 100644
--- a/arch/arm/mach-s3c24xx/include/mach/debug-macro.S
+++ b/arch/arm/mach-s3c24xx/include/mach/debug-macro.S
@@ -40,17 +40,17 @@
40 addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART) 40 addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART)
41 addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART) 41 addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART)
42 bic \rd, \rd, #0xff000 42 bic \rd, \rd, #0xff000
43 ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ] 43 ldr \rd, [\rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0)]
44 and \rd, \rd, #0x00ff0000 44 and \rd, \rd, #0x00ff0000
45 teq \rd, #0x00440000 @ is it 2440? 45 teq \rd, #0x00440000 @ is it 2440?
461004: 461004:
47 ldr \rd, [ \rx, # S3C2410_UFSTAT ] 47 ldr \rd, [\rx, # S3C2410_UFSTAT]
48 moveq \rd, \rd, lsr #SHIFT_2440TXF 48 moveq \rd, \rd, lsr #SHIFT_2440TXF
49 tst \rd, #S3C2410_UFSTAT_TXFULL 49 tst \rd, #S3C2410_UFSTAT_TXFULL
50 .endm 50 .endm
51 51
52 .macro fifo_full_s3c2410 rd, rx 52 .macro fifo_full_s3c2410 rd, rx
53 ldr \rd, [ \rx, # S3C2410_UFSTAT ] 53 ldr \rd, [\rx, # S3C2410_UFSTAT]
54 tst \rd, #S3C2410_UFSTAT_TXFULL 54 tst \rd, #S3C2410_UFSTAT_TXFULL
55 .endm 55 .endm
56 56
@@ -68,18 +68,18 @@
68 addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART) 68 addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART)
69 addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART) 69 addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART)
70 bic \rd, \rd, #0xff000 70 bic \rd, \rd, #0xff000
71 ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ] 71 ldr \rd, [\rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0)]
72 and \rd, \rd, #0x00ff0000 72 and \rd, \rd, #0x00ff0000
73 teq \rd, #0x00440000 @ is it 2440? 73 teq \rd, #0x00440000 @ is it 2440?
74 74
7510000: 7510000:
76 ldr \rd, [ \rx, # S3C2410_UFSTAT ] 76 ldr \rd, [\rx, # S3C2410_UFSTAT]
77 andne \rd, \rd, #S3C2410_UFSTAT_TXMASK 77 andne \rd, \rd, #S3C2410_UFSTAT_TXMASK
78 andeq \rd, \rd, #S3C2440_UFSTAT_TXMASK 78 andeq \rd, \rd, #S3C2440_UFSTAT_TXMASK
79 .endm 79 .endm
80 80
81 .macro fifo_level_s3c2410 rd, rx 81 .macro fifo_level_s3c2410 rd, rx
82 ldr \rd, [ \rx, # S3C2410_UFSTAT ] 82 ldr \rd, [\rx, # S3C2410_UFSTAT]
83 and \rd, \rd, #S3C2410_UFSTAT_TXMASK 83 and \rd, \rd, #S3C2410_UFSTAT_TXMASK
84 .endm 84 .endm
85 85
diff --git a/arch/arm/mach-s3c24xx/include/mach/entry-macro.S b/arch/arm/mach-s3c24xx/include/mach/entry-macro.S
index 7615a14773fa..6a21beeba1da 100644
--- a/arch/arm/mach-s3c24xx/include/mach/entry-macro.S
+++ b/arch/arm/mach-s3c24xx/include/mach/entry-macro.S
@@ -31,10 +31,10 @@
31 31
32 @@ try the interrupt offset register, since it is there 32 @@ try the interrupt offset register, since it is there
33 33
34 ldr \irqstat, [ \base, #INTPND ] 34 ldr \irqstat, [\base, #INTPND ]
35 teq \irqstat, #0 35 teq \irqstat, #0
36 beq 1002f 36 beq 1002f
37 ldr \irqnr, [ \base, #INTOFFSET ] 37 ldr \irqnr, [\base, #INTOFFSET ]
38 mov \tmp, #1 38 mov \tmp, #1
39 tst \irqstat, \tmp, lsl \irqnr 39 tst \irqstat, \tmp, lsl \irqnr
40 bne 1001f 40 bne 1001f
diff --git a/arch/arm/mach-s3c24xx/include/mach/gpio-fns.h b/arch/arm/mach-s3c24xx/include/mach/gpio-fns.h
deleted file mode 100644
index c53ad34c6579..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/gpio-fns.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <plat/gpio-fns.h>
diff --git a/arch/arm/mach-s3c24xx/include/mach/gpio-nrs.h b/arch/arm/mach-s3c24xx/include/mach/gpio-nrs.h
deleted file mode 100644
index 3890a05948fb..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/gpio-nrs.h
+++ /dev/null
@@ -1,97 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/gpio-nrs.h
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C2410 - GPIO bank numbering
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 version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#ifndef __MACH_GPIONRS_H
15#define __MACH_GPIONRS_H
16
17#define S3C2410_GPIONO(bank,offset) ((bank) + (offset))
18
19#define S3C2410_GPIO_BANKG (32*6)
20#define S3C2410_GPIO_BANKH (32*7)
21
22/* GPIO sizes for various SoCs:
23 *
24 * 2442
25 * 2410 2412 2440 2443 2416
26 * ---- ---- ---- ---- ----
27 * A 23 22 25 16 25
28 * B 11 11 11 11 9
29 * C 16 15 16 16 16
30 * D 16 16 16 16 16
31 * E 16 16 16 16 16
32 * F 8 8 8 8 8
33 * G 16 16 16 16 8
34 * H 11 11 9 15 15
35 * J -- -- 13 16 --
36 * K -- -- -- -- 16
37 * L -- -- -- 15 7
38 * M -- -- -- 2 2
39 */
40
41/* GPIO bank sizes */
42#define S3C2410_GPIO_A_NR (32)
43#define S3C2410_GPIO_B_NR (32)
44#define S3C2410_GPIO_C_NR (32)
45#define S3C2410_GPIO_D_NR (32)
46#define S3C2410_GPIO_E_NR (32)
47#define S3C2410_GPIO_F_NR (32)
48#define S3C2410_GPIO_G_NR (32)
49#define S3C2410_GPIO_H_NR (32)
50#define S3C2410_GPIO_J_NR (32) /* technically 16. */
51#define S3C2410_GPIO_K_NR (32) /* technically 16. */
52#define S3C2410_GPIO_L_NR (32) /* technically 15. */
53#define S3C2410_GPIO_M_NR (32) /* technically 2. */
54
55#if CONFIG_S3C_GPIO_SPACE != 0
56#error CONFIG_S3C_GPIO_SPACE cannot be nonzero at the moment
57#endif
58
59#define S3C2410_GPIO_NEXT(__gpio) \
60 ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 0)
61
62#ifndef __ASSEMBLY__
63
64enum s3c_gpio_number {
65 S3C2410_GPIO_A_START = 0,
66 S3C2410_GPIO_B_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_A),
67 S3C2410_GPIO_C_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_B),
68 S3C2410_GPIO_D_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_C),
69 S3C2410_GPIO_E_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_D),
70 S3C2410_GPIO_F_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_E),
71 S3C2410_GPIO_G_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_F),
72 S3C2410_GPIO_H_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_G),
73 S3C2410_GPIO_J_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_H),
74 S3C2410_GPIO_K_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_J),
75 S3C2410_GPIO_L_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_K),
76 S3C2410_GPIO_M_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_L),
77};
78
79#endif /* __ASSEMBLY__ */
80
81/* S3C2410 GPIO number definitions. */
82
83#define S3C2410_GPA(_nr) (S3C2410_GPIO_A_START + (_nr))
84#define S3C2410_GPB(_nr) (S3C2410_GPIO_B_START + (_nr))
85#define S3C2410_GPC(_nr) (S3C2410_GPIO_C_START + (_nr))
86#define S3C2410_GPD(_nr) (S3C2410_GPIO_D_START + (_nr))
87#define S3C2410_GPE(_nr) (S3C2410_GPIO_E_START + (_nr))
88#define S3C2410_GPF(_nr) (S3C2410_GPIO_F_START + (_nr))
89#define S3C2410_GPG(_nr) (S3C2410_GPIO_G_START + (_nr))
90#define S3C2410_GPH(_nr) (S3C2410_GPIO_H_START + (_nr))
91#define S3C2410_GPJ(_nr) (S3C2410_GPIO_J_START + (_nr))
92#define S3C2410_GPK(_nr) (S3C2410_GPIO_K_START + (_nr))
93#define S3C2410_GPL(_nr) (S3C2410_GPIO_L_START + (_nr))
94#define S3C2410_GPM(_nr) (S3C2410_GPIO_M_START + (_nr))
95
96#endif /* __MACH_GPIONRS_H */
97
diff --git a/arch/arm/mach-s3c24xx/include/mach/gpio-track.h b/arch/arm/mach-s3c24xx/include/mach/gpio-track.h
deleted file mode 100644
index c410a078622c..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/gpio-track.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/* arch/arm/mach-s3c24100/include/mach/gpio-core.h
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C2410 - GPIO core support
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#ifndef __ASM_ARCH_GPIO_CORE_H
16#define __ASM_ARCH_GPIO_CORE_H __FILE__
17
18#include <mach/regs-gpio.h>
19
20extern struct samsung_gpio_chip s3c24xx_gpios[];
21
22static inline struct samsung_gpio_chip *samsung_gpiolib_getchip(unsigned int pin)
23{
24 struct samsung_gpio_chip *chip;
25
26 if (pin > S3C_GPIO_END)
27 return NULL;
28
29 chip = &s3c24xx_gpios[pin/32];
30 return ((pin - chip->chip.base) < chip->chip.ngpio) ? chip : NULL;
31}
32
33#endif /* __ASM_ARCH_GPIO_CORE_H */
diff --git a/arch/arm/mach-s3c24xx/include/mach/gpio.h b/arch/arm/mach-s3c24xx/include/mach/gpio.h
index 6fac70f3484e..14591563ca70 100644
--- a/arch/arm/mach-s3c24xx/include/mach/gpio.h
+++ b/arch/arm/mach-s3c24xx/include/mach/gpio.h
@@ -1,5 +1,4 @@
1/* arch/arm/mach-s3c2410/include/mach/gpio.h 1/*
2 *
3 * Copyright (c) 2008 Simtec Electronics 2 * Copyright (c) 2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 3 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
@@ -15,6 +14,9 @@
15 * devices that need GPIO. 14 * devices that need GPIO.
16 */ 15 */
17 16
17#ifndef __MACH_GPIO_H
18#define __MACH_GPIO_H __FILE__
19
18#ifdef CONFIG_CPU_S3C244X 20#ifdef CONFIG_CPU_S3C244X
19#define ARCH_NR_GPIOS (32 * 9 + CONFIG_S3C24XX_GPIO_EXTRA) 21#define ARCH_NR_GPIOS (32 * 9 + CONFIG_S3C24XX_GPIO_EXTRA)
20#elif defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2416) 22#elif defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2416)
@@ -23,8 +25,83 @@
23#define ARCH_NR_GPIOS (256 + CONFIG_S3C24XX_GPIO_EXTRA) 25#define ARCH_NR_GPIOS (256 + CONFIG_S3C24XX_GPIO_EXTRA)
24#endif 26#endif
25 27
26#include <mach/gpio-nrs.h> 28/*
27#include <mach/gpio-fns.h> 29 * GPIO sizes for various SoCs:
30 *
31 * 2410 2412 2440 2443 2416
32 * 2442
33 * ---- ---- ---- ---- ----
34 * A 23 22 25 16 25
35 * B 11 11 11 11 9
36 * C 16 15 16 16 16
37 * D 16 16 16 16 16
38 * E 16 16 16 16 16
39 * F 8 8 8 8 8
40 * G 16 16 16 16 8
41 * H 11 11 9 15 15
42 * J -- -- 13 16 --
43 * K -- -- -- -- 16
44 * L -- -- -- 15 7
45 * M -- -- -- 2 2
46 */
47
48/* GPIO bank sizes */
49
50#define S3C2410_GPIO_A_NR (32)
51#define S3C2410_GPIO_B_NR (32)
52#define S3C2410_GPIO_C_NR (32)
53#define S3C2410_GPIO_D_NR (32)
54#define S3C2410_GPIO_E_NR (32)
55#define S3C2410_GPIO_F_NR (32)
56#define S3C2410_GPIO_G_NR (32)
57#define S3C2410_GPIO_H_NR (32)
58#define S3C2410_GPIO_J_NR (32) /* technically 16. */
59#define S3C2410_GPIO_K_NR (32) /* technically 16. */
60#define S3C2410_GPIO_L_NR (32) /* technically 15. */
61#define S3C2410_GPIO_M_NR (32) /* technically 2. */
62
63#if CONFIG_S3C_GPIO_SPACE != 0
64#error CONFIG_S3C_GPIO_SPACE cannot be nonzero at the moment
65#endif
66
67#define S3C2410_GPIO_NEXT(__gpio) \
68 ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 0)
69
70#ifndef __ASSEMBLY__
71
72enum s3c_gpio_number {
73 S3C2410_GPIO_A_START = 0,
74 S3C2410_GPIO_B_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_A),
75 S3C2410_GPIO_C_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_B),
76 S3C2410_GPIO_D_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_C),
77 S3C2410_GPIO_E_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_D),
78 S3C2410_GPIO_F_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_E),
79 S3C2410_GPIO_G_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_F),
80 S3C2410_GPIO_H_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_G),
81 S3C2410_GPIO_J_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_H),
82 S3C2410_GPIO_K_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_J),
83 S3C2410_GPIO_L_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_K),
84 S3C2410_GPIO_M_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_L),
85};
86
87#endif /* __ASSEMBLY__ */
88
89/* S3C2410 GPIO number definitions. */
90
91#define S3C2410_GPA(_nr) (S3C2410_GPIO_A_START + (_nr))
92#define S3C2410_GPB(_nr) (S3C2410_GPIO_B_START + (_nr))
93#define S3C2410_GPC(_nr) (S3C2410_GPIO_C_START + (_nr))
94#define S3C2410_GPD(_nr) (S3C2410_GPIO_D_START + (_nr))
95#define S3C2410_GPE(_nr) (S3C2410_GPIO_E_START + (_nr))
96#define S3C2410_GPF(_nr) (S3C2410_GPIO_F_START + (_nr))
97#define S3C2410_GPG(_nr) (S3C2410_GPIO_G_START + (_nr))
98#define S3C2410_GPH(_nr) (S3C2410_GPIO_H_START + (_nr))
99#define S3C2410_GPJ(_nr) (S3C2410_GPIO_J_START + (_nr))
100#define S3C2410_GPK(_nr) (S3C2410_GPIO_K_START + (_nr))
101#define S3C2410_GPL(_nr) (S3C2410_GPIO_L_START + (_nr))
102#define S3C2410_GPM(_nr) (S3C2410_GPIO_M_START + (_nr))
103
104#include <plat/gpio-cfg.h>
28 105
29#ifdef CONFIG_CPU_S3C244X 106#ifdef CONFIG_CPU_S3C244X
30#define S3C_GPIO_END (S3C2410_GPJ(0) + 32) 107#define S3C_GPIO_END (S3C2410_GPJ(0) + 32)
@@ -33,3 +110,5 @@
33#else 110#else
34#define S3C_GPIO_END (S3C2410_GPH(0) + 32) 111#define S3C_GPIO_END (S3C2410_GPH(0) + 32)
35#endif 112#endif
113
114#endif /* __MACH_GPIO_H */
diff --git a/arch/arm/mach-s3c24xx/include/mach/h1940.h b/arch/arm/mach-s3c24xx/include/mach/h1940.h
deleted file mode 100644
index 2aa683c8d3d6..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/h1940.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/h1940.h
2 *
3 * Copyright 2006 Ben Dooks <ben-linux@fluff.org>
4 *
5 * H1940 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#ifndef __ASM_ARCH_H1940_H
13#define __ASM_ARCH_H1940_H
14
15#define H1940_SUSPEND_CHECKSUM (0x30003ff8)
16#define H1940_SUSPEND_RESUMEAT (0x30081000)
17#define H1940_SUSPEND_CHECK (0x30080000)
18
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
23
24#endif /* __ASM_ARCH_H1940_H */
diff --git a/arch/arm/mach-s3c24xx/include/mach/hardware.h b/arch/arm/mach-s3c24xx/include/mach/hardware.h
index aef5631eac58..a6cc14a092fc 100644
--- a/arch/arm/mach-s3c24xx/include/mach/hardware.h
+++ b/arch/arm/mach-s3c24xx/include/mach/hardware.h
@@ -23,12 +23,6 @@ extern int s3c2440_set_dsc(unsigned int pin, unsigned int value);
23 23
24#endif /* CONFIG_CPU_S3C2440 */ 24#endif /* CONFIG_CPU_S3C2440 */
25 25
26#ifdef CONFIG_CPU_S3C2412
27
28extern int s3c2412_gpio_set_sleepcfg(unsigned int pin, unsigned int state);
29
30#endif /* CONFIG_CPU_S3C2412 */
31
32#endif /* __ASSEMBLY__ */ 26#endif /* __ASSEMBLY__ */
33 27
34#include <asm/sizes.h> 28#include <asm/sizes.h>
diff --git a/arch/arm/mach-s3c24xx/include/mach/idle.h b/arch/arm/mach-s3c24xx/include/mach/idle.h
deleted file mode 100644
index e9ddd706b16e..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/idle.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/idle.h
2 *
3 * Copyright (c) 2004 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
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 * S3C2410 CPU Idle controls
11*/
12
13#ifndef __ASM_ARCH_IDLE_H
14#define __ASM_ARCH_IDLE_H __FILE__
15
16/* This allows the over-ride of the default idle code, in case there
17 * is any other things to be done over idle (like DVS)
18*/
19
20extern void (*s3c24xx_idle)(void);
21
22extern void s3c24xx_default_idle(void);
23
24#endif /* __ASM_ARCH_IDLE_H */
diff --git a/arch/arm/mach-s3c24xx/include/mach/osiris-cpld.h b/arch/arm/mach-s3c24xx/include/mach/osiris-cpld.h
deleted file mode 100644
index e9e36b0abbac..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/osiris-cpld.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/osiris-cpld.h
2 *
3 * Copyright 2005 Simtec Electronics
4 * http://www.simtec.co.uk/products/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * OSIRIS - CPLD control constants
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 version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#ifndef __ASM_ARCH_OSIRISCPLD_H
15#define __ASM_ARCH_OSIRISCPLD_H
16
17/* CTRL0 - NAND WP control */
18
19#define OSIRIS_CTRL0_NANDSEL (0x3)
20#define OSIRIS_CTRL0_BOOT_INT (1<<3)
21#define OSIRIS_CTRL0_PCMCIA (1<<4)
22#define OSIRIS_CTRL0_FIX8 (1<<5)
23#define OSIRIS_CTRL0_PCMCIA_nWAIT (1<<6)
24#define OSIRIS_CTRL0_PCMCIA_nIOIS16 (1<<7)
25
26#define OSIRIS_CTRL1_FIX8 (1<<0)
27
28#define OSIRIS_ID_REVMASK (0x7)
29
30#endif /* __ASM_ARCH_OSIRISCPLD_H */
diff --git a/arch/arm/mach-s3c24xx/include/mach/regs-gpio.h b/arch/arm/mach-s3c24xx/include/mach/regs-gpio.h
index a11a638bd599..c2ef016032ab 100644
--- a/arch/arm/mach-s3c24xx/include/mach/regs-gpio.h
+++ b/arch/arm/mach-s3c24xx/include/mach/regs-gpio.h
@@ -14,8 +14,6 @@
14#ifndef __ASM_ARCH_REGS_GPIO_H 14#ifndef __ASM_ARCH_REGS_GPIO_H
15#define __ASM_ARCH_REGS_GPIO_H 15#define __ASM_ARCH_REGS_GPIO_H
16 16
17#include <mach/gpio-nrs.h>
18
19#define S3C24XX_MISCCR S3C24XX_GPIOREG2(0x80) 17#define S3C24XX_MISCCR S3C24XX_GPIOREG2(0x80)
20 18
21/* general configuration options */ 19/* general configuration options */
diff --git a/arch/arm/mach-s3c24xx/include/mach/regs-mem.h b/arch/arm/mach-s3c24xx/include/mach/regs-mem.h
deleted file mode 100644
index e0c67b0163d8..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/regs-mem.h
+++ /dev/null
@@ -1,202 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/regs-mem.h
2 *
3 * Copyright (c) 2004 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
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 * S3C2410 Memory Control register definitions
11*/
12
13#ifndef __ASM_ARM_MEMREGS_H
14#define __ASM_ARM_MEMREGS_H
15
16#ifndef S3C2410_MEMREG
17#define S3C2410_MEMREG(x) (S3C24XX_VA_MEMCTRL + (x))
18#endif
19
20/* bus width, and wait state control */
21#define S3C2410_BWSCON S3C2410_MEMREG(0x0000)
22
23/* bank zero config - note, pinstrapped from OM pins! */
24#define S3C2410_BWSCON_DW0_16 (1<<1)
25#define S3C2410_BWSCON_DW0_32 (2<<1)
26
27/* bank one configs */
28#define S3C2410_BWSCON_DW1_8 (0<<4)
29#define S3C2410_BWSCON_DW1_16 (1<<4)
30#define S3C2410_BWSCON_DW1_32 (2<<4)
31#define S3C2410_BWSCON_WS1 (1<<6)
32#define S3C2410_BWSCON_ST1 (1<<7)
33
34/* bank 2 configurations */
35#define S3C2410_BWSCON_DW2_8 (0<<8)
36#define S3C2410_BWSCON_DW2_16 (1<<8)
37#define S3C2410_BWSCON_DW2_32 (2<<8)
38#define S3C2410_BWSCON_WS2 (1<<10)
39#define S3C2410_BWSCON_ST2 (1<<11)
40
41/* bank 3 configurations */
42#define S3C2410_BWSCON_DW3_8 (0<<12)
43#define S3C2410_BWSCON_DW3_16 (1<<12)
44#define S3C2410_BWSCON_DW3_32 (2<<12)
45#define S3C2410_BWSCON_WS3 (1<<14)
46#define S3C2410_BWSCON_ST3 (1<<15)
47
48/* bank 4 configurations */
49#define S3C2410_BWSCON_DW4_8 (0<<16)
50#define S3C2410_BWSCON_DW4_16 (1<<16)
51#define S3C2410_BWSCON_DW4_32 (2<<16)
52#define S3C2410_BWSCON_WS4 (1<<18)
53#define S3C2410_BWSCON_ST4 (1<<19)
54
55/* bank 5 configurations */
56#define S3C2410_BWSCON_DW5_8 (0<<20)
57#define S3C2410_BWSCON_DW5_16 (1<<20)
58#define S3C2410_BWSCON_DW5_32 (2<<20)
59#define S3C2410_BWSCON_WS5 (1<<22)
60#define S3C2410_BWSCON_ST5 (1<<23)
61
62/* bank 6 configurations */
63#define S3C2410_BWSCON_DW6_8 (0<<24)
64#define S3C2410_BWSCON_DW6_16 (1<<24)
65#define S3C2410_BWSCON_DW6_32 (2<<24)
66#define S3C2410_BWSCON_WS6 (1<<26)
67#define S3C2410_BWSCON_ST6 (1<<27)
68
69/* bank 7 configurations */
70#define S3C2410_BWSCON_DW7_8 (0<<28)
71#define S3C2410_BWSCON_DW7_16 (1<<28)
72#define S3C2410_BWSCON_DW7_32 (2<<28)
73#define S3C2410_BWSCON_WS7 (1<<30)
74#define S3C2410_BWSCON_ST7 (1<<31)
75
76/* accesor functions for getting BANK(n) configuration. (n != 0) */
77
78#define S3C2410_BWSCON_GET(_bwscon, _bank) (((_bwscon) >> ((_bank) * 4)) & 0xf)
79
80#define S3C2410_BWSCON_DW8 (0)
81#define S3C2410_BWSCON_DW16 (1)
82#define S3C2410_BWSCON_DW32 (2)
83#define S3C2410_BWSCON_WS (1 << 2)
84#define S3C2410_BWSCON_ST (1 << 3)
85
86/* memory set (rom, ram) */
87#define S3C2410_BANKCON0 S3C2410_MEMREG(0x0004)
88#define S3C2410_BANKCON1 S3C2410_MEMREG(0x0008)
89#define S3C2410_BANKCON2 S3C2410_MEMREG(0x000C)
90#define S3C2410_BANKCON3 S3C2410_MEMREG(0x0010)
91#define S3C2410_BANKCON4 S3C2410_MEMREG(0x0014)
92#define S3C2410_BANKCON5 S3C2410_MEMREG(0x0018)
93#define S3C2410_BANKCON6 S3C2410_MEMREG(0x001C)
94#define S3C2410_BANKCON7 S3C2410_MEMREG(0x0020)
95
96/* bank configuration registers */
97
98#define S3C2410_BANKCON_PMCnorm (0x00)
99#define S3C2410_BANKCON_PMC4 (0x01)
100#define S3C2410_BANKCON_PMC8 (0x02)
101#define S3C2410_BANKCON_PMC16 (0x03)
102
103/* bank configurations for banks 0..7, note banks
104 * 6 and 7 have different configurations depending on
105 * the memory type bits */
106
107#define S3C2410_BANKCON_Tacp2 (0x0 << 2)
108#define S3C2410_BANKCON_Tacp3 (0x1 << 2)
109#define S3C2410_BANKCON_Tacp4 (0x2 << 2)
110#define S3C2410_BANKCON_Tacp6 (0x3 << 2)
111#define S3C2410_BANKCON_Tacp_SHIFT (2)
112
113#define S3C2410_BANKCON_Tcah0 (0x0 << 4)
114#define S3C2410_BANKCON_Tcah1 (0x1 << 4)
115#define S3C2410_BANKCON_Tcah2 (0x2 << 4)
116#define S3C2410_BANKCON_Tcah4 (0x3 << 4)
117#define S3C2410_BANKCON_Tcah_SHIFT (4)
118
119#define S3C2410_BANKCON_Tcoh0 (0x0 << 6)
120#define S3C2410_BANKCON_Tcoh1 (0x1 << 6)
121#define S3C2410_BANKCON_Tcoh2 (0x2 << 6)
122#define S3C2410_BANKCON_Tcoh4 (0x3 << 6)
123#define S3C2410_BANKCON_Tcoh_SHIFT (6)
124
125#define S3C2410_BANKCON_Tacc1 (0x0 << 8)
126#define S3C2410_BANKCON_Tacc2 (0x1 << 8)
127#define S3C2410_BANKCON_Tacc3 (0x2 << 8)
128#define S3C2410_BANKCON_Tacc4 (0x3 << 8)
129#define S3C2410_BANKCON_Tacc6 (0x4 << 8)
130#define S3C2410_BANKCON_Tacc8 (0x5 << 8)
131#define S3C2410_BANKCON_Tacc10 (0x6 << 8)
132#define S3C2410_BANKCON_Tacc14 (0x7 << 8)
133#define S3C2410_BANKCON_Tacc_SHIFT (8)
134
135#define S3C2410_BANKCON_Tcos0 (0x0 << 11)
136#define S3C2410_BANKCON_Tcos1 (0x1 << 11)
137#define S3C2410_BANKCON_Tcos2 (0x2 << 11)
138#define S3C2410_BANKCON_Tcos4 (0x3 << 11)
139#define S3C2410_BANKCON_Tcos_SHIFT (11)
140
141#define S3C2410_BANKCON_Tacs0 (0x0 << 13)
142#define S3C2410_BANKCON_Tacs1 (0x1 << 13)
143#define S3C2410_BANKCON_Tacs2 (0x2 << 13)
144#define S3C2410_BANKCON_Tacs4 (0x3 << 13)
145#define S3C2410_BANKCON_Tacs_SHIFT (13)
146
147#define S3C2410_BANKCON_SRAM (0x0 << 15)
148#define S3C2410_BANKCON_SDRAM (0x3 << 15)
149
150/* next bits only for SDRAM in 6,7 */
151#define S3C2410_BANKCON_Trcd2 (0x00 << 2)
152#define S3C2410_BANKCON_Trcd3 (0x01 << 2)
153#define S3C2410_BANKCON_Trcd4 (0x02 << 2)
154
155/* control column address select */
156#define S3C2410_BANKCON_SCANb8 (0x00 << 0)
157#define S3C2410_BANKCON_SCANb9 (0x01 << 0)
158#define S3C2410_BANKCON_SCANb10 (0x02 << 0)
159
160#define S3C2410_REFRESH S3C2410_MEMREG(0x0024)
161#define S3C2410_BANKSIZE S3C2410_MEMREG(0x0028)
162#define S3C2410_MRSRB6 S3C2410_MEMREG(0x002C)
163#define S3C2410_MRSRB7 S3C2410_MEMREG(0x0030)
164
165/* refresh control */
166
167#define S3C2410_REFRESH_REFEN (1<<23)
168#define S3C2410_REFRESH_SELF (1<<22)
169#define S3C2410_REFRESH_REFCOUNTER ((1<<11)-1)
170
171#define S3C2410_REFRESH_TRP_MASK (3<<20)
172#define S3C2410_REFRESH_TRP_2clk (0<<20)
173#define S3C2410_REFRESH_TRP_3clk (1<<20)
174#define S3C2410_REFRESH_TRP_4clk (2<<20)
175
176#define S3C2410_REFRESH_TSRC_MASK (3<<18)
177#define S3C2410_REFRESH_TSRC_4clk (0<<18)
178#define S3C2410_REFRESH_TSRC_5clk (1<<18)
179#define S3C2410_REFRESH_TSRC_6clk (2<<18)
180#define S3C2410_REFRESH_TSRC_7clk (3<<18)
181
182
183/* mode select register(s) */
184
185#define S3C2410_MRSRB_CL1 (0x00 << 4)
186#define S3C2410_MRSRB_CL2 (0x02 << 4)
187#define S3C2410_MRSRB_CL3 (0x03 << 4)
188
189/* bank size register */
190#define S3C2410_BANKSIZE_128M (0x2 << 0)
191#define S3C2410_BANKSIZE_64M (0x1 << 0)
192#define S3C2410_BANKSIZE_32M (0x0 << 0)
193#define S3C2410_BANKSIZE_16M (0x7 << 0)
194#define S3C2410_BANKSIZE_8M (0x6 << 0)
195#define S3C2410_BANKSIZE_4M (0x5 << 0)
196#define S3C2410_BANKSIZE_2M (0x4 << 0)
197#define S3C2410_BANKSIZE_MASK (0x7 << 0)
198#define S3C2410_BANKSIZE_SCLK_EN (1<<4)
199#define S3C2410_BANKSIZE_SCKE_EN (1<<5)
200#define S3C2410_BANKSIZE_BURST (1<<7)
201
202#endif /* __ASM_ARM_MEMREGS_H */
diff --git a/arch/arm/mach-s3c24xx/include/mach/regs-power.h b/arch/arm/mach-s3c24xx/include/mach/regs-power.h
deleted file mode 100644
index 4932b87bdf3d..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/regs-power.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/regs-power.h
2 *
3 * Copyright (c) 2003-2006 Simtec Electronics <linux@simtec.co.uk>
4 * http://armlinux.simtec.co.uk/
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 * S3C24XX power control register definitions
11*/
12
13#ifndef __ASM_ARM_REGS_PWR
14#define __ASM_ARM_REGS_PWR __FILE__
15
16#define S3C24XX_PWRREG(x) ((x) + S3C24XX_VA_CLKPWR)
17
18#define S3C2412_PWRMODECON S3C24XX_PWRREG(0x20)
19#define S3C2412_PWRCFG S3C24XX_PWRREG(0x24)
20
21#define S3C2412_INFORM0 S3C24XX_PWRREG(0x70)
22#define S3C2412_INFORM1 S3C24XX_PWRREG(0x74)
23#define S3C2412_INFORM2 S3C24XX_PWRREG(0x78)
24#define S3C2412_INFORM3 S3C24XX_PWRREG(0x7C)
25
26#define S3C2412_PWRCFG_BATF_IRQ (1<<0)
27#define S3C2412_PWRCFG_BATF_IGNORE (2<<0)
28#define S3C2412_PWRCFG_BATF_SLEEP (3<<0)
29#define S3C2412_PWRCFG_BATF_MASK (3<<0)
30
31#define S3C2412_PWRCFG_STANDBYWFI_IGNORE (0<<6)
32#define S3C2412_PWRCFG_STANDBYWFI_IDLE (1<<6)
33#define S3C2412_PWRCFG_STANDBYWFI_STOP (2<<6)
34#define S3C2412_PWRCFG_STANDBYWFI_SLEEP (3<<6)
35#define S3C2412_PWRCFG_STANDBYWFI_MASK (3<<6)
36
37#define S3C2412_PWRCFG_RTC_MASKIRQ (1<<8)
38#define S3C2412_PWRCFG_NAND_NORST (1<<9)
39
40#endif /* __ASM_ARM_REGS_PWR */
diff --git a/arch/arm/mach-s3c24xx/include/mach/regs-s3c2412-mem.h b/arch/arm/mach-s3c24xx/include/mach/regs-s3c2412-mem.h
deleted file mode 100644
index fb6352515090..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/regs-s3c2412-mem.h
+++ /dev/null
@@ -1,48 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/regs-s3c2412-mem.h
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
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 * S3C2412 memory register definitions
12*/
13
14#ifndef __ASM_ARM_REGS_S3C2412_MEM
15#define __ASM_ARM_REGS_S3C2412_MEM
16
17#define S3C2412_MEMREG(x) (S3C24XX_VA_MEMCTRL + (x))
18#define S3C2412_EBIREG(x) (S3C2412_VA_EBI + (x))
19
20#define S3C2412_SSMCREG(x) (S3C2412_VA_SSMC + (x))
21#define S3C2412_SSMC(x, o) (S3C2412_SSMCREG((x * 0x20) + (o)))
22
23#define S3C2412_BANKCFG S3C2412_MEMREG(0x00)
24#define S3C2412_BANKCON1 S3C2412_MEMREG(0x04)
25#define S3C2412_BANKCON2 S3C2412_MEMREG(0x08)
26#define S3C2412_BANKCON3 S3C2412_MEMREG(0x0C)
27
28#define S3C2412_REFRESH S3C2412_MEMREG(0x10)
29#define S3C2412_TIMEOUT S3C2412_MEMREG(0x14)
30
31/* EBI control registers */
32
33#define S3C2412_EBI_PR S3C2412_EBIREG(0x00)
34#define S3C2412_EBI_BANKCFG S3C2412_EBIREG(0x04)
35
36/* SSMC control registers */
37
38#define S3C2412_SSMC_BANK(x) S3C2412_SSMC(x, 0x00)
39#define S3C2412_SMIDCYR(x) S3C2412_SSMC(x, 0x00)
40#define S3C2412_SMBWSTRD(x) S3C2412_SSMC(x, 0x04)
41#define S3C2412_SMBWSTWRR(x) S3C2412_SSMC(x, 0x08)
42#define S3C2412_SMBWSTOENR(x) S3C2412_SSMC(x, 0x0C)
43#define S3C2412_SMBWSTWENR(x) S3C2412_SSMC(x, 0x10)
44#define S3C2412_SMBCR(x) S3C2412_SSMC(x, 0x14)
45#define S3C2412_SMBSR(x) S3C2412_SSMC(x, 0x18)
46#define S3C2412_SMBWSTBRDR(x) S3C2412_SSMC(x, 0x1C)
47
48#endif /* __ASM_ARM_REGS_S3C2412_MEM */
diff --git a/arch/arm/mach-s3c24xx/include/mach/regs-s3c2412.h b/arch/arm/mach-s3c24xx/include/mach/regs-s3c2412.h
deleted file mode 100644
index aa69dc79bc38..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/regs-s3c2412.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/regs-s3c2412.h
2 *
3 * Copyright 2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
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 * S3C2412 specific register definitions
12*/
13
14#ifndef __ASM_ARCH_REGS_S3C2412_H
15#define __ASM_ARCH_REGS_S3C2412_H "s3c2412"
16
17#define S3C2412_SWRST (S3C24XX_VA_CLKPWR + 0x30)
18#define S3C2412_SWRST_RESET (0x533C2412)
19
20/* see regs-power.h for the other registers in the power block. */
21
22#endif /* __ASM_ARCH_REGS_S3C2412_H */
23
diff --git a/arch/arm/mach-s3c24xx/include/mach/regs-s3c2416-mem.h b/arch/arm/mach-s3c24xx/include/mach/regs-s3c2416-mem.h
deleted file mode 100644
index 2f31b74974af..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/regs-s3c2416-mem.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/regs-s3c2416-mem.h
2 *
3 * Copyright (c) 2009 Yauhen Kharuzhy <jekhor@gmail.com>,
4 * as part of OpenInkpot project
5 * Copyright (c) 2009 Promwad Innovation Company
6 * Yauhen Kharuzhy <yauhen.kharuzhy@promwad.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 version 2 as
10 * published by the Free Software Foundation.
11 *
12 * S3C2416 memory register definitions
13*/
14
15#ifndef __ASM_ARM_REGS_S3C2416_MEM
16#define __ASM_ARM_REGS_S3C2416_MEM
17
18#ifndef S3C2416_MEMREG
19#define S3C2416_MEMREG(x) (S3C24XX_VA_MEMCTRL + (x))
20#endif
21
22#define S3C2416_BANKCFG S3C2416_MEMREG(0x00)
23#define S3C2416_BANKCON1 S3C2416_MEMREG(0x04)
24#define S3C2416_BANKCON2 S3C2416_MEMREG(0x08)
25#define S3C2416_BANKCON3 S3C2416_MEMREG(0x0C)
26
27#define S3C2416_REFRESH S3C2416_MEMREG(0x10)
28#define S3C2416_TIMEOUT S3C2416_MEMREG(0x14)
29
30#endif /* __ASM_ARM_REGS_S3C2416_MEM */
diff --git a/arch/arm/mach-s3c24xx/include/mach/regs-s3c2416.h b/arch/arm/mach-s3c24xx/include/mach/regs-s3c2416.h
deleted file mode 100644
index e443167efb87..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/regs-s3c2416.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/regs-s3c2416.h
2 *
3 * Copyright (c) 2009 Yauhen Kharuzhy <jekhor@gmail.com>,
4 * as part of OpenInkpot project
5 * Copyright (c) 2009 Promwad Innovation Company
6 * Yauhen Kharuzhy <yauhen.kharuzhy@promwad.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 version 2 as
10 * published by the Free Software Foundation.
11 *
12 * S3C2416 specific register definitions
13*/
14
15#ifndef __ASM_ARCH_REGS_S3C2416_H
16#define __ASM_ARCH_REGS_S3C2416_H "s3c2416"
17
18#define S3C2416_SWRST (S3C24XX_VA_CLKPWR + 0x44)
19#define S3C2416_SWRST_RESET (0x533C2416)
20
21/* see regs-power.h for the other registers in the power block. */
22
23#endif /* __ASM_ARCH_REGS_S3C2416_H */
24
diff --git a/arch/arm/mach-s3c24xx/include/mach/vr1000-cpld.h b/arch/arm/mach-s3c24xx/include/mach/vr1000-cpld.h
deleted file mode 100644
index e4119913d7c5..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/vr1000-cpld.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/vr1000-cpld.h
2 *
3 * Copyright (c) 2003 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * VR1000 - CPLD control constants
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_VR1000CPLD_H
14#define __ASM_ARCH_VR1000CPLD_H
15
16#define VR1000_CPLD_CTRL2_RAMWEN (0x04) /* SRAM Write Enable */
17
18#endif /* __ASM_ARCH_VR1000CPLD_H */
diff --git a/arch/arm/mach-s3c24xx/include/mach/vr1000-irq.h b/arch/arm/mach-s3c24xx/include/mach/vr1000-irq.h
deleted file mode 100644
index 47add133b8ee..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/vr1000-irq.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/vr1000-irq.h
2 *
3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Machine VR1000 - IRQ Number 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_VR1000IRQ_H
14#define __ASM_ARCH_VR1000IRQ_H
15
16/* irq numbers to onboard peripherals */
17
18#define IRQ_USBOC IRQ_EINT19
19#define IRQ_IDE0 IRQ_EINT16
20#define IRQ_IDE1 IRQ_EINT17
21#define IRQ_VR1000_SERIAL IRQ_EINT12
22#define IRQ_VR1000_DM9000A IRQ_EINT10
23#define IRQ_VR1000_DM9000N IRQ_EINT9
24#define IRQ_SMALERT IRQ_EINT8
25
26#endif /* __ASM_ARCH_VR1000IRQ_H */
diff --git a/arch/arm/mach-s3c24xx/include/mach/vr1000-map.h b/arch/arm/mach-s3c24xx/include/mach/vr1000-map.h
deleted file mode 100644
index 28376e56dd3b..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/vr1000-map.h
+++ /dev/null
@@ -1,110 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/vr1000-map.h
2 *
3 * Copyright (c) 2003-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Machine VR1000 - 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/* needs arch/map.h including with this */
14
15/* ok, we've used up to 0x13000000, now we need to find space for the
16 * peripherals that live in the nGCS[x] areas, which are quite numerous
17 * in their space. We also have the board's CPLD to find register space
18 * for.
19 */
20
21#ifndef __ASM_ARCH_VR1000MAP_H
22#define __ASM_ARCH_VR1000MAP_H
23
24#include <mach/bast-map.h>
25
26#define VR1000_IOADDR(x) BAST_IOADDR(x)
27
28/* we put the CPLD registers next, to get them out of the way */
29
30#define VR1000_VA_CTRL1 VR1000_IOADDR(0x00000000) /* 0x01300000 */
31#define VR1000_PA_CTRL1 (S3C2410_CS5 | 0x7800000)
32
33#define VR1000_VA_CTRL2 VR1000_IOADDR(0x00100000) /* 0x01400000 */
34#define VR1000_PA_CTRL2 (S3C2410_CS1 | 0x6000000)
35
36#define VR1000_VA_CTRL3 VR1000_IOADDR(0x00200000) /* 0x01500000 */
37#define VR1000_PA_CTRL3 (S3C2410_CS1 | 0x6800000)
38
39#define VR1000_VA_CTRL4 VR1000_IOADDR(0x00300000) /* 0x01600000 */
40#define VR1000_PA_CTRL4 (S3C2410_CS1 | 0x7000000)
41
42/* next, we have the PC104 ISA interrupt registers */
43
44#define VR1000_PA_PC104_IRQREQ (S3C2410_CS5 | 0x6000000) /* 0x01700000 */
45#define VR1000_VA_PC104_IRQREQ VR1000_IOADDR(0x00400000)
46
47#define VR1000_PA_PC104_IRQRAW (S3C2410_CS5 | 0x6800000) /* 0x01800000 */
48#define VR1000_VA_PC104_IRQRAW VR1000_IOADDR(0x00500000)
49
50#define VR1000_PA_PC104_IRQMASK (S3C2410_CS5 | 0x7000000) /* 0x01900000 */
51#define VR1000_VA_PC104_IRQMASK VR1000_IOADDR(0x00600000)
52
53/* 0xE0000000 contains the IO space that is split by speed and
54 * whether the access is for 8 or 16bit IO... this ensures that
55 * the correct access is made
56 *
57 * 0x10000000 of space, partitioned as so:
58 *
59 * 0x00000000 to 0x04000000 8bit, slow
60 * 0x04000000 to 0x08000000 16bit, slow
61 * 0x08000000 to 0x0C000000 16bit, net
62 * 0x0C000000 to 0x10000000 16bit, fast
63 *
64 * each of these spaces has the following in:
65 *
66 * 0x02000000 to 0x02100000 1MB IDE primary channel
67 * 0x02100000 to 0x02200000 1MB IDE primary channel aux
68 * 0x02200000 to 0x02400000 1MB IDE secondary channel
69 * 0x02300000 to 0x02400000 1MB IDE secondary channel aux
70 * 0x02500000 to 0x02600000 1MB Davicom DM9000 ethernet controllers
71 * 0x02600000 to 0x02700000 1MB
72 *
73 * the phyiscal layout of the zones are:
74 * nGCS2 - 8bit, slow
75 * nGCS3 - 16bit, slow
76 * nGCS4 - 16bit, net
77 * nGCS5 - 16bit, fast
78 */
79
80#define VR1000_VA_MULTISPACE (0xE0000000)
81
82#define VR1000_VA_ISAIO (VR1000_VA_MULTISPACE + 0x00000000)
83#define VR1000_VA_ISAMEM (VR1000_VA_MULTISPACE + 0x01000000)
84#define VR1000_VA_IDEPRI (VR1000_VA_MULTISPACE + 0x02000000)
85#define VR1000_VA_IDEPRIAUX (VR1000_VA_MULTISPACE + 0x02100000)
86#define VR1000_VA_IDESEC (VR1000_VA_MULTISPACE + 0x02200000)
87#define VR1000_VA_IDESECAUX (VR1000_VA_MULTISPACE + 0x02300000)
88#define VR1000_VA_ASIXNET (VR1000_VA_MULTISPACE + 0x02400000)
89#define VR1000_VA_DM9000 (VR1000_VA_MULTISPACE + 0x02500000)
90#define VR1000_VA_SUPERIO (VR1000_VA_MULTISPACE + 0x02600000)
91
92/* physical offset addresses for the peripherals */
93
94#define VR1000_PA_IDEPRI (0x02000000)
95#define VR1000_PA_IDEPRIAUX (0x02800000)
96#define VR1000_PA_IDESEC (0x03000000)
97#define VR1000_PA_IDESECAUX (0x03800000)
98#define VR1000_PA_DM9000 (0x05000000)
99
100#define VR1000_PA_SERIAL (0x11800000)
101#define VR1000_VA_SERIAL (VR1000_IOADDR(0x00700000))
102
103/* VR1000 ram is in CS1, with A26..A24 = 2_101 */
104#define VR1000_PA_SRAM (S3C2410_CS1 | 0x05000000)
105
106/* some configurations for the peripherals */
107
108#define VR1000_DM9000_CS VR1000_VAM_CS4
109
110#endif /* __ASM_ARCH_VR1000MAP_H */
diff --git a/arch/arm/plat-s3c24xx/s3c2410-iotiming.c b/arch/arm/mach-s3c24xx/iotiming-s3c2410.c
index b1908e56da1b..4cd13ab6496b 100644
--- a/arch/arm/plat-s3c24xx/s3c2410-iotiming.c
+++ b/arch/arm/mach-s3c24xx/iotiming-s3c2410.c
@@ -1,5 +1,4 @@
1/* linux/arch/arm/plat-s3c24xx/s3c2410-iotiming.c 1/*
2 *
3 * Copyright (c) 2006-2009 Simtec Electronics 2 * Copyright (c) 2006-2009 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 3 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
@@ -20,11 +19,12 @@
20#include <linux/slab.h> 19#include <linux/slab.h>
21 20
22#include <mach/map.h> 21#include <mach/map.h>
23#include <mach/regs-mem.h>
24#include <mach/regs-clock.h> 22#include <mach/regs-clock.h>
25 23
26#include <plat/cpu-freq-core.h> 24#include <plat/cpu-freq-core.h>
27 25
26#include "regs-mem.h"
27
28#define print_ns(x) ((x) / 10), ((x) % 10) 28#define print_ns(x) ((x) / 10), ((x) % 10)
29 29
30/** 30/**
diff --git a/arch/arm/plat-s3c24xx/s3c2412-iotiming.c b/arch/arm/mach-s3c24xx/iotiming-s3c2412.c
index 48eee39ab369..663436d9db01 100644
--- a/arch/arm/plat-s3c24xx/s3c2412-iotiming.c
+++ b/arch/arm/mach-s3c24xx/iotiming-s3c2412.c
@@ -1,5 +1,4 @@
1/* linux/arch/arm/plat-s3c24xx/s3c2412-iotiming.c 1/*
2 *
3 * Copyright (c) 2006-2008 Simtec Electronics 2 * Copyright (c) 2006-2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 3 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
@@ -28,12 +27,12 @@
28#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
29#include <asm/mach/map.h> 28#include <asm/mach/map.h>
30 29
31#include <mach/regs-s3c2412-mem.h>
32
33#include <plat/cpu.h> 30#include <plat/cpu.h>
34#include <plat/cpu-freq-core.h> 31#include <plat/cpu-freq-core.h>
35#include <plat/clock.h> 32#include <plat/clock.h>
36 33
34#include "s3c2412.h"
35
37#define print_ns(x) ((x) / 10), ((x) % 10) 36#define print_ns(x) ((x) / 10), ((x) % 10)
38 37
39/** 38/**
diff --git a/arch/arm/mach-s3c24xx/irq-pm.c b/arch/arm/mach-s3c24xx/irq-pm.c
index 0efb2e2848c8..e1199599873e 100644
--- a/arch/arm/mach-s3c24xx/irq-pm.c
+++ b/arch/arm/mach-s3c24xx/irq-pm.c
@@ -15,6 +15,7 @@
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/irq.h> 17#include <linux/irq.h>
18#include <linux/syscore_ops.h>
18 19
19#include <plat/cpu.h> 20#include <plat/cpu.h>
20#include <plat/pm.h> 21#include <plat/pm.h>
@@ -29,18 +30,18 @@
29 * set bit to 1 in allow bitfield to enable the wakeup settings on it 30 * set bit to 1 in allow bitfield to enable the wakeup settings on it
30*/ 31*/
31 32
32unsigned long s3c_irqwake_intallow = 1L << (IRQ_RTC - IRQ_EINT0) | 0xfL; 33unsigned long s3c_irqwake_intallow = 1L << 30 | 0xfL;
33unsigned long s3c_irqwake_eintallow = 0x0000fff0L; 34unsigned long s3c_irqwake_eintallow = 0x0000fff0L;
34 35
35int s3c_irq_wake(struct irq_data *data, unsigned int state) 36int s3c_irq_wake(struct irq_data *data, unsigned int state)
36{ 37{
37 unsigned long irqbit = 1 << (data->irq - IRQ_EINT0); 38 unsigned long irqbit = 1 << data->hwirq;
38 39
39 if (!(s3c_irqwake_intallow & irqbit)) 40 if (!(s3c_irqwake_intallow & irqbit))
40 return -ENOENT; 41 return -ENOENT;
41 42
42 printk(KERN_INFO "wake %s for irq %d\n", 43 pr_info("wake %s for hwirq %lu\n",
43 state ? "enabled" : "disabled", data->irq); 44 state ? "enabled" : "disabled", data->hwirq);
44 45
45 if (!state) 46 if (!state)
46 s3c_irqwake_intmask |= irqbit; 47 s3c_irqwake_intmask |= irqbit;
@@ -64,7 +65,7 @@ static unsigned long save_extint[3];
64static unsigned long save_eintflt[4]; 65static unsigned long save_eintflt[4];
65static unsigned long save_eintmask; 66static unsigned long save_eintmask;
66 67
67int s3c24xx_irq_suspend(void) 68static int s3c24xx_irq_suspend(void)
68{ 69{
69 unsigned int i; 70 unsigned int i;
70 71
@@ -80,7 +81,7 @@ int s3c24xx_irq_suspend(void)
80 return 0; 81 return 0;
81} 82}
82 83
83void s3c24xx_irq_resume(void) 84static void s3c24xx_irq_resume(void)
84{ 85{
85 unsigned int i; 86 unsigned int i;
86 87
@@ -93,3 +94,31 @@ void s3c24xx_irq_resume(void)
93 s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save)); 94 s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save));
94 __raw_writel(save_eintmask, S3C24XX_EINTMASK); 95 __raw_writel(save_eintmask, S3C24XX_EINTMASK);
95} 96}
97
98struct syscore_ops s3c24xx_irq_syscore_ops = {
99 .suspend = s3c24xx_irq_suspend,
100 .resume = s3c24xx_irq_resume,
101};
102
103#ifdef CONFIG_CPU_S3C2416
104static struct sleep_save s3c2416_irq_save[] = {
105 SAVE_ITEM(S3C2416_INTMSK2),
106};
107
108static int s3c2416_irq_suspend(void)
109{
110 s3c_pm_do_save(s3c2416_irq_save, ARRAY_SIZE(s3c2416_irq_save));
111
112 return 0;
113}
114
115static void s3c2416_irq_resume(void)
116{
117 s3c_pm_do_restore(s3c2416_irq_save, ARRAY_SIZE(s3c2416_irq_save));
118}
119
120struct syscore_ops s3c2416_irq_syscore_ops = {
121 .suspend = s3c2416_irq_suspend,
122 .resume = s3c2416_irq_resume,
123};
124#endif
diff --git a/arch/arm/mach-s3c24xx/irq-s3c2412.c b/arch/arm/mach-s3c24xx/irq-s3c2412.c
index e65619ddbccc..67d763178d3f 100644
--- a/arch/arm/mach-s3c24xx/irq-s3c2412.c
+++ b/arch/arm/mach-s3c24xx/irq-s3c2412.c
@@ -33,12 +33,13 @@
33 33
34#include <mach/regs-irq.h> 34#include <mach/regs-irq.h>
35#include <mach/regs-gpio.h> 35#include <mach/regs-gpio.h>
36#include <mach/regs-power.h>
37 36
38#include <plat/cpu.h> 37#include <plat/cpu.h>
39#include <plat/irq.h> 38#include <plat/irq.h>
40#include <plat/pm.h> 39#include <plat/pm.h>
41 40
41#include "s3c2412-power.h"
42
42#define INTMSK(start, end) ((1 << ((end) + 1 - (start))) - 1) 43#define INTMSK(start, end) ((1 << ((end) + 1 - (start))) - 1)
43#define INTMSK_SUB(start, end) (INTMSK(start, end) << ((start - S3C2410_IRQSUB(0)))) 44#define INTMSK_SUB(start, end) (INTMSK(start, end) << ((start - S3C2410_IRQSUB(0))))
44 45
diff --git a/arch/arm/mach-s3c24xx/irq-s3c2416.c b/arch/arm/mach-s3c24xx/irq-s3c2416.c
deleted file mode 100644
index ff141b0af26b..000000000000
--- a/arch/arm/mach-s3c24xx/irq-s3c2416.c
+++ /dev/null
@@ -1,348 +0,0 @@
1/* linux/arch/arm/mach-s3c2416/irq.c
2 *
3 * Copyright (c) 2009 Yauhen Kharuzhy <jekhor@gmail.com>,
4 * as part of OpenInkpot project
5 * Copyright (c) 2009 Promwad Innovation Company
6 * Yauhen Kharuzhy <yauhen.kharuzhy@promwad.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 USA
21 *
22*/
23
24#include <linux/init.h>
25#include <linux/module.h>
26#include <linux/interrupt.h>
27#include <linux/ioport.h>
28#include <linux/device.h>
29#include <linux/io.h>
30#include <linux/syscore_ops.h>
31
32#include <mach/hardware.h>
33#include <asm/irq.h>
34
35#include <asm/mach/irq.h>
36
37#include <mach/regs-irq.h>
38#include <mach/regs-gpio.h>
39
40#include <plat/cpu.h>
41#include <plat/pm.h>
42#include <plat/irq.h>
43
44#define INTMSK(start, end) ((1 << ((end) + 1 - (start))) - 1)
45
46static inline void s3c2416_irq_demux(unsigned int irq, unsigned int len)
47{
48 unsigned int subsrc, submsk;
49 unsigned int end;
50
51 /* read the current pending interrupts, and the mask
52 * for what it is available */
53
54 subsrc = __raw_readl(S3C2410_SUBSRCPND);
55 submsk = __raw_readl(S3C2410_INTSUBMSK);
56
57 subsrc &= ~submsk;
58 subsrc >>= (irq - S3C2410_IRQSUB(0));
59 subsrc &= (1 << len)-1;
60
61 end = len + irq;
62
63 for (; irq < end && subsrc; irq++) {
64 if (subsrc & 1)
65 generic_handle_irq(irq);
66
67 subsrc >>= 1;
68 }
69}
70
71/* WDT/AC97 sub interrupts */
72
73static void s3c2416_irq_demux_wdtac97(unsigned int irq, struct irq_desc *desc)
74{
75 s3c2416_irq_demux(IRQ_S3C2443_WDT, 4);
76}
77
78#define INTMSK_WDTAC97 (1UL << (IRQ_WDT - IRQ_EINT0))
79#define SUBMSK_WDTAC97 INTMSK(IRQ_S3C2443_WDT, IRQ_S3C2443_AC97)
80
81static void s3c2416_irq_wdtac97_mask(struct irq_data *data)
82{
83 s3c_irqsub_mask(data->irq, INTMSK_WDTAC97, SUBMSK_WDTAC97);
84}
85
86static void s3c2416_irq_wdtac97_unmask(struct irq_data *data)
87{
88 s3c_irqsub_unmask(data->irq, INTMSK_WDTAC97);
89}
90
91static void s3c2416_irq_wdtac97_ack(struct irq_data *data)
92{
93 s3c_irqsub_maskack(data->irq, INTMSK_WDTAC97, SUBMSK_WDTAC97);
94}
95
96static struct irq_chip s3c2416_irq_wdtac97 = {
97 .irq_mask = s3c2416_irq_wdtac97_mask,
98 .irq_unmask = s3c2416_irq_wdtac97_unmask,
99 .irq_ack = s3c2416_irq_wdtac97_ack,
100};
101
102/* LCD sub interrupts */
103
104static void s3c2416_irq_demux_lcd(unsigned int irq, struct irq_desc *desc)
105{
106 s3c2416_irq_demux(IRQ_S3C2443_LCD1, 4);
107}
108
109#define INTMSK_LCD (1UL << (IRQ_LCD - IRQ_EINT0))
110#define SUBMSK_LCD INTMSK(IRQ_S3C2443_LCD1, IRQ_S3C2443_LCD4)
111
112static void s3c2416_irq_lcd_mask(struct irq_data *data)
113{
114 s3c_irqsub_mask(data->irq, INTMSK_LCD, SUBMSK_LCD);
115}
116
117static void s3c2416_irq_lcd_unmask(struct irq_data *data)
118{
119 s3c_irqsub_unmask(data->irq, INTMSK_LCD);
120}
121
122static void s3c2416_irq_lcd_ack(struct irq_data *data)
123{
124 s3c_irqsub_maskack(data->irq, INTMSK_LCD, SUBMSK_LCD);
125}
126
127static struct irq_chip s3c2416_irq_lcd = {
128 .irq_mask = s3c2416_irq_lcd_mask,
129 .irq_unmask = s3c2416_irq_lcd_unmask,
130 .irq_ack = s3c2416_irq_lcd_ack,
131};
132
133/* DMA sub interrupts */
134
135static void s3c2416_irq_demux_dma(unsigned int irq, struct irq_desc *desc)
136{
137 s3c2416_irq_demux(IRQ_S3C2443_DMA0, 6);
138}
139
140#define INTMSK_DMA (1UL << (IRQ_S3C2443_DMA - IRQ_EINT0))
141#define SUBMSK_DMA INTMSK(IRQ_S3C2443_DMA0, IRQ_S3C2443_DMA5)
142
143
144static void s3c2416_irq_dma_mask(struct irq_data *data)
145{
146 s3c_irqsub_mask(data->irq, INTMSK_DMA, SUBMSK_DMA);
147}
148
149static void s3c2416_irq_dma_unmask(struct irq_data *data)
150{
151 s3c_irqsub_unmask(data->irq, INTMSK_DMA);
152}
153
154static void s3c2416_irq_dma_ack(struct irq_data *data)
155{
156 s3c_irqsub_maskack(data->irq, INTMSK_DMA, SUBMSK_DMA);
157}
158
159static struct irq_chip s3c2416_irq_dma = {
160 .irq_mask = s3c2416_irq_dma_mask,
161 .irq_unmask = s3c2416_irq_dma_unmask,
162 .irq_ack = s3c2416_irq_dma_ack,
163};
164
165/* UART3 sub interrupts */
166
167static void s3c2416_irq_demux_uart3(unsigned int irq, struct irq_desc *desc)
168{
169 s3c2416_irq_demux(IRQ_S3C2443_RX3, 3);
170}
171
172#define INTMSK_UART3 (1UL << (IRQ_S3C2443_UART3 - IRQ_EINT0))
173#define SUBMSK_UART3 (0x7 << (IRQ_S3C2443_RX3 - S3C2410_IRQSUB(0)))
174
175static void s3c2416_irq_uart3_mask(struct irq_data *data)
176{
177 s3c_irqsub_mask(data->irq, INTMSK_UART3, SUBMSK_UART3);
178}
179
180static void s3c2416_irq_uart3_unmask(struct irq_data *data)
181{
182 s3c_irqsub_unmask(data->irq, INTMSK_UART3);
183}
184
185static void s3c2416_irq_uart3_ack(struct irq_data *data)
186{
187 s3c_irqsub_maskack(data->irq, INTMSK_UART3, SUBMSK_UART3);
188}
189
190static struct irq_chip s3c2416_irq_uart3 = {
191 .irq_mask = s3c2416_irq_uart3_mask,
192 .irq_unmask = s3c2416_irq_uart3_unmask,
193 .irq_ack = s3c2416_irq_uart3_ack,
194};
195
196/* second interrupt register */
197
198static inline void s3c2416_irq_ack_second(struct irq_data *data)
199{
200 unsigned long bitval = 1UL << (data->irq - IRQ_S3C2416_2D);
201
202 __raw_writel(bitval, S3C2416_SRCPND2);
203 __raw_writel(bitval, S3C2416_INTPND2);
204}
205
206static void s3c2416_irq_mask_second(struct irq_data *data)
207{
208 unsigned long bitval = 1UL << (data->irq - IRQ_S3C2416_2D);
209 unsigned long mask;
210
211 mask = __raw_readl(S3C2416_INTMSK2);
212 mask |= bitval;
213 __raw_writel(mask, S3C2416_INTMSK2);
214}
215
216static void s3c2416_irq_unmask_second(struct irq_data *data)
217{
218 unsigned long bitval = 1UL << (data->irq - IRQ_S3C2416_2D);
219 unsigned long mask;
220
221 mask = __raw_readl(S3C2416_INTMSK2);
222 mask &= ~bitval;
223 __raw_writel(mask, S3C2416_INTMSK2);
224}
225
226struct irq_chip s3c2416_irq_second = {
227 .irq_ack = s3c2416_irq_ack_second,
228 .irq_mask = s3c2416_irq_mask_second,
229 .irq_unmask = s3c2416_irq_unmask_second,
230};
231
232
233/* IRQ initialisation code */
234
235static int s3c2416_add_sub(unsigned int base,
236 void (*demux)(unsigned int,
237 struct irq_desc *),
238 struct irq_chip *chip,
239 unsigned int start, unsigned int end)
240{
241 unsigned int irqno;
242
243 irq_set_chip_and_handler(base, &s3c_irq_level_chip, handle_level_irq);
244 irq_set_chained_handler(base, demux);
245
246 for (irqno = start; irqno <= end; irqno++) {
247 irq_set_chip_and_handler(irqno, chip, handle_level_irq);
248 set_irq_flags(irqno, IRQF_VALID);
249 }
250
251 return 0;
252}
253
254static void s3c2416_irq_add_second(void)
255{
256 unsigned long pend;
257 unsigned long last;
258 int irqno;
259 int i;
260
261 /* first, clear all interrupts pending... */
262 last = 0;
263 for (i = 0; i < 4; i++) {
264 pend = __raw_readl(S3C2416_INTPND2);
265
266 if (pend == 0 || pend == last)
267 break;
268
269 __raw_writel(pend, S3C2416_SRCPND2);
270 __raw_writel(pend, S3C2416_INTPND2);
271 printk(KERN_INFO "irq: clearing pending status %08x\n",
272 (int)pend);
273 last = pend;
274 }
275
276 for (irqno = IRQ_S3C2416_2D; irqno <= IRQ_S3C2416_I2S1; irqno++) {
277 switch (irqno) {
278 case IRQ_S3C2416_RESERVED2:
279 case IRQ_S3C2416_RESERVED3:
280 /* no IRQ here */
281 break;
282 default:
283 irq_set_chip_and_handler(irqno, &s3c2416_irq_second,
284 handle_edge_irq);
285 set_irq_flags(irqno, IRQF_VALID);
286 }
287 }
288}
289
290static int s3c2416_irq_add(struct device *dev,
291 struct subsys_interface *sif)
292{
293 printk(KERN_INFO "S3C2416: IRQ Support\n");
294
295 s3c2416_add_sub(IRQ_LCD, s3c2416_irq_demux_lcd, &s3c2416_irq_lcd,
296 IRQ_S3C2443_LCD2, IRQ_S3C2443_LCD4);
297
298 s3c2416_add_sub(IRQ_S3C2443_DMA, s3c2416_irq_demux_dma,
299 &s3c2416_irq_dma, IRQ_S3C2443_DMA0, IRQ_S3C2443_DMA5);
300
301 s3c2416_add_sub(IRQ_S3C2443_UART3, s3c2416_irq_demux_uart3,
302 &s3c2416_irq_uart3,
303 IRQ_S3C2443_RX3, IRQ_S3C2443_ERR3);
304
305 s3c2416_add_sub(IRQ_WDT, s3c2416_irq_demux_wdtac97,
306 &s3c2416_irq_wdtac97,
307 IRQ_S3C2443_WDT, IRQ_S3C2443_AC97);
308
309 s3c2416_irq_add_second();
310
311 return 0;
312}
313
314static struct subsys_interface s3c2416_irq_interface = {
315 .name = "s3c2416_irq",
316 .subsys = &s3c2416_subsys,
317 .add_dev = s3c2416_irq_add,
318};
319
320static int __init s3c2416_irq_init(void)
321{
322 return subsys_interface_register(&s3c2416_irq_interface);
323}
324
325arch_initcall(s3c2416_irq_init);
326
327#ifdef CONFIG_PM
328static struct sleep_save irq_save[] = {
329 SAVE_ITEM(S3C2416_INTMSK2),
330};
331
332int s3c2416_irq_suspend(void)
333{
334 s3c_pm_do_save(irq_save, ARRAY_SIZE(irq_save));
335
336 return 0;
337}
338
339void s3c2416_irq_resume(void)
340{
341 s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save));
342}
343
344struct syscore_ops s3c2416_irq_syscore_ops = {
345 .suspend = s3c2416_irq_suspend,
346 .resume = s3c2416_irq_resume,
347};
348#endif
diff --git a/arch/arm/mach-s3c24xx/irq-s3c2443.c b/arch/arm/mach-s3c24xx/irq-s3c2443.c
deleted file mode 100644
index 5e69109c0928..000000000000
--- a/arch/arm/mach-s3c24xx/irq-s3c2443.c
+++ /dev/null
@@ -1,281 +0,0 @@
1/* linux/arch/arm/mach-s3c2443/irq.c
2 *
3 * Copyright (c) 2007 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
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
22#include <linux/init.h>
23#include <linux/module.h>
24#include <linux/interrupt.h>
25#include <linux/ioport.h>
26#include <linux/device.h>
27#include <linux/io.h>
28
29#include <mach/hardware.h>
30#include <asm/irq.h>
31
32#include <asm/mach/irq.h>
33
34#include <mach/regs-irq.h>
35#include <mach/regs-gpio.h>
36
37#include <plat/cpu.h>
38#include <plat/pm.h>
39#include <plat/irq.h>
40
41#define INTMSK(start, end) ((1 << ((end) + 1 - (start))) - 1)
42
43static inline void s3c2443_irq_demux(unsigned int irq, unsigned int len)
44{
45 unsigned int subsrc, submsk;
46 unsigned int end;
47
48 /* read the current pending interrupts, and the mask
49 * for what it is available */
50
51 subsrc = __raw_readl(S3C2410_SUBSRCPND);
52 submsk = __raw_readl(S3C2410_INTSUBMSK);
53
54 subsrc &= ~submsk;
55 subsrc >>= (irq - S3C2410_IRQSUB(0));
56 subsrc &= (1 << len)-1;
57
58 end = len + irq;
59
60 for (; irq < end && subsrc; irq++) {
61 if (subsrc & 1)
62 generic_handle_irq(irq);
63
64 subsrc >>= 1;
65 }
66}
67
68/* WDT/AC97 sub interrupts */
69
70static void s3c2443_irq_demux_wdtac97(unsigned int irq, struct irq_desc *desc)
71{
72 s3c2443_irq_demux(IRQ_S3C2443_WDT, 4);
73}
74
75#define INTMSK_WDTAC97 (1UL << (IRQ_WDT - IRQ_EINT0))
76#define SUBMSK_WDTAC97 INTMSK(IRQ_S3C2443_WDT, IRQ_S3C2443_AC97)
77
78static void s3c2443_irq_wdtac97_mask(struct irq_data *data)
79{
80 s3c_irqsub_mask(data->irq, INTMSK_WDTAC97, SUBMSK_WDTAC97);
81}
82
83static void s3c2443_irq_wdtac97_unmask(struct irq_data *data)
84{
85 s3c_irqsub_unmask(data->irq, INTMSK_WDTAC97);
86}
87
88static void s3c2443_irq_wdtac97_ack(struct irq_data *data)
89{
90 s3c_irqsub_maskack(data->irq, INTMSK_WDTAC97, SUBMSK_WDTAC97);
91}
92
93static struct irq_chip s3c2443_irq_wdtac97 = {
94 .irq_mask = s3c2443_irq_wdtac97_mask,
95 .irq_unmask = s3c2443_irq_wdtac97_unmask,
96 .irq_ack = s3c2443_irq_wdtac97_ack,
97};
98
99/* LCD sub interrupts */
100
101static void s3c2443_irq_demux_lcd(unsigned int irq, struct irq_desc *desc)
102{
103 s3c2443_irq_demux(IRQ_S3C2443_LCD1, 4);
104}
105
106#define INTMSK_LCD (1UL << (IRQ_LCD - IRQ_EINT0))
107#define SUBMSK_LCD INTMSK(IRQ_S3C2443_LCD1, IRQ_S3C2443_LCD4)
108
109static void s3c2443_irq_lcd_mask(struct irq_data *data)
110{
111 s3c_irqsub_mask(data->irq, INTMSK_LCD, SUBMSK_LCD);
112}
113
114static void s3c2443_irq_lcd_unmask(struct irq_data *data)
115{
116 s3c_irqsub_unmask(data->irq, INTMSK_LCD);
117}
118
119static void s3c2443_irq_lcd_ack(struct irq_data *data)
120{
121 s3c_irqsub_maskack(data->irq, INTMSK_LCD, SUBMSK_LCD);
122}
123
124static struct irq_chip s3c2443_irq_lcd = {
125 .irq_mask = s3c2443_irq_lcd_mask,
126 .irq_unmask = s3c2443_irq_lcd_unmask,
127 .irq_ack = s3c2443_irq_lcd_ack,
128};
129
130/* DMA sub interrupts */
131
132static void s3c2443_irq_demux_dma(unsigned int irq, struct irq_desc *desc)
133{
134 s3c2443_irq_demux(IRQ_S3C2443_DMA0, 6);
135}
136
137#define INTMSK_DMA (1UL << (IRQ_S3C2443_DMA - IRQ_EINT0))
138#define SUBMSK_DMA INTMSK(IRQ_S3C2443_DMA0, IRQ_S3C2443_DMA5)
139
140static void s3c2443_irq_dma_mask(struct irq_data *data)
141{
142 s3c_irqsub_mask(data->irq, INTMSK_DMA, SUBMSK_DMA);
143}
144
145static void s3c2443_irq_dma_unmask(struct irq_data *data)
146{
147 s3c_irqsub_unmask(data->irq, INTMSK_DMA);
148}
149
150static void s3c2443_irq_dma_ack(struct irq_data *data)
151{
152 s3c_irqsub_maskack(data->irq, INTMSK_DMA, SUBMSK_DMA);
153}
154
155static struct irq_chip s3c2443_irq_dma = {
156 .irq_mask = s3c2443_irq_dma_mask,
157 .irq_unmask = s3c2443_irq_dma_unmask,
158 .irq_ack = s3c2443_irq_dma_ack,
159};
160
161/* UART3 sub interrupts */
162
163static void s3c2443_irq_demux_uart3(unsigned int irq, struct irq_desc *desc)
164{
165 s3c2443_irq_demux(IRQ_S3C2443_RX3, 3);
166}
167
168#define INTMSK_UART3 (1UL << (IRQ_S3C2443_UART3 - IRQ_EINT0))
169#define SUBMSK_UART3 (0x7 << (IRQ_S3C2443_RX3 - S3C2410_IRQSUB(0)))
170
171static void s3c2443_irq_uart3_mask(struct irq_data *data)
172{
173 s3c_irqsub_mask(data->irq, INTMSK_UART3, SUBMSK_UART3);
174}
175
176static void s3c2443_irq_uart3_unmask(struct irq_data *data)
177{
178 s3c_irqsub_unmask(data->irq, INTMSK_UART3);
179}
180
181static void s3c2443_irq_uart3_ack(struct irq_data *data)
182{
183 s3c_irqsub_maskack(data->irq, INTMSK_UART3, SUBMSK_UART3);
184}
185
186static struct irq_chip s3c2443_irq_uart3 = {
187 .irq_mask = s3c2443_irq_uart3_mask,
188 .irq_unmask = s3c2443_irq_uart3_unmask,
189 .irq_ack = s3c2443_irq_uart3_ack,
190};
191
192/* CAM sub interrupts */
193
194static void s3c2443_irq_demux_cam(unsigned int irq, struct irq_desc *desc)
195{
196 s3c2443_irq_demux(IRQ_S3C2440_CAM_C, 4);
197}
198
199#define INTMSK_CAM (1UL << (IRQ_CAM - IRQ_EINT0))
200#define SUBMSK_CAM INTMSK(IRQ_S3C2440_CAM_C, IRQ_S3C2440_CAM_P)
201
202static void s3c2443_irq_cam_mask(struct irq_data *data)
203{
204 s3c_irqsub_mask(data->irq, INTMSK_CAM, SUBMSK_CAM);
205}
206
207static void s3c2443_irq_cam_unmask(struct irq_data *data)
208{
209 s3c_irqsub_unmask(data->irq, INTMSK_CAM);
210}
211
212static void s3c2443_irq_cam_ack(struct irq_data *data)
213{
214 s3c_irqsub_maskack(data->irq, INTMSK_CAM, SUBMSK_CAM);
215}
216
217static struct irq_chip s3c2443_irq_cam = {
218 .irq_mask = s3c2443_irq_cam_mask,
219 .irq_unmask = s3c2443_irq_cam_unmask,
220 .irq_ack = s3c2443_irq_cam_ack,
221};
222
223/* IRQ initialisation code */
224
225static int s3c2443_add_sub(unsigned int base,
226 void (*demux)(unsigned int,
227 struct irq_desc *),
228 struct irq_chip *chip,
229 unsigned int start, unsigned int end)
230{
231 unsigned int irqno;
232
233 irq_set_chip_and_handler(base, &s3c_irq_level_chip, handle_level_irq);
234 irq_set_chained_handler(base, demux);
235
236 for (irqno = start; irqno <= end; irqno++) {
237 irq_set_chip_and_handler(irqno, chip, handle_level_irq);
238 set_irq_flags(irqno, IRQF_VALID);
239 }
240
241 return 0;
242}
243
244static int s3c2443_irq_add(struct device *dev,
245 struct subsys_interface *sif)
246{
247 printk("S3C2443: IRQ Support\n");
248
249 s3c2443_add_sub(IRQ_CAM, s3c2443_irq_demux_cam, &s3c2443_irq_cam,
250 IRQ_S3C2440_CAM_C, IRQ_S3C2440_CAM_P);
251
252 s3c2443_add_sub(IRQ_LCD, s3c2443_irq_demux_lcd, &s3c2443_irq_lcd,
253 IRQ_S3C2443_LCD1, IRQ_S3C2443_LCD4);
254
255 s3c2443_add_sub(IRQ_S3C2443_DMA, s3c2443_irq_demux_dma,
256 &s3c2443_irq_dma, IRQ_S3C2443_DMA0, IRQ_S3C2443_DMA5);
257
258 s3c2443_add_sub(IRQ_S3C2443_UART3, s3c2443_irq_demux_uart3,
259 &s3c2443_irq_uart3,
260 IRQ_S3C2443_RX3, IRQ_S3C2443_ERR3);
261
262 s3c2443_add_sub(IRQ_WDT, s3c2443_irq_demux_wdtac97,
263 &s3c2443_irq_wdtac97,
264 IRQ_S3C2443_WDT, IRQ_S3C2443_AC97);
265
266 return 0;
267}
268
269static struct subsys_interface s3c2443_irq_interface = {
270 .name = "s3c2443_irq",
271 .subsys = &s3c2443_subsys,
272 .add_dev = s3c2443_irq_add,
273};
274
275static int __init s3c2443_irq_init(void)
276{
277 return subsys_interface_register(&s3c2443_irq_interface);
278}
279
280arch_initcall(s3c2443_irq_init);
281
diff --git a/arch/arm/mach-s3c24xx/irq.c b/arch/arm/mach-s3c24xx/irq.c
new file mode 100644
index 000000000000..cb9f5e011e73
--- /dev/null
+++ b/arch/arm/mach-s3c24xx/irq.c
@@ -0,0 +1,822 @@
1/*
2 * S3C24XX IRQ handling
3 *
4 * Copyright (c) 2003-2004 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * Copyright (c) 2012 Heiko Stuebner <heiko@sntech.de>
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
19#include <linux/init.h>
20#include <linux/slab.h>
21#include <linux/module.h>
22#include <linux/io.h>
23#include <linux/err.h>
24#include <linux/interrupt.h>
25#include <linux/ioport.h>
26#include <linux/device.h>
27#include <linux/irqdomain.h>
28
29#include <asm/mach/irq.h>
30
31#include <mach/regs-irq.h>
32#include <mach/regs-gpio.h>
33
34#include <plat/cpu.h>
35#include <plat/regs-irqtype.h>
36#include <plat/pm.h>
37#include <plat/irq.h>
38
39#define S3C_IRQTYPE_NONE 0
40#define S3C_IRQTYPE_EINT 1
41#define S3C_IRQTYPE_EDGE 2
42#define S3C_IRQTYPE_LEVEL 3
43
44struct s3c_irq_data {
45 unsigned int type;
46 unsigned long parent_irq;
47
48 /* data gets filled during init */
49 struct s3c_irq_intc *intc;
50 unsigned long sub_bits;
51 struct s3c_irq_intc *sub_intc;
52};
53
54/*
55 * Sructure holding the controller data
56 * @reg_pending register holding pending irqs
57 * @reg_intpnd special register intpnd in main intc
58 * @reg_mask mask register
59 * @domain irq_domain of the controller
60 * @parent parent controller for ext and sub irqs
61 * @irqs irq-data, always s3c_irq_data[32]
62 */
63struct s3c_irq_intc {
64 void __iomem *reg_pending;
65 void __iomem *reg_intpnd;
66 void __iomem *reg_mask;
67 struct irq_domain *domain;
68 struct s3c_irq_intc *parent;
69 struct s3c_irq_data *irqs;
70};
71
72static void s3c_irq_mask(struct irq_data *data)
73{
74 struct s3c_irq_intc *intc = data->domain->host_data;
75 struct s3c_irq_intc *parent_intc = intc->parent;
76 struct s3c_irq_data *irq_data = &intc->irqs[data->hwirq];
77 struct s3c_irq_data *parent_data;
78 unsigned long mask;
79 unsigned int irqno;
80
81 mask = __raw_readl(intc->reg_mask);
82 mask |= (1UL << data->hwirq);
83 __raw_writel(mask, intc->reg_mask);
84
85 if (parent_intc && irq_data->parent_irq) {
86 parent_data = &parent_intc->irqs[irq_data->parent_irq];
87
88 /* check to see if we need to mask the parent IRQ */
89 if ((mask & parent_data->sub_bits) == parent_data->sub_bits) {
90 irqno = irq_find_mapping(parent_intc->domain,
91 irq_data->parent_irq);
92 s3c_irq_mask(irq_get_irq_data(irqno));
93 }
94 }
95}
96
97static void s3c_irq_unmask(struct irq_data *data)
98{
99 struct s3c_irq_intc *intc = data->domain->host_data;
100 struct s3c_irq_intc *parent_intc = intc->parent;
101 struct s3c_irq_data *irq_data = &intc->irqs[data->hwirq];
102 unsigned long mask;
103 unsigned int irqno;
104
105 mask = __raw_readl(intc->reg_mask);
106 mask &= ~(1UL << data->hwirq);
107 __raw_writel(mask, intc->reg_mask);
108
109 if (parent_intc && irq_data->parent_irq) {
110 irqno = irq_find_mapping(parent_intc->domain,
111 irq_data->parent_irq);
112 s3c_irq_unmask(irq_get_irq_data(irqno));
113 }
114}
115
116static inline void s3c_irq_ack(struct irq_data *data)
117{
118 struct s3c_irq_intc *intc = data->domain->host_data;
119 unsigned long bitval = 1UL << data->hwirq;
120
121 __raw_writel(bitval, intc->reg_pending);
122 if (intc->reg_intpnd)
123 __raw_writel(bitval, intc->reg_intpnd);
124}
125
126static int s3c_irqext_type_set(void __iomem *gpcon_reg,
127 void __iomem *extint_reg,
128 unsigned long gpcon_offset,
129 unsigned long extint_offset,
130 unsigned int type)
131{
132 unsigned long newvalue = 0, value;
133
134 /* Set the GPIO to external interrupt mode */
135 value = __raw_readl(gpcon_reg);
136 value = (value & ~(3 << gpcon_offset)) | (0x02 << gpcon_offset);
137 __raw_writel(value, gpcon_reg);
138
139 /* Set the external interrupt to pointed trigger type */
140 switch (type)
141 {
142 case IRQ_TYPE_NONE:
143 pr_warn("No edge setting!\n");
144 break;
145
146 case IRQ_TYPE_EDGE_RISING:
147 newvalue = S3C2410_EXTINT_RISEEDGE;
148 break;
149
150 case IRQ_TYPE_EDGE_FALLING:
151 newvalue = S3C2410_EXTINT_FALLEDGE;
152 break;
153
154 case IRQ_TYPE_EDGE_BOTH:
155 newvalue = S3C2410_EXTINT_BOTHEDGE;
156 break;
157
158 case IRQ_TYPE_LEVEL_LOW:
159 newvalue = S3C2410_EXTINT_LOWLEV;
160 break;
161
162 case IRQ_TYPE_LEVEL_HIGH:
163 newvalue = S3C2410_EXTINT_HILEV;
164 break;
165
166 default:
167 pr_err("No such irq type %d", type);
168 return -EINVAL;
169 }
170
171 value = __raw_readl(extint_reg);
172 value = (value & ~(7 << extint_offset)) | (newvalue << extint_offset);
173 __raw_writel(value, extint_reg);
174
175 return 0;
176}
177
178/* FIXME: make static when it's out of plat-samsung/irq.h */
179int s3c_irqext_type(struct irq_data *data, unsigned int type)
180{
181 void __iomem *extint_reg;
182 void __iomem *gpcon_reg;
183 unsigned long gpcon_offset, extint_offset;
184
185 if ((data->hwirq >= 4) && (data->hwirq <= 7)) {
186 gpcon_reg = S3C2410_GPFCON;
187 extint_reg = S3C24XX_EXTINT0;
188 gpcon_offset = (data->hwirq) * 2;
189 extint_offset = (data->hwirq) * 4;
190 } else if ((data->hwirq >= 8) && (data->hwirq <= 15)) {
191 gpcon_reg = S3C2410_GPGCON;
192 extint_reg = S3C24XX_EXTINT1;
193 gpcon_offset = (data->hwirq - 8) * 2;
194 extint_offset = (data->hwirq - 8) * 4;
195 } else if ((data->hwirq >= 16) && (data->hwirq <= 23)) {
196 gpcon_reg = S3C2410_GPGCON;
197 extint_reg = S3C24XX_EXTINT2;
198 gpcon_offset = (data->hwirq - 8) * 2;
199 extint_offset = (data->hwirq - 16) * 4;
200 } else {
201 return -EINVAL;
202 }
203
204 return s3c_irqext_type_set(gpcon_reg, extint_reg, gpcon_offset,
205 extint_offset, type);
206}
207
208static int s3c_irqext0_type(struct irq_data *data, unsigned int type)
209{
210 void __iomem *extint_reg;
211 void __iomem *gpcon_reg;
212 unsigned long gpcon_offset, extint_offset;
213
214 if ((data->hwirq >= 0) && (data->hwirq <= 3)) {
215 gpcon_reg = S3C2410_GPFCON;
216 extint_reg = S3C24XX_EXTINT0;
217 gpcon_offset = (data->hwirq) * 2;
218 extint_offset = (data->hwirq) * 4;
219 } else {
220 return -EINVAL;
221 }
222
223 return s3c_irqext_type_set(gpcon_reg, extint_reg, gpcon_offset,
224 extint_offset, type);
225}
226
227struct irq_chip s3c_irq_chip = {
228 .name = "s3c",
229 .irq_ack = s3c_irq_ack,
230 .irq_mask = s3c_irq_mask,
231 .irq_unmask = s3c_irq_unmask,
232 .irq_set_wake = s3c_irq_wake
233};
234
235struct irq_chip s3c_irq_level_chip = {
236 .name = "s3c-level",
237 .irq_mask = s3c_irq_mask,
238 .irq_unmask = s3c_irq_unmask,
239 .irq_ack = s3c_irq_ack,
240};
241
242static struct irq_chip s3c_irqext_chip = {
243 .name = "s3c-ext",
244 .irq_mask = s3c_irq_mask,
245 .irq_unmask = s3c_irq_unmask,
246 .irq_ack = s3c_irq_ack,
247 .irq_set_type = s3c_irqext_type,
248 .irq_set_wake = s3c_irqext_wake
249};
250
251static struct irq_chip s3c_irq_eint0t4 = {
252 .name = "s3c-ext0",
253 .irq_ack = s3c_irq_ack,
254 .irq_mask = s3c_irq_mask,
255 .irq_unmask = s3c_irq_unmask,
256 .irq_set_wake = s3c_irq_wake,
257 .irq_set_type = s3c_irqext0_type,
258};
259
260static void s3c_irq_demux(unsigned int irq, struct irq_desc *desc)
261{
262 struct irq_chip *chip = irq_desc_get_chip(desc);
263 struct s3c_irq_intc *intc = desc->irq_data.domain->host_data;
264 struct s3c_irq_data *irq_data = &intc->irqs[desc->irq_data.hwirq];
265 struct s3c_irq_intc *sub_intc = irq_data->sub_intc;
266 unsigned long src;
267 unsigned long msk;
268 unsigned int n;
269
270 chained_irq_enter(chip, desc);
271
272 src = __raw_readl(sub_intc->reg_pending);
273 msk = __raw_readl(sub_intc->reg_mask);
274
275 src &= ~msk;
276 src &= irq_data->sub_bits;
277
278 while (src) {
279 n = __ffs(src);
280 src &= ~(1 << n);
281 generic_handle_irq(irq_find_mapping(sub_intc->domain, n));
282 }
283
284 chained_irq_exit(chip, desc);
285}
286
287#ifdef CONFIG_FIQ
288/**
289 * s3c24xx_set_fiq - set the FIQ routing
290 * @irq: IRQ number to route to FIQ on processor.
291 * @on: Whether to route @irq to the FIQ, or to remove the FIQ routing.
292 *
293 * Change the state of the IRQ to FIQ routing depending on @irq and @on. If
294 * @on is true, the @irq is checked to see if it can be routed and the
295 * interrupt controller updated to route the IRQ. If @on is false, the FIQ
296 * routing is cleared, regardless of which @irq is specified.
297 */
298int s3c24xx_set_fiq(unsigned int irq, bool on)
299{
300 u32 intmod;
301 unsigned offs;
302
303 if (on) {
304 offs = irq - FIQ_START;
305 if (offs > 31)
306 return -EINVAL;
307
308 intmod = 1 << offs;
309 } else {
310 intmod = 0;
311 }
312
313 __raw_writel(intmod, S3C2410_INTMOD);
314 return 0;
315}
316
317EXPORT_SYMBOL_GPL(s3c24xx_set_fiq);
318#endif
319
320static int s3c24xx_irq_map(struct irq_domain *h, unsigned int virq,
321 irq_hw_number_t hw)
322{
323 struct s3c_irq_intc *intc = h->host_data;
324 struct s3c_irq_data *irq_data = &intc->irqs[hw];
325 struct s3c_irq_intc *parent_intc;
326 struct s3c_irq_data *parent_irq_data;
327 unsigned int irqno;
328
329 if (!intc) {
330 pr_err("irq-s3c24xx: no controller found for hwirq %lu\n", hw);
331 return -EINVAL;
332 }
333
334 if (!irq_data) {
335 pr_err("irq-s3c24xx: no irq data found for hwirq %lu\n", hw);
336 return -EINVAL;
337 }
338
339 /* attach controller pointer to irq_data */
340 irq_data->intc = intc;
341
342 /* set handler and flags */
343 switch (irq_data->type) {
344 case S3C_IRQTYPE_NONE:
345 return 0;
346 case S3C_IRQTYPE_EINT:
347 if (irq_data->parent_irq)
348 irq_set_chip_and_handler(virq, &s3c_irqext_chip,
349 handle_edge_irq);
350 else
351 irq_set_chip_and_handler(virq, &s3c_irq_eint0t4,
352 handle_edge_irq);
353 break;
354 case S3C_IRQTYPE_EDGE:
355 if (irq_data->parent_irq ||
356 intc->reg_pending == S3C2416_SRCPND2)
357 irq_set_chip_and_handler(virq, &s3c_irq_level_chip,
358 handle_edge_irq);
359 else
360 irq_set_chip_and_handler(virq, &s3c_irq_chip,
361 handle_edge_irq);
362 break;
363 case S3C_IRQTYPE_LEVEL:
364 if (irq_data->parent_irq)
365 irq_set_chip_and_handler(virq, &s3c_irq_level_chip,
366 handle_level_irq);
367 else
368 irq_set_chip_and_handler(virq, &s3c_irq_chip,
369 handle_level_irq);
370 break;
371 default:
372 pr_err("irq-s3c24xx: unsupported irqtype %d\n", irq_data->type);
373 return -EINVAL;
374 }
375 set_irq_flags(virq, IRQF_VALID);
376
377 if (irq_data->parent_irq) {
378 parent_intc = intc->parent;
379 if (!parent_intc) {
380 pr_err("irq-s3c24xx: no parent controller found for hwirq %lu\n",
381 hw);
382 goto err;
383 }
384
385 parent_irq_data = &parent_intc->irqs[irq_data->parent_irq];
386 if (!irq_data) {
387 pr_err("irq-s3c24xx: no irq data found for hwirq %lu\n",
388 hw);
389 goto err;
390 }
391
392 parent_irq_data->sub_intc = intc;
393 parent_irq_data->sub_bits |= (1UL << hw);
394
395 /* attach the demuxer to the parent irq */
396 irqno = irq_find_mapping(parent_intc->domain,
397 irq_data->parent_irq);
398 if (!irqno) {
399 pr_err("irq-s3c24xx: could not find mapping for parent irq %lu\n",
400 irq_data->parent_irq);
401 goto err;
402 }
403 irq_set_chained_handler(irqno, s3c_irq_demux);
404 }
405
406 return 0;
407
408err:
409 set_irq_flags(virq, 0);
410
411 /* the only error can result from bad mapping data*/
412 return -EINVAL;
413}
414
415static struct irq_domain_ops s3c24xx_irq_ops = {
416 .map = s3c24xx_irq_map,
417 .xlate = irq_domain_xlate_twocell,
418};
419
420static void s3c24xx_clear_intc(struct s3c_irq_intc *intc)
421{
422 void __iomem *reg_source;
423 unsigned long pend;
424 unsigned long last;
425 int i;
426
427 /* if intpnd is set, read the next pending irq from there */
428 reg_source = intc->reg_intpnd ? intc->reg_intpnd : intc->reg_pending;
429
430 last = 0;
431 for (i = 0; i < 4; i++) {
432 pend = __raw_readl(reg_source);
433
434 if (pend == 0 || pend == last)
435 break;
436
437 __raw_writel(pend, intc->reg_pending);
438 if (intc->reg_intpnd)
439 __raw_writel(pend, intc->reg_intpnd);
440
441 pr_info("irq: clearing pending status %08x\n", (int)pend);
442 last = pend;
443 }
444}
445
446struct s3c_irq_intc *s3c24xx_init_intc(struct device_node *np,
447 struct s3c_irq_data *irq_data,
448 struct s3c_irq_intc *parent,
449 unsigned long address)
450{
451 struct s3c_irq_intc *intc;
452 void __iomem *base = (void *)0xf6000000; /* static mapping */
453 int irq_num;
454 int irq_start;
455 int irq_offset;
456 int ret;
457
458 intc = kzalloc(sizeof(struct s3c_irq_intc), GFP_KERNEL);
459 if (!intc)
460 return ERR_PTR(-ENOMEM);
461
462 intc->irqs = irq_data;
463
464 if (parent)
465 intc->parent = parent;
466
467 /* select the correct data for the controller.
468 * Need to hard code the irq num start and offset
469 * to preserve the static mapping for now
470 */
471 switch (address) {
472 case 0x4a000000:
473 pr_debug("irq: found main intc\n");
474 intc->reg_pending = base;
475 intc->reg_mask = base + 0x08;
476 intc->reg_intpnd = base + 0x10;
477 irq_num = 32;
478 irq_start = S3C2410_IRQ(0);
479 irq_offset = 0;
480 break;
481 case 0x4a000018:
482 pr_debug("irq: found subintc\n");
483 intc->reg_pending = base + 0x18;
484 intc->reg_mask = base + 0x1c;
485 irq_num = 29;
486 irq_start = S3C2410_IRQSUB(0);
487 irq_offset = 0;
488 break;
489 case 0x4a000040:
490 pr_debug("irq: found intc2\n");
491 intc->reg_pending = base + 0x40;
492 intc->reg_mask = base + 0x48;
493 intc->reg_intpnd = base + 0x50;
494 irq_num = 8;
495 irq_start = S3C2416_IRQ(0);
496 irq_offset = 0;
497 break;
498 case 0x560000a4:
499 pr_debug("irq: found eintc\n");
500 base = (void *)0xfd000000;
501
502 intc->reg_mask = base + 0xa4;
503 intc->reg_pending = base + 0x08;
504 irq_num = 20;
505 irq_start = S3C2410_IRQ(32);
506 irq_offset = 4;
507 break;
508 default:
509 pr_err("irq: unsupported controller address\n");
510 ret = -EINVAL;
511 goto err;
512 }
513
514 /* now that all the data is complete, init the irq-domain */
515 s3c24xx_clear_intc(intc);
516 intc->domain = irq_domain_add_legacy(np, irq_num, irq_start,
517 irq_offset, &s3c24xx_irq_ops,
518 intc);
519 if (!intc->domain) {
520 pr_err("irq: could not create irq-domain\n");
521 ret = -EINVAL;
522 goto err;
523 }
524
525 return intc;
526
527err:
528 kfree(intc);
529 return ERR_PTR(ret);
530}
531
532/* s3c24xx_init_irq
533 *
534 * Initialise S3C2410 IRQ system
535*/
536
537static struct s3c_irq_data init_base[32] = {
538 { .type = S3C_IRQTYPE_EINT, }, /* EINT0 */
539 { .type = S3C_IRQTYPE_EINT, }, /* EINT1 */
540 { .type = S3C_IRQTYPE_EINT, }, /* EINT2 */
541 { .type = S3C_IRQTYPE_EINT, }, /* EINT3 */
542 { .type = S3C_IRQTYPE_LEVEL, }, /* EINT4to7 */
543 { .type = S3C_IRQTYPE_LEVEL, }, /* EINT8to23 */
544 { .type = S3C_IRQTYPE_NONE, }, /* reserved */
545 { .type = S3C_IRQTYPE_EDGE, }, /* nBATT_FLT */
546 { .type = S3C_IRQTYPE_EDGE, }, /* TICK */
547 { .type = S3C_IRQTYPE_EDGE, }, /* WDT */
548 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER0 */
549 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER1 */
550 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER2 */
551 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER3 */
552 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER4 */
553 { .type = S3C_IRQTYPE_LEVEL, }, /* UART2 */
554 { .type = S3C_IRQTYPE_EDGE, }, /* LCD */
555 { .type = S3C_IRQTYPE_EDGE, }, /* DMA0 */
556 { .type = S3C_IRQTYPE_EDGE, }, /* DMA1 */
557 { .type = S3C_IRQTYPE_EDGE, }, /* DMA2 */
558 { .type = S3C_IRQTYPE_EDGE, }, /* DMA3 */
559 { .type = S3C_IRQTYPE_EDGE, }, /* SDI */
560 { .type = S3C_IRQTYPE_EDGE, }, /* SPI0 */
561 { .type = S3C_IRQTYPE_LEVEL, }, /* UART1 */
562 { .type = S3C_IRQTYPE_NONE, }, /* reserved */
563 { .type = S3C_IRQTYPE_EDGE, }, /* USBD */
564 { .type = S3C_IRQTYPE_EDGE, }, /* USBH */
565 { .type = S3C_IRQTYPE_EDGE, }, /* IIC */
566 { .type = S3C_IRQTYPE_LEVEL, }, /* UART0 */
567 { .type = S3C_IRQTYPE_EDGE, }, /* SPI1 */
568 { .type = S3C_IRQTYPE_EDGE, }, /* RTC */
569 { .type = S3C_IRQTYPE_LEVEL, }, /* ADCPARENT */
570};
571
572static struct s3c_irq_data init_eint[32] = {
573 { .type = S3C_IRQTYPE_NONE, }, /* reserved */
574 { .type = S3C_IRQTYPE_NONE, }, /* reserved */
575 { .type = S3C_IRQTYPE_NONE, }, /* reserved */
576 { .type = S3C_IRQTYPE_NONE, }, /* reserved */
577 { .type = S3C_IRQTYPE_EINT, .parent_irq = 4 }, /* EINT4 */
578 { .type = S3C_IRQTYPE_EINT, .parent_irq = 4 }, /* EINT5 */
579 { .type = S3C_IRQTYPE_EINT, .parent_irq = 4 }, /* EINT6 */
580 { .type = S3C_IRQTYPE_EINT, .parent_irq = 4 }, /* EINT7 */
581 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT8 */
582 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT9 */
583 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT10 */
584 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT11 */
585 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT12 */
586 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT13 */
587 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT14 */
588 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT15 */
589 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT16 */
590 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT17 */
591 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT18 */
592 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT19 */
593 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT20 */
594 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT21 */
595 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT22 */
596 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT23 */
597};
598
599static struct s3c_irq_data init_subint[32] = {
600 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-RX */
601 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-TX */
602 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-ERR */
603 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-RX */
604 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-TX */
605 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-ERR */
606 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-RX */
607 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-TX */
608 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-ERR */
609 { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* TC */
610 { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* ADC */
611};
612
613void __init s3c24xx_init_irq(void)
614{
615 struct s3c_irq_intc *main_intc;
616
617#ifdef CONFIG_FIQ
618 init_FIQ(FIQ_START);
619#endif
620
621 main_intc = s3c24xx_init_intc(NULL, &init_base[0], NULL, 0x4a000000);
622 if (IS_ERR(main_intc)) {
623 pr_err("irq: could not create main interrupt controller\n");
624 return;
625 }
626
627 s3c24xx_init_intc(NULL, &init_subint[0], main_intc, 0x4a000018);
628 s3c24xx_init_intc(NULL, &init_eint[0], main_intc, 0x560000a4);
629}
630
631#ifdef CONFIG_CPU_S3C2416
632static struct s3c_irq_data init_s3c2416base[32] = {
633 { .type = S3C_IRQTYPE_EINT, }, /* EINT0 */
634 { .type = S3C_IRQTYPE_EINT, }, /* EINT1 */
635 { .type = S3C_IRQTYPE_EINT, }, /* EINT2 */
636 { .type = S3C_IRQTYPE_EINT, }, /* EINT3 */
637 { .type = S3C_IRQTYPE_LEVEL, }, /* EINT4to7 */
638 { .type = S3C_IRQTYPE_LEVEL, }, /* EINT8to23 */
639 { .type = S3C_IRQTYPE_NONE, }, /* reserved */
640 { .type = S3C_IRQTYPE_EDGE, }, /* nBATT_FLT */
641 { .type = S3C_IRQTYPE_EDGE, }, /* TICK */
642 { .type = S3C_IRQTYPE_LEVEL, }, /* WDT/AC97 */
643 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER0 */
644 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER1 */
645 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER2 */
646 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER3 */
647 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER4 */
648 { .type = S3C_IRQTYPE_LEVEL, }, /* UART2 */
649 { .type = S3C_IRQTYPE_LEVEL, }, /* LCD */
650 { .type = S3C_IRQTYPE_LEVEL, }, /* DMA */
651 { .type = S3C_IRQTYPE_LEVEL, }, /* UART3 */
652 { .type = S3C_IRQTYPE_NONE, }, /* reserved */
653 { .type = S3C_IRQTYPE_EDGE, }, /* SDI1 */
654 { .type = S3C_IRQTYPE_EDGE, }, /* SDI0 */
655 { .type = S3C_IRQTYPE_EDGE, }, /* SPI0 */
656 { .type = S3C_IRQTYPE_LEVEL, }, /* UART1 */
657 { .type = S3C_IRQTYPE_EDGE, }, /* NAND */
658 { .type = S3C_IRQTYPE_EDGE, }, /* USBD */
659 { .type = S3C_IRQTYPE_EDGE, }, /* USBH */
660 { .type = S3C_IRQTYPE_EDGE, }, /* IIC */
661 { .type = S3C_IRQTYPE_LEVEL, }, /* UART0 */
662 { .type = S3C_IRQTYPE_NONE, },
663 { .type = S3C_IRQTYPE_EDGE, }, /* RTC */
664 { .type = S3C_IRQTYPE_LEVEL, }, /* ADCPARENT */
665};
666
667static struct s3c_irq_data init_s3c2416subint[32] = {
668 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-RX */
669 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-TX */
670 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-ERR */
671 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-RX */
672 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-TX */
673 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-ERR */
674 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-RX */
675 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-TX */
676 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-ERR */
677 { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* TC */
678 { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* ADC */
679 { .type = S3C_IRQTYPE_NONE }, /* reserved */
680 { .type = S3C_IRQTYPE_NONE }, /* reserved */
681 { .type = S3C_IRQTYPE_NONE }, /* reserved */
682 { .type = S3C_IRQTYPE_NONE }, /* reserved */
683 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 16 }, /* LCD2 */
684 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 16 }, /* LCD3 */
685 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 16 }, /* LCD4 */
686 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA0 */
687 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA1 */
688 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA2 */
689 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA3 */
690 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA4 */
691 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA5 */
692 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 18 }, /* UART3-RX */
693 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 18 }, /* UART3-TX */
694 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 18 }, /* UART3-ERR */
695 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 9 }, /* WDT */
696 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 9 }, /* AC97 */
697};
698
699static struct s3c_irq_data init_s3c2416_second[32] = {
700 { .type = S3C_IRQTYPE_EDGE }, /* 2D */
701 { .type = S3C_IRQTYPE_EDGE }, /* IIC1 */
702 { .type = S3C_IRQTYPE_NONE }, /* reserved */
703 { .type = S3C_IRQTYPE_NONE }, /* reserved */
704 { .type = S3C_IRQTYPE_EDGE }, /* PCM0 */
705 { .type = S3C_IRQTYPE_EDGE }, /* PCM1 */
706 { .type = S3C_IRQTYPE_EDGE }, /* I2S0 */
707 { .type = S3C_IRQTYPE_EDGE }, /* I2S1 */
708};
709
710void __init s3c2416_init_irq(void)
711{
712 struct s3c_irq_intc *main_intc;
713
714 pr_info("S3C2416: IRQ Support\n");
715
716#ifdef CONFIG_FIQ
717 init_FIQ(FIQ_START);
718#endif
719
720 main_intc = s3c24xx_init_intc(NULL, &init_s3c2416base[0], NULL, 0x4a000000);
721 if (IS_ERR(main_intc)) {
722 pr_err("irq: could not create main interrupt controller\n");
723 return;
724 }
725
726 s3c24xx_init_intc(NULL, &init_eint[0], main_intc, 0x560000a4);
727 s3c24xx_init_intc(NULL, &init_s3c2416subint[0], main_intc, 0x4a000018);
728
729 s3c24xx_init_intc(NULL, &init_s3c2416_second[0], NULL, 0x4a000040);
730}
731
732#endif
733
734#ifdef CONFIG_CPU_S3C2443
735static struct s3c_irq_data init_s3c2443base[32] = {
736 { .type = S3C_IRQTYPE_EINT, }, /* EINT0 */
737 { .type = S3C_IRQTYPE_EINT, }, /* EINT1 */
738 { .type = S3C_IRQTYPE_EINT, }, /* EINT2 */
739 { .type = S3C_IRQTYPE_EINT, }, /* EINT3 */
740 { .type = S3C_IRQTYPE_LEVEL, }, /* EINT4to7 */
741 { .type = S3C_IRQTYPE_LEVEL, }, /* EINT8to23 */
742 { .type = S3C_IRQTYPE_LEVEL, }, /* CAM */
743 { .type = S3C_IRQTYPE_EDGE, }, /* nBATT_FLT */
744 { .type = S3C_IRQTYPE_EDGE, }, /* TICK */
745 { .type = S3C_IRQTYPE_LEVEL, }, /* WDT/AC97 */
746 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER0 */
747 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER1 */
748 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER2 */
749 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER3 */
750 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER4 */
751 { .type = S3C_IRQTYPE_LEVEL, }, /* UART2 */
752 { .type = S3C_IRQTYPE_LEVEL, }, /* LCD */
753 { .type = S3C_IRQTYPE_LEVEL, }, /* DMA */
754 { .type = S3C_IRQTYPE_LEVEL, }, /* UART3 */
755 { .type = S3C_IRQTYPE_EDGE, }, /* CFON */
756 { .type = S3C_IRQTYPE_EDGE, }, /* SDI1 */
757 { .type = S3C_IRQTYPE_EDGE, }, /* SDI0 */
758 { .type = S3C_IRQTYPE_EDGE, }, /* SPI0 */
759 { .type = S3C_IRQTYPE_LEVEL, }, /* UART1 */
760 { .type = S3C_IRQTYPE_EDGE, }, /* NAND */
761 { .type = S3C_IRQTYPE_EDGE, }, /* USBD */
762 { .type = S3C_IRQTYPE_EDGE, }, /* USBH */
763 { .type = S3C_IRQTYPE_EDGE, }, /* IIC */
764 { .type = S3C_IRQTYPE_LEVEL, }, /* UART0 */
765 { .type = S3C_IRQTYPE_EDGE, }, /* SPI1 */
766 { .type = S3C_IRQTYPE_EDGE, }, /* RTC */
767 { .type = S3C_IRQTYPE_LEVEL, }, /* ADCPARENT */
768};
769
770
771static struct s3c_irq_data init_s3c2443subint[32] = {
772 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-RX */
773 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-TX */
774 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-ERR */
775 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-RX */
776 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-TX */
777 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-ERR */
778 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-RX */
779 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-TX */
780 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-ERR */
781 { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* TC */
782 { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* ADC */
783 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 6 }, /* CAM_C */
784 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 6 }, /* CAM_P */
785 { .type = S3C_IRQTYPE_NONE }, /* reserved */
786 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 16 }, /* LCD1 */
787 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 16 }, /* LCD2 */
788 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 16 }, /* LCD3 */
789 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 16 }, /* LCD4 */
790 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA0 */
791 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA1 */
792 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA2 */
793 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA3 */
794 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA4 */
795 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA5 */
796 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 18 }, /* UART3-RX */
797 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 18 }, /* UART3-TX */
798 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 18 }, /* UART3-ERR */
799 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 9 }, /* WDT */
800 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 9 }, /* AC97 */
801};
802
803void __init s3c2443_init_irq(void)
804{
805 struct s3c_irq_intc *main_intc;
806
807 pr_info("S3C2443: IRQ Support\n");
808
809#ifdef CONFIG_FIQ
810 init_FIQ(FIQ_START);
811#endif
812
813 main_intc = s3c24xx_init_intc(NULL, &init_s3c2443base[0], NULL, 0x4a000000);
814 if (IS_ERR(main_intc)) {
815 pr_err("irq: could not create main interrupt controller\n");
816 return;
817 }
818
819 s3c24xx_init_intc(NULL, &init_eint[0], main_intc, 0x560000a4);
820 s3c24xx_init_intc(NULL, &init_s3c2443subint[0], main_intc, 0x4a000018);
821}
822#endif
diff --git a/arch/arm/mach-s3c24xx/mach-amlm5900.c b/arch/arm/mach-s3c24xx/mach-amlm5900.c
index f4ad99c1e476..0e0279e79150 100644
--- a/arch/arm/mach-s3c24xx/mach-amlm5900.c
+++ b/arch/arm/mach-s3c24xx/mach-amlm5900.c
@@ -237,6 +237,6 @@ MACHINE_START(AML_M5900, "AML_M5900")
237 .map_io = amlm5900_map_io, 237 .map_io = amlm5900_map_io,
238 .init_irq = s3c24xx_init_irq, 238 .init_irq = s3c24xx_init_irq,
239 .init_machine = amlm5900_init, 239 .init_machine = amlm5900_init,
240 .timer = &s3c24xx_timer, 240 .init_time = s3c24xx_timer_init,
241 .restart = s3c2410_restart, 241 .restart = s3c2410_restart,
242MACHINE_END 242MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-anubis.c b/arch/arm/mach-s3c24xx/mach-anubis.c
index 1ee8c4638743..bb595f15ce36 100644
--- a/arch/arm/mach-s3c24xx/mach-anubis.c
+++ b/arch/arm/mach-s3c24xx/mach-anubis.c
@@ -28,17 +28,12 @@
28#include <asm/mach/map.h> 28#include <asm/mach/map.h>
29#include <asm/mach/irq.h> 29#include <asm/mach/irq.h>
30 30
31#include <mach/anubis-map.h>
32#include <mach/anubis-irq.h>
33#include <mach/anubis-cpld.h>
34
35#include <mach/hardware.h> 31#include <mach/hardware.h>
36#include <asm/irq.h> 32#include <asm/irq.h>
37#include <asm/mach-types.h> 33#include <asm/mach-types.h>
38 34
39#include <plat/regs-serial.h> 35#include <plat/regs-serial.h>
40#include <mach/regs-gpio.h> 36#include <mach/regs-gpio.h>
41#include <mach/regs-mem.h>
42#include <mach/regs-lcd.h> 37#include <mach/regs-lcd.h>
43#include <linux/platform_data/mtd-nand-s3c2410.h> 38#include <linux/platform_data/mtd-nand-s3c2410.h>
44#include <linux/platform_data/i2c-s3c2410.h> 39#include <linux/platform_data/i2c-s3c2410.h>
@@ -55,8 +50,9 @@
55#include <plat/cpu.h> 50#include <plat/cpu.h>
56#include <linux/platform_data/asoc-s3c24xx_simtec.h> 51#include <linux/platform_data/asoc-s3c24xx_simtec.h>
57 52
58#include "simtec.h" 53#include "anubis.h"
59#include "common.h" 54#include "common.h"
55#include "simtec.h"
60 56
61#define COPYRIGHT ", Copyright 2005-2009 Simtec Electronics" 57#define COPYRIGHT ", Copyright 2005-2009 Simtec Electronics"
62 58
@@ -237,7 +233,7 @@ static struct pata_platform_info anubis_ide_platdata = {
237static struct resource anubis_ide0_resource[] = { 233static struct resource anubis_ide0_resource[] = {
238 [0] = DEFINE_RES_MEM(S3C2410_CS3, 8 * 32), 234 [0] = DEFINE_RES_MEM(S3C2410_CS3, 8 * 32),
239 [2] = DEFINE_RES_MEM(S3C2410_CS3 + (1 << 26) + (6 * 32), 32), 235 [2] = DEFINE_RES_MEM(S3C2410_CS3 + (1 << 26) + (6 * 32), 32),
240 [3] = DEFINE_RES_IRQ(IRQ_IDE0), 236 [3] = DEFINE_RES_IRQ(ANUBIS_IRQ_IDE0),
241}; 237};
242 238
243static struct platform_device anubis_device_ide0 = { 239static struct platform_device anubis_device_ide0 = {
@@ -254,7 +250,7 @@ static struct platform_device anubis_device_ide0 = {
254static struct resource anubis_ide1_resource[] = { 250static struct resource anubis_ide1_resource[] = {
255 [0] = DEFINE_RES_MEM(S3C2410_CS4, 8 * 32), 251 [0] = DEFINE_RES_MEM(S3C2410_CS4, 8 * 32),
256 [1] = DEFINE_RES_MEM(S3C2410_CS4 + (1 << 26) + (6 * 32), 32), 252 [1] = DEFINE_RES_MEM(S3C2410_CS4 + (1 << 26) + (6 * 32), 32),
257 [2] = DEFINE_RES_IRQ(IRQ_IDE0), 253 [2] = DEFINE_RES_IRQ(ANUBIS_IRQ_IDE0),
258}; 254};
259 255
260static struct platform_device anubis_device_ide1 = { 256static struct platform_device anubis_device_ide1 = {
@@ -279,7 +275,7 @@ static struct ax_plat_data anubis_asix_platdata = {
279 275
280static struct resource anubis_asix_resource[] = { 276static struct resource anubis_asix_resource[] = {
281 [0] = DEFINE_RES_MEM(S3C2410_CS5, 0x20 * 0x20), 277 [0] = DEFINE_RES_MEM(S3C2410_CS5, 0x20 * 0x20),
282 [1] = DEFINE_RES_IRQ(IRQ_ASIX), 278 [1] = DEFINE_RES_IRQ(ANUBIS_IRQ_ASIX),
283}; 279};
284 280
285static struct platform_device anubis_device_asix = { 281static struct platform_device anubis_device_asix = {
@@ -448,6 +444,6 @@ MACHINE_START(ANUBIS, "Simtec-Anubis")
448 .map_io = anubis_map_io, 444 .map_io = anubis_map_io,
449 .init_machine = anubis_init, 445 .init_machine = anubis_init,
450 .init_irq = s3c24xx_init_irq, 446 .init_irq = s3c24xx_init_irq,
451 .timer = &s3c24xx_timer, 447 .init_time = s3c24xx_timer_init,
452 .restart = s3c244x_restart, 448 .restart = s3c244x_restart,
453MACHINE_END 449MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-at2440evb.c b/arch/arm/mach-s3c24xx/mach-at2440evb.c
index 00381fe5de32..b4bc60c78ebb 100644
--- a/arch/arm/mach-s3c24xx/mach-at2440evb.c
+++ b/arch/arm/mach-s3c24xx/mach-at2440evb.c
@@ -14,6 +14,7 @@
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/gpio.h>
17#include <linux/interrupt.h> 18#include <linux/interrupt.h>
18#include <linux/list.h> 19#include <linux/list.h>
19#include <linux/timer.h> 20#include <linux/timer.h>
@@ -34,7 +35,6 @@
34 35
35#include <plat/regs-serial.h> 36#include <plat/regs-serial.h>
36#include <mach/regs-gpio.h> 37#include <mach/regs-gpio.h>
37#include <mach/regs-mem.h>
38#include <mach/regs-lcd.h> 38#include <mach/regs-lcd.h>
39#include <linux/platform_data/mtd-nand-s3c2410.h> 39#include <linux/platform_data/mtd-nand-s3c2410.h>
40#include <linux/platform_data/i2c-s3c2410.h> 40#include <linux/platform_data/i2c-s3c2410.h>
@@ -210,6 +210,6 @@ MACHINE_START(AT2440EVB, "AT2440EVB")
210 .map_io = at2440evb_map_io, 210 .map_io = at2440evb_map_io,
211 .init_machine = at2440evb_init, 211 .init_machine = at2440evb_init,
212 .init_irq = s3c24xx_init_irq, 212 .init_irq = s3c24xx_init_irq,
213 .timer = &s3c24xx_timer, 213 .init_time = s3c24xx_timer_init,
214 .restart = s3c244x_restart, 214 .restart = s3c244x_restart,
215MACHINE_END 215MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-bast.c b/arch/arm/mach-s3c24xx/mach-bast.c
index 6a30ce7e4aa7..ca6618081041 100644
--- a/arch/arm/mach-s3c24xx/mach-bast.c
+++ b/arch/arm/mach-s3c24xx/mach-bast.c
@@ -24,48 +24,41 @@
24#include <linux/ata_platform.h> 24#include <linux/ata_platform.h>
25#include <linux/i2c.h> 25#include <linux/i2c.h>
26#include <linux/io.h> 26#include <linux/io.h>
27#include <linux/serial_8250.h>
28
29#include <linux/mtd/mtd.h>
30#include <linux/mtd/nand.h>
31#include <linux/mtd/nand_ecc.h>
32#include <linux/mtd/partitions.h>
33
34#include <linux/platform_data/asoc-s3c24xx_simtec.h>
35#include <linux/platform_data/hwmon-s3c.h>
36#include <linux/platform_data/i2c-s3c2410.h>
37#include <linux/platform_data/mtd-nand-s3c2410.h>
27 38
28#include <net/ax88796.h> 39#include <net/ax88796.h>
29 40
41#include <asm/irq.h>
30#include <asm/mach/arch.h> 42#include <asm/mach/arch.h>
31#include <asm/mach/map.h> 43#include <asm/mach/map.h>
32#include <asm/mach/irq.h> 44#include <asm/mach/irq.h>
33
34#include <mach/bast-map.h>
35#include <mach/bast-irq.h>
36#include <mach/bast-cpld.h>
37
38#include <mach/hardware.h>
39#include <asm/irq.h>
40#include <asm/mach-types.h> 45#include <asm/mach-types.h>
41 46
42//#include <asm/debug-ll.h> 47#include <mach/fb.h>
43#include <plat/regs-serial.h> 48#include <mach/hardware.h>
44#include <mach/regs-gpio.h> 49#include <mach/regs-gpio.h>
45#include <mach/regs-mem.h>
46#include <mach/regs-lcd.h> 50#include <mach/regs-lcd.h>
47 51
48#include <linux/platform_data/hwmon-s3c.h>
49#include <linux/platform_data/mtd-nand-s3c2410.h>
50#include <linux/platform_data/i2c-s3c2410.h>
51#include <mach/fb.h>
52
53#include <linux/mtd/mtd.h>
54#include <linux/mtd/nand.h>
55#include <linux/mtd/nand_ecc.h>
56#include <linux/mtd/partitions.h>
57
58#include <linux/serial_8250.h>
59
60#include <plat/clock.h> 52#include <plat/clock.h>
61#include <plat/devs.h>
62#include <plat/cpu.h> 53#include <plat/cpu.h>
63#include <plat/cpu-freq.h> 54#include <plat/cpu-freq.h>
55#include <plat/devs.h>
64#include <plat/gpio-cfg.h> 56#include <plat/gpio-cfg.h>
65#include <linux/platform_data/asoc-s3c24xx_simtec.h> 57#include <plat/regs-serial.h>
66 58
67#include "simtec.h" 59#include "bast.h"
68#include "common.h" 60#include "common.h"
61#include "simtec.h"
69 62
70#define COPYRIGHT ", Copyright 2004-2008 Simtec Electronics" 63#define COPYRIGHT ", Copyright 2004-2008 Simtec Electronics"
71 64
@@ -312,7 +305,7 @@ static struct s3c2410_platform_nand __initdata bast_nand_info = {
312static struct resource bast_dm9k_resource[] = { 305static struct resource bast_dm9k_resource[] = {
313 [0] = DEFINE_RES_MEM(S3C2410_CS5 + BAST_PA_DM9000, 4), 306 [0] = DEFINE_RES_MEM(S3C2410_CS5 + BAST_PA_DM9000, 4),
314 [1] = DEFINE_RES_MEM(S3C2410_CS5 + BAST_PA_DM9000 + 0x40, 0x40), 307 [1] = DEFINE_RES_MEM(S3C2410_CS5 + BAST_PA_DM9000 + 0x40, 0x40),
315 [2] = DEFINE_RES_NAMED(IRQ_DM9000 , 1, NULL, IORESOURCE_IRQ \ 308 [2] = DEFINE_RES_NAMED(BAST_IRQ_DM9000 , 1, NULL, IORESOURCE_IRQ \
316 | IORESOURCE_IRQ_HIGHLEVEL), 309 | IORESOURCE_IRQ_HIGHLEVEL),
317}; 310};
318 311
@@ -343,7 +336,7 @@ static struct platform_device bast_device_dm9k = {
343static struct plat_serial8250_port bast_sio_data[] = { 336static struct plat_serial8250_port bast_sio_data[] = {
344 [0] = { 337 [0] = {
345 .mapbase = SERIAL_BASE + 0x2f8, 338 .mapbase = SERIAL_BASE + 0x2f8,
346 .irq = IRQ_PCSERIAL1, 339 .irq = BAST_IRQ_PCSERIAL1,
347 .flags = SERIAL_FLAGS, 340 .flags = SERIAL_FLAGS,
348 .iotype = UPIO_MEM, 341 .iotype = UPIO_MEM,
349 .regshift = 0, 342 .regshift = 0,
@@ -351,7 +344,7 @@ static struct plat_serial8250_port bast_sio_data[] = {
351 }, 344 },
352 [1] = { 345 [1] = {
353 .mapbase = SERIAL_BASE + 0x3f8, 346 .mapbase = SERIAL_BASE + 0x3f8,
354 .irq = IRQ_PCSERIAL2, 347 .irq = BAST_IRQ_PCSERIAL2,
355 .flags = SERIAL_FLAGS, 348 .flags = SERIAL_FLAGS,
356 .iotype = UPIO_MEM, 349 .iotype = UPIO_MEM,
357 .regshift = 0, 350 .regshift = 0,
@@ -390,7 +383,7 @@ static struct ax_plat_data bast_asix_platdata = {
390static struct resource bast_asix_resource[] = { 383static struct resource bast_asix_resource[] = {
391 [0] = DEFINE_RES_MEM(S3C2410_CS5 + BAST_PA_ASIXNET, 0x18 * 0x20), 384 [0] = DEFINE_RES_MEM(S3C2410_CS5 + BAST_PA_ASIXNET, 0x18 * 0x20),
392 [1] = DEFINE_RES_MEM(S3C2410_CS5 + BAST_PA_ASIXNET + (0x1f * 0x20), 1), 385 [1] = DEFINE_RES_MEM(S3C2410_CS5 + BAST_PA_ASIXNET + (0x1f * 0x20), 1),
393 [2] = DEFINE_RES_IRQ(IRQ_ASIX), 386 [2] = DEFINE_RES_IRQ(BAST_IRQ_ASIX),
394}; 387};
395 388
396static struct platform_device bast_device_asix = { 389static struct platform_device bast_device_asix = {
@@ -612,6 +605,6 @@ MACHINE_START(BAST, "Simtec-BAST")
612 .map_io = bast_map_io, 605 .map_io = bast_map_io,
613 .init_irq = s3c24xx_init_irq, 606 .init_irq = s3c24xx_init_irq,
614 .init_machine = bast_init, 607 .init_machine = bast_init,
615 .timer = &s3c24xx_timer, 608 .init_time = s3c24xx_timer_init,
616 .restart = s3c2410_restart, 609 .restart = s3c2410_restart,
617MACHINE_END 610MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-gta02.c b/arch/arm/mach-s3c24xx/mach-gta02.c
index 973b87ca87f4..a25e8c5a7b4c 100644
--- a/arch/arm/mach-s3c24xx/mach-gta02.c
+++ b/arch/arm/mach-s3c24xx/mach-gta02.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/arch/arm/mach-s3c2442/mach-gta02.c
3 *
4 * S3C2442 Machine Support for Openmoko GTA02 / FreeRunner. 2 * S3C2442 Machine Support for Openmoko GTA02 / FreeRunner.
5 * 3 *
6 * Copyright (C) 2006-2009 by Openmoko, Inc. 4 * Copyright (C) 2006-2009 by Openmoko, Inc.
@@ -23,7 +21,6 @@
23 * along with this program; if not, write to the Free Software 21 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25 * MA 02111-1307 USA 23 * MA 02111-1307 USA
26 *
27 */ 24 */
28 25
29#include <linux/kernel.h> 26#include <linux/kernel.h>
@@ -34,62 +31,59 @@
34#include <linux/timer.h> 31#include <linux/timer.h>
35#include <linux/init.h> 32#include <linux/init.h>
36#include <linux/gpio.h> 33#include <linux/gpio.h>
34#include <linux/gpio_keys.h>
37#include <linux/workqueue.h> 35#include <linux/workqueue.h>
38#include <linux/platform_device.h> 36#include <linux/platform_device.h>
39#include <linux/serial_core.h> 37#include <linux/serial_core.h>
40#include <linux/spi/spi.h> 38#include <linux/input.h>
41#include <linux/spi/s3c24xx.h> 39#include <linux/io.h>
40#include <linux/i2c.h>
42 41
43#include <linux/mmc/host.h> 42#include <linux/mmc/host.h>
44 43
44#include <linux/mfd/pcf50633/adc.h>
45#include <linux/mfd/pcf50633/backlight.h>
46#include <linux/mfd/pcf50633/core.h>
47#include <linux/mfd/pcf50633/gpio.h>
48#include <linux/mfd/pcf50633/mbc.h>
49#include <linux/mfd/pcf50633/pmic.h>
50
45#include <linux/mtd/mtd.h> 51#include <linux/mtd/mtd.h>
46#include <linux/mtd/nand.h> 52#include <linux/mtd/nand.h>
47#include <linux/mtd/nand_ecc.h> 53#include <linux/mtd/nand_ecc.h>
48#include <linux/mtd/partitions.h> 54#include <linux/mtd/partitions.h>
49#include <linux/mtd/physmap.h> 55#include <linux/mtd/physmap.h>
50#include <linux/io.h>
51 56
52#include <linux/i2c.h>
53#include <linux/regulator/machine.h> 57#include <linux/regulator/machine.h>
54 58
55#include <linux/mfd/pcf50633/core.h> 59#include <linux/spi/spi.h>
56#include <linux/mfd/pcf50633/mbc.h> 60#include <linux/spi/s3c24xx.h>
57#include <linux/mfd/pcf50633/adc.h>
58#include <linux/mfd/pcf50633/gpio.h>
59#include <linux/mfd/pcf50633/pmic.h>
60#include <linux/mfd/pcf50633/backlight.h>
61
62#include <linux/input.h>
63#include <linux/gpio_keys.h>
64 61
62#include <asm/irq.h>
63#include <asm/mach-types.h>
65#include <asm/mach/arch.h> 64#include <asm/mach/arch.h>
66#include <asm/mach/map.h> 65#include <asm/mach/map.h>
67#include <asm/mach/irq.h> 66#include <asm/mach/irq.h>
68 67
69#include <asm/irq.h> 68#include <linux/platform_data/i2c-s3c2410.h>
70#include <asm/mach-types.h> 69#include <linux/platform_data/mtd-nand-s3c2410.h>
70#include <linux/platform_data/touchscreen-s3c2410.h>
71#include <linux/platform_data/usb-ohci-s3c2410.h>
72#include <linux/platform_data/usb-s3c2410_udc.h>
71 73
72#include <mach/regs-irq.h>
73#include <mach/regs-gpio.h>
74#include <mach/fb.h> 74#include <mach/fb.h>
75
76#include <linux/platform_data/usb-ohci-s3c2410.h>
77#include <mach/regs-mem.h>
78#include <mach/hardware.h> 75#include <mach/hardware.h>
76#include <mach/regs-gpio.h>
77#include <mach/regs-irq.h>
79 78
80#include <mach/gta02.h>
81
82#include <plat/regs-serial.h>
83#include <linux/platform_data/mtd-nand-s3c2410.h>
84#include <plat/devs.h>
85#include <plat/cpu.h> 79#include <plat/cpu.h>
86#include <plat/pm.h> 80#include <plat/devs.h>
87#include <linux/platform_data/usb-s3c2410_udc.h>
88#include <plat/gpio-cfg.h> 81#include <plat/gpio-cfg.h>
89#include <linux/platform_data/i2c-s3c2410.h> 82#include <plat/pm.h>
90#include <linux/platform_data/touchscreen-s3c2410.h> 83#include <plat/regs-serial.h>
91 84
92#include "common.h" 85#include "common.h"
86#include "gta02.h"
93 87
94static struct pcf50633 *gta02_pcf; 88static struct pcf50633 *gta02_pcf;
95 89
@@ -595,6 +589,6 @@ MACHINE_START(NEO1973_GTA02, "GTA02")
595 .map_io = gta02_map_io, 589 .map_io = gta02_map_io,
596 .init_irq = s3c24xx_init_irq, 590 .init_irq = s3c24xx_init_irq,
597 .init_machine = gta02_machine_init, 591 .init_machine = gta02_machine_init,
598 .timer = &s3c24xx_timer, 592 .init_time = s3c24xx_timer_init,
599 .restart = s3c244x_restart, 593 .restart = s3c244x_restart,
600MACHINE_END 594MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c
index b23dd1b106e8..79bc0830d740 100644
--- a/arch/arm/mach-s3c24xx/mach-h1940.c
+++ b/arch/arm/mach-s3c24xx/mach-h1940.c
@@ -1,5 +1,4 @@
1/* linux/arch/arm/mach-s3c2410/mach-h1940.c 1/*
2 *
3 * Copyright (c) 2003-2005 Simtec Electronics 2 * Copyright (c) 2003-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 3 * Ben Dooks <ben@simtec.co.uk>
5 * 4 *
@@ -37,40 +36,36 @@
37#include <linux/mmc/host.h> 36#include <linux/mmc/host.h>
38#include <linux/export.h> 37#include <linux/export.h>
39 38
39#include <asm/irq.h>
40#include <asm/mach-types.h>
40#include <asm/mach/arch.h> 41#include <asm/mach/arch.h>
41#include <asm/mach/map.h> 42#include <asm/mach/map.h>
42#include <asm/mach/irq.h> 43#include <asm/mach/irq.h>
43 44
44#include <mach/hardware.h> 45#include <linux/platform_data/i2c-s3c2410.h>
45#include <asm/irq.h> 46#include <linux/platform_data/mmc-s3cmci.h>
46#include <asm/mach-types.h> 47#include <linux/platform_data/touchscreen-s3c2410.h>
47 48#include <linux/platform_data/usb-s3c2410_udc.h>
48#include <plat/regs-serial.h>
49#include <mach/regs-lcd.h>
50#include <mach/regs-clock.h>
51 49
52#include <mach/regs-gpio.h> 50#include <sound/uda1380.h>
53#include <mach/gpio-fns.h>
54#include <mach/gpio-nrs.h>
55 51
56#include <mach/h1940.h>
57#include <mach/h1940-latch.h>
58#include <mach/fb.h> 52#include <mach/fb.h>
59#include <linux/platform_data/usb-s3c2410_udc.h> 53#include <mach/hardware.h>
60#include <linux/platform_data/i2c-s3c2410.h> 54#include <mach/regs-clock.h>
55#include <mach/regs-gpio.h>
56#include <mach/regs-lcd.h>
61 57
62#include <plat/gpio-cfg.h>
63#include <plat/clock.h> 58#include <plat/clock.h>
64#include <plat/devs.h>
65#include <plat/cpu.h> 59#include <plat/cpu.h>
60#include <plat/devs.h>
61#include <plat/gpio-cfg.h>
66#include <plat/pll.h> 62#include <plat/pll.h>
67#include <plat/pm.h> 63#include <plat/pm.h>
68#include <linux/platform_data/mmc-s3cmci.h> 64#include <plat/regs-serial.h>
69#include <linux/platform_data/touchscreen-s3c2410.h>
70 65
71#include <sound/uda1380.h>
72 66
73#include "common.h" 67#include "common.h"
68#include "h1940.h"
74 69
75#define H1940_LATCH ((void __force __iomem *)0xF8000000) 70#define H1940_LATCH ((void __force __iomem *)0xF8000000)
76 71
@@ -746,6 +741,6 @@ MACHINE_START(H1940, "IPAQ-H1940")
746 .reserve = h1940_reserve, 741 .reserve = h1940_reserve,
747 .init_irq = h1940_init_irq, 742 .init_irq = h1940_init_irq,
748 .init_machine = h1940_init, 743 .init_machine = h1940_init,
749 .timer = &s3c24xx_timer, 744 .init_time = s3c24xx_timer_init,
750 .restart = s3c2410_restart, 745 .restart = s3c2410_restart,
751MACHINE_END 746MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-jive.c b/arch/arm/mach-s3c24xx/mach-jive.c
index c9954e26b492..54e83c1f780c 100644
--- a/arch/arm/mach-s3c24xx/mach-jive.c
+++ b/arch/arm/mach-s3c24xx/mach-jive.c
@@ -35,9 +35,7 @@
35#include <linux/platform_data/mtd-nand-s3c2410.h> 35#include <linux/platform_data/mtd-nand-s3c2410.h>
36#include <linux/platform_data/i2c-s3c2410.h> 36#include <linux/platform_data/i2c-s3c2410.h>
37 37
38#include <mach/regs-power.h>
39#include <mach/regs-gpio.h> 38#include <mach/regs-gpio.h>
40#include <mach/regs-mem.h>
41#include <mach/regs-lcd.h> 39#include <mach/regs-lcd.h>
42#include <mach/fb.h> 40#include <mach/fb.h>
43 41
@@ -56,6 +54,8 @@
56#include <plat/pm.h> 54#include <plat/pm.h>
57#include <linux/platform_data/usb-s3c2410_udc.h> 55#include <linux/platform_data/usb-s3c2410_udc.h>
58 56
57#include "s3c2412-power.h"
58
59static struct map_desc jive_iodesc[] __initdata = { 59static struct map_desc jive_iodesc[] __initdata = {
60}; 60};
61 61
@@ -661,6 +661,6 @@ MACHINE_START(JIVE, "JIVE")
661 .init_irq = s3c24xx_init_irq, 661 .init_irq = s3c24xx_init_irq,
662 .map_io = jive_map_io, 662 .map_io = jive_map_io,
663 .init_machine = jive_machine_init, 663 .init_machine = jive_machine_init,
664 .timer = &s3c24xx_timer, 664 .init_time = s3c24xx_timer_init,
665 .restart = s3c2412_restart, 665 .restart = s3c2412_restart,
666MACHINE_END 666MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-mini2440.c b/arch/arm/mach-s3c24xx/mach-mini2440.c
index a31d5b83e5f7..2865e5919f2c 100644
--- a/arch/arm/mach-s3c24xx/mach-mini2440.c
+++ b/arch/arm/mach-s3c24xx/mach-mini2440.c
@@ -40,7 +40,6 @@
40#include <plat/regs-serial.h> 40#include <plat/regs-serial.h>
41#include <mach/regs-gpio.h> 41#include <mach/regs-gpio.h>
42#include <linux/platform_data/leds-s3c24xx.h> 42#include <linux/platform_data/leds-s3c24xx.h>
43#include <mach/regs-mem.h>
44#include <mach/regs-lcd.h> 43#include <mach/regs-lcd.h>
45#include <mach/irqs.h> 44#include <mach/irqs.h>
46#include <linux/platform_data/mtd-nand-s3c2410.h> 45#include <linux/platform_data/mtd-nand-s3c2410.h>
@@ -688,6 +687,6 @@ MACHINE_START(MINI2440, "MINI2440")
688 .map_io = mini2440_map_io, 687 .map_io = mini2440_map_io,
689 .init_machine = mini2440_init, 688 .init_machine = mini2440_init,
690 .init_irq = s3c24xx_init_irq, 689 .init_irq = s3c24xx_init_irq,
691 .timer = &s3c24xx_timer, 690 .init_time = s3c24xx_timer_init,
692 .restart = s3c244x_restart, 691 .restart = s3c244x_restart,
693MACHINE_END 692MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-n30.c b/arch/arm/mach-s3c24xx/mach-n30.c
index c53a9bfe1417..d9d04b240295 100644
--- a/arch/arm/mach-s3c24xx/mach-n30.c
+++ b/arch/arm/mach-s3c24xx/mach-n30.c
@@ -589,7 +589,7 @@ MACHINE_START(N30, "Acer-N30")
589 Ben Dooks <ben-linux@fluff.org> 589 Ben Dooks <ben-linux@fluff.org>
590 */ 590 */
591 .atag_offset = 0x100, 591 .atag_offset = 0x100,
592 .timer = &s3c24xx_timer, 592 .init_time = s3c24xx_timer_init,
593 .init_machine = n30_init, 593 .init_machine = n30_init,
594 .init_irq = s3c24xx_init_irq, 594 .init_irq = s3c24xx_init_irq,
595 .map_io = n30_map_io, 595 .map_io = n30_map_io,
@@ -600,7 +600,7 @@ MACHINE_START(N35, "Acer-N35")
600 /* Maintainer: Christer Weinigel <christer@weinigel.se> 600 /* Maintainer: Christer Weinigel <christer@weinigel.se>
601 */ 601 */
602 .atag_offset = 0x100, 602 .atag_offset = 0x100,
603 .timer = &s3c24xx_timer, 603 .init_time = s3c24xx_timer_init,
604 .init_machine = n30_init, 604 .init_machine = n30_init,
605 .init_irq = s3c24xx_init_irq, 605 .init_irq = s3c24xx_init_irq,
606 .map_io = n30_map_io, 606 .map_io = n30_map_io,
diff --git a/arch/arm/mach-s3c24xx/mach-nexcoder.c b/arch/arm/mach-s3c24xx/mach-nexcoder.c
index a2b92b0898e2..a454e2461860 100644
--- a/arch/arm/mach-s3c24xx/mach-nexcoder.c
+++ b/arch/arm/mach-s3c24xx/mach-nexcoder.c
@@ -153,6 +153,6 @@ MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440")
153 .map_io = nexcoder_map_io, 153 .map_io = nexcoder_map_io,
154 .init_machine = nexcoder_init, 154 .init_machine = nexcoder_init,
155 .init_irq = s3c24xx_init_irq, 155 .init_irq = s3c24xx_init_irq,
156 .timer = &s3c24xx_timer, 156 .init_time = s3c24xx_timer_init,
157 .restart = s3c244x_restart, 157 .restart = s3c244x_restart,
158MACHINE_END 158MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-osiris.c b/arch/arm/mach-s3c24xx/mach-osiris.c
index bb36d832bd3d..ae2cbdf3e3ca 100644
--- a/arch/arm/mach-s3c24xx/mach-osiris.c
+++ b/arch/arm/mach-s3c24xx/mach-osiris.c
@@ -1,5 +1,4 @@
1/* linux/arch/arm/mach-s3c2440/mach-osiris.c 1/*
2 *
3 * Copyright (c) 2005-2008 Simtec Electronics 2 * Copyright (c) 2005-2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 3 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
@@ -22,25 +21,16 @@
22#include <linux/clk.h> 21#include <linux/clk.h>
23#include <linux/i2c.h> 22#include <linux/i2c.h>
24#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/platform_device.h>
25 25
26#include <linux/i2c/tps65010.h> 26#include <linux/i2c/tps65010.h>
27 27
28#include <asm/mach-types.h>
28#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
29#include <asm/mach/map.h> 30#include <asm/mach/map.h>
30#include <asm/mach/irq.h> 31#include <asm/mach/irq.h>
31
32#include <mach/osiris-map.h>
33#include <mach/osiris-cpld.h>
34
35#include <mach/hardware.h>
36#include <asm/irq.h> 32#include <asm/irq.h>
37#include <asm/mach-types.h>
38 33
39#include <plat/cpu-freq.h>
40#include <plat/regs-serial.h>
41#include <mach/regs-gpio.h>
42#include <mach/regs-mem.h>
43#include <mach/regs-lcd.h>
44#include <linux/platform_data/mtd-nand-s3c2410.h> 34#include <linux/platform_data/mtd-nand-s3c2410.h>
45#include <linux/platform_data/i2c-s3c2410.h> 35#include <linux/platform_data/i2c-s3c2410.h>
46 36
@@ -49,12 +39,20 @@
49#include <linux/mtd/nand_ecc.h> 39#include <linux/mtd/nand_ecc.h>
50#include <linux/mtd/partitions.h> 40#include <linux/mtd/partitions.h>
51 41
52#include <plat/gpio-cfg.h>
53#include <plat/clock.h> 42#include <plat/clock.h>
54#include <plat/devs.h>
55#include <plat/cpu.h> 43#include <plat/cpu.h>
44#include <plat/cpu-freq.h>
45#include <plat/devs.h>
46#include <plat/gpio-cfg.h>
47#include <plat/regs-serial.h>
48
49#include <mach/hardware.h>
50#include <mach/regs-gpio.h>
51#include <mach/regs-lcd.h>
56 52
57#include "common.h" 53#include "common.h"
54#include "osiris.h"
55#include "regs-mem.h"
58 56
59/* onboard perihperal map */ 57/* onboard perihperal map */
60 58
@@ -428,6 +426,6 @@ MACHINE_START(OSIRIS, "Simtec-OSIRIS")
428 .map_io = osiris_map_io, 426 .map_io = osiris_map_io,
429 .init_irq = s3c24xx_init_irq, 427 .init_irq = s3c24xx_init_irq,
430 .init_machine = osiris_init, 428 .init_machine = osiris_init,
431 .timer = &s3c24xx_timer, 429 .init_time = s3c24xx_timer_init,
432 .restart = s3c244x_restart, 430 .restart = s3c244x_restart,
433MACHINE_END 431MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-otom.c b/arch/arm/mach-s3c24xx/mach-otom.c
index bca39f0232b3..40a47d6c6a85 100644
--- a/arch/arm/mach-s3c24xx/mach-otom.c
+++ b/arch/arm/mach-s3c24xx/mach-otom.c
@@ -1,4 +1,4 @@
1/* linux/arch/arm/mach-s3c2410/mach-otom.c 1/*
2 * 2 *
3 * Copyright (c) 2004 Nex Vision 3 * Copyright (c) 2004 Nex Vision
4 * Guillaume GOURAT <guillaume.gourat@nexvision.fr> 4 * Guillaume GOURAT <guillaume.gourat@nexvision.fr>
@@ -6,7 +6,6 @@
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
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 *
10 */ 9 */
11 10
12#include <linux/kernel.h> 11#include <linux/kernel.h>
@@ -19,26 +18,25 @@
19#include <linux/platform_device.h> 18#include <linux/platform_device.h>
20#include <linux/io.h> 19#include <linux/io.h>
21 20
21#include <linux/platform_data/i2c-s3c2410.h>
22
23#include <asm/irq.h>
24#include <asm/mach-types.h>
22#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
23#include <asm/mach/map.h> 26#include <asm/mach/map.h>
24#include <asm/mach/irq.h> 27#include <asm/mach/irq.h>
25 28
26#include <mach/otom-map.h>
27
28#include <mach/hardware.h> 29#include <mach/hardware.h>
29#include <asm/irq.h>
30#include <asm/mach-types.h>
31
32#include <plat/regs-serial.h>
33#include <mach/regs-gpio.h> 30#include <mach/regs-gpio.h>
34 31
35#include <plat/s3c2410.h>
36#include <plat/clock.h> 32#include <plat/clock.h>
37#include <plat/devs.h>
38#include <linux/platform_data/i2c-s3c2410.h>
39#include <plat/cpu.h> 33#include <plat/cpu.h>
34#include <plat/devs.h>
35#include <plat/regs-serial.h>
36#include <plat/s3c2410.h>
40 37
41#include "common.h" 38#include "common.h"
39#include "otom.h"
42 40
43static struct map_desc otom11_iodesc[] __initdata = { 41static struct map_desc otom11_iodesc[] __initdata = {
44 /* Device area */ 42 /* Device area */
@@ -118,6 +116,6 @@ MACHINE_START(OTOM, "Nex Vision - Otom 1.1")
118 .map_io = otom11_map_io, 116 .map_io = otom11_map_io,
119 .init_machine = otom11_init, 117 .init_machine = otom11_init,
120 .init_irq = s3c24xx_init_irq, 118 .init_irq = s3c24xx_init_irq,
121 .timer = &s3c24xx_timer, 119 .init_time = s3c24xx_timer_init,
122 .restart = s3c2410_restart, 120 .restart = s3c2410_restart,
123MACHINE_END 121MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-qt2410.c b/arch/arm/mach-s3c24xx/mach-qt2410.c
index 7b6ba13d7285..56175f0941b1 100644
--- a/arch/arm/mach-s3c24xx/mach-qt2410.c
+++ b/arch/arm/mach-s3c24xx/mach-qt2410.c
@@ -343,6 +343,6 @@ MACHINE_START(QT2410, "QT2410")
343 .map_io = qt2410_map_io, 343 .map_io = qt2410_map_io,
344 .init_irq = s3c24xx_init_irq, 344 .init_irq = s3c24xx_init_irq,
345 .init_machine = qt2410_machine_init, 345 .init_machine = qt2410_machine_init,
346 .timer = &s3c24xx_timer, 346 .init_time = s3c24xx_timer_init,
347 .restart = s3c2410_restart, 347 .restart = s3c2410_restart,
348MACHINE_END 348MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-rx1950.c b/arch/arm/mach-s3c24xx/mach-rx1950.c
index 0606f2faaa5c..1f9ba2ae5288 100644
--- a/arch/arm/mach-s3c24xx/mach-rx1950.c
+++ b/arch/arm/mach-s3c24xx/mach-rx1950.c
@@ -1,5 +1,4 @@
1/* linux/arch/arm/mach-s3c2440/mach-rx1950.c 1/*
2 *
3 * Copyright (c) 2006-2009 Victor Chukhantsev, Denis Grigoriev, 2 * Copyright (c) 2006-2009 Victor Chukhantsev, Denis Grigoriev,
4 * Copyright (c) 2007-2010 Vasily Khoruzhick 3 * Copyright (c) 2007-2010 Vasily Khoruzhick
5 * 4 *
@@ -37,31 +36,31 @@
37 36
38#include <linux/mmc/host.h> 37#include <linux/mmc/host.h>
39 38
39#include <asm/mach-types.h>
40#include <asm/mach/arch.h> 40#include <asm/mach/arch.h>
41#include <asm/mach/map.h> 41#include <asm/mach/map.h>
42#include <asm/mach-types.h>
43 42
43#include <linux/platform_data/i2c-s3c2410.h>
44#include <linux/platform_data/mmc-s3cmci.h>
45#include <linux/platform_data/mtd-nand-s3c2410.h>
46#include <linux/platform_data/touchscreen-s3c2410.h>
47#include <linux/platform_data/usb-s3c2410_udc.h>
48
49#include <sound/uda1380.h>
50
51#include <mach/fb.h>
44#include <mach/regs-gpio.h> 52#include <mach/regs-gpio.h>
45#include <mach/regs-lcd.h> 53#include <mach/regs-lcd.h>
46#include <mach/h1940.h>
47#include <mach/fb.h>
48 54
49#include <plat/clock.h> 55#include <plat/clock.h>
50#include <plat/regs-serial.h>
51#include <plat/regs-iic.h>
52#include <linux/platform_data/mmc-s3cmci.h>
53#include <linux/platform_data/usb-s3c2410_udc.h>
54#include <linux/platform_data/mtd-nand-s3c2410.h>
55#include <linux/platform_data/i2c-s3c2410.h>
56#include <plat/devs.h>
57#include <plat/cpu.h> 56#include <plat/cpu.h>
57#include <plat/devs.h>
58#include <plat/pm.h> 58#include <plat/pm.h>
59#include <plat/irq.h> 59#include <plat/regs-iic.h>
60#include <linux/platform_data/touchscreen-s3c2410.h> 60#include <plat/regs-serial.h>
61
62#include <sound/uda1380.h>
63 61
64#include "common.h" 62#include "common.h"
63#include "h1940.h"
65 64
66#define LCD_PWM_PERIOD 192960 65#define LCD_PWM_PERIOD 192960
67#define LCD_PWM_DUTY 127353 66#define LCD_PWM_DUTY 127353
@@ -814,6 +813,6 @@ MACHINE_START(RX1950, "HP iPAQ RX1950")
814 .reserve = rx1950_reserve, 813 .reserve = rx1950_reserve,
815 .init_irq = s3c24xx_init_irq, 814 .init_irq = s3c24xx_init_irq,
816 .init_machine = rx1950_init_machine, 815 .init_machine = rx1950_init_machine,
817 .timer = &s3c24xx_timer, 816 .init_time = s3c24xx_timer_init,
818 .restart = s3c244x_restart, 817 .restart = s3c244x_restart,
819MACHINE_END 818MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-rx3715.c b/arch/arm/mach-s3c24xx/mach-rx3715.c
index dacbb9a2122a..f20418a2fb1b 100644
--- a/arch/arm/mach-s3c24xx/mach-rx3715.c
+++ b/arch/arm/mach-s3c24xx/mach-rx3715.c
@@ -31,27 +31,27 @@
31#include <linux/mtd/partitions.h> 31#include <linux/mtd/partitions.h>
32 32
33#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
34#include <asm/mach/map.h>
35#include <asm/mach/irq.h> 34#include <asm/mach/irq.h>
35#include <asm/mach/map.h>
36
37#include <linux/platform_data/mtd-nand-s3c2410.h>
36 38
37#include <mach/hardware.h>
38#include <asm/irq.h> 39#include <asm/irq.h>
39#include <asm/mach-types.h> 40#include <asm/mach-types.h>
40 41
41#include <plat/regs-serial.h> 42#include <mach/fb.h>
43#include <mach/hardware.h>
42#include <mach/regs-gpio.h> 44#include <mach/regs-gpio.h>
43#include <mach/regs-lcd.h> 45#include <mach/regs-lcd.h>
44 46
45#include <mach/h1940.h>
46#include <linux/platform_data/mtd-nand-s3c2410.h>
47#include <mach/fb.h>
48
49#include <plat/clock.h> 47#include <plat/clock.h>
50#include <plat/devs.h>
51#include <plat/cpu.h> 48#include <plat/cpu.h>
49#include <plat/devs.h>
52#include <plat/pm.h> 50#include <plat/pm.h>
51#include <plat/regs-serial.h>
53 52
54#include "common.h" 53#include "common.h"
54#include "h1940.h"
55 55
56static struct map_desc rx3715_iodesc[] __initdata = { 56static struct map_desc rx3715_iodesc[] __initdata = {
57 /* dump ISA space somewhere unused */ 57 /* dump ISA space somewhere unused */
@@ -212,6 +212,6 @@ MACHINE_START(RX3715, "IPAQ-RX3715")
212 .reserve = rx3715_reserve, 212 .reserve = rx3715_reserve,
213 .init_irq = rx3715_init_irq, 213 .init_irq = rx3715_init_irq,
214 .init_machine = rx3715_init_machine, 214 .init_machine = rx3715_init_machine,
215 .timer = &s3c24xx_timer, 215 .init_time = s3c24xx_timer_init,
216 .restart = s3c244x_restart, 216 .restart = s3c244x_restart,
217MACHINE_END 217MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2410.c b/arch/arm/mach-s3c24xx/mach-smdk2410.c
index 82796b97cb04..e184bfa9613a 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2410.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2410.c
@@ -117,6 +117,6 @@ MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switc
117 .map_io = smdk2410_map_io, 117 .map_io = smdk2410_map_io,
118 .init_irq = s3c24xx_init_irq, 118 .init_irq = s3c24xx_init_irq,
119 .init_machine = smdk2410_init, 119 .init_machine = smdk2410_init,
120 .timer = &s3c24xx_timer, 120 .init_time = s3c24xx_timer_init,
121 .restart = s3c2410_restart, 121 .restart = s3c2410_restart,
122MACHINE_END 122MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2413.c b/arch/arm/mach-s3c24xx/mach-smdk2413.c
index ce99fd8bbbc5..86d7847c9d45 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2413.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2413.c
@@ -37,7 +37,6 @@
37#include <mach/regs-gpio.h> 37#include <mach/regs-gpio.h>
38#include <mach/regs-lcd.h> 38#include <mach/regs-lcd.h>
39 39
40#include <mach/idle.h>
41#include <linux/platform_data/usb-s3c2410_udc.h> 40#include <linux/platform_data/usb-s3c2410_udc.h>
42#include <linux/platform_data/i2c-s3c2410.h> 41#include <linux/platform_data/i2c-s3c2410.h>
43#include <mach/fb.h> 42#include <mach/fb.h>
@@ -133,7 +132,7 @@ MACHINE_START(S3C2413, "S3C2413")
133 .init_irq = s3c24xx_init_irq, 132 .init_irq = s3c24xx_init_irq,
134 .map_io = smdk2413_map_io, 133 .map_io = smdk2413_map_io,
135 .init_machine = smdk2413_machine_init, 134 .init_machine = smdk2413_machine_init,
136 .timer = &s3c24xx_timer, 135 .init_time = s3c24xx_timer_init,
137 .restart = s3c2412_restart, 136 .restart = s3c2412_restart,
138MACHINE_END 137MACHINE_END
139 138
@@ -145,7 +144,7 @@ MACHINE_START(SMDK2412, "SMDK2412")
145 .init_irq = s3c24xx_init_irq, 144 .init_irq = s3c24xx_init_irq,
146 .map_io = smdk2413_map_io, 145 .map_io = smdk2413_map_io,
147 .init_machine = smdk2413_machine_init, 146 .init_machine = smdk2413_machine_init,
148 .timer = &s3c24xx_timer, 147 .init_time = s3c24xx_timer_init,
149 .restart = s3c2412_restart, 148 .restart = s3c2412_restart,
150MACHINE_END 149MACHINE_END
151 150
@@ -157,6 +156,6 @@ MACHINE_START(SMDK2413, "SMDK2413")
157 .init_irq = s3c24xx_init_irq, 156 .init_irq = s3c24xx_init_irq,
158 .map_io = smdk2413_map_io, 157 .map_io = smdk2413_map_io,
159 .init_machine = smdk2413_machine_init, 158 .init_machine = smdk2413_machine_init,
160 .timer = &s3c24xx_timer, 159 .init_time = s3c24xx_timer_init,
161 .restart = s3c2412_restart, 160 .restart = s3c2412_restart,
162MACHINE_END 161MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2416.c b/arch/arm/mach-s3c24xx/mach-smdk2416.c
index f30d7fccbfee..ebb2e61f3d07 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2416.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2416.c
@@ -39,7 +39,6 @@
39#include <mach/regs-lcd.h> 39#include <mach/regs-lcd.h>
40#include <mach/regs-s3c2443-clock.h> 40#include <mach/regs-s3c2443-clock.h>
41 41
42#include <mach/idle.h>
43#include <linux/platform_data/leds-s3c24xx.h> 42#include <linux/platform_data/leds-s3c24xx.h>
44#include <linux/platform_data/i2c-s3c2410.h> 43#include <linux/platform_data/i2c-s3c2410.h>
45 44
@@ -251,9 +250,9 @@ MACHINE_START(SMDK2416, "SMDK2416")
251 /* Maintainer: Yauhen Kharuzhy <jekhor@gmail.com> */ 250 /* Maintainer: Yauhen Kharuzhy <jekhor@gmail.com> */
252 .atag_offset = 0x100, 251 .atag_offset = 0x100,
253 252
254 .init_irq = s3c24xx_init_irq, 253 .init_irq = s3c2416_init_irq,
255 .map_io = smdk2416_map_io, 254 .map_io = smdk2416_map_io,
256 .init_machine = smdk2416_machine_init, 255 .init_machine = smdk2416_machine_init,
257 .timer = &s3c24xx_timer, 256 .init_time = s3c24xx_timer_init,
258 .restart = s3c2416_restart, 257 .restart = s3c2416_restart,
259MACHINE_END 258MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2440.c b/arch/arm/mach-s3c24xx/mach-smdk2440.c
index b7ff882c6ce6..08cc38c8a4ae 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2440.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2440.c
@@ -35,7 +35,6 @@
35#include <mach/regs-gpio.h> 35#include <mach/regs-gpio.h>
36#include <mach/regs-lcd.h> 36#include <mach/regs-lcd.h>
37 37
38#include <mach/idle.h>
39#include <mach/fb.h> 38#include <mach/fb.h>
40#include <linux/platform_data/i2c-s3c2410.h> 39#include <linux/platform_data/i2c-s3c2410.h>
41 40
@@ -182,6 +181,6 @@ MACHINE_START(S3C2440, "SMDK2440")
182 .init_irq = s3c24xx_init_irq, 181 .init_irq = s3c24xx_init_irq,
183 .map_io = smdk2440_map_io, 182 .map_io = smdk2440_map_io,
184 .init_machine = smdk2440_machine_init, 183 .init_machine = smdk2440_machine_init,
185 .timer = &s3c24xx_timer, 184 .init_time = s3c24xx_timer_init,
186 .restart = s3c244x_restart, 185 .restart = s3c244x_restart,
187MACHINE_END 186MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2443.c b/arch/arm/mach-s3c24xx/mach-smdk2443.c
index 2568656f046f..fc65d74d3c73 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2443.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2443.c
@@ -35,7 +35,6 @@
35#include <mach/regs-gpio.h> 35#include <mach/regs-gpio.h>
36#include <mach/regs-lcd.h> 36#include <mach/regs-lcd.h>
37 37
38#include <mach/idle.h>
39#include <mach/fb.h> 38#include <mach/fb.h>
40#include <linux/platform_data/i2c-s3c2410.h> 39#include <linux/platform_data/i2c-s3c2410.h>
41 40
@@ -141,9 +140,9 @@ MACHINE_START(SMDK2443, "SMDK2443")
141 /* Maintainer: Ben Dooks <ben-linux@fluff.org> */ 140 /* Maintainer: Ben Dooks <ben-linux@fluff.org> */
142 .atag_offset = 0x100, 141 .atag_offset = 0x100,
143 142
144 .init_irq = s3c24xx_init_irq, 143 .init_irq = s3c2443_init_irq,
145 .map_io = smdk2443_map_io, 144 .map_io = smdk2443_map_io,
146 .init_machine = smdk2443_machine_init, 145 .init_machine = smdk2443_machine_init,
147 .timer = &s3c24xx_timer, 146 .init_time = s3c24xx_timer_init,
148 .restart = s3c2443_restart, 147 .restart = s3c2443_restart,
149MACHINE_END 148MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-tct_hammer.c b/arch/arm/mach-s3c24xx/mach-tct_hammer.c
index 495bf5cf52e9..24b3d79e7b2c 100644
--- a/arch/arm/mach-s3c24xx/mach-tct_hammer.c
+++ b/arch/arm/mach-s3c24xx/mach-tct_hammer.c
@@ -149,6 +149,6 @@ MACHINE_START(TCT_HAMMER, "TCT_HAMMER")
149 .map_io = tct_hammer_map_io, 149 .map_io = tct_hammer_map_io,
150 .init_irq = s3c24xx_init_irq, 150 .init_irq = s3c24xx_init_irq,
151 .init_machine = tct_hammer_init, 151 .init_machine = tct_hammer_init,
152 .timer = &s3c24xx_timer, 152 .init_time = s3c24xx_timer_init,
153 .restart = s3c2410_restart, 153 .restart = s3c2410_restart,
154MACHINE_END 154MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-vr1000.c b/arch/arm/mach-s3c24xx/mach-vr1000.c
index 14d5b12e388c..ec42d1e4e465 100644
--- a/arch/arm/mach-s3c24xx/mach-vr1000.c
+++ b/arch/arm/mach-s3c24xx/mach-vr1000.c
@@ -1,5 +1,4 @@
1/* linux/arch/arm/mach-s3c2410/mach-vr1000.c 1/*
2 *
3 * Copyright (c) 2003-2008 Simtec Electronics 2 * Copyright (c) 2003-2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 3 * Ben Dooks <ben@simtec.co.uk>
5 * 4 *
@@ -32,27 +31,25 @@
32#include <asm/mach/map.h> 31#include <asm/mach/map.h>
33#include <asm/mach/irq.h> 32#include <asm/mach/irq.h>
34 33
35#include <mach/bast-map.h>
36#include <mach/vr1000-map.h>
37#include <mach/vr1000-irq.h>
38#include <mach/vr1000-cpld.h>
39
40#include <mach/hardware.h>
41#include <asm/irq.h> 34#include <asm/irq.h>
42#include <asm/mach-types.h> 35#include <asm/mach-types.h>
43 36
44#include <plat/regs-serial.h>
45#include <mach/regs-gpio.h>
46#include <linux/platform_data/leds-s3c24xx.h> 37#include <linux/platform_data/leds-s3c24xx.h>
38#include <linux/platform_data/i2c-s3c2410.h>
39#include <linux/platform_data/asoc-s3c24xx_simtec.h>
40
41#include <mach/hardware.h>
42#include <mach/regs-gpio.h>
47 43
48#include <plat/clock.h> 44#include <plat/clock.h>
49#include <plat/devs.h>
50#include <plat/cpu.h> 45#include <plat/cpu.h>
51#include <linux/platform_data/i2c-s3c2410.h> 46#include <plat/devs.h>
52#include <linux/platform_data/asoc-s3c24xx_simtec.h> 47#include <plat/regs-serial.h>
53 48
54#include "simtec.h" 49#include "bast.h"
55#include "common.h" 50#include "common.h"
51#include "simtec.h"
52#include "vr1000.h"
56 53
57/* macros for virtual address mods for the io space entries */ 54/* macros for virtual address mods for the io space entries */
58#define VA_C5(item) ((unsigned long)(item) + BAST_VAM_CS5) 55#define VA_C5(item) ((unsigned long)(item) + BAST_VAM_CS5)
@@ -143,7 +140,7 @@ static struct s3c2410_uartcfg vr1000_uartcfgs[] __initdata = {
143static struct plat_serial8250_port serial_platform_data[] = { 140static struct plat_serial8250_port serial_platform_data[] = {
144 [0] = { 141 [0] = {
145 .mapbase = VR1000_SERIAL_MAPBASE(0), 142 .mapbase = VR1000_SERIAL_MAPBASE(0),
146 .irq = IRQ_VR1000_SERIAL + 0, 143 .irq = VR1000_IRQ_SERIAL + 0,
147 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, 144 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
148 .iotype = UPIO_MEM, 145 .iotype = UPIO_MEM,
149 .regshift = 0, 146 .regshift = 0,
@@ -151,7 +148,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
151 }, 148 },
152 [1] = { 149 [1] = {
153 .mapbase = VR1000_SERIAL_MAPBASE(1), 150 .mapbase = VR1000_SERIAL_MAPBASE(1),
154 .irq = IRQ_VR1000_SERIAL + 1, 151 .irq = VR1000_IRQ_SERIAL + 1,
155 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, 152 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
156 .iotype = UPIO_MEM, 153 .iotype = UPIO_MEM,
157 .regshift = 0, 154 .regshift = 0,
@@ -159,7 +156,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
159 }, 156 },
160 [2] = { 157 [2] = {
161 .mapbase = VR1000_SERIAL_MAPBASE(2), 158 .mapbase = VR1000_SERIAL_MAPBASE(2),
162 .irq = IRQ_VR1000_SERIAL + 2, 159 .irq = VR1000_IRQ_SERIAL + 2,
163 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, 160 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
164 .iotype = UPIO_MEM, 161 .iotype = UPIO_MEM,
165 .regshift = 0, 162 .regshift = 0,
@@ -167,7 +164,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
167 }, 164 },
168 [3] = { 165 [3] = {
169 .mapbase = VR1000_SERIAL_MAPBASE(3), 166 .mapbase = VR1000_SERIAL_MAPBASE(3),
170 .irq = IRQ_VR1000_SERIAL + 3, 167 .irq = VR1000_IRQ_SERIAL + 3,
171 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, 168 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
172 .iotype = UPIO_MEM, 169 .iotype = UPIO_MEM,
173 .regshift = 0, 170 .regshift = 0,
@@ -189,14 +186,14 @@ static struct platform_device serial_device = {
189static struct resource vr1000_dm9k0_resource[] = { 186static struct resource vr1000_dm9k0_resource[] = {
190 [0] = DEFINE_RES_MEM(S3C2410_CS5 + VR1000_PA_DM9000, 4), 187 [0] = DEFINE_RES_MEM(S3C2410_CS5 + VR1000_PA_DM9000, 4),
191 [1] = DEFINE_RES_MEM(S3C2410_CS5 + VR1000_PA_DM9000 + 0x40, 0x40), 188 [1] = DEFINE_RES_MEM(S3C2410_CS5 + VR1000_PA_DM9000 + 0x40, 0x40),
192 [2] = DEFINE_RES_NAMED(IRQ_VR1000_DM9000A, 1, NULL, IORESOURCE_IRQ \ 189 [2] = DEFINE_RES_NAMED(VR1000_IRQ_DM9000A, 1, NULL, IORESOURCE_IRQ \
193 | IORESOURCE_IRQ_HIGHLEVEL), 190 | IORESOURCE_IRQ_HIGHLEVEL),
194}; 191};
195 192
196static struct resource vr1000_dm9k1_resource[] = { 193static struct resource vr1000_dm9k1_resource[] = {
197 [0] = DEFINE_RES_MEM(S3C2410_CS5 + VR1000_PA_DM9000 + 0x80, 4), 194 [0] = DEFINE_RES_MEM(S3C2410_CS5 + VR1000_PA_DM9000 + 0x80, 4),
198 [1] = DEFINE_RES_MEM(S3C2410_CS5 + VR1000_PA_DM9000 + 0xC0, 0x40), 195 [1] = DEFINE_RES_MEM(S3C2410_CS5 + VR1000_PA_DM9000 + 0xC0, 0x40),
199 [2] = DEFINE_RES_NAMED(IRQ_VR1000_DM9000N, 1, NULL, IORESOURCE_IRQ \ 196 [2] = DEFINE_RES_NAMED(VR1000_IRQ_DM9000N, 1, NULL, IORESOURCE_IRQ \
200 | IORESOURCE_IRQ_HIGHLEVEL), 197 | IORESOURCE_IRQ_HIGHLEVEL),
201}; 198};
202 199
@@ -357,6 +354,6 @@ MACHINE_START(VR1000, "Thorcom-VR1000")
357 .map_io = vr1000_map_io, 354 .map_io = vr1000_map_io,
358 .init_machine = vr1000_init, 355 .init_machine = vr1000_init,
359 .init_irq = s3c24xx_init_irq, 356 .init_irq = s3c24xx_init_irq,
360 .timer = &s3c24xx_timer, 357 .init_time = s3c24xx_timer_init,
361 .restart = s3c2410_restart, 358 .restart = s3c2410_restart,
362MACHINE_END 359MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-vstms.c b/arch/arm/mach-s3c24xx/mach-vstms.c
index f1d44ae11833..3e2bfddc9df1 100644
--- a/arch/arm/mach-s3c24xx/mach-vstms.c
+++ b/arch/arm/mach-s3c24xx/mach-vstms.c
@@ -36,7 +36,6 @@
36#include <mach/regs-gpio.h> 36#include <mach/regs-gpio.h>
37#include <mach/regs-lcd.h> 37#include <mach/regs-lcd.h>
38 38
39#include <mach/idle.h>
40#include <mach/fb.h> 39#include <mach/fb.h>
41 40
42#include <linux/platform_data/i2c-s3c2410.h> 41#include <linux/platform_data/i2c-s3c2410.h>
@@ -161,6 +160,6 @@ MACHINE_START(VSTMS, "VSTMS")
161 .init_irq = s3c24xx_init_irq, 160 .init_irq = s3c24xx_init_irq,
162 .init_machine = vstms_init, 161 .init_machine = vstms_init,
163 .map_io = vstms_map_io, 162 .map_io = vstms_map_io,
164 .timer = &s3c24xx_timer, 163 .init_time = s3c24xx_timer_init,
165 .restart = s3c2412_restart, 164 .restart = s3c2412_restart,
166MACHINE_END 165MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/include/mach/osiris-map.h b/arch/arm/mach-s3c24xx/osiris.h
index 17380f848428..b8d56074abac 100644
--- a/arch/arm/mach-s3c24xx/include/mach/osiris-map.h
+++ b/arch/arm/mach-s3c24xx/osiris.h
@@ -1,9 +1,9 @@
1/* arch/arm/mach-s3c2410/include/mach/osiris-map.h 1/*
2 *
3 * Copyright 2005 Simtec Electronics 2 * Copyright 2005 Simtec Electronics
4 * http://www.simtec.co.uk/products/ 3 * http://www.simtec.co.uk/products/
5 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
6 * 5 *
6 * OSIRIS - CPLD control constants
7 * OSIRIS - Memory map definitions 7 * OSIRIS - Memory map definitions
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
@@ -11,10 +11,21 @@
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12*/ 12*/
13 13
14/* needs arch/map.h including with this */ 14#ifndef __MACH_S3C24XX_OSIRIS_H
15#define __MACH_S3C24XX_OSIRIS_H __FILE__
16
17/* CTRL0 - NAND WP control */
18
19#define OSIRIS_CTRL0_NANDSEL (0x3)
20#define OSIRIS_CTRL0_BOOT_INT (1<<3)
21#define OSIRIS_CTRL0_PCMCIA (1<<4)
22#define OSIRIS_CTRL0_FIX8 (1<<5)
23#define OSIRIS_CTRL0_PCMCIA_nWAIT (1<<6)
24#define OSIRIS_CTRL0_PCMCIA_nIOIS16 (1<<7)
25
26#define OSIRIS_CTRL1_FIX8 (1<<0)
15 27
16#ifndef __ASM_ARCH_OSIRISMAP_H 28#define OSIRIS_ID_REVMASK (0x7)
17#define __ASM_ARCH_OSIRISMAP_H
18 29
19/* start peripherals off after the S3C2410 */ 30/* start peripherals off after the S3C2410 */
20 31
@@ -39,4 +50,4 @@
39#define OSIRIS_VA_IDREG OSIRIS_IOADDR(0x00700000) 50#define OSIRIS_VA_IDREG OSIRIS_IOADDR(0x00700000)
40#define OSIRIS_PA_IDREG (OSIRIS_PA_CPLD + (7<<23)) 51#define OSIRIS_PA_IDREG (OSIRIS_PA_CPLD + (7<<23))
41 52
42#endif /* __ASM_ARCH_OSIRISMAP_H */ 53#endif /* __MACH_S3C24XX_OSIRIS_H */
diff --git a/arch/arm/mach-s3c24xx/include/mach/otom-map.h b/arch/arm/mach-s3c24xx/otom.h
index f9277a52c145..321b7be1c0f7 100644
--- a/arch/arm/mach-s3c24xx/include/mach/otom-map.h
+++ b/arch/arm/mach-s3c24xx/otom.h
@@ -1,5 +1,4 @@
1/* arch/arm/mach-s3c2410/include/mach/otom-map.h 1/*
2 *
3 * (c) 2005 Guillaume GOURAT / NexVision 2 * (c) 2005 Guillaume GOURAT / NexVision
4 * guillaume.gourat@nexvision.fr 3 * guillaume.gourat@nexvision.fr
5 * 4 *
@@ -10,21 +9,20 @@
10 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
11*/ 10*/
12 11
13/* needs arch/map.h including with this */ 12/*
14 13 * ok, we've used up to 0x01300000, now we need to find space for the
15/* ok, we've used up to 0x01300000, now we need to find space for the
16 * peripherals that live in the nGCS[x] areas, which are quite numerous 14 * peripherals that live in the nGCS[x] areas, which are quite numerous
17 * in their space. 15 * in their space.
18 */ 16 */
19 17
20#ifndef __ASM_ARCH_OTOMMAP_H 18#ifndef __MACH_S3C24XX_OTOM_H
21#define __ASM_ARCH_OTOMMAP_H 19#define __MACH_S3C24XX_OTOM_H __FILE__
22 20
23#define OTOM_PA_CS8900A_BASE (S3C2410_CS3 + 0x01000000) /* nGCS3 +0x01000000 */ 21#define OTOM_PA_CS8900A_BASE (S3C2410_CS3 + 0x01000000) /* nGCS3 +0x01000000 */
24#define OTOM_VA_CS8900A_BASE S3C2410_ADDR(0x04000000) /* 0xF4000000 */ 22#define OTOM_VA_CS8900A_BASE S3C2410_ADDR(0x04000000) /* 0xF4000000 */
25 23
26/* physical offset addresses for the peripherals */ 24/* physical offset addresses for the peripherals */
27 25
28#define OTOM_PA_FLASH0_BASE (S3C2410_CS0) /* Bank 0 */ 26#define OTOM_PA_FLASH0_BASE (S3C2410_CS0)
29 27
30#endif /* __ASM_ARCH_OTOMMAP_H */ 28#endif /* __MACH_S3C24XX_OTOM_H */
diff --git a/arch/arm/mach-s3c2410/pll.c b/arch/arm/mach-s3c24xx/pll-s3c2410.c
index e0b3b347da82..dcf3420a3271 100644
--- a/arch/arm/mach-s3c2410/pll.c
+++ b/arch/arm/mach-s3c24xx/pll-s3c2410.c
@@ -1,5 +1,4 @@
1/* arch/arm/mach-s3c2410/pll.c 1/*
2 *
3 * Copyright (c) 2006-2007 Simtec Electronics 2 * Copyright (c) 2006-2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 3 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
@@ -82,7 +81,6 @@ static int __init s3c2410_pll_init(void)
82 return subsys_interface_register(&s3c2410_plls_interface); 81 return subsys_interface_register(&s3c2410_plls_interface);
83 82
84} 83}
85
86arch_initcall(s3c2410_pll_init); 84arch_initcall(s3c2410_pll_init);
87 85
88static struct subsys_interface s3c2410a_plls_interface = { 86static struct subsys_interface s3c2410a_plls_interface = {
@@ -95,5 +93,4 @@ static int __init s3c2410a_pll_init(void)
95{ 93{
96 return subsys_interface_register(&s3c2410a_plls_interface); 94 return subsys_interface_register(&s3c2410a_plls_interface);
97} 95}
98
99arch_initcall(s3c2410a_pll_init); 96arch_initcall(s3c2410a_pll_init);
diff --git a/arch/arm/mach-s3c2440/s3c2440-pll-12000000.c b/arch/arm/mach-s3c24xx/pll-s3c2440-12000000.c
index 551fb433be87..673781758319 100644
--- a/arch/arm/mach-s3c2440/s3c2440-pll-12000000.c
+++ b/arch/arm/mach-s3c24xx/pll-s3c2440-12000000.c
@@ -1,5 +1,4 @@
1/* arch/arm/mach-s3c2440/s3c2440-pll-12000000.c 1/*
2 *
3 * Copyright (c) 2006-2007 Simtec Electronics 2 * Copyright (c) 2006-2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 3 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
@@ -83,7 +82,6 @@ static int __init s3c2440_pll_12mhz(void)
83 return subsys_interface_register(&s3c2440_plls12_interface); 82 return subsys_interface_register(&s3c2440_plls12_interface);
84 83
85} 84}
86
87arch_initcall(s3c2440_pll_12mhz); 85arch_initcall(s3c2440_pll_12mhz);
88 86
89static struct subsys_interface s3c2442_plls12_interface = { 87static struct subsys_interface s3c2442_plls12_interface = {
@@ -97,5 +95,4 @@ static int __init s3c2442_pll_12mhz(void)
97 return subsys_interface_register(&s3c2442_plls12_interface); 95 return subsys_interface_register(&s3c2442_plls12_interface);
98 96
99} 97}
100
101arch_initcall(s3c2442_pll_12mhz); 98arch_initcall(s3c2442_pll_12mhz);
diff --git a/arch/arm/mach-s3c2440/s3c2440-pll-16934400.c b/arch/arm/mach-s3c24xx/pll-s3c2440-16934400.c
index 3f15bcf64290..debfa106289b 100644
--- a/arch/arm/mach-s3c2440/s3c2440-pll-16934400.c
+++ b/arch/arm/mach-s3c24xx/pll-s3c2440-16934400.c
@@ -1,5 +1,4 @@
1/* arch/arm/mach-s3c2440/s3c2440-pll-16934400.c 1/*
2 *
3 * Copyright (c) 2006-2008 Simtec Electronics 2 * Copyright (c) 2006-2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 3 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
@@ -111,7 +110,6 @@ static int __init s3c2440_pll_16934400(void)
111{ 110{
112 return subsys_interface_register(&s3c2440_plls169344_interface); 111 return subsys_interface_register(&s3c2440_plls169344_interface);
113} 112}
114
115arch_initcall(s3c2440_pll_16934400); 113arch_initcall(s3c2440_pll_16934400);
116 114
117static struct subsys_interface s3c2442_plls169344_interface = { 115static struct subsys_interface s3c2442_plls169344_interface = {
@@ -124,5 +122,4 @@ static int __init s3c2442_pll_16934400(void)
124{ 122{
125 return subsys_interface_register(&s3c2442_plls169344_interface); 123 return subsys_interface_register(&s3c2442_plls169344_interface);
126} 124}
127
128arch_initcall(s3c2442_pll_16934400); 125arch_initcall(s3c2442_pll_16934400);
diff --git a/arch/arm/mach-s3c24xx/pm-h1940.S b/arch/arm/mach-s3c24xx/pm-h1940.S
index c93bf2db9f4d..6183a688012b 100644
--- a/arch/arm/mach-s3c24xx/pm-h1940.S
+++ b/arch/arm/mach-s3c24xx/pm-h1940.S
@@ -30,4 +30,4 @@
30 30
31h1940_pm_return: 31h1940_pm_return:
32 mov r0, #S3C2410_PA_GPIO 32 mov r0, #S3C2410_PA_GPIO
33 ldr pc, [ r0, #S3C2410_GSTATUS3 - S3C24XX_VA_GPIO ] 33 ldr pc, [r0, #S3C2410_GSTATUS3 - S3C24XX_VA_GPIO]
diff --git a/arch/arm/mach-s3c24xx/pm-s3c2410.c b/arch/arm/mach-s3c24xx/pm-s3c2410.c
index 949ae05e07c5..2d82c4f116cd 100644
--- a/arch/arm/mach-s3c24xx/pm-s3c2410.c
+++ b/arch/arm/mach-s3c24xx/pm-s3c2410.c
@@ -29,16 +29,16 @@
29#include <linux/gpio.h> 29#include <linux/gpio.h>
30#include <linux/io.h> 30#include <linux/io.h>
31 31
32#include <mach/hardware.h>
33
34#include <asm/mach-types.h> 32#include <asm/mach-types.h>
35 33
34#include <mach/hardware.h>
36#include <mach/regs-gpio.h> 35#include <mach/regs-gpio.h>
37#include <mach/h1940.h>
38 36
39#include <plat/cpu.h> 37#include <plat/cpu.h>
40#include <plat/pm.h> 38#include <plat/pm.h>
41 39
40#include "h1940.h"
41
42static void s3c2410_pm_prepare(void) 42static void s3c2410_pm_prepare(void)
43{ 43{
44 /* ensure at least GSTATUS3 has the resume address */ 44 /* ensure at least GSTATUS3 has the resume address */
diff --git a/arch/arm/mach-s3c24xx/pm-s3c2412.c b/arch/arm/mach-s3c24xx/pm-s3c2412.c
index c60f67a75aff..668a78a8b195 100644
--- a/arch/arm/mach-s3c24xx/pm-s3c2412.c
+++ b/arch/arm/mach-s3c24xx/pm-s3c2412.c
@@ -21,19 +21,19 @@
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/io.h> 22#include <linux/io.h>
23 23
24#include <mach/hardware.h>
25#include <asm/cacheflush.h> 24#include <asm/cacheflush.h>
26#include <asm/irq.h> 25#include <asm/irq.h>
27 26
28#include <mach/regs-power.h> 27#include <mach/hardware.h>
29#include <mach/regs-gpio.h> 28#include <mach/regs-gpio.h>
30#include <mach/regs-dsc.h>
31 29
32#include <plat/cpu.h> 30#include <plat/cpu.h>
33#include <plat/pm.h> 31#include <plat/pm.h>
34
35#include <plat/s3c2412.h> 32#include <plat/s3c2412.h>
36 33
34#include "regs-dsc.h"
35#include "s3c2412-power.h"
36
37extern void s3c2412_sleep_enter(void); 37extern void s3c2412_sleep_enter(void);
38 38
39static int s3c2412_cpu_suspend(unsigned long arg) 39static int s3c2412_cpu_suspend(unsigned long arg)
@@ -48,7 +48,8 @@ static int s3c2412_cpu_suspend(unsigned long arg)
48 48
49 s3c2412_sleep_enter(); 49 s3c2412_sleep_enter();
50 50
51 panic("sleep resumed to originator?"); 51 pr_info("Failed to suspend the system\n");
52 return 1; /* Aborting suspend */
52} 53}
53 54
54static void s3c2412_pm_prepare(void) 55static void s3c2412_pm_prepare(void)
diff --git a/arch/arm/mach-s3c24xx/pm-s3c2416.c b/arch/arm/mach-s3c24xx/pm-s3c2416.c
index 1bd4817b8eb8..44923895f558 100644
--- a/arch/arm/mach-s3c24xx/pm-s3c2416.c
+++ b/arch/arm/mach-s3c24xx/pm-s3c2416.c
@@ -16,12 +16,13 @@
16 16
17#include <asm/cacheflush.h> 17#include <asm/cacheflush.h>
18 18
19#include <mach/regs-power.h>
20#include <mach/regs-s3c2443-clock.h> 19#include <mach/regs-s3c2443-clock.h>
21 20
22#include <plat/cpu.h> 21#include <plat/cpu.h>
23#include <plat/pm.h> 22#include <plat/pm.h>
24 23
24#include "s3c2412-power.h"
25
25extern void s3c2412_sleep_enter(void); 26extern void s3c2412_sleep_enter(void);
26 27
27static int s3c2416_cpu_suspend(unsigned long arg) 28static int s3c2416_cpu_suspend(unsigned long arg)
@@ -34,7 +35,8 @@ static int s3c2416_cpu_suspend(unsigned long arg)
34 35
35 s3c2412_sleep_enter(); 36 s3c2412_sleep_enter();
36 37
37 panic("sleep resumed to originator?"); 38 pr_info("Failed to suspend the system\n");
39 return 1; /* Aborting suspend */
38} 40}
39 41
40static void s3c2416_pm_prepare(void) 42static void s3c2416_pm_prepare(void)
diff --git a/arch/arm/mach-s3c24xx/pm.c b/arch/arm/mach-s3c24xx/pm.c
index 724755f0b0f5..caa5b7211380 100644
--- a/arch/arm/mach-s3c24xx/pm.c
+++ b/arch/arm/mach-s3c24xx/pm.c
@@ -38,7 +38,6 @@
38#include <plat/regs-serial.h> 38#include <plat/regs-serial.h>
39#include <mach/regs-clock.h> 39#include <mach/regs-clock.h>
40#include <mach/regs-gpio.h> 40#include <mach/regs-gpio.h>
41#include <mach/regs-mem.h>
42#include <mach/regs-irq.h> 41#include <mach/regs-irq.h>
43 42
44#include <asm/mach/time.h> 43#include <asm/mach/time.h>
@@ -46,6 +45,8 @@
46#include <plat/gpio-cfg.h> 45#include <plat/gpio-cfg.h>
47#include <plat/pm.h> 46#include <plat/pm.h>
48 47
48#include "regs-mem.h"
49
49#define PFX "s3c24xx-pm: " 50#define PFX "s3c24xx-pm: "
50 51
51static struct sleep_save core_save[] = { 52static struct sleep_save core_save[] = {
diff --git a/arch/arm/mach-s3c24xx/include/mach/regs-dsc.h b/arch/arm/mach-s3c24xx/regs-dsc.h
index 98fd4a05587c..98fd4a05587c 100644
--- a/arch/arm/mach-s3c24xx/include/mach/regs-dsc.h
+++ b/arch/arm/mach-s3c24xx/regs-dsc.h
diff --git a/arch/arm/mach-s3c24xx/regs-mem.h b/arch/arm/mach-s3c24xx/regs-mem.h
new file mode 100644
index 000000000000..86b1258368c2
--- /dev/null
+++ b/arch/arm/mach-s3c24xx/regs-mem.h
@@ -0,0 +1,54 @@
1/*
2 * Copyright (c) 2004 Simtec Electronics <linux@simtec.co.uk>
3 * http://www.simtec.co.uk/products/SWLINUX/
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 * S3C2410 Memory Control register definitions
10 */
11
12#ifndef __ARCH_ARM_MACH_S3C24XX_REGS_MEM_H
13#define __ARCH_ARM_MACH_S3C24XX_REGS_MEM_H __FILE__
14
15#define S3C2410_MEMREG(x) (S3C24XX_VA_MEMCTRL + (x))
16
17#define S3C2410_BWSCON S3C2410_MEMREG(0x00)
18#define S3C2410_BANKCON0 S3C2410_MEMREG(0x04)
19#define S3C2410_BANKCON1 S3C2410_MEMREG(0x08)
20#define S3C2410_BANKCON2 S3C2410_MEMREG(0x0C)
21#define S3C2410_BANKCON3 S3C2410_MEMREG(0x10)
22#define S3C2410_BANKCON4 S3C2410_MEMREG(0x14)
23#define S3C2410_BANKCON5 S3C2410_MEMREG(0x18)
24#define S3C2410_BANKCON6 S3C2410_MEMREG(0x1C)
25#define S3C2410_BANKCON7 S3C2410_MEMREG(0x20)
26#define S3C2410_REFRESH S3C2410_MEMREG(0x24)
27#define S3C2410_BANKSIZE S3C2410_MEMREG(0x28)
28
29#define S3C2410_BWSCON_ST1 (1 << 7)
30#define S3C2410_BWSCON_ST2 (1 << 11)
31#define S3C2410_BWSCON_ST3 (1 << 15)
32#define S3C2410_BWSCON_ST4 (1 << 19)
33#define S3C2410_BWSCON_ST5 (1 << 23)
34
35#define S3C2410_BWSCON_GET(_bwscon, _bank) (((_bwscon) >> ((_bank) * 4)) & 0xf)
36
37#define S3C2410_BWSCON_WS (1 << 2)
38
39#define S3C2410_BANKCON_PMC16 (0x3)
40
41#define S3C2410_BANKCON_Tacp_SHIFT (2)
42#define S3C2410_BANKCON_Tcah_SHIFT (4)
43#define S3C2410_BANKCON_Tcoh_SHIFT (6)
44#define S3C2410_BANKCON_Tacc_SHIFT (8)
45#define S3C2410_BANKCON_Tcos_SHIFT (11)
46#define S3C2410_BANKCON_Tacs_SHIFT (13)
47
48#define S3C2410_BANKCON_SDRAM (0x3 << 15)
49
50#define S3C2410_REFRESH_SELF (1 << 22)
51
52#define S3C2410_BANKSIZE_MASK (0x7 << 0)
53
54#endif /* __ARCH_ARM_MACH_S3C24XX_REGS_MEM_H */
diff --git a/arch/arm/mach-s3c24xx/s3c2410.c b/arch/arm/mach-s3c24xx/s3c2410.c
index a3c5cb086ee2..9ebef95da721 100644
--- a/arch/arm/mach-s3c24xx/s3c2410.c
+++ b/arch/arm/mach-s3c24xx/s3c2410.c
@@ -49,6 +49,8 @@
49#include <plat/gpio-cfg.h> 49#include <plat/gpio-cfg.h>
50#include <plat/gpio-cfg-helpers.h> 50#include <plat/gpio-cfg-helpers.h>
51 51
52#include "common.h"
53
52/* Initial IO mappings */ 54/* Initial IO mappings */
53 55
54static struct map_desc s3c2410_iodesc[] __initdata = { 56static struct map_desc s3c2410_iodesc[] __initdata = {
@@ -182,8 +184,8 @@ int __init s3c2410_init(void)
182 184
183#ifdef CONFIG_PM 185#ifdef CONFIG_PM
184 register_syscore_ops(&s3c2410_pm_syscore_ops); 186 register_syscore_ops(&s3c2410_pm_syscore_ops);
185#endif
186 register_syscore_ops(&s3c24xx_irq_syscore_ops); 187 register_syscore_ops(&s3c24xx_irq_syscore_ops);
188#endif
187 189
188 return device_register(&s3c2410_dev); 190 return device_register(&s3c2410_dev);
189} 191}
diff --git a/arch/arm/mach-s3c24xx/s3c2412-power.h b/arch/arm/mach-s3c24xx/s3c2412-power.h
new file mode 100644
index 000000000000..1b02c5ddb31b
--- /dev/null
+++ b/arch/arm/mach-s3c24xx/s3c2412-power.h
@@ -0,0 +1,37 @@
1/*
2 * Copyright (c) 2003-2006 Simtec Electronics <linux@simtec.co.uk>
3 * http://armlinux.simtec.co.uk/
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#ifndef __ARCH_ARM_MACH_S3C24XX_S3C2412_POWER_H
11#define __ARCH_ARM_MACH_S3C24XX_S3C2412_POWER_H __FILE__
12
13#define S3C24XX_PWRREG(x) ((x) + S3C24XX_VA_CLKPWR)
14
15#define S3C2412_PWRMODECON S3C24XX_PWRREG(0x20)
16#define S3C2412_PWRCFG S3C24XX_PWRREG(0x24)
17
18#define S3C2412_INFORM0 S3C24XX_PWRREG(0x70)
19#define S3C2412_INFORM1 S3C24XX_PWRREG(0x74)
20#define S3C2412_INFORM2 S3C24XX_PWRREG(0x78)
21#define S3C2412_INFORM3 S3C24XX_PWRREG(0x7C)
22
23#define S3C2412_PWRCFG_BATF_IRQ (1 << 0)
24#define S3C2412_PWRCFG_BATF_IGNORE (2 << 0)
25#define S3C2412_PWRCFG_BATF_SLEEP (3 << 0)
26#define S3C2412_PWRCFG_BATF_MASK (3 << 0)
27
28#define S3C2412_PWRCFG_STANDBYWFI_IGNORE (0 << 6)
29#define S3C2412_PWRCFG_STANDBYWFI_IDLE (1 << 6)
30#define S3C2412_PWRCFG_STANDBYWFI_STOP (2 << 6)
31#define S3C2412_PWRCFG_STANDBYWFI_SLEEP (3 << 6)
32#define S3C2412_PWRCFG_STANDBYWFI_MASK (3 << 6)
33
34#define S3C2412_PWRCFG_RTC_MASKIRQ (1 << 8)
35#define S3C2412_PWRCFG_NAND_NORST (1 << 9)
36
37#endif /* __ARCH_ARM_MACH_S3C24XX_S3C2412_POWER_H */
diff --git a/arch/arm/mach-s3c24xx/s3c2412.c b/arch/arm/mach-s3c24xx/s3c2412.c
index 6c5f4031ff0c..0d592159a5c3 100644
--- a/arch/arm/mach-s3c24xx/s3c2412.c
+++ b/arch/arm/mach-s3c24xx/s3c2412.c
@@ -1,5 +1,4 @@
1/* linux/arch/arm/mach-s3c2412/s3c2412.c 1/*
2 *
3 * Copyright (c) 2006 Simtec Electronics 2 * Copyright (c) 2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 3 * Ben Dooks <ben@simtec.co.uk>
5 * 4 *
@@ -28,28 +27,31 @@
28#include <asm/mach/map.h> 27#include <asm/mach/map.h>
29#include <asm/mach/irq.h> 28#include <asm/mach/irq.h>
30 29
31#include <mach/hardware.h>
32#include <asm/proc-fns.h> 30#include <asm/proc-fns.h>
33#include <asm/irq.h> 31#include <asm/irq.h>
34#include <asm/system_misc.h> 32#include <asm/system_misc.h>
35 33
36#include <plat/cpu-freq.h> 34#include <mach/hardware.h>
37
38#include <mach/regs-clock.h> 35#include <mach/regs-clock.h>
39#include <plat/regs-serial.h>
40#include <mach/regs-power.h>
41#include <mach/regs-gpio.h> 36#include <mach/regs-gpio.h>
42#include <mach/regs-dsc.h>
43#include <plat/regs-spi.h>
44#include <mach/regs-s3c2412.h>
45 37
46#include <plat/s3c2412.h> 38#include <plat/clock.h>
47#include <plat/cpu.h> 39#include <plat/cpu.h>
40#include <plat/cpu-freq.h>
48#include <plat/devs.h> 41#include <plat/devs.h>
49#include <plat/clock.h>
50#include <plat/pm.h>
51#include <plat/pll.h>
52#include <plat/nand-core.h> 42#include <plat/nand-core.h>
43#include <plat/pll.h>
44#include <plat/pm.h>
45#include <plat/regs-serial.h>
46#include <plat/regs-spi.h>
47#include <plat/s3c2412.h>
48
49#include "common.h"
50#include "regs-dsc.h"
51#include "s3c2412-power.h"
52
53#define S3C2412_SWRST (S3C24XX_VA_CLKPWR + 0x30)
54#define S3C2412_SWRST_RESET (0x533C2412)
53 55
54#ifndef CONFIG_CPU_S3C2412_ONLY 56#ifndef CONFIG_CPU_S3C2412_ONLY
55void __iomem *s3c24xx_va_gpio2 = S3C24XX_VA_GPIO; 57void __iomem *s3c24xx_va_gpio2 = S3C24XX_VA_GPIO;
@@ -244,8 +246,8 @@ int __init s3c2412_init(void)
244 246
245#ifdef CONFIG_PM 247#ifdef CONFIG_PM
246 register_syscore_ops(&s3c2412_pm_syscore_ops); 248 register_syscore_ops(&s3c2412_pm_syscore_ops);
247#endif
248 register_syscore_ops(&s3c24xx_irq_syscore_ops); 249 register_syscore_ops(&s3c24xx_irq_syscore_ops);
250#endif
249 251
250 return device_register(&s3c2412_dev); 252 return device_register(&s3c2412_dev);
251} 253}
diff --git a/arch/arm/mach-s3c24xx/s3c2412.h b/arch/arm/mach-s3c24xx/s3c2412.h
new file mode 100644
index 000000000000..548ced42cbb7
--- /dev/null
+++ b/arch/arm/mach-s3c24xx/s3c2412.h
@@ -0,0 +1,26 @@
1/*
2 * Copyright (c) 2008 Simtec Electronics
3 * Ben Dooks <ben@simtec.co.uk>
4 * http://armlinux.simtec.co.uk/
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 __ARCH_ARM_MACH_S3C24XX_S3C2412_H
12#define __ARCH_ARM_REGS_S3C24XX_S3C2412_H __FILE__
13
14#define S3C2412_MEMREG(x) (S3C24XX_VA_MEMCTRL + (x))
15#define S3C2412_EBIREG(x) (S3C2412_VA_EBI + (x))
16
17#define S3C2412_SSMCREG(x) (S3C2412_VA_SSMC + (x))
18#define S3C2412_SSMC(x, o) (S3C2412_SSMCREG((x * 0x20) + (o)))
19
20#define S3C2412_REFRESH S3C2412_MEMREG(0x10)
21
22#define S3C2412_EBI_BANKCFG S3C2412_EBIREG(0x4)
23
24#define S3C2412_SSMC_BANK(x) S3C2412_SSMC(x, 0x0)
25
26#endif /* __ARCH_ARM_MACH_S3C24XX_S3C2412_H */
diff --git a/arch/arm/mach-s3c24xx/s3c2416.c b/arch/arm/mach-s3c24xx/s3c2416.c
index 77ee0b732237..e30476db0295 100644
--- a/arch/arm/mach-s3c24xx/s3c2416.c
+++ b/arch/arm/mach-s3c24xx/s3c2416.c
@@ -63,6 +63,8 @@
63#include <plat/rtc-core.h> 63#include <plat/rtc-core.h>
64#include <plat/spi-core.h> 64#include <plat/spi-core.h>
65 65
66#include "common.h"
67
66static struct map_desc s3c2416_iodesc[] __initdata = { 68static struct map_desc s3c2416_iodesc[] __initdata = {
67 IODESC_ENT(WATCHDOG), 69 IODESC_ENT(WATCHDOG),
68 IODESC_ENT(CLKPWR), 70 IODESC_ENT(CLKPWR),
@@ -105,9 +107,9 @@ int __init s3c2416_init(void)
105 107
106#ifdef CONFIG_PM 108#ifdef CONFIG_PM
107 register_syscore_ops(&s3c2416_pm_syscore_ops); 109 register_syscore_ops(&s3c2416_pm_syscore_ops);
108#endif
109 register_syscore_ops(&s3c24xx_irq_syscore_ops); 110 register_syscore_ops(&s3c24xx_irq_syscore_ops);
110 register_syscore_ops(&s3c2416_irq_syscore_ops); 111 register_syscore_ops(&s3c2416_irq_syscore_ops);
112#endif
111 113
112 return device_register(&s3c2416_dev); 114 return device_register(&s3c2416_dev);
113} 115}
diff --git a/arch/arm/mach-s3c24xx/s3c2440.c b/arch/arm/mach-s3c24xx/s3c2440.c
index 2b3dddb49af7..559e394e8989 100644
--- a/arch/arm/mach-s3c24xx/s3c2440.c
+++ b/arch/arm/mach-s3c24xx/s3c2440.c
@@ -40,6 +40,8 @@
40#include <plat/gpio-cfg.h> 40#include <plat/gpio-cfg.h>
41#include <plat/gpio-cfg-helpers.h> 41#include <plat/gpio-cfg-helpers.h>
42 42
43#include "common.h"
44
43static struct device s3c2440_dev = { 45static struct device s3c2440_dev = {
44 .bus = &s3c2440_subsys, 46 .bus = &s3c2440_subsys,
45}; 47};
@@ -57,9 +59,9 @@ int __init s3c2440_init(void)
57 59
58#ifdef CONFIG_PM 60#ifdef CONFIG_PM
59 register_syscore_ops(&s3c2410_pm_syscore_ops); 61 register_syscore_ops(&s3c2410_pm_syscore_ops);
62 register_syscore_ops(&s3c24xx_irq_syscore_ops);
60#endif 63#endif
61 register_syscore_ops(&s3c244x_pm_syscore_ops); 64 register_syscore_ops(&s3c244x_pm_syscore_ops);
62 register_syscore_ops(&s3c24xx_irq_syscore_ops);
63 65
64 /* register our system device for everything else */ 66 /* register our system device for everything else */
65 67
diff --git a/arch/arm/mach-s3c24xx/s3c2442.c b/arch/arm/mach-s3c24xx/s3c2442.c
index 22cb7c94a8c8..f732826c2359 100644
--- a/arch/arm/mach-s3c24xx/s3c2442.c
+++ b/arch/arm/mach-s3c24xx/s3c2442.c
@@ -51,6 +51,8 @@
51#include <plat/gpio-cfg.h> 51#include <plat/gpio-cfg.h>
52#include <plat/gpio-cfg-helpers.h> 52#include <plat/gpio-cfg-helpers.h>
53 53
54#include "common.h"
55
54/* S3C2442 extended clock support */ 56/* S3C2442 extended clock support */
55 57
56static unsigned long s3c2442_camif_upll_round(struct clk *clk, 58static unsigned long s3c2442_camif_upll_round(struct clk *clk,
@@ -172,9 +174,9 @@ int __init s3c2442_init(void)
172 174
173#ifdef CONFIG_PM 175#ifdef CONFIG_PM
174 register_syscore_ops(&s3c2410_pm_syscore_ops); 176 register_syscore_ops(&s3c2410_pm_syscore_ops);
177 register_syscore_ops(&s3c24xx_irq_syscore_ops);
175#endif 178#endif
176 register_syscore_ops(&s3c244x_pm_syscore_ops); 179 register_syscore_ops(&s3c244x_pm_syscore_ops);
177 register_syscore_ops(&s3c24xx_irq_syscore_ops);
178 180
179 return device_register(&s3c2442_dev); 181 return device_register(&s3c2442_dev);
180} 182}
diff --git a/arch/arm/mach-s3c24xx/s3c244x.c b/arch/arm/mach-s3c24xx/s3c244x.c
index b0b60a1154d6..ad2671baa910 100644
--- a/arch/arm/mach-s3c24xx/s3c244x.c
+++ b/arch/arm/mach-s3c24xx/s3c244x.c
@@ -36,7 +36,6 @@
36#include <mach/regs-clock.h> 36#include <mach/regs-clock.h>
37#include <plat/regs-serial.h> 37#include <plat/regs-serial.h>
38#include <mach/regs-gpio.h> 38#include <mach/regs-gpio.h>
39#include <mach/regs-dsc.h>
40 39
41#include <plat/s3c2410.h> 40#include <plat/s3c2410.h>
42#include <plat/s3c244x.h> 41#include <plat/s3c244x.h>
@@ -48,6 +47,8 @@
48#include <plat/nand-core.h> 47#include <plat/nand-core.h>
49#include <plat/watchdog-reset.h> 48#include <plat/watchdog-reset.h>
50 49
50#include "regs-dsc.h"
51
51static struct map_desc s3c244x_iodesc[] __initdata = { 52static struct map_desc s3c244x_iodesc[] __initdata = {
52 IODESC_ENT(CLKPWR), 53 IODESC_ENT(CLKPWR),
53 IODESC_ENT(TIMER), 54 IODESC_ENT(TIMER),
diff --git a/arch/arm/mach-s3c24xx/simtec-audio.c b/arch/arm/mach-s3c24xx/simtec-audio.c
index fd0ef05763a9..67cb5120dfeb 100644
--- a/arch/arm/mach-s3c24xx/simtec-audio.c
+++ b/arch/arm/mach-s3c24xx/simtec-audio.c
@@ -17,16 +17,13 @@
17#include <linux/device.h> 17#include <linux/device.h>
18#include <linux/io.h> 18#include <linux/io.h>
19 19
20#include <mach/bast-map.h>
21#include <mach/bast-irq.h>
22#include <mach/bast-cpld.h>
23
24#include <mach/hardware.h> 20#include <mach/hardware.h>
25#include <mach/regs-gpio.h> 21#include <mach/regs-gpio.h>
26 22
27#include <linux/platform_data/asoc-s3c24xx_simtec.h> 23#include <linux/platform_data/asoc-s3c24xx_simtec.h>
28#include <plat/devs.h> 24#include <plat/devs.h>
29 25
26#include "bast.h"
30#include "simtec.h" 27#include "simtec.h"
31 28
32/* platform ops for audio */ 29/* platform ops for audio */
diff --git a/arch/arm/mach-s3c24xx/simtec-nor.c b/arch/arm/mach-s3c24xx/simtec-nor.c
index 029744fcaacb..8884bffa619a 100644
--- a/arch/arm/mach-s3c24xx/simtec-nor.c
+++ b/arch/arm/mach-s3c24xx/simtec-nor.c
@@ -27,9 +27,8 @@
27#include <asm/mach/irq.h> 27#include <asm/mach/irq.h>
28 28
29#include <mach/map.h> 29#include <mach/map.h>
30#include <mach/bast-map.h>
31#include <mach/bast-cpld.h>
32 30
31#include "bast.h"
33#include "simtec.h" 32#include "simtec.h"
34 33
35static void simtec_nor_vpp(struct platform_device *pdev, int vpp) 34static void simtec_nor_vpp(struct platform_device *pdev, int vpp)
diff --git a/arch/arm/mach-s3c24xx/simtec-pm.c b/arch/arm/mach-s3c24xx/simtec-pm.c
index 699f93171297..38a2f1fdebab 100644
--- a/arch/arm/mach-s3c24xx/simtec-pm.c
+++ b/arch/arm/mach-s3c24xx/simtec-pm.c
@@ -28,12 +28,13 @@
28 28
29#include <mach/map.h> 29#include <mach/map.h>
30#include <mach/regs-gpio.h> 30#include <mach/regs-gpio.h>
31#include <mach/regs-mem.h>
32 31
33#include <asm/mach-types.h> 32#include <asm/mach-types.h>
34 33
35#include <plat/pm.h> 34#include <plat/pm.h>
36 35
36#include "regs-mem.h"
37
37#define COPYRIGHT ", Copyright 2005 Simtec Electronics" 38#define COPYRIGHT ", Copyright 2005 Simtec Electronics"
38 39
39/* pm_simtec_init 40/* pm_simtec_init
diff --git a/arch/arm/mach-s3c24xx/simtec-usb.c b/arch/arm/mach-s3c24xx/simtec-usb.c
index ddf7a3c743ac..2ed2e32430dc 100644
--- a/arch/arm/mach-s3c24xx/simtec-usb.c
+++ b/arch/arm/mach-s3c24xx/simtec-usb.c
@@ -28,15 +28,13 @@
28#include <asm/mach/map.h> 28#include <asm/mach/map.h>
29#include <asm/mach/irq.h> 29#include <asm/mach/irq.h>
30 30
31#include <mach/bast-map.h>
32#include <mach/bast-irq.h>
33
34#include <mach/hardware.h> 31#include <mach/hardware.h>
35#include <asm/irq.h> 32#include <asm/irq.h>
36 33
37#include <linux/platform_data/usb-ohci-s3c2410.h> 34#include <linux/platform_data/usb-ohci-s3c2410.h>
38#include <plat/devs.h> 35#include <plat/devs.h>
39 36
37#include "bast.h"
40#include "simtec.h" 38#include "simtec.h"
41 39
42/* control power and monitor over-current events on various Simtec 40/* control power and monitor over-current events on various Simtec
@@ -79,7 +77,7 @@ static void usb_simtec_enableoc(struct s3c2410_hcd_info *info, int on)
79 int ret; 77 int ret;
80 78
81 if (on) { 79 if (on) {
82 ret = request_irq(IRQ_USBOC, usb_simtec_ocirq, 80 ret = request_irq(BAST_IRQ_USBOC, usb_simtec_ocirq,
83 IRQF_DISABLED | IRQF_TRIGGER_RISING | 81 IRQF_DISABLED | IRQF_TRIGGER_RISING |
84 IRQF_TRIGGER_FALLING, 82 IRQF_TRIGGER_FALLING,
85 "USB Over-current", info); 83 "USB Over-current", info);
@@ -87,7 +85,7 @@ static void usb_simtec_enableoc(struct s3c2410_hcd_info *info, int on)
87 printk(KERN_ERR "failed to request usb oc irq\n"); 85 printk(KERN_ERR "failed to request usb oc irq\n");
88 } 86 }
89 } else { 87 } else {
90 free_irq(IRQ_USBOC, info); 88 free_irq(BAST_IRQ_USBOC, info);
91 } 89 }
92} 90}
93 91
diff --git a/arch/arm/mach-s3c24xx/sleep-s3c2410.S b/arch/arm/mach-s3c24xx/sleep-s3c2410.S
index dd5b6388a5a5..dd47c8fa07fa 100644
--- a/arch/arm/mach-s3c24xx/sleep-s3c2410.S
+++ b/arch/arm/mach-s3c24xx/sleep-s3c2410.S
@@ -31,9 +31,10 @@
31 31
32#include <mach/regs-gpio.h> 32#include <mach/regs-gpio.h>
33#include <mach/regs-clock.h> 33#include <mach/regs-clock.h>
34#include <mach/regs-mem.h>
35#include <plat/regs-serial.h> 34#include <plat/regs-serial.h>
36 35
36#include "regs-mem.h"
37
37 /* s3c2410_cpu_suspend 38 /* s3c2410_cpu_suspend
38 * 39 *
39 * put the cpu into sleep mode 40 * put the cpu into sleep mode
@@ -45,9 +46,9 @@ ENTRY(s3c2410_cpu_suspend)
45 ldr r4, =S3C2410_REFRESH 46 ldr r4, =S3C2410_REFRESH
46 ldr r5, =S3C24XX_MISCCR 47 ldr r5, =S3C24XX_MISCCR
47 ldr r6, =S3C2410_CLKCON 48 ldr r6, =S3C2410_CLKCON
48 ldr r7, [ r4 ] @ get REFRESH (and ensure in TLB) 49 ldr r7, [r4] @ get REFRESH (and ensure in TLB)
49 ldr r8, [ r5 ] @ get MISCCR (and ensure in TLB) 50 ldr r8, [r5] @ get MISCCR (and ensure in TLB)
50 ldr r9, [ r6 ] @ get CLKCON (and ensure in TLB) 51 ldr r9, [r6] @ get CLKCON (and ensure in TLB)
51 52
52 orr r7, r7, #S3C2410_REFRESH_SELF @ SDRAM sleep command 53 orr r7, r7, #S3C2410_REFRESH_SELF @ SDRAM sleep command
53 orr r8, r8, #S3C2410_MISCCR_SDSLEEP @ SDRAM power-down signals 54 orr r8, r8, #S3C2410_MISCCR_SDSLEEP @ SDRAM power-down signals
@@ -61,8 +62,8 @@ ENTRY(s3c2410_cpu_suspend)
61 @@ align next bit of code to cache line 62 @@ align next bit of code to cache line
62 .align 5 63 .align 5
63s3c2410_do_sleep: 64s3c2410_do_sleep:
64 streq r7, [ r4 ] @ SDRAM sleep command 65 streq r7, [r4] @ SDRAM sleep command
65 streq r8, [ r5 ] @ SDRAM power-down config 66 streq r8, [r5] @ SDRAM power-down config
66 streq r9, [ r6 ] @ CPU sleep 67 streq r9, [r6] @ CPU sleep
671: beq 1b 681: beq 1b
68 mov pc, r14 69 mov pc, r14
diff --git a/arch/arm/mach-s3c24xx/sleep-s3c2412.S b/arch/arm/mach-s3c24xx/sleep-s3c2412.S
index c82418ed714d..5adaceb7da13 100644
--- a/arch/arm/mach-s3c24xx/sleep-s3c2412.S
+++ b/arch/arm/mach-s3c24xx/sleep-s3c2412.S
@@ -57,12 +57,12 @@ s3c2412_sleep_enter1:
57 * retry, as simply returning causes the system to lock. 57 * retry, as simply returning causes the system to lock.
58 */ 58 */
59 59
60 ldrne r9, [ r1 ] 60 ldrne r9, [r1]
61 strne r9, [ r1 ] 61 strne r9, [r1]
62 ldrne r9, [ r2 ] 62 ldrne r9, [r2]
63 strne r9, [ r2 ] 63 strne r9, [r2]
64 ldrne r9, [ r3 ] 64 ldrne r9, [r3]
65 strne r9, [ r3 ] 65 strne r9, [r3]
66 bne s3c2412_sleep_enter1 66 bne s3c2412_sleep_enter1
67 67
68 mov pc, r14 68 mov pc, r14
diff --git a/arch/arm/mach-s3c24xx/sleep.S b/arch/arm/mach-s3c24xx/sleep.S
index c56612569b40..7f378b662da6 100644
--- a/arch/arm/mach-s3c24xx/sleep.S
+++ b/arch/arm/mach-s3c24xx/sleep.S
@@ -31,7 +31,6 @@
31 31
32#include <mach/regs-gpio.h> 32#include <mach/regs-gpio.h>
33#include <mach/regs-clock.h> 33#include <mach/regs-clock.h>
34#include <mach/regs-mem.h>
35#include <plat/regs-serial.h> 34#include <plat/regs-serial.h>
36 35
37/* CONFIG_DEBUG_RESUME is dangerous if your bootloader does not 36/* CONFIG_DEBUG_RESUME is dangerous if your bootloader does not
diff --git a/arch/arm/mach-s3c24xx/vr1000.h b/arch/arm/mach-s3c24xx/vr1000.h
new file mode 100644
index 000000000000..7fcd2c2f183c
--- /dev/null
+++ b/arch/arm/mach-s3c24xx/vr1000.h
@@ -0,0 +1,118 @@
1
2/* arch/arm/mach-s3c2410/include/mach/vr1000-cpld.h
3 *
4 * Copyright (c) 2003 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * VR1000 - CPLD control constants
8 * Machine VR1000 - IRQ Number definitions
9 * Machine VR1000 - Memory map definitions
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14*/
15
16#ifndef __MACH_S3C24XX_VR1000_H
17#define __MACH_S3C24XX_VR1000_H __FILE__
18
19#define VR1000_CPLD_CTRL2_RAMWEN (0x04) /* SRAM Write Enable */
20
21/* irq numbers to onboard peripherals */
22
23#define VR1000_IRQ_USBOC IRQ_EINT19
24#define VR1000_IRQ_IDE0 IRQ_EINT16
25#define VR1000_IRQ_IDE1 IRQ_EINT17
26#define VR1000_IRQ_SERIAL IRQ_EINT12
27#define VR1000_IRQ_DM9000A IRQ_EINT10
28#define VR1000_IRQ_DM9000N IRQ_EINT9
29#define VR1000_IRQ_SMALERT IRQ_EINT8
30
31/* map */
32
33#define VR1000_IOADDR(x) (S3C2410_ADDR((x) + 0x01300000))
34
35/* we put the CPLD registers next, to get them out of the way */
36
37#define VR1000_VA_CTRL1 VR1000_IOADDR(0x00000000) /* 0x01300000 */
38#define VR1000_PA_CTRL1 (S3C2410_CS5 | 0x7800000)
39
40#define VR1000_VA_CTRL2 VR1000_IOADDR(0x00100000) /* 0x01400000 */
41#define VR1000_PA_CTRL2 (S3C2410_CS1 | 0x6000000)
42
43#define VR1000_VA_CTRL3 VR1000_IOADDR(0x00200000) /* 0x01500000 */
44#define VR1000_PA_CTRL3 (S3C2410_CS1 | 0x6800000)
45
46#define VR1000_VA_CTRL4 VR1000_IOADDR(0x00300000) /* 0x01600000 */
47#define VR1000_PA_CTRL4 (S3C2410_CS1 | 0x7000000)
48
49/* next, we have the PC104 ISA interrupt registers */
50
51#define VR1000_PA_PC104_IRQREQ (S3C2410_CS5 | 0x6000000) /* 0x01700000 */
52#define VR1000_VA_PC104_IRQREQ VR1000_IOADDR(0x00400000)
53
54#define VR1000_PA_PC104_IRQRAW (S3C2410_CS5 | 0x6800000) /* 0x01800000 */
55#define VR1000_VA_PC104_IRQRAW VR1000_IOADDR(0x00500000)
56
57#define VR1000_PA_PC104_IRQMASK (S3C2410_CS5 | 0x7000000) /* 0x01900000 */
58#define VR1000_VA_PC104_IRQMASK VR1000_IOADDR(0x00600000)
59
60/*
61 * 0xE0000000 contains the IO space that is split by speed and
62 * whether the access is for 8 or 16bit IO... this ensures that
63 * the correct access is made
64 *
65 * 0x10000000 of space, partitioned as so:
66 *
67 * 0x00000000 to 0x04000000 8bit, slow
68 * 0x04000000 to 0x08000000 16bit, slow
69 * 0x08000000 to 0x0C000000 16bit, net
70 * 0x0C000000 to 0x10000000 16bit, fast
71 *
72 * each of these spaces has the following in:
73 *
74 * 0x02000000 to 0x02100000 1MB IDE primary channel
75 * 0x02100000 to 0x02200000 1MB IDE primary channel aux
76 * 0x02200000 to 0x02400000 1MB IDE secondary channel
77 * 0x02300000 to 0x02400000 1MB IDE secondary channel aux
78 * 0x02500000 to 0x02600000 1MB Davicom DM9000 ethernet controllers
79 * 0x02600000 to 0x02700000 1MB
80 *
81 * the phyiscal layout of the zones are:
82 * nGCS2 - 8bit, slow
83 * nGCS3 - 16bit, slow
84 * nGCS4 - 16bit, net
85 * nGCS5 - 16bit, fast
86 */
87
88#define VR1000_VA_MULTISPACE (0xE0000000)
89
90#define VR1000_VA_ISAIO (VR1000_VA_MULTISPACE + 0x00000000)
91#define VR1000_VA_ISAMEM (VR1000_VA_MULTISPACE + 0x01000000)
92#define VR1000_VA_IDEPRI (VR1000_VA_MULTISPACE + 0x02000000)
93#define VR1000_VA_IDEPRIAUX (VR1000_VA_MULTISPACE + 0x02100000)
94#define VR1000_VA_IDESEC (VR1000_VA_MULTISPACE + 0x02200000)
95#define VR1000_VA_IDESECAUX (VR1000_VA_MULTISPACE + 0x02300000)
96#define VR1000_VA_ASIXNET (VR1000_VA_MULTISPACE + 0x02400000)
97#define VR1000_VA_DM9000 (VR1000_VA_MULTISPACE + 0x02500000)
98#define VR1000_VA_SUPERIO (VR1000_VA_MULTISPACE + 0x02600000)
99
100/* physical offset addresses for the peripherals */
101
102#define VR1000_PA_IDEPRI (0x02000000)
103#define VR1000_PA_IDEPRIAUX (0x02800000)
104#define VR1000_PA_IDESEC (0x03000000)
105#define VR1000_PA_IDESECAUX (0x03800000)
106#define VR1000_PA_DM9000 (0x05000000)
107
108#define VR1000_PA_SERIAL (0x11800000)
109#define VR1000_VA_SERIAL (VR1000_IOADDR(0x00700000))
110
111/* VR1000 ram is in CS1, with A26..A24 = 2_101 */
112#define VR1000_PA_SRAM (S3C2410_CS1 | 0x05000000)
113
114/* some configurations for the peripherals */
115
116#define VR1000_DM9000_CS VR1000_VAM_CS4
117
118#endif /* __MACH_S3C24XX_VR1000_H */
diff --git a/arch/arm/mach-s3c64xx/clock.c b/arch/arm/mach-s3c64xx/clock.c
index 803711e283b2..8499415be9cd 100644
--- a/arch/arm/mach-s3c64xx/clock.c
+++ b/arch/arm/mach-s3c64xx/clock.c
@@ -23,7 +23,6 @@
23#include <mach/hardware.h> 23#include <mach/hardware.h>
24#include <mach/map.h> 24#include <mach/map.h>
25 25
26#include <mach/regs-sys.h>
27#include <mach/regs-clock.h> 26#include <mach/regs-clock.h>
28 27
29#include <plat/cpu.h> 28#include <plat/cpu.h>
@@ -33,6 +32,8 @@
33#include <plat/clock-clksrc.h> 32#include <plat/clock-clksrc.h>
34#include <plat/pll.h> 33#include <plat/pll.h>
35 34
35#include "regs-sys.h"
36
36/* fin_apll, fin_mpll and fin_epll are all the same clock, which we call 37/* fin_apll, fin_mpll and fin_epll are all the same clock, which we call
37 * ext_xtal_mux for want of an actual name from the manual. 38 * ext_xtal_mux for want of an actual name from the manual.
38*/ 39*/
diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c
index aef303b8997e..0b9c0ba44834 100644
--- a/arch/arm/mach-s3c64xx/common.c
+++ b/arch/arm/mach-s3c64xx/common.c
@@ -25,10 +25,10 @@
25#include <linux/dma-mapping.h> 25#include <linux/dma-mapping.h>
26#include <linux/irq.h> 26#include <linux/irq.h>
27#include <linux/gpio.h> 27#include <linux/gpio.h>
28#include <linux/irqchip/arm-vic.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>
31#include <asm/hardware/vic.h>
32#include <asm/system_misc.h> 32#include <asm/system_misc.h>
33 33
34#include <mach/map.h> 34#include <mach/map.h>
diff --git a/arch/arm/mach-s3c64xx/cpuidle.c b/arch/arm/mach-s3c64xx/cpuidle.c
index acb197ccf3f7..ead5fab0dbb5 100644
--- a/arch/arm/mach-s3c64xx/cpuidle.c
+++ b/arch/arm/mach-s3c64xx/cpuidle.c
@@ -20,8 +20,8 @@
20 20
21#include <mach/map.h> 21#include <mach/map.h>
22 22
23#include <mach/regs-sys.h> 23#include "regs-sys.h"
24#include <mach/regs-syscon-power.h> 24#include "regs-syscon-power.h"
25 25
26static int s3c64xx_enter_idle(struct cpuidle_device *dev, 26static int s3c64xx_enter_idle(struct cpuidle_device *dev,
27 struct cpuidle_driver *drv, 27 struct cpuidle_driver *drv,
diff --git a/arch/arm/mach-s3c64xx/include/mach/crag6410.h b/arch/arm/mach-s3c64xx/crag6410.h
index 4c3c9994fc2c..4c3c9994fc2c 100644
--- a/arch/arm/mach-s3c64xx/include/mach/crag6410.h
+++ b/arch/arm/mach-s3c64xx/crag6410.h
diff --git a/arch/arm/mach-s3c64xx/dma.c b/arch/arm/mach-s3c64xx/dma.c
index f2a7a1725596..6af1aa1ef213 100644
--- a/arch/arm/mach-s3c64xx/dma.c
+++ b/arch/arm/mach-s3c64xx/dma.c
@@ -23,14 +23,13 @@
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/err.h> 24#include <linux/err.h>
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/amba/pl080.h>
26 27
27#include <mach/dma.h> 28#include <mach/dma.h>
28#include <mach/map.h> 29#include <mach/map.h>
29#include <mach/irqs.h> 30#include <mach/irqs.h>
30 31
31#include <mach/regs-sys.h> 32#include "regs-sys.h"
32
33#include <asm/hardware/pl080.h>
34 33
35/* dma channel state information */ 34/* dma channel state information */
36 35
diff --git a/arch/arm/mach-s3c64xx/include/mach/regs-irq.h b/arch/arm/mach-s3c64xx/include/mach/regs-irq.h
index bcce68a0bb75..6a1127891c87 100644
--- a/arch/arm/mach-s3c64xx/include/mach/regs-irq.h
+++ b/arch/arm/mach-s3c64xx/include/mach/regs-irq.h
@@ -15,6 +15,5 @@
15#ifndef __ASM_ARCH_REGS_IRQ_H 15#ifndef __ASM_ARCH_REGS_IRQ_H
16#define __ASM_ARCH_REGS_IRQ_H __FILE__ 16#define __ASM_ARCH_REGS_IRQ_H __FILE__
17 17
18#include <asm/hardware/vic.h>
19 18
20#endif /* __ASM_ARCH_6400_REGS_IRQ_H */ 19#endif /* __ASM_ARCH_6400_REGS_IRQ_H */
diff --git a/arch/arm/mach-s3c64xx/include/mach/regs-sys.h b/arch/arm/mach-s3c64xx/include/mach/regs-sys.h
deleted file mode 100644
index b91e02093289..000000000000
--- a/arch/arm/mach-s3c64xx/include/mach/regs-sys.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/* arch/arm/plat-s3c64xx/include/plat/regs-sys.h
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C64XX system register definitions
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#ifndef __PLAT_REGS_SYS_H
16#define __PLAT_REGS_SYS_H __FILE__
17
18#define S3C_SYSREG(x) (S3C_VA_SYS + (x))
19
20#define S3C64XX_AHB_CON0 S3C_SYSREG(0x100)
21#define S3C64XX_AHB_CON1 S3C_SYSREG(0x104)
22#define S3C64XX_AHB_CON2 S3C_SYSREG(0x108)
23
24#define S3C64XX_SDMA_SEL S3C_SYSREG(0x110)
25
26#define S3C64XX_OTHERS S3C_SYSREG(0x900)
27
28#define S3C64XX_OTHERS_USBMASK (1 << 16)
29#define S3C64XX_OTHERS_SYNCMUXSEL (1 << 6)
30
31#endif /* _PLAT_REGS_SYS_H */
diff --git a/arch/arm/mach-s3c64xx/include/mach/tick.h b/arch/arm/mach-s3c64xx/include/mach/tick.h
index ebe18a9469b8..db9c1b1d56a4 100644
--- a/arch/arm/mach-s3c64xx/include/mach/tick.h
+++ b/arch/arm/mach-s3c64xx/include/mach/tick.h
@@ -15,6 +15,8 @@
15#ifndef __ASM_ARCH_TICK_H 15#ifndef __ASM_ARCH_TICK_H
16#define __ASM_ARCH_TICK_H __FILE__ 16#define __ASM_ARCH_TICK_H __FILE__
17 17
18#include <linux/irqchip/arm-vic.h>
19
18/* note, the timer interrutps turn up in 2 places, the vic and then 20/* note, the timer interrutps turn up in 2 places, the vic and then
19 * the timer block. We take the VIC as the base at the moment. 21 * the timer block. We take the VIC as the base at the moment.
20 */ 22 */
diff --git a/arch/arm/mach-s3c64xx/mach-anw6410.c b/arch/arm/mach-s3c64xx/mach-anw6410.c
index 99e82ac81b69..728eef3296b2 100644
--- a/arch/arm/mach-s3c64xx/mach-anw6410.c
+++ b/arch/arm/mach-s3c64xx/mach-anw6410.c
@@ -31,7 +31,6 @@
31#include <video/platform_lcd.h> 31#include <video/platform_lcd.h>
32#include <video/samsung_fimd.h> 32#include <video/samsung_fimd.h>
33 33
34#include <asm/hardware/vic.h>
35#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
36#include <asm/mach/map.h> 35#include <asm/mach/map.h>
37#include <asm/mach/irq.h> 36#include <asm/mach/irq.h>
@@ -50,9 +49,9 @@
50#include <plat/devs.h> 49#include <plat/devs.h>
51#include <plat/cpu.h> 50#include <plat/cpu.h>
52#include <mach/regs-gpio.h> 51#include <mach/regs-gpio.h>
53#include <mach/regs-modem.h>
54 52
55#include "common.h" 53#include "common.h"
54#include "regs-modem.h"
56 55
57/* DM9000 */ 56/* DM9000 */
58#define ANW6410_PA_DM9000 (0x18000000) 57#define ANW6410_PA_DM9000 (0x18000000)
@@ -230,10 +229,9 @@ MACHINE_START(ANW6410, "A&W6410")
230 .atag_offset = 0x100, 229 .atag_offset = 0x100,
231 230
232 .init_irq = s3c6410_init_irq, 231 .init_irq = s3c6410_init_irq,
233 .handle_irq = vic_handle_irq,
234 .map_io = anw6410_map_io, 232 .map_io = anw6410_map_io,
235 .init_machine = anw6410_machine_init, 233 .init_machine = anw6410_machine_init,
236 .init_late = s3c64xx_init_late, 234 .init_late = s3c64xx_init_late,
237 .timer = &s3c24xx_timer, 235 .init_time = s3c24xx_timer_init,
238 .restart = s3c64xx_restart, 236 .restart = s3c64xx_restart,
239MACHINE_END 237MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410-module.c b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
index 755c0bb119f4..bf3d1c09b085 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410-module.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
@@ -29,7 +29,7 @@
29 29
30#include <linux/platform_data/spi-s3c64xx.h> 30#include <linux/platform_data/spi-s3c64xx.h>
31 31
32#include <mach/crag6410.h> 32#include "crag6410.h"
33 33
34static struct s3c64xx_spi_csinfo wm0010_spi_csinfo = { 34static struct s3c64xx_spi_csinfo wm0010_spi_csinfo = {
35 .line = S3C64XX_GPC(3), 35 .line = S3C64XX_GPC(3),
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
index bf6311a28f3d..1acf02bace57 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
@@ -42,7 +42,6 @@
42 42
43#include <sound/wm1250-ev1.h> 43#include <sound/wm1250-ev1.h>
44 44
45#include <asm/hardware/vic.h>
46#include <asm/mach/arch.h> 45#include <asm/mach/arch.h>
47#include <asm/mach-types.h> 46#include <asm/mach-types.h>
48 47
@@ -50,12 +49,7 @@
50#include <mach/hardware.h> 49#include <mach/hardware.h>
51#include <mach/map.h> 50#include <mach/map.h>
52 51
53#include <mach/regs-sys.h>
54#include <mach/regs-gpio.h> 52#include <mach/regs-gpio.h>
55#include <mach/regs-modem.h>
56#include <mach/crag6410.h>
57
58#include <mach/regs-gpio-memport.h>
59 53
60#include <plat/regs-serial.h> 54#include <plat/regs-serial.h>
61#include <plat/fb.h> 55#include <plat/fb.h>
@@ -72,6 +66,10 @@
72#include <plat/pm.h> 66#include <plat/pm.h>
73 67
74#include "common.h" 68#include "common.h"
69#include "crag6410.h"
70#include "regs-gpio-memport.h"
71#include "regs-modem.h"
72#include "regs-sys.h"
75 73
76/* serial port setup */ 74/* serial port setup */
77 75
@@ -867,10 +865,9 @@ MACHINE_START(WLF_CRAGG_6410, "Wolfson Cragganmore 6410")
867 /* Maintainer: Mark Brown <broonie@opensource.wolfsonmicro.com> */ 865 /* Maintainer: Mark Brown <broonie@opensource.wolfsonmicro.com> */
868 .atag_offset = 0x100, 866 .atag_offset = 0x100,
869 .init_irq = s3c6410_init_irq, 867 .init_irq = s3c6410_init_irq,
870 .handle_irq = vic_handle_irq,
871 .map_io = crag6410_map_io, 868 .map_io = crag6410_map_io,
872 .init_machine = crag6410_machine_init, 869 .init_machine = crag6410_machine_init,
873 .init_late = s3c64xx_init_late, 870 .init_late = s3c64xx_init_late,
874 .timer = &s3c24xx_timer, 871 .init_time = s3c24xx_timer_init,
875 .restart = s3c64xx_restart, 872 .restart = s3c64xx_restart,
876MACHINE_END 873MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-hmt.c b/arch/arm/mach-s3c64xx/mach-hmt.c
index 2b144893ddc4..7212eb9cfeb9 100644
--- a/arch/arm/mach-s3c64xx/mach-hmt.c
+++ b/arch/arm/mach-s3c64xx/mach-hmt.c
@@ -30,7 +30,6 @@
30#include <mach/hardware.h> 30#include <mach/hardware.h>
31#include <mach/map.h> 31#include <mach/map.h>
32 32
33#include <asm/hardware/vic.h>
34#include <asm/irq.h> 33#include <asm/irq.h>
35#include <asm/mach-types.h> 34#include <asm/mach-types.h>
36 35
@@ -273,10 +272,9 @@ MACHINE_START(HMT, "Airgoo-HMT")
273 /* Maintainer: Peter Korsgaard <jacmet@sunsite.dk> */ 272 /* Maintainer: Peter Korsgaard <jacmet@sunsite.dk> */
274 .atag_offset = 0x100, 273 .atag_offset = 0x100,
275 .init_irq = s3c6410_init_irq, 274 .init_irq = s3c6410_init_irq,
276 .handle_irq = vic_handle_irq,
277 .map_io = hmt_map_io, 275 .map_io = hmt_map_io,
278 .init_machine = hmt_machine_init, 276 .init_machine = hmt_machine_init,
279 .init_late = s3c64xx_init_late, 277 .init_late = s3c64xx_init_late,
280 .timer = &s3c24xx_timer, 278 .init_time = s3c24xx_timer_init,
281 .restart = s3c64xx_restart, 279 .restart = s3c64xx_restart,
282MACHINE_END 280MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
index 07c349cca333..4b41fcdaa7b6 100644
--- a/arch/arm/mach-s3c64xx/mach-mini6410.c
+++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
@@ -24,15 +24,12 @@
24#include <linux/serial_core.h> 24#include <linux/serial_core.h>
25#include <linux/types.h> 25#include <linux/types.h>
26 26
27#include <asm/hardware/vic.h>
28#include <asm/mach-types.h> 27#include <asm/mach-types.h>
29#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
30#include <asm/mach/map.h> 29#include <asm/mach/map.h>
31 30
32#include <mach/map.h> 31#include <mach/map.h>
33#include <mach/regs-gpio.h> 32#include <mach/regs-gpio.h>
34#include <mach/regs-modem.h>
35#include <mach/regs-srom.h>
36 33
37#include <plat/adc.h> 34#include <plat/adc.h>
38#include <plat/cpu.h> 35#include <plat/cpu.h>
@@ -46,6 +43,8 @@
46#include <video/samsung_fimd.h> 43#include <video/samsung_fimd.h>
47 44
48#include "common.h" 45#include "common.h"
46#include "regs-modem.h"
47#include "regs-srom.h"
49 48
50#define UCON S3C2410_UCON_DEFAULT 49#define UCON S3C2410_UCON_DEFAULT
51#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB) 50#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB)
@@ -352,10 +351,9 @@ MACHINE_START(MINI6410, "MINI6410")
352 /* Maintainer: Darius Augulis <augulis.darius@gmail.com> */ 351 /* Maintainer: Darius Augulis <augulis.darius@gmail.com> */
353 .atag_offset = 0x100, 352 .atag_offset = 0x100,
354 .init_irq = s3c6410_init_irq, 353 .init_irq = s3c6410_init_irq,
355 .handle_irq = vic_handle_irq,
356 .map_io = mini6410_map_io, 354 .map_io = mini6410_map_io,
357 .init_machine = mini6410_machine_init, 355 .init_machine = mini6410_machine_init,
358 .init_late = s3c64xx_init_late, 356 .init_late = s3c64xx_init_late,
359 .timer = &s3c24xx_timer, 357 .init_time = s3c24xx_timer_init,
360 .restart = s3c64xx_restart, 358 .restart = s3c64xx_restart,
361MACHINE_END 359MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-ncp.c b/arch/arm/mach-s3c64xx/mach-ncp.c
index e5f9a79b535d..8d3cedd995ff 100644
--- a/arch/arm/mach-s3c64xx/mach-ncp.c
+++ b/arch/arm/mach-s3c64xx/mach-ncp.c
@@ -26,7 +26,6 @@
26#include <video/platform_lcd.h> 26#include <video/platform_lcd.h>
27#include <video/samsung_fimd.h> 27#include <video/samsung_fimd.h>
28 28
29#include <asm/hardware/vic.h>
30#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
31#include <asm/mach/map.h> 30#include <asm/mach/map.h>
32#include <asm/mach/irq.h> 31#include <asm/mach/irq.h>
@@ -101,10 +100,9 @@ MACHINE_START(NCP, "NCP")
101 /* Maintainer: Samsung Electronics */ 100 /* Maintainer: Samsung Electronics */
102 .atag_offset = 0x100, 101 .atag_offset = 0x100,
103 .init_irq = s3c6410_init_irq, 102 .init_irq = s3c6410_init_irq,
104 .handle_irq = vic_handle_irq,
105 .map_io = ncp_map_io, 103 .map_io = ncp_map_io,
106 .init_machine = ncp_machine_init, 104 .init_machine = ncp_machine_init,
107 .init_late = s3c64xx_init_late, 105 .init_late = s3c64xx_init_late,
108 .timer = &s3c24xx_timer, 106 .init_time = s3c24xx_timer_init,
109 .restart = s3c64xx_restart, 107 .restart = s3c64xx_restart,
110MACHINE_END 108MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
index 7476f7c722ab..fa12bd21ad82 100644
--- a/arch/arm/mach-s3c64xx/mach-real6410.c
+++ b/arch/arm/mach-s3c64xx/mach-real6410.c
@@ -25,15 +25,12 @@
25#include <linux/serial_core.h> 25#include <linux/serial_core.h>
26#include <linux/types.h> 26#include <linux/types.h>
27 27
28#include <asm/hardware/vic.h>
29#include <asm/mach-types.h> 28#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
31#include <asm/mach/map.h> 30#include <asm/mach/map.h>
32 31
33#include <mach/map.h> 32#include <mach/map.h>
34#include <mach/regs-gpio.h> 33#include <mach/regs-gpio.h>
35#include <mach/regs-modem.h>
36#include <mach/regs-srom.h>
37 34
38#include <plat/adc.h> 35#include <plat/adc.h>
39#include <plat/cpu.h> 36#include <plat/cpu.h>
@@ -47,6 +44,8 @@
47#include <video/samsung_fimd.h> 44#include <video/samsung_fimd.h>
48 45
49#include "common.h" 46#include "common.h"
47#include "regs-modem.h"
48#include "regs-srom.h"
50 49
51#define UCON S3C2410_UCON_DEFAULT 50#define UCON S3C2410_UCON_DEFAULT
52#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB) 51#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB)
@@ -331,10 +330,9 @@ MACHINE_START(REAL6410, "REAL6410")
331 .atag_offset = 0x100, 330 .atag_offset = 0x100,
332 331
333 .init_irq = s3c6410_init_irq, 332 .init_irq = s3c6410_init_irq,
334 .handle_irq = vic_handle_irq,
335 .map_io = real6410_map_io, 333 .map_io = real6410_map_io,
336 .init_machine = real6410_machine_init, 334 .init_machine = real6410_machine_init,
337 .init_late = s3c64xx_init_late, 335 .init_late = s3c64xx_init_late,
338 .timer = &s3c24xx_timer, 336 .init_time = s3c24xx_timer_init,
339 .restart = s3c64xx_restart, 337 .restart = s3c64xx_restart,
340MACHINE_END 338MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smartq.c b/arch/arm/mach-s3c64xx/mach-smartq.c
index c6d7390939ae..fc3e9b32e26f 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq.c
@@ -25,7 +25,6 @@
25 25
26#include <mach/map.h> 26#include <mach/map.h>
27#include <mach/regs-gpio.h> 27#include <mach/regs-gpio.h>
28#include <mach/regs-modem.h>
29 28
30#include <plat/clock.h> 29#include <plat/clock.h>
31#include <plat/cpu.h> 30#include <plat/cpu.h>
@@ -41,6 +40,7 @@
41#include <video/platform_lcd.h> 40#include <video/platform_lcd.h>
42 41
43#include "common.h" 42#include "common.h"
43#include "regs-modem.h"
44 44
45#define UCON S3C2410_UCON_DEFAULT 45#define UCON S3C2410_UCON_DEFAULT
46#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE) 46#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE)
diff --git a/arch/arm/mach-s3c64xx/mach-smartq5.c b/arch/arm/mach-s3c64xx/mach-smartq5.c
index 96d6da2b6b5f..ca2afcfce573 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq5.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq5.c
@@ -17,7 +17,6 @@
17#include <linux/leds.h> 17#include <linux/leds.h>
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19 19
20#include <asm/hardware/vic.h>
21#include <asm/mach-types.h> 20#include <asm/mach-types.h>
22#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
23 22
@@ -153,10 +152,9 @@ MACHINE_START(SMARTQ5, "SmartQ 5")
153 /* Maintainer: Maurus Cuelenaere <mcuelenaere AT gmail DOT com> */ 152 /* Maintainer: Maurus Cuelenaere <mcuelenaere AT gmail DOT com> */
154 .atag_offset = 0x100, 153 .atag_offset = 0x100,
155 .init_irq = s3c6410_init_irq, 154 .init_irq = s3c6410_init_irq,
156 .handle_irq = vic_handle_irq,
157 .map_io = smartq_map_io, 155 .map_io = smartq_map_io,
158 .init_machine = smartq5_machine_init, 156 .init_machine = smartq5_machine_init,
159 .init_late = s3c64xx_init_late, 157 .init_late = s3c64xx_init_late,
160 .timer = &s3c24xx_timer, 158 .init_time = s3c24xx_timer_init,
161 .restart = s3c64xx_restart, 159 .restart = s3c64xx_restart,
162MACHINE_END 160MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smartq7.c b/arch/arm/mach-s3c64xx/mach-smartq7.c
index 7d1167bdc921..37bb0c632a5e 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq7.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq7.c
@@ -17,7 +17,6 @@
17#include <linux/leds.h> 17#include <linux/leds.h>
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19 19
20#include <asm/hardware/vic.h>
21#include <asm/mach-types.h> 20#include <asm/mach-types.h>
22#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
23 22
@@ -169,10 +168,9 @@ MACHINE_START(SMARTQ7, "SmartQ 7")
169 /* Maintainer: Maurus Cuelenaere <mcuelenaere AT gmail DOT com> */ 168 /* Maintainer: Maurus Cuelenaere <mcuelenaere AT gmail DOT com> */
170 .atag_offset = 0x100, 169 .atag_offset = 0x100,
171 .init_irq = s3c6410_init_irq, 170 .init_irq = s3c6410_init_irq,
172 .handle_irq = vic_handle_irq,
173 .map_io = smartq_map_io, 171 .map_io = smartq_map_io,
174 .init_machine = smartq7_machine_init, 172 .init_machine = smartq7_machine_init,
175 .init_late = s3c64xx_init_late, 173 .init_late = s3c64xx_init_late,
176 .timer = &s3c24xx_timer, 174 .init_time = s3c24xx_timer_init,
177 .restart = s3c64xx_restart, 175 .restart = s3c64xx_restart,
178MACHINE_END 176MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6400.c b/arch/arm/mach-s3c64xx/mach-smdk6400.c
index a928fae5694e..a392869c8342 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6400.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6400.c
@@ -22,7 +22,6 @@
22 22
23#include <asm/mach-types.h> 23#include <asm/mach-types.h>
24 24
25#include <asm/hardware/vic.h>
26#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
27#include <asm/mach/map.h> 26#include <asm/mach/map.h>
28#include <asm/mach/irq.h> 27#include <asm/mach/irq.h>
@@ -90,10 +89,9 @@ MACHINE_START(SMDK6400, "SMDK6400")
90 .atag_offset = 0x100, 89 .atag_offset = 0x100,
91 90
92 .init_irq = s3c6400_init_irq, 91 .init_irq = s3c6400_init_irq,
93 .handle_irq = vic_handle_irq,
94 .map_io = smdk6400_map_io, 92 .map_io = smdk6400_map_io,
95 .init_machine = smdk6400_machine_init, 93 .init_machine = smdk6400_machine_init,
96 .init_late = s3c64xx_init_late, 94 .init_late = s3c64xx_init_late,
97 .timer = &s3c24xx_timer, 95 .init_time = s3c24xx_timer_init,
98 .restart = s3c64xx_restart, 96 .restart = s3c64xx_restart,
99MACHINE_END 97MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index 574a9eef588d..ba7544e2d04d 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -45,7 +45,6 @@
45#include <video/platform_lcd.h> 45#include <video/platform_lcd.h>
46#include <video/samsung_fimd.h> 46#include <video/samsung_fimd.h>
47 47
48#include <asm/hardware/vic.h>
49#include <asm/mach/arch.h> 48#include <asm/mach/arch.h>
50#include <asm/mach/map.h> 49#include <asm/mach/map.h>
51#include <asm/mach/irq.h> 50#include <asm/mach/irq.h>
@@ -57,10 +56,7 @@
57#include <asm/mach-types.h> 56#include <asm/mach-types.h>
58 57
59#include <plat/regs-serial.h> 58#include <plat/regs-serial.h>
60#include <mach/regs-modem.h>
61#include <mach/regs-gpio.h> 59#include <mach/regs-gpio.h>
62#include <mach/regs-sys.h>
63#include <mach/regs-srom.h>
64#include <linux/platform_data/ata-samsung_cf.h> 60#include <linux/platform_data/ata-samsung_cf.h>
65#include <linux/platform_data/i2c-s3c2410.h> 61#include <linux/platform_data/i2c-s3c2410.h>
66#include <plat/fb.h> 62#include <plat/fb.h>
@@ -75,6 +71,9 @@
75#include <plat/backlight.h> 71#include <plat/backlight.h>
76 72
77#include "common.h" 73#include "common.h"
74#include "regs-modem.h"
75#include "regs-srom.h"
76#include "regs-sys.h"
78 77
79#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK 78#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
80#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB 79#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
@@ -700,10 +699,9 @@ MACHINE_START(SMDK6410, "SMDK6410")
700 .atag_offset = 0x100, 699 .atag_offset = 0x100,
701 700
702 .init_irq = s3c6410_init_irq, 701 .init_irq = s3c6410_init_irq,
703 .handle_irq = vic_handle_irq,
704 .map_io = smdk6410_map_io, 702 .map_io = smdk6410_map_io,
705 .init_machine = smdk6410_machine_init, 703 .init_machine = smdk6410_machine_init,
706 .init_late = s3c64xx_init_late, 704 .init_late = s3c64xx_init_late,
707 .timer = &s3c24xx_timer, 705 .init_time = s3c24xx_timer_init,
708 .restart = s3c64xx_restart, 706 .restart = s3c64xx_restart,
709MACHINE_END 707MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
index d2e1a16690bd..6a1f91fea678 100644
--- a/arch/arm/mach-s3c64xx/pm.c
+++ b/arch/arm/mach-s3c64xx/pm.c
@@ -26,12 +26,13 @@
26#include <plat/pm.h> 26#include <plat/pm.h>
27#include <plat/wakeup-mask.h> 27#include <plat/wakeup-mask.h>
28 28
29#include <mach/regs-sys.h>
30#include <mach/regs-gpio.h> 29#include <mach/regs-gpio.h>
31#include <mach/regs-clock.h> 30#include <mach/regs-clock.h>
32#include <mach/regs-syscon-power.h> 31
33#include <mach/regs-gpio-memport.h> 32#include "regs-gpio-memport.h"
34#include <mach/regs-modem.h> 33#include "regs-modem.h"
34#include "regs-sys.h"
35#include "regs-syscon-power.h"
35 36
36struct s3c64xx_pm_domain { 37struct s3c64xx_pm_domain {
37 char *const name; 38 char *const name;
@@ -296,7 +297,8 @@ static int s3c64xx_cpu_suspend(unsigned long arg)
296 297
297 /* we should never get past here */ 298 /* we should never get past here */
298 299
299 panic("sleep resumed to originator?"); 300 pr_info("Failed to suspend the system\n");
301 return 1; /* Aborting suspend */
300} 302}
301 303
302/* mapping of interrupts to parts of the wakeup mask */ 304/* mapping of interrupts to parts of the wakeup mask */
diff --git a/arch/arm/mach-s3c64xx/include/mach/regs-gpio-memport.h b/arch/arm/mach-s3c64xx/regs-gpio-memport.h
index 82342f6fd27d..b927593019f5 100644
--- a/arch/arm/mach-s3c64xx/include/mach/regs-gpio-memport.h
+++ b/arch/arm/mach-s3c64xx/regs-gpio-memport.h
@@ -1,5 +1,4 @@
1/* linux/arch/arm/plat-s3c64xx/include/mach/regs-gpio-memport.h 1/*
2 *
3 * Copyright 2008 Openmoko, Inc. 2 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 3 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
@@ -8,8 +7,8 @@
8 * S3C64XX - GPIO memory port register definitions 7 * S3C64XX - GPIO memory port register definitions
9 */ 8 */
10 9
11#ifndef __ASM_PLAT_S3C64XX_REGS_GPIO_MEMPORT_H 10#ifndef __MACH_S3C64XX_REGS_GPIO_MEMPORT_H
12#define __ASM_PLAT_S3C64XX_REGS_GPIO_MEMPORT_H __FILE__ 11#define __MACH_S3C64XX_REGS_GPIO_MEMPORT_H __FILE__
13 12
14#define S3C64XX_MEM0CONSTOP S3C64XX_GPIOREG(0x1B0) 13#define S3C64XX_MEM0CONSTOP S3C64XX_GPIOREG(0x1B0)
15#define S3C64XX_MEM1CONSTOP S3C64XX_GPIOREG(0x1B4) 14#define S3C64XX_MEM1CONSTOP S3C64XX_GPIOREG(0x1B4)
@@ -21,5 +20,5 @@
21#define S3C64XX_MEM0DRVCON S3C64XX_GPIOREG(0x1D0) 20#define S3C64XX_MEM0DRVCON S3C64XX_GPIOREG(0x1D0)
22#define S3C64XX_MEM1DRVCON S3C64XX_GPIOREG(0x1D4) 21#define S3C64XX_MEM1DRVCON S3C64XX_GPIOREG(0x1D4)
23 22
24#endif /* __ASM_PLAT_S3C64XX_REGS_GPIO_MEMPORT_H */ 23#endif /* __MACH_S3C64XX_REGS_GPIO_MEMPORT_H */
25 24
diff --git a/arch/arm/mach-s3c64xx/include/mach/regs-modem.h b/arch/arm/mach-s3c64xx/regs-modem.h
index 49f7759dedfa..073cdd3a03be 100644
--- a/arch/arm/mach-s3c64xx/include/mach/regs-modem.h
+++ b/arch/arm/mach-s3c64xx/regs-modem.h
@@ -1,5 +1,4 @@
1/* arch/arm/plat-s3c64xx/include/plat/regs-modem.h 1/*
2 *
3 * Copyright 2008 Openmoko, Inc. 2 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 3 * Copyright 2008 Simtec Electronics
5 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
@@ -12,10 +11,10 @@
12 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
13*/ 12*/
14 13
15#ifndef __PLAT_S3C64XX_REGS_MODEM_H 14#ifndef __MACH_S3C64XX_REGS_MODEM_H
16#define __PLAT_S3C64XX_REGS_MODEM_H __FILE__ 15#define __MACH_S3C64XX_REGS_MODEM_H __FILE__
17 16
18#define S3C64XX_MODEMREG(x) (S3C64XX_VA_MODEM + (x)) 17#define S3C64XX_MODEMREG(x) (S3C64XX_VA_MODEM + (x))
19 18
20#define S3C64XX_MODEM_INT2AP S3C64XX_MODEMREG(0x0) 19#define S3C64XX_MODEM_INT2AP S3C64XX_MODEMREG(0x0)
21#define S3C64XX_MODEM_INT2MODEM S3C64XX_MODEMREG(0x4) 20#define S3C64XX_MODEM_INT2MODEM S3C64XX_MODEMREG(0x4)
@@ -28,4 +27,4 @@
28#define MIFPCON_INT2M_LEVEL (1 << 4) 27#define MIFPCON_INT2M_LEVEL (1 << 4)
29#define MIFPCON_LCD_BYPASS (1 << 3) 28#define MIFPCON_LCD_BYPASS (1 << 3)
30 29
31#endif /* __PLAT_S3C64XX_REGS_MODEM_H */ 30#endif /* __MACH_S3C64XX_REGS_MODEM_H */
diff --git a/arch/arm/mach-s3c64xx/include/mach/regs-srom.h b/arch/arm/mach-s3c64xx/regs-srom.h
index 756731b36297..d56f3386eb00 100644
--- a/arch/arm/mach-s3c64xx/include/mach/regs-srom.h
+++ b/arch/arm/mach-s3c64xx/regs-srom.h
@@ -1,5 +1,4 @@
1/* arch/arm/plat-s3c64xx/include/plat/regs-srom.h 1/*
2 *
3 * Copyright 2009 Andy Green <andy@warmcat.com> 2 * Copyright 2009 Andy Green <andy@warmcat.com>
4 * 3 *
5 * S3C64XX SROM definitions 4 * S3C64XX SROM definitions
@@ -9,8 +8,8 @@
9 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
10*/ 9*/
11 10
12#ifndef __PLAT_REGS_SROM_H 11#ifndef __MACH_S3C64XX_REGS_SROM_H
13#define __PLAT_REGS_SROM_H __FILE__ 12#define __MACH_S3C64XX_REGS_SROM_H __FILE__
14 13
15#define S3C64XX_SROMREG(x) (S3C_VA_MEM + (x)) 14#define S3C64XX_SROMREG(x) (S3C_VA_MEM + (x))
16 15
@@ -29,7 +28,7 @@
29#define S3C64XX_SROM_BW__DATAWIDTH__SHIFT 0 28#define S3C64XX_SROM_BW__DATAWIDTH__SHIFT 0
30#define S3C64XX_SROM_BW__WAITENABLE__SHIFT 2 29#define S3C64XX_SROM_BW__WAITENABLE__SHIFT 2
31#define S3C64XX_SROM_BW__BYTEENABLE__SHIFT 3 30#define S3C64XX_SROM_BW__BYTEENABLE__SHIFT 3
32#define S3C64XX_SROM_BW__CS_MASK 0xf 31#define S3C64XX_SROM_BW__CS_MASK 0xf
33 32
34#define S3C64XX_SROM_BW__NCS0__SHIFT 0 33#define S3C64XX_SROM_BW__NCS0__SHIFT 0
35#define S3C64XX_SROM_BW__NCS1__SHIFT 4 34#define S3C64XX_SROM_BW__NCS1__SHIFT 4
@@ -56,4 +55,4 @@
56#define S3C64XX_SROM_BCX__TACS__SHIFT 28 55#define S3C64XX_SROM_BCX__TACS__SHIFT 28
57#define S3C64XX_SROM_BCX__TACS__MASK 0xf 56#define S3C64XX_SROM_BCX__TACS__MASK 0xf
58 57
59#endif /* _PLAT_REGS_SROM_H */ 58#endif /* __MACH_S3C64XX_REGS_SROM_H */
diff --git a/arch/arm/mach-s3c64xx/regs-sys.h b/arch/arm/mach-s3c64xx/regs-sys.h
new file mode 100644
index 000000000000..8c411fbb0cd9
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/regs-sys.h
@@ -0,0 +1,30 @@
1/*
2 * Copyright 2008 Openmoko, Inc.
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C64XX system register definitions
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 version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#ifndef __MACH_S3C64XX_REGS_SYS_H
15#define __MACH_S3C64XX_REGS_SYS_H __FILE__
16
17#define S3C_SYSREG(x) (S3C_VA_SYS + (x))
18
19#define S3C64XX_AHB_CON0 S3C_SYSREG(0x100)
20#define S3C64XX_AHB_CON1 S3C_SYSREG(0x104)
21#define S3C64XX_AHB_CON2 S3C_SYSREG(0x108)
22
23#define S3C64XX_SDMA_SEL S3C_SYSREG(0x110)
24
25#define S3C64XX_OTHERS S3C_SYSREG(0x900)
26
27#define S3C64XX_OTHERS_USBMASK (1 << 16)
28#define S3C64XX_OTHERS_SYNCMUXSEL (1 << 6)
29
30#endif /* __MACH_S3C64XX_REGS_SYS_H */
diff --git a/arch/arm/mach-s3c64xx/include/mach/regs-syscon-power.h b/arch/arm/mach-s3c64xx/regs-syscon-power.h
index 270d96ac9705..6e16b3404da9 100644
--- a/arch/arm/mach-s3c64xx/include/mach/regs-syscon-power.h
+++ b/arch/arm/mach-s3c64xx/regs-syscon-power.h
@@ -1,5 +1,4 @@
1/* arch/arm/plat-s3c64xx/include/plat/regs-syscon-power.h 1/*
2 *
3 * Copyright 2008 Openmoko, Inc. 2 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 3 * Copyright 2008 Simtec Electronics
5 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
@@ -12,8 +11,8 @@
12 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
13*/ 12*/
14 13
15#ifndef __PLAT_S3C64XX_REGS_SYSCON_POWER_H 14#ifndef __MACH_S3C64XX_REGS_SYSCON_POWER_H
16#define __PLAT_S3C64XX_REGS_SYSCON_POWER_H __FILE__ 15#define __MACH_S3C64XX_REGS_SYSCON_POWER_H __FILE__
17 16
18#define S3C64XX_PWR_CFG S3C_SYSREG(0x804) 17#define S3C64XX_PWR_CFG S3C_SYSREG(0x804)
19 18
@@ -113,4 +112,4 @@
113#define S3C64XX_INFORM2 S3C_SYSREG(0xA08) 112#define S3C64XX_INFORM2 S3C_SYSREG(0xA08)
114#define S3C64XX_INFORM3 S3C_SYSREG(0xA0C) 113#define S3C64XX_INFORM3 S3C_SYSREG(0xA0C)
115 114
116#endif /* __PLAT_S3C64XX_REGS_SYSCON_POWER_H */ 115#endif /* __MACH_S3C64XX_REGS_SYSCON_POWER_H */
diff --git a/arch/arm/mach-s3c64xx/setup-usb-phy.c b/arch/arm/mach-s3c64xx/setup-usb-phy.c
index f6757e02d7db..c8174d95339b 100644
--- a/arch/arm/mach-s3c64xx/setup-usb-phy.c
+++ b/arch/arm/mach-s3c64xx/setup-usb-phy.c
@@ -15,11 +15,12 @@
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <mach/map.h> 17#include <mach/map.h>
18#include <mach/regs-sys.h>
19#include <plat/cpu.h> 18#include <plat/cpu.h>
20#include <plat/regs-usb-hsotg-phy.h> 19#include <plat/regs-usb-hsotg-phy.h>
21#include <plat/usb-phy.h> 20#include <plat/usb-phy.h>
22 21
22#include "regs-sys.h"
23
23static int s3c_usb_otgphy_init(struct platform_device *pdev) 24static int s3c_usb_otgphy_init(struct platform_device *pdev)
24{ 25{
25 struct clk *xusbxti; 26 struct clk *xusbxti;
diff --git a/arch/arm/mach-s5p64x0/clock-s5p6440.c b/arch/arm/mach-s5p64x0/clock-s5p6440.c
index 5112371079d0..3537815247f1 100644
--- a/arch/arm/mach-s5p64x0/clock-s5p6440.c
+++ b/arch/arm/mach-s5p64x0/clock-s5p6440.c
@@ -23,7 +23,6 @@
23#include <mach/hardware.h> 23#include <mach/hardware.h>
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/s5p64x0-clock.h>
27 26
28#include <plat/cpu-freq.h> 27#include <plat/cpu-freq.h>
29#include <plat/clock.h> 28#include <plat/clock.h>
@@ -32,6 +31,7 @@
32#include <plat/s5p-clock.h> 31#include <plat/s5p-clock.h>
33#include <plat/clock-clksrc.h> 32#include <plat/clock-clksrc.h>
34 33
34#include "clock.h"
35#include "common.h" 35#include "common.h"
36 36
37static u32 epll_div[][5] = { 37static u32 epll_div[][5] = {
diff --git a/arch/arm/mach-s5p64x0/clock-s5p6450.c b/arch/arm/mach-s5p64x0/clock-s5p6450.c
index 154dea702d70..af384ddd2dcf 100644
--- a/arch/arm/mach-s5p64x0/clock-s5p6450.c
+++ b/arch/arm/mach-s5p64x0/clock-s5p6450.c
@@ -23,7 +23,6 @@
23#include <mach/hardware.h> 23#include <mach/hardware.h>
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/s5p64x0-clock.h>
27 26
28#include <plat/cpu-freq.h> 27#include <plat/cpu-freq.h>
29#include <plat/clock.h> 28#include <plat/clock.h>
@@ -32,6 +31,7 @@
32#include <plat/s5p-clock.h> 31#include <plat/s5p-clock.h>
33#include <plat/clock-clksrc.h> 32#include <plat/clock-clksrc.h>
34 33
34#include "clock.h"
35#include "common.h" 35#include "common.h"
36 36
37static struct clksrc_clk clk_mout_dpll = { 37static struct clksrc_clk clk_mout_dpll = {
diff --git a/arch/arm/mach-s5p64x0/include/mach/s5p64x0-clock.h b/arch/arm/mach-s5p64x0/clock.h
index 0ef47d1b7670..28b8e3c6bd24 100644
--- a/arch/arm/mach-s5p64x0/include/mach/s5p64x0-clock.h
+++ b/arch/arm/mach-s5p64x0/clock.h
@@ -1,5 +1,4 @@
1/* linux/arch/arm/mach-s5p64x0/include/mach/s5p64x0-clock.h 1/*
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 2 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 3 * http://www.samsung.com
5 * 4 *
@@ -10,8 +9,8 @@
10 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
11*/ 10*/
12 11
13#ifndef __ASM_ARCH_CLOCK_H 12#ifndef __MACH_S5P64X0_CLOCK_H
14#define __ASM_ARCH_CLOCK_H __FILE__ 13#define __MACH_S5P64X0_CLOCK_H __FILE__
15 14
16#include <linux/clk.h> 15#include <linux/clk.h>
17 16
@@ -36,4 +35,4 @@ extern int s5p64x0_mem_ctrl(struct clk *clk, int enable);
36 35
37extern int s5p64x0_clk48m_ctrl(struct clk *clk, int enable); 36extern int s5p64x0_clk48m_ctrl(struct clk *clk, int enable);
38 37
39#endif /* __ASM_ARCH_CLOCK_H */ 38#endif /* __MACH_S5P64X0_CLOCK_H */
diff --git a/arch/arm/mach-s5p64x0/gpiolib.c b/arch/arm/mach-s5p64x0/gpiolib.c
deleted file mode 100644
index 700dac6c43f3..000000000000
--- a/arch/arm/mach-s5p64x0/gpiolib.c
+++ /dev/null
@@ -1,508 +0,0 @@
1/* linux/arch/arm/mach-s5p64x0/gpiolib.c
2 *
3 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * S5P64X0 - 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#include <mach/regs-gpio.h>
20#include <mach/regs-clock.h>
21
22#include <plat/cpu.h>
23#include <plat/gpio-core.h>
24#include <plat/gpio-cfg.h>
25#include <plat/gpio-cfg-helpers.h>
26
27/*
28 * S5P6440 GPIO bank summary:
29 *
30 * Bank GPIOs Style SlpCon ExtInt Group
31 * A 6 4Bit Yes 1
32 * B 7 4Bit Yes 1
33 * C 8 4Bit Yes 2
34 * F 2 2Bit Yes 4 [1]
35 * G 7 4Bit Yes 5
36 * H 10 4Bit[2] Yes 6
37 * I 16 2Bit Yes None
38 * J 12 2Bit Yes None
39 * N 16 2Bit No IRQ_EINT
40 * P 8 2Bit Yes 8
41 * R 15 4Bit[2] Yes 8
42 *
43 * S5P6450 GPIO bank summary:
44 *
45 * Bank GPIOs Style SlpCon ExtInt Group
46 * A 6 4Bit Yes 1
47 * B 7 4Bit Yes 1
48 * C 8 4Bit Yes 2
49 * D 8 4Bit Yes None
50 * F 2 2Bit Yes None
51 * G 14 4Bit[2] Yes 5
52 * H 10 4Bit[2] Yes 6
53 * I 16 2Bit Yes None
54 * J 12 2Bit Yes None
55 * K 5 4Bit Yes None
56 * N 16 2Bit No IRQ_EINT
57 * P 11 2Bit Yes 8
58 * Q 14 2Bit Yes None
59 * R 15 4Bit[2] Yes None
60 * S 8 2Bit Yes None
61 *
62 * [1] BANKF pins 14,15 do not form part of the external interrupt sources
63 * [2] BANK has two control registers, GPxCON0 and GPxCON1
64 */
65
66static int s5p64x0_gpiolib_rbank_4bit2_input(struct gpio_chip *chip,
67 unsigned int offset)
68{
69 struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
70 void __iomem *base = ourchip->base;
71 void __iomem *regcon = base;
72 unsigned long con;
73 unsigned long flags;
74
75 switch (offset) {
76 case 6:
77 offset += 1;
78 case 0:
79 case 1:
80 case 2:
81 case 3:
82 case 4:
83 case 5:
84 regcon -= 4;
85 break;
86 default:
87 offset -= 7;
88 break;
89 }
90
91 s3c_gpio_lock(ourchip, flags);
92
93 con = __raw_readl(regcon);
94 con &= ~(0xf << con_4bit_shift(offset));
95 __raw_writel(con, regcon);
96
97 s3c_gpio_unlock(ourchip, flags);
98
99 return 0;
100}
101
102static int s5p64x0_gpiolib_rbank_4bit2_output(struct gpio_chip *chip,
103 unsigned int offset, int value)
104{
105 struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
106 void __iomem *base = ourchip->base;
107 void __iomem *regcon = base;
108 unsigned long con;
109 unsigned long dat;
110 unsigned long flags;
111 unsigned con_offset = offset;
112
113 switch (con_offset) {
114 case 6:
115 con_offset += 1;
116 case 0:
117 case 1:
118 case 2:
119 case 3:
120 case 4:
121 case 5:
122 regcon -= 4;
123 break;
124 default:
125 con_offset -= 7;
126 break;
127 }
128
129 s3c_gpio_lock(ourchip, flags);
130
131 con = __raw_readl(regcon);
132 con &= ~(0xf << con_4bit_shift(con_offset));
133 con |= 0x1 << con_4bit_shift(con_offset);
134
135 dat = __raw_readl(base + GPIODAT_OFF);
136 if (value)
137 dat |= 1 << offset;
138 else
139 dat &= ~(1 << offset);
140
141 __raw_writel(con, regcon);
142 __raw_writel(dat, base + GPIODAT_OFF);
143
144 s3c_gpio_unlock(ourchip, flags);
145
146 return 0;
147}
148
149int s5p64x0_gpio_setcfg_4bit_rbank(struct s3c_gpio_chip *chip,
150 unsigned int off, unsigned int cfg)
151{
152 void __iomem *reg = chip->base;
153 unsigned int shift;
154 u32 con;
155
156 switch (off) {
157 case 0:
158 case 1:
159 case 2:
160 case 3:
161 case 4:
162 case 5:
163 shift = (off & 7) * 4;
164 reg -= 4;
165 break;
166 case 6:
167 shift = ((off + 1) & 7) * 4;
168 reg -= 4;
169 default:
170 shift = ((off + 1) & 7) * 4;
171 break;
172 }
173
174 if (s3c_gpio_is_cfg_special(cfg)) {
175 cfg &= 0xf;
176 cfg <<= shift;
177 }
178
179 con = __raw_readl(reg);
180 con &= ~(0xf << shift);
181 con |= cfg;
182 __raw_writel(con, reg);
183
184 return 0;
185}
186
187static struct s3c_gpio_cfg s5p64x0_gpio_cfgs[] = {
188 {
189 .cfg_eint = 0,
190 }, {
191 .cfg_eint = 7,
192 }, {
193 .cfg_eint = 3,
194 .set_config = s5p64x0_gpio_setcfg_4bit_rbank,
195 }, {
196 .cfg_eint = 0,
197 .set_config = s3c_gpio_setcfg_s3c24xx,
198 .get_config = s3c_gpio_getcfg_s3c24xx,
199 }, {
200 .cfg_eint = 2,
201 .set_config = s3c_gpio_setcfg_s3c24xx,
202 .get_config = s3c_gpio_getcfg_s3c24xx,
203 }, {
204 .cfg_eint = 3,
205 .set_config = s3c_gpio_setcfg_s3c24xx,
206 .get_config = s3c_gpio_getcfg_s3c24xx,
207 },
208};
209
210static struct s3c_gpio_chip s5p6440_gpio_4bit[] = {
211 {
212 .base = S5P64X0_GPA_BASE,
213 .config = &s5p64x0_gpio_cfgs[1],
214 .chip = {
215 .base = S5P6440_GPA(0),
216 .ngpio = S5P6440_GPIO_A_NR,
217 .label = "GPA",
218 },
219 }, {
220 .base = S5P64X0_GPB_BASE,
221 .config = &s5p64x0_gpio_cfgs[1],
222 .chip = {
223 .base = S5P6440_GPB(0),
224 .ngpio = S5P6440_GPIO_B_NR,
225 .label = "GPB",
226 },
227 }, {
228 .base = S5P64X0_GPC_BASE,
229 .config = &s5p64x0_gpio_cfgs[1],
230 .chip = {
231 .base = S5P6440_GPC(0),
232 .ngpio = S5P6440_GPIO_C_NR,
233 .label = "GPC",
234 },
235 }, {
236 .base = S5P64X0_GPG_BASE,
237 .config = &s5p64x0_gpio_cfgs[1],
238 .chip = {
239 .base = S5P6440_GPG(0),
240 .ngpio = S5P6440_GPIO_G_NR,
241 .label = "GPG",
242 },
243 },
244};
245
246static struct s3c_gpio_chip s5p6440_gpio_4bit2[] = {
247 {
248 .base = S5P64X0_GPH_BASE + 0x4,
249 .config = &s5p64x0_gpio_cfgs[1],
250 .chip = {
251 .base = S5P6440_GPH(0),
252 .ngpio = S5P6440_GPIO_H_NR,
253 .label = "GPH",
254 },
255 },
256};
257
258static struct s3c_gpio_chip s5p6440_gpio_rbank_4bit2[] = {
259 {
260 .base = S5P64X0_GPR_BASE + 0x4,
261 .config = &s5p64x0_gpio_cfgs[2],
262 .chip = {
263 .base = S5P6440_GPR(0),
264 .ngpio = S5P6440_GPIO_R_NR,
265 .label = "GPR",
266 },
267 },
268};
269
270static struct s3c_gpio_chip s5p6440_gpio_2bit[] = {
271 {
272 .base = S5P64X0_GPF_BASE,
273 .config = &s5p64x0_gpio_cfgs[5],
274 .chip = {
275 .base = S5P6440_GPF(0),
276 .ngpio = S5P6440_GPIO_F_NR,
277 .label = "GPF",
278 },
279 }, {
280 .base = S5P64X0_GPI_BASE,
281 .config = &s5p64x0_gpio_cfgs[3],
282 .chip = {
283 .base = S5P6440_GPI(0),
284 .ngpio = S5P6440_GPIO_I_NR,
285 .label = "GPI",
286 },
287 }, {
288 .base = S5P64X0_GPJ_BASE,
289 .config = &s5p64x0_gpio_cfgs[3],
290 .chip = {
291 .base = S5P6440_GPJ(0),
292 .ngpio = S5P6440_GPIO_J_NR,
293 .label = "GPJ",
294 },
295 }, {
296 .base = S5P64X0_GPN_BASE,
297 .config = &s5p64x0_gpio_cfgs[4],
298 .chip = {
299 .base = S5P6440_GPN(0),
300 .ngpio = S5P6440_GPIO_N_NR,
301 .label = "GPN",
302 },
303 }, {
304 .base = S5P64X0_GPP_BASE,
305 .config = &s5p64x0_gpio_cfgs[5],
306 .chip = {
307 .base = S5P6440_GPP(0),
308 .ngpio = S5P6440_GPIO_P_NR,
309 .label = "GPP",
310 },
311 },
312};
313
314static struct s3c_gpio_chip s5p6450_gpio_4bit[] = {
315 {
316 .base = S5P64X0_GPA_BASE,
317 .config = &s5p64x0_gpio_cfgs[1],
318 .chip = {
319 .base = S5P6450_GPA(0),
320 .ngpio = S5P6450_GPIO_A_NR,
321 .label = "GPA",
322 },
323 }, {
324 .base = S5P64X0_GPB_BASE,
325 .config = &s5p64x0_gpio_cfgs[1],
326 .chip = {
327 .base = S5P6450_GPB(0),
328 .ngpio = S5P6450_GPIO_B_NR,
329 .label = "GPB",
330 },
331 }, {
332 .base = S5P64X0_GPC_BASE,
333 .config = &s5p64x0_gpio_cfgs[1],
334 .chip = {
335 .base = S5P6450_GPC(0),
336 .ngpio = S5P6450_GPIO_C_NR,
337 .label = "GPC",
338 },
339 }, {
340 .base = S5P6450_GPD_BASE,
341 .config = &s5p64x0_gpio_cfgs[1],
342 .chip = {
343 .base = S5P6450_GPD(0),
344 .ngpio = S5P6450_GPIO_D_NR,
345 .label = "GPD",
346 },
347 }, {
348 .base = S5P6450_GPK_BASE,
349 .config = &s5p64x0_gpio_cfgs[1],
350 .chip = {
351 .base = S5P6450_GPK(0),
352 .ngpio = S5P6450_GPIO_K_NR,
353 .label = "GPK",
354 },
355 },
356};
357
358static struct s3c_gpio_chip s5p6450_gpio_4bit2[] = {
359 {
360 .base = S5P64X0_GPG_BASE + 0x4,
361 .config = &s5p64x0_gpio_cfgs[1],
362 .chip = {
363 .base = S5P6450_GPG(0),
364 .ngpio = S5P6450_GPIO_G_NR,
365 .label = "GPG",
366 },
367 }, {
368 .base = S5P64X0_GPH_BASE + 0x4,
369 .config = &s5p64x0_gpio_cfgs[1],
370 .chip = {
371 .base = S5P6450_GPH(0),
372 .ngpio = S5P6450_GPIO_H_NR,
373 .label = "GPH",
374 },
375 },
376};
377
378static struct s3c_gpio_chip s5p6450_gpio_rbank_4bit2[] = {
379 {
380 .base = S5P64X0_GPR_BASE + 0x4,
381 .config = &s5p64x0_gpio_cfgs[2],
382 .chip = {
383 .base = S5P6450_GPR(0),
384 .ngpio = S5P6450_GPIO_R_NR,
385 .label = "GPR",
386 },
387 },
388};
389
390static struct s3c_gpio_chip s5p6450_gpio_2bit[] = {
391 {
392 .base = S5P64X0_GPF_BASE,
393 .config = &s5p64x0_gpio_cfgs[5],
394 .chip = {
395 .base = S5P6450_GPF(0),
396 .ngpio = S5P6450_GPIO_F_NR,
397 .label = "GPF",
398 },
399 }, {
400 .base = S5P64X0_GPI_BASE,
401 .config = &s5p64x0_gpio_cfgs[3],
402 .chip = {
403 .base = S5P6450_GPI(0),
404 .ngpio = S5P6450_GPIO_I_NR,
405 .label = "GPI",
406 },
407 }, {
408 .base = S5P64X0_GPJ_BASE,
409 .config = &s5p64x0_gpio_cfgs[3],
410 .chip = {
411 .base = S5P6450_GPJ(0),
412 .ngpio = S5P6450_GPIO_J_NR,
413 .label = "GPJ",
414 },
415 }, {
416 .base = S5P64X0_GPN_BASE,
417 .config = &s5p64x0_gpio_cfgs[4],
418 .chip = {
419 .base = S5P6450_GPN(0),
420 .ngpio = S5P6450_GPIO_N_NR,
421 .label = "GPN",
422 },
423 }, {
424 .base = S5P64X0_GPP_BASE,
425 .config = &s5p64x0_gpio_cfgs[5],
426 .chip = {
427 .base = S5P6450_GPP(0),
428 .ngpio = S5P6450_GPIO_P_NR,
429 .label = "GPP",
430 },
431 }, {
432 .base = S5P6450_GPQ_BASE,
433 .config = &s5p64x0_gpio_cfgs[4],
434 .chip = {
435 .base = S5P6450_GPQ(0),
436 .ngpio = S5P6450_GPIO_Q_NR,
437 .label = "GPQ",
438 },
439 }, {
440 .base = S5P6450_GPS_BASE,
441 .config = &s5p64x0_gpio_cfgs[5],
442 .chip = {
443 .base = S5P6450_GPS(0),
444 .ngpio = S5P6450_GPIO_S_NR,
445 .label = "GPS",
446 },
447 },
448};
449
450void __init s5p64x0_gpiolib_set_cfg(struct s3c_gpio_cfg *chipcfg, int nr_chips)
451{
452 for (; nr_chips > 0; nr_chips--, chipcfg++) {
453 if (!chipcfg->set_config)
454 chipcfg->set_config = s3c_gpio_setcfg_s3c64xx_4bit;
455 if (!chipcfg->get_config)
456 chipcfg->get_config = s3c_gpio_getcfg_s3c64xx_4bit;
457 if (!chipcfg->set_pull)
458 chipcfg->set_pull = s3c_gpio_setpull_updown;
459 if (!chipcfg->get_pull)
460 chipcfg->get_pull = s3c_gpio_getpull_updown;
461 }
462}
463
464static void __init s5p64x0_gpio_add_rbank_4bit2(struct s3c_gpio_chip *chip,
465 int nr_chips)
466{
467 for (; nr_chips > 0; nr_chips--, chip++) {
468 chip->chip.direction_input = s5p64x0_gpiolib_rbank_4bit2_input;
469 chip->chip.direction_output =
470 s5p64x0_gpiolib_rbank_4bit2_output;
471 s3c_gpiolib_add(chip);
472 }
473}
474
475static int __init s5p64x0_gpiolib_init(void)
476{
477 s5p64x0_gpiolib_set_cfg(s5p64x0_gpio_cfgs,
478 ARRAY_SIZE(s5p64x0_gpio_cfgs));
479
480 if (soc_is_s5p6450()) {
481 samsung_gpiolib_add_2bit_chips(s5p6450_gpio_2bit,
482 ARRAY_SIZE(s5p6450_gpio_2bit));
483
484 samsung_gpiolib_add_4bit_chips(s5p6450_gpio_4bit,
485 ARRAY_SIZE(s5p6450_gpio_4bit));
486
487 samsung_gpiolib_add_4bit2_chips(s5p6450_gpio_4bit2,
488 ARRAY_SIZE(s5p6450_gpio_4bit2));
489
490 s5p64x0_gpio_add_rbank_4bit2(s5p6450_gpio_rbank_4bit2,
491 ARRAY_SIZE(s5p6450_gpio_rbank_4bit2));
492 } else {
493 samsung_gpiolib_add_2bit_chips(s5p6440_gpio_2bit,
494 ARRAY_SIZE(s5p6440_gpio_2bit));
495
496 samsung_gpiolib_add_4bit_chips(s5p6440_gpio_4bit,
497 ARRAY_SIZE(s5p6440_gpio_4bit));
498
499 samsung_gpiolib_add_4bit2_chips(s5p6440_gpio_4bit2,
500 ARRAY_SIZE(s5p6440_gpio_4bit2));
501
502 s5p64x0_gpio_add_rbank_4bit2(s5p6440_gpio_rbank_4bit2,
503 ARRAY_SIZE(s5p6440_gpio_rbank_4bit2));
504 }
505
506 return 0;
507}
508core_initcall(s5p64x0_gpiolib_init);
diff --git a/arch/arm/mach-s5p64x0/include/mach/i2c.h b/arch/arm/mach-s5p64x0/i2c.h
index 887d25209e8e..1e5bb4ea200d 100644
--- a/arch/arm/mach-s5p64x0/include/mach/i2c.h
+++ b/arch/arm/mach-s5p64x0/i2c.h
@@ -1,5 +1,4 @@
1/* linux/arch/arm/mach-s5p64x0/include/mach/i2c.h 1/*
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 2 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 3 * http://www.samsung.com
5 * 4 *
diff --git a/arch/arm/mach-s5p64x0/include/mach/regs-irq.h b/arch/arm/mach-s5p64x0/include/mach/regs-irq.h
index 4aaebdace55f..d60397d1ff40 100644
--- a/arch/arm/mach-s5p64x0/include/mach/regs-irq.h
+++ b/arch/arm/mach-s5p64x0/include/mach/regs-irq.h
@@ -13,7 +13,6 @@
13#ifndef __ASM_ARCH_REGS_IRQ_H 13#ifndef __ASM_ARCH_REGS_IRQ_H
14#define __ASM_ARCH_REGS_IRQ_H __FILE__ 14#define __ASM_ARCH_REGS_IRQ_H __FILE__
15 15
16#include <asm/hardware/vic.h>
17#include <mach/map.h> 16#include <mach/map.h>
18 17
19#endif /* __ASM_ARCH_REGS_IRQ_H */ 18#endif /* __ASM_ARCH_REGS_IRQ_H */
diff --git a/arch/arm/mach-s5p64x0/include/mach/tick.h b/arch/arm/mach-s5p64x0/include/mach/tick.h
deleted file mode 100644
index 00aa7f1d8e51..000000000000
--- a/arch/arm/mach-s5p64x0/include/mach/tick.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/* linux/arch/arm/mach-s5p64x0/include/mach/tick.h
2 *
3 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Copyright 2008 Openmoko, Inc.
7 * Copyright 2008 Simtec Electronics
8 * http://armlinux.simtec.co.uk/
9 * Ben Dooks <ben@simtec.co.uk>
10 *
11 * S5P64X0 - Timer tick support definitions
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#ifndef __ASM_ARCH_TICK_H
19#define __ASM_ARCH_TICK_H __FILE__
20
21static inline u32 s3c24xx_ostimer_pending(void)
22{
23 u32 pend = __raw_readl(VA_VIC0 + VIC_RAW_STATUS);
24 return pend & (1 << (IRQ_TIMER4_VIC - S5P_IRQ_VIC0(0)));
25}
26
27#define TICK_MAX (0xffffffff)
28
29#endif /* __ASM_ARCH_TICK_H */
diff --git a/arch/arm/mach-s5p64x0/include/mach/uncompress.h b/arch/arm/mach-s5p64x0/include/mach/uncompress.h
index 1608faf870ff..19e0d64d78c5 100644
--- a/arch/arm/mach-s5p64x0/include/mach/uncompress.h
+++ b/arch/arm/mach-s5p64x0/include/mach/uncompress.h
@@ -116,33 +116,6 @@ static inline void flush(void)
116 *((volatile unsigned int __force *)(ad)) = (d); \ 116 *((volatile unsigned int __force *)(ad)) = (d); \
117 } while (0) 117 } while (0)
118 118
119/*
120 * CONFIG_S3C_BOOT_WATCHDOG
121 *
122 * Simple boot-time watchdog setup, to reboot the system if there is
123 * any problem with the boot process
124 */
125
126#ifdef CONFIG_S3C_BOOT_WATCHDOG
127
128#define WDOG_COUNT (0xff00)
129
130static inline void arch_decomp_wdog(void)
131{
132 __raw_writel(WDOG_COUNT, S3C2410_WTCNT);
133}
134
135static void arch_decomp_wdog_start(void)
136{
137 __raw_writel(WDOG_COUNT, S3C2410_WTDAT);
138 __raw_writel(WDOG_COUNT, S3C2410_WTCNT);
139 __raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x80), S3C2410_WTCON);
140}
141
142#else
143#define arch_decomp_wdog_start()
144#define arch_decomp_wdog()
145#endif
146 119
147#ifdef CONFIG_S3C_BOOT_ERROR_RESET 120#ifdef CONFIG_S3C_BOOT_ERROR_RESET
148 121
@@ -192,7 +165,6 @@ static void arch_decomp_setup(void)
192 */ 165 */
193 166
194 arch_detect_cpu(); 167 arch_detect_cpu();
195 arch_decomp_wdog_start();
196 168
197 /* 169 /*
198 * Enable the UART FIFOs if they where not enabled and our 170 * Enable the UART FIFOs if they where not enabled and our
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6440.c b/arch/arm/mach-s5p64x0/mach-smdk6440.c
index 1af823558c60..e23723a5a214 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6440.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6440.c
@@ -29,7 +29,6 @@
29#include <video/platform_lcd.h> 29#include <video/platform_lcd.h>
30#include <video/samsung_fimd.h> 30#include <video/samsung_fimd.h>
31 31
32#include <asm/hardware/vic.h>
33#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
34#include <asm/mach/map.h> 33#include <asm/mach/map.h>
35#include <asm/irq.h> 34#include <asm/irq.h>
@@ -38,7 +37,6 @@
38#include <mach/hardware.h> 37#include <mach/hardware.h>
39#include <mach/map.h> 38#include <mach/map.h>
40#include <mach/regs-clock.h> 39#include <mach/regs-clock.h>
41#include <mach/i2c.h>
42#include <mach/regs-gpio.h> 40#include <mach/regs-gpio.h>
43 41
44#include <plat/regs-serial.h> 42#include <plat/regs-serial.h>
@@ -56,6 +54,7 @@
56#include <plat/sdhci.h> 54#include <plat/sdhci.h>
57 55
58#include "common.h" 56#include "common.h"
57#include "i2c.h"
59 58
60#define SMDK6440_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 59#define SMDK6440_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
61 S3C2410_UCON_RXILEVEL | \ 60 S3C2410_UCON_RXILEVEL | \
@@ -272,9 +271,8 @@ MACHINE_START(SMDK6440, "SMDK6440")
272 .atag_offset = 0x100, 271 .atag_offset = 0x100,
273 272
274 .init_irq = s5p6440_init_irq, 273 .init_irq = s5p6440_init_irq,
275 .handle_irq = vic_handle_irq,
276 .map_io = smdk6440_map_io, 274 .map_io = smdk6440_map_io,
277 .init_machine = smdk6440_machine_init, 275 .init_machine = smdk6440_machine_init,
278 .timer = &s5p_timer, 276 .init_time = s5p_timer_init,
279 .restart = s5p64x0_restart, 277 .restart = s5p64x0_restart,
280MACHINE_END 278MACHINE_END
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c b/arch/arm/mach-s5p64x0/mach-smdk6450.c
index 62526ccf6b70..ca10963a959e 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6450.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6450.c
@@ -29,7 +29,6 @@
29#include <video/platform_lcd.h> 29#include <video/platform_lcd.h>
30#include <video/samsung_fimd.h> 30#include <video/samsung_fimd.h>
31 31
32#include <asm/hardware/vic.h>
33#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
34#include <asm/mach/map.h> 33#include <asm/mach/map.h>
35#include <asm/irq.h> 34#include <asm/irq.h>
@@ -38,7 +37,6 @@
38#include <mach/hardware.h> 37#include <mach/hardware.h>
39#include <mach/map.h> 38#include <mach/map.h>
40#include <mach/regs-clock.h> 39#include <mach/regs-clock.h>
41#include <mach/i2c.h>
42#include <mach/regs-gpio.h> 40#include <mach/regs-gpio.h>
43 41
44#include <plat/regs-serial.h> 42#include <plat/regs-serial.h>
@@ -56,6 +54,7 @@
56#include <plat/sdhci.h> 54#include <plat/sdhci.h>
57 55
58#include "common.h" 56#include "common.h"
57#include "i2c.h"
59 58
60#define SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 59#define SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
61 S3C2410_UCON_RXILEVEL | \ 60 S3C2410_UCON_RXILEVEL | \
@@ -291,9 +290,8 @@ MACHINE_START(SMDK6450, "SMDK6450")
291 .atag_offset = 0x100, 290 .atag_offset = 0x100,
292 291
293 .init_irq = s5p6450_init_irq, 292 .init_irq = s5p6450_init_irq,
294 .handle_irq = vic_handle_irq,
295 .map_io = smdk6450_map_io, 293 .map_io = smdk6450_map_io,
296 .init_machine = smdk6450_machine_init, 294 .init_machine = smdk6450_machine_init,
297 .timer = &s5p_timer, 295 .init_time = s5p_timer_init,
298 .restart = s5p64x0_restart, 296 .restart = s5p64x0_restart,
299MACHINE_END 297MACHINE_END
diff --git a/arch/arm/mach-s5p64x0/pm.c b/arch/arm/mach-s5p64x0/pm.c
index 9cba18bfe47b..97c2a08ad490 100644
--- a/arch/arm/mach-s5p64x0/pm.c
+++ b/arch/arm/mach-s5p64x0/pm.c
@@ -103,8 +103,8 @@ static int s5p64x0_cpu_suspend(unsigned long arg)
103 "mcr p15, 0, %0, c7, c10, 4\n\t" 103 "mcr p15, 0, %0, c7, c10, 4\n\t"
104 "mcr p15, 0, %0, c7, c0, 4" : : "r" (tmp)); 104 "mcr p15, 0, %0, c7, c0, 4" : : "r" (tmp));
105 105
106 /* we should never get past here */ 106 pr_info("Failed to suspend the system\n");
107 panic("sleep resumed to originator?"); 107 return 1; /* Aborting suspend */
108} 108}
109 109
110/* mapping of interrupts to parts of the wakeup mask */ 110/* mapping of interrupts to parts of the wakeup mask */
diff --git a/arch/arm/mach-s5p64x0/setup-i2c0.c b/arch/arm/mach-s5p64x0/setup-i2c0.c
index a32edc545e6c..569b76ac98cb 100644
--- a/arch/arm/mach-s5p64x0/setup-i2c0.c
+++ b/arch/arm/mach-s5p64x0/setup-i2c0.c
@@ -21,7 +21,7 @@ struct platform_device; /* don't need the contents */
21#include <plat/gpio-cfg.h> 21#include <plat/gpio-cfg.h>
22#include <linux/platform_data/i2c-s3c2410.h> 22#include <linux/platform_data/i2c-s3c2410.h>
23 23
24#include <mach/i2c.h> 24#include "i2c.h"
25 25
26void s5p6440_i2c0_cfg_gpio(struct platform_device *dev) 26void s5p6440_i2c0_cfg_gpio(struct platform_device *dev)
27{ 27{
diff --git a/arch/arm/mach-s5p64x0/setup-i2c1.c b/arch/arm/mach-s5p64x0/setup-i2c1.c
index ca2c5c7f8aa6..867374e6d0bc 100644
--- a/arch/arm/mach-s5p64x0/setup-i2c1.c
+++ b/arch/arm/mach-s5p64x0/setup-i2c1.c
@@ -21,7 +21,7 @@ struct platform_device; /* don't need the contents */
21#include <plat/gpio-cfg.h> 21#include <plat/gpio-cfg.h>
22#include <linux/platform_data/i2c-s3c2410.h> 22#include <linux/platform_data/i2c-s3c2410.h>
23 23
24#include <mach/i2c.h> 24#include "i2c.h"
25 25
26void s5p6440_i2c1_cfg_gpio(struct platform_device *dev) 26void s5p6440_i2c1_cfg_gpio(struct platform_device *dev)
27{ 27{
diff --git a/arch/arm/mach-s5pc100/include/mach/regs-irq.h b/arch/arm/mach-s5pc100/include/mach/regs-irq.h
index 4d9036d0f288..761627897f30 100644
--- a/arch/arm/mach-s5pc100/include/mach/regs-irq.h
+++ b/arch/arm/mach-s5pc100/include/mach/regs-irq.h
@@ -14,6 +14,5 @@
14#define __ASM_ARCH_REGS_IRQ_H __FILE__ 14#define __ASM_ARCH_REGS_IRQ_H __FILE__
15 15
16#include <mach/map.h> 16#include <mach/map.h>
17#include <asm/hardware/vic.h>
18 17
19#endif /* __ASM_ARCH_REGS_IRQ_H */ 18#endif /* __ASM_ARCH_REGS_IRQ_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/tick.h b/arch/arm/mach-s5pc100/include/mach/tick.h
index 20f68730ed18..0af8e41230ed 100644
--- a/arch/arm/mach-s5pc100/include/mach/tick.h
+++ b/arch/arm/mach-s5pc100/include/mach/tick.h
@@ -15,6 +15,8 @@
15#ifndef __ASM_ARCH_TICK_H 15#ifndef __ASM_ARCH_TICK_H
16#define __ASM_ARCH_TICK_H __FILE__ 16#define __ASM_ARCH_TICK_H __FILE__
17 17
18#include <linux/irqchip/arm-vic.h>
19
18/* note, the timer interrutps turn up in 2 places, the vic and then 20/* note, the timer interrutps turn up in 2 places, the vic and then
19 * the timer block. We take the VIC as the base at the moment. 21 * the timer block. We take the VIC as the base at the moment.
20 */ 22 */
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c b/arch/arm/mach-s5pc100/mach-smdkc100.c
index 9abe95e806ab..185a19583898 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -25,7 +25,6 @@
25#include <linux/input.h> 25#include <linux/input.h>
26#include <linux/pwm_backlight.h> 26#include <linux/pwm_backlight.h>
27 27
28#include <asm/hardware/vic.h>
29#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
30#include <asm/mach/map.h> 29#include <asm/mach/map.h>
31 30
@@ -254,9 +253,8 @@ MACHINE_START(SMDKC100, "SMDKC100")
254 /* Maintainer: Byungho Min <bhmin@samsung.com> */ 253 /* Maintainer: Byungho Min <bhmin@samsung.com> */
255 .atag_offset = 0x100, 254 .atag_offset = 0x100,
256 .init_irq = s5pc100_init_irq, 255 .init_irq = s5pc100_init_irq,
257 .handle_irq = vic_handle_irq,
258 .map_io = smdkc100_map_io, 256 .map_io = smdkc100_map_io,
259 .init_machine = smdkc100_machine_init, 257 .init_machine = smdkc100_machine_init,
260 .timer = &s3c24xx_timer, 258 .init_time = s3c24xx_timer_init,
261 .restart = s5pc100_restart, 259 .restart = s5pc100_restart,
262MACHINE_END 260MACHINE_END
diff --git a/arch/arm/mach-s5pv210/dev-audio.c b/arch/arm/mach-s5pv210/dev-audio.c
index addfb165c13d..2d67361ef431 100644
--- a/arch/arm/mach-s5pv210/dev-audio.c
+++ b/arch/arm/mach-s5pv210/dev-audio.c
@@ -18,7 +18,8 @@
18#include <mach/map.h> 18#include <mach/map.h>
19#include <mach/dma.h> 19#include <mach/dma.h>
20#include <mach/irqs.h> 20#include <mach/irqs.h>
21#include <mach/regs-audss.h> 21
22#define S5PV210_AUDSS_INT_MEM (0xC0000000)
22 23
23static int s5pv210_cfg_i2s(struct platform_device *pdev) 24static int s5pv210_cfg_i2s(struct platform_device *pdev)
24{ 25{
diff --git a/arch/arm/mach-s5pv210/include/mach/regs-audss.h b/arch/arm/mach-s5pv210/include/mach/regs-audss.h
deleted file mode 100644
index eacc1f790807..000000000000
--- a/arch/arm/mach-s5pv210/include/mach/regs-audss.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/* arch/arm/mach-s5pv210/include/mach/regs-audss.h
2 *
3 * Copyright (c) 2011 Samsung Electronics
4 * http://www.samsung.com
5 *
6 * S5PV210 Audio SubSystem clock 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 __PLAT_REGS_AUDSS_H
14#define __PLAT_REGS_AUDSS_H __FILE__
15
16#define S5PV210_AUDSS_INT_MEM (0xC0000000)
17
18#endif /* _PLAT_REGS_AUDSS_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/regs-irq.h b/arch/arm/mach-s5pv210/include/mach/regs-irq.h
index 5c3b104a7c86..d8bc1e6c7aaa 100644
--- a/arch/arm/mach-s5pv210/include/mach/regs-irq.h
+++ b/arch/arm/mach-s5pv210/include/mach/regs-irq.h
@@ -13,7 +13,6 @@
13#ifndef __ASM_ARCH_REGS_IRQ_H 13#ifndef __ASM_ARCH_REGS_IRQ_H
14#define __ASM_ARCH_REGS_IRQ_H __FILE__ 14#define __ASM_ARCH_REGS_IRQ_H __FILE__
15 15
16#include <asm/hardware/vic.h>
17#include <mach/map.h> 16#include <mach/map.h>
18 17
19#endif /* __ASM_ARCH_REGS_IRQ_H */ 18#endif /* __ASM_ARCH_REGS_IRQ_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/regs-sys.h b/arch/arm/mach-s5pv210/include/mach/regs-sys.h
deleted file mode 100644
index cccb1eddaa38..000000000000
--- a/arch/arm/mach-s5pv210/include/mach/regs-sys.h
+++ /dev/null
@@ -1,15 +0,0 @@
1/* arch/arm/mach-s5pv210/include/mach/regs-sys.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5PV210 - System registers 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#define S5PV210_USB_PHY_CON (S3C_VA_SYS + 0xE80C)
14#define S5PV210_USB_PHY0_EN (1 << 0)
15#define S5PV210_USB_PHY1_EN (1 << 1)
diff --git a/arch/arm/mach-s5pv210/include/mach/tick.h b/arch/arm/mach-s5pv210/include/mach/tick.h
deleted file mode 100644
index 7993b3603ccf..000000000000
--- a/arch/arm/mach-s5pv210/include/mach/tick.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/* linux/arch/arm/mach-s5pv210/include/mach/tick.h
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Based on arch/arm/mach-s3c6400/include/mach/tick.h
7 *
8 * S5PV210 - Timer tick support definitions
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#ifndef __ASM_ARCH_TICK_H
16#define __ASM_ARCH_TICK_H __FILE__
17
18static inline u32 s3c24xx_ostimer_pending(void)
19{
20 u32 pend = __raw_readl(VA_VIC0 + VIC_RAW_STATUS);
21 return pend & (1 << (IRQ_TIMER4_VIC - S5P_IRQ_VIC0(0)));
22}
23
24#define TICK_MAX (0xffffffff)
25
26#endif /* __ASM_ARCH_TICK_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/uncompress.h b/arch/arm/mach-s5pv210/include/mach/uncompress.h
index 08ff2fda1fb9..ef977ea8546d 100644
--- a/arch/arm/mach-s5pv210/include/mach/uncompress.h
+++ b/arch/arm/mach-s5pv210/include/mach/uncompress.h
@@ -19,6 +19,8 @@
19static void arch_detect_cpu(void) 19static void arch_detect_cpu(void)
20{ 20{
21 /* we do not need to do any cpu detection here at the moment. */ 21 /* we do not need to do any cpu detection here at the moment. */
22 fifo_mask = S5PV210_UFSTAT_TXMASK;
23 fifo_max = 63 << S5PV210_UFSTAT_TXSHIFT;
22} 24}
23 25
24#endif /* __ASM_ARCH_UNCOMPRESS_H */ 26#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c
index ee9fa5c2ef2c..11900a8e88a3 100644
--- a/arch/arm/mach-s5pv210/mach-aquila.c
+++ b/arch/arm/mach-s5pv210/mach-aquila.c
@@ -22,7 +22,6 @@
22#include <linux/input.h> 22#include <linux/input.h>
23#include <linux/gpio.h> 23#include <linux/gpio.h>
24 24
25#include <asm/hardware/vic.h>
26#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
27#include <asm/mach/map.h> 26#include <asm/mach/map.h>
28#include <asm/setup.h> 27#include <asm/setup.h>
@@ -685,9 +684,8 @@ MACHINE_START(AQUILA, "Aquila")
685 Kyungmin Park <kyungmin.park@samsung.com> */ 684 Kyungmin Park <kyungmin.park@samsung.com> */
686 .atag_offset = 0x100, 685 .atag_offset = 0x100,
687 .init_irq = s5pv210_init_irq, 686 .init_irq = s5pv210_init_irq,
688 .handle_irq = vic_handle_irq,
689 .map_io = aquila_map_io, 687 .map_io = aquila_map_io,
690 .init_machine = aquila_machine_init, 688 .init_machine = aquila_machine_init,
691 .timer = &s5p_timer, 689 .init_time = s5p_timer_init,
692 .restart = s5pv210_restart, 690 .restart = s5pv210_restart,
693MACHINE_END 691MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c
index c72b31078c99..3a38f7b34b94 100644
--- a/arch/arm/mach-s5pv210/mach-goni.c
+++ b/arch/arm/mach-s5pv210/mach-goni.c
@@ -29,7 +29,6 @@
29#include <linux/interrupt.h> 29#include <linux/interrupt.h>
30#include <linux/platform_data/s3c-hsotg.h> 30#include <linux/platform_data/s3c-hsotg.h>
31 31
32#include <asm/hardware/vic.h>
33#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
34#include <asm/mach/map.h> 33#include <asm/mach/map.h>
35#include <asm/setup.h> 34#include <asm/setup.h>
@@ -841,12 +840,12 @@ static struct i2c_board_info noon010pc30_board_info = {
841 .platform_data = &noon010pc30_pldata, 840 .platform_data = &noon010pc30_pldata,
842}; 841};
843 842
844static struct s5p_fimc_isp_info goni_camera_sensors[] = { 843static struct fimc_source_info goni_camera_sensors[] = {
845 { 844 {
846 .mux_id = 0, 845 .mux_id = 0,
847 .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING | 846 .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING |
848 V4L2_MBUS_VSYNC_ACTIVE_LOW, 847 V4L2_MBUS_VSYNC_ACTIVE_LOW,
849 .bus_type = FIMC_ITU_601, 848 .bus_type = FIMC_BUS_TYPE_ITU_601,
850 .board_info = &noon010pc30_board_info, 849 .board_info = &noon010pc30_board_info,
851 .i2c_bus_num = 0, 850 .i2c_bus_num = 0,
852 .clk_frequency = 16000000UL, 851 .clk_frequency = 16000000UL,
@@ -854,7 +853,7 @@ static struct s5p_fimc_isp_info goni_camera_sensors[] = {
854}; 853};
855 854
856static struct s5p_platform_fimc goni_fimc_md_platdata __initdata = { 855static struct s5p_platform_fimc goni_fimc_md_platdata __initdata = {
857 .isp_info = goni_camera_sensors, 856 .source_info = goni_camera_sensors,
858 .num_clients = ARRAY_SIZE(goni_camera_sensors), 857 .num_clients = ARRAY_SIZE(goni_camera_sensors),
859}; 858};
860 859
@@ -972,10 +971,9 @@ MACHINE_START(GONI, "GONI")
972 /* Maintainers: Kyungmin Park <kyungmin.park@samsung.com> */ 971 /* Maintainers: Kyungmin Park <kyungmin.park@samsung.com> */
973 .atag_offset = 0x100, 972 .atag_offset = 0x100,
974 .init_irq = s5pv210_init_irq, 973 .init_irq = s5pv210_init_irq,
975 .handle_irq = vic_handle_irq,
976 .map_io = goni_map_io, 974 .map_io = goni_map_io,
977 .init_machine = goni_machine_init, 975 .init_machine = goni_machine_init,
978 .timer = &s5p_timer, 976 .init_time = s5p_timer_init,
979 .reserve = &goni_reserve, 977 .reserve = &goni_reserve,
980 .restart = s5pv210_restart, 978 .restart = s5pv210_restart,
981MACHINE_END 979MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-smdkc110.c b/arch/arm/mach-s5pv210/mach-smdkc110.c
index f1f3bd37ecda..28bd0248a3e2 100644
--- a/arch/arm/mach-s5pv210/mach-smdkc110.c
+++ b/arch/arm/mach-s5pv210/mach-smdkc110.c
@@ -15,7 +15,6 @@
15#include <linux/i2c.h> 15#include <linux/i2c.h>
16#include <linux/device.h> 16#include <linux/device.h>
17 17
18#include <asm/hardware/vic.h>
19#include <asm/mach/arch.h> 18#include <asm/mach/arch.h>
20#include <asm/mach/map.h> 19#include <asm/mach/map.h>
21#include <asm/setup.h> 20#include <asm/setup.h>
@@ -152,10 +151,9 @@ MACHINE_START(SMDKC110, "SMDKC110")
152 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ 151 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
153 .atag_offset = 0x100, 152 .atag_offset = 0x100,
154 .init_irq = s5pv210_init_irq, 153 .init_irq = s5pv210_init_irq,
155 .handle_irq = vic_handle_irq,
156 .map_io = smdkc110_map_io, 154 .map_io = smdkc110_map_io,
157 .init_machine = smdkc110_machine_init, 155 .init_machine = smdkc110_machine_init,
158 .timer = &s5p_timer, 156 .init_time = s5p_timer_init,
159 .restart = s5pv210_restart, 157 .restart = s5pv210_restart,
160 .reserve = &smdkc110_reserve, 158 .reserve = &smdkc110_reserve,
161MACHINE_END 159MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c
index 6bc8404bf678..3c73f36869bb 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -21,7 +21,6 @@
21#include <linux/pwm_backlight.h> 21#include <linux/pwm_backlight.h>
22#include <linux/platform_data/s3c-hsotg.h> 22#include <linux/platform_data/s3c-hsotg.h>
23 23
24#include <asm/hardware/vic.h>
25#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
26#include <asm/mach/map.h> 25#include <asm/mach/map.h>
27#include <asm/setup.h> 26#include <asm/setup.h>
@@ -328,10 +327,9 @@ MACHINE_START(SMDKV210, "SMDKV210")
328 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ 327 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
329 .atag_offset = 0x100, 328 .atag_offset = 0x100,
330 .init_irq = s5pv210_init_irq, 329 .init_irq = s5pv210_init_irq,
331 .handle_irq = vic_handle_irq,
332 .map_io = smdkv210_map_io, 330 .map_io = smdkv210_map_io,
333 .init_machine = smdkv210_machine_init, 331 .init_machine = smdkv210_machine_init,
334 .timer = &s5p_timer, 332 .init_time = s5p_timer_init,
335 .restart = s5pv210_restart, 333 .restart = s5pv210_restart,
336 .reserve = &smdkv210_reserve, 334 .reserve = &smdkv210_reserve,
337MACHINE_END 335MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-torbreck.c b/arch/arm/mach-s5pv210/mach-torbreck.c
index 18785cb5e1ef..2d4c5531819c 100644
--- a/arch/arm/mach-s5pv210/mach-torbreck.c
+++ b/arch/arm/mach-s5pv210/mach-torbreck.c
@@ -14,7 +14,6 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/serial_core.h> 15#include <linux/serial_core.h>
16 16
17#include <asm/hardware/vic.h>
18#include <asm/mach/arch.h> 17#include <asm/mach/arch.h>
19#include <asm/mach/map.h> 18#include <asm/mach/map.h>
20#include <asm/setup.h> 19#include <asm/setup.h>
@@ -129,9 +128,8 @@ MACHINE_START(TORBRECK, "TORBRECK")
129 /* Maintainer: Hyunchul Ko <ghcstop@gmail.com> */ 128 /* Maintainer: Hyunchul Ko <ghcstop@gmail.com> */
130 .atag_offset = 0x100, 129 .atag_offset = 0x100,
131 .init_irq = s5pv210_init_irq, 130 .init_irq = s5pv210_init_irq,
132 .handle_irq = vic_handle_irq,
133 .map_io = torbreck_map_io, 131 .map_io = torbreck_map_io,
134 .init_machine = torbreck_machine_init, 132 .init_machine = torbreck_machine_init,
135 .timer = &s5p_timer, 133 .init_time = s5p_timer_init,
136 .restart = s5pv210_restart, 134 .restart = s5pv210_restart,
137MACHINE_END 135MACHINE_END
diff --git a/arch/arm/mach-s5pv210/pm.c b/arch/arm/mach-s5pv210/pm.c
index 736bfb103cbc..2b68a67b6e95 100644
--- a/arch/arm/mach-s5pv210/pm.c
+++ b/arch/arm/mach-s5pv210/pm.c
@@ -104,8 +104,8 @@ static int s5pv210_cpu_suspend(unsigned long arg)
104 "mcr p15, 0, %0, c7, c10, 4\n\t" 104 "mcr p15, 0, %0, c7, c10, 4\n\t"
105 "wfi" : : "r" (tmp)); 105 "wfi" : : "r" (tmp));
106 106
107 /* we should never get past here */ 107 pr_info("Failed to suspend the system\n");
108 panic("sleep resumed to originator?"); 108 return 1; /* Aborting suspend */
109} 109}
110 110
111static void s5pv210_pm_prepare(void) 111static void s5pv210_pm_prepare(void)
diff --git a/arch/arm/mach-s5pv210/setup-usb-phy.c b/arch/arm/mach-s5pv210/setup-usb-phy.c
index be39cf4aa91b..356a0900af03 100644
--- a/arch/arm/mach-s5pv210/setup-usb-phy.c
+++ b/arch/arm/mach-s5pv210/setup-usb-phy.c
@@ -12,12 +12,17 @@
12#include <linux/err.h> 12#include <linux/err.h>
13#include <linux/io.h> 13#include <linux/io.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15
15#include <mach/map.h> 16#include <mach/map.h>
16#include <mach/regs-sys.h> 17
17#include <plat/cpu.h> 18#include <plat/cpu.h>
18#include <plat/regs-usb-hsotg-phy.h> 19#include <plat/regs-usb-hsotg-phy.h>
19#include <plat/usb-phy.h> 20#include <plat/usb-phy.h>
20 21
22#define S5PV210_USB_PHY_CON (S3C_VA_SYS + 0xE80C)
23#define S5PV210_USB_PHY0_EN (1 << 0)
24#define S5PV210_USB_PHY1_EN (1 << 1)
25
21static int s5pv210_usb_otgphy_init(struct platform_device *pdev) 26static int s5pv210_usb_otgphy_init(struct platform_device *pdev)
22{ 27{
23 struct clk *xusbxti; 28 struct clk *xusbxti;
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c
index 9a23739f7026..e838ba27e443 100644
--- a/arch/arm/mach-sa1100/assabet.c
+++ b/arch/arm/mach-sa1100/assabet.c
@@ -16,6 +16,7 @@
16#include <linux/ioport.h> 16#include <linux/ioport.h>
17#include <linux/platform_data/sa11x0-serial.h> 17#include <linux/platform_data/sa11x0-serial.h>
18#include <linux/serial_core.h> 18#include <linux/serial_core.h>
19#include <linux/platform_device.h>
19#include <linux/mfd/ucb1x00.h> 20#include <linux/mfd/ucb1x00.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>
@@ -621,7 +622,7 @@ MACHINE_START(ASSABET, "Intel-Assabet")
621 .map_io = assabet_map_io, 622 .map_io = assabet_map_io,
622 .nr_irqs = SA1100_NR_IRQS, 623 .nr_irqs = SA1100_NR_IRQS,
623 .init_irq = sa1100_init_irq, 624 .init_irq = sa1100_init_irq,
624 .timer = &sa1100_timer, 625 .init_time = sa1100_timer_init,
625 .init_machine = assabet_init, 626 .init_machine = assabet_init,
626 .init_late = sa11x0_init_late, 627 .init_late = sa11x0_init_late,
627#ifdef CONFIG_SA1111 628#ifdef CONFIG_SA1111
diff --git a/arch/arm/mach-sa1100/badge4.c b/arch/arm/mach-sa1100/badge4.c
index b2dadf3ea3df..63361b6d04e9 100644
--- a/arch/arm/mach-sa1100/badge4.c
+++ b/arch/arm/mach-sa1100/badge4.c
@@ -336,7 +336,7 @@ MACHINE_START(BADGE4, "Hewlett-Packard Laboratories BadgePAD 4")
336 .nr_irqs = SA1100_NR_IRQS, 336 .nr_irqs = SA1100_NR_IRQS,
337 .init_irq = sa1100_init_irq, 337 .init_irq = sa1100_init_irq,
338 .init_late = sa11x0_init_late, 338 .init_late = sa11x0_init_late,
339 .timer = &sa1100_timer, 339 .init_time = sa1100_timer_init,
340#ifdef CONFIG_SA1111 340#ifdef CONFIG_SA1111
341 .dma_zone_size = SZ_1M, 341 .dma_zone_size = SZ_1M,
342#endif 342#endif
diff --git a/arch/arm/mach-sa1100/cerf.c b/arch/arm/mach-sa1100/cerf.c
index 304bca4a07c0..2d25ececb415 100644
--- a/arch/arm/mach-sa1100/cerf.c
+++ b/arch/arm/mach-sa1100/cerf.c
@@ -174,7 +174,7 @@ MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube")
174 .map_io = cerf_map_io, 174 .map_io = cerf_map_io,
175 .nr_irqs = SA1100_NR_IRQS, 175 .nr_irqs = SA1100_NR_IRQS,
176 .init_irq = cerf_init_irq, 176 .init_irq = cerf_init_irq,
177 .timer = &sa1100_timer, 177 .init_time = sa1100_timer_init,
178 .init_machine = cerf_init, 178 .init_machine = cerf_init,
179 .init_late = sa11x0_init_late, 179 .init_late = sa11x0_init_late,
180 .restart = sa11x0_restart, 180 .restart = sa11x0_restart,
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index 45f424f5fca6..612a45689770 100644
--- a/arch/arm/mach-sa1100/collie.c
+++ b/arch/arm/mach-sa1100/collie.c
@@ -399,7 +399,7 @@ MACHINE_START(COLLIE, "Sharp-Collie")
399 .map_io = collie_map_io, 399 .map_io = collie_map_io,
400 .nr_irqs = SA1100_NR_IRQS, 400 .nr_irqs = SA1100_NR_IRQS,
401 .init_irq = sa1100_init_irq, 401 .init_irq = sa1100_init_irq,
402 .timer = &sa1100_timer, 402 .init_time = sa1100_timer_init,
403 .init_machine = collie_init, 403 .init_machine = collie_init,
404 .init_late = sa11x0_init_late, 404 .init_late = sa11x0_init_late,
405 .restart = sa11x0_restart, 405 .restart = sa11x0_restart,
diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h
index a5b7c13da3e3..2abc6a1f6e86 100644
--- a/arch/arm/mach-sa1100/generic.h
+++ b/arch/arm/mach-sa1100/generic.h
@@ -4,9 +4,7 @@
4 * Author: Nicolas Pitre 4 * Author: Nicolas Pitre
5 */ 5 */
6 6
7struct sys_timer; 7extern void sa1100_timer_init(void);
8
9extern struct sys_timer sa1100_timer;
10extern void __init sa1100_map_io(void); 8extern void __init sa1100_map_io(void);
11extern void __init sa1100_init_irq(void); 9extern void __init sa1100_init_irq(void);
12extern void __init sa1100_init_gpio(void); 10extern void __init sa1100_init_gpio(void);
diff --git a/arch/arm/mach-sa1100/h3100.c b/arch/arm/mach-sa1100/h3100.c
index e1571eab08ae..b8f2b151539b 100644
--- a/arch/arm/mach-sa1100/h3100.c
+++ b/arch/arm/mach-sa1100/h3100.c
@@ -108,7 +108,7 @@ MACHINE_START(H3100, "Compaq iPAQ H3100")
108 .map_io = h3100_map_io, 108 .map_io = h3100_map_io,
109 .nr_irqs = SA1100_NR_IRQS, 109 .nr_irqs = SA1100_NR_IRQS,
110 .init_irq = sa1100_init_irq, 110 .init_irq = sa1100_init_irq,
111 .timer = &sa1100_timer, 111 .init_time = sa1100_timer_init,
112 .init_machine = h3100_mach_init, 112 .init_machine = h3100_mach_init,
113 .init_late = sa11x0_init_late, 113 .init_late = sa11x0_init_late,
114 .restart = sa11x0_restart, 114 .restart = sa11x0_restart,
diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c
index ba7a2901ab88..b8dc5bd22623 100644
--- a/arch/arm/mach-sa1100/h3600.c
+++ b/arch/arm/mach-sa1100/h3600.c
@@ -158,7 +158,7 @@ MACHINE_START(H3600, "Compaq iPAQ H3600")
158 .map_io = h3600_map_io, 158 .map_io = h3600_map_io,
159 .nr_irqs = SA1100_NR_IRQS, 159 .nr_irqs = SA1100_NR_IRQS,
160 .init_irq = sa1100_init_irq, 160 .init_irq = sa1100_init_irq,
161 .timer = &sa1100_timer, 161 .init_time = sa1100_timer_init,
162 .init_machine = h3600_mach_init, 162 .init_machine = h3600_mach_init,
163 .init_late = sa11x0_init_late, 163 .init_late = sa11x0_init_late,
164 .restart = sa11x0_restart, 164 .restart = sa11x0_restart,
diff --git a/arch/arm/mach-sa1100/hackkit.c b/arch/arm/mach-sa1100/hackkit.c
index d005939c41fc..643d5f2d9af9 100644
--- a/arch/arm/mach-sa1100/hackkit.c
+++ b/arch/arm/mach-sa1100/hackkit.c
@@ -229,7 +229,7 @@ MACHINE_START(HACKKIT, "HackKit Cpu Board")
229 .map_io = hackkit_map_io, 229 .map_io = hackkit_map_io,
230 .nr_irqs = SA1100_NR_IRQS, 230 .nr_irqs = SA1100_NR_IRQS,
231 .init_irq = sa1100_init_irq, 231 .init_irq = sa1100_init_irq,
232 .timer = &sa1100_timer, 232 .init_time = sa1100_timer_init,
233 .init_machine = hackkit_init, 233 .init_machine = hackkit_init,
234 .init_late = sa11x0_init_late, 234 .init_late = sa11x0_init_late,
235 .restart = sa11x0_restart, 235 .restart = sa11x0_restart,
diff --git a/arch/arm/mach-sa1100/include/mach/uncompress.h b/arch/arm/mach-sa1100/include/mach/uncompress.h
index 5cf71da60e42..73093dc89829 100644
--- a/arch/arm/mach-sa1100/include/mach/uncompress.h
+++ b/arch/arm/mach-sa1100/include/mach/uncompress.h
@@ -49,4 +49,3 @@ static inline void flush(void)
49 * Nothing to do for these 49 * Nothing to do for these
50 */ 50 */
51#define arch_decomp_setup() 51#define arch_decomp_setup()
52#define arch_decomp_wdog()
diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c
index 35cfc428b4d4..c0b1f5bafae4 100644
--- a/arch/arm/mach-sa1100/jornada720.c
+++ b/arch/arm/mach-sa1100/jornada720.c
@@ -346,7 +346,7 @@ MACHINE_START(JORNADA720, "HP Jornada 720")
346 .map_io = jornada720_map_io, 346 .map_io = jornada720_map_io,
347 .nr_irqs = SA1100_NR_IRQS, 347 .nr_irqs = SA1100_NR_IRQS,
348 .init_irq = sa1100_init_irq, 348 .init_irq = sa1100_init_irq,
349 .timer = &sa1100_timer, 349 .init_time = sa1100_timer_init,
350 .init_machine = jornada720_mach_init, 350 .init_machine = jornada720_mach_init,
351 .init_late = sa11x0_init_late, 351 .init_late = sa11x0_init_late,
352#ifdef CONFIG_SA1111 352#ifdef CONFIG_SA1111
diff --git a/arch/arm/mach-sa1100/lart.c b/arch/arm/mach-sa1100/lart.c
index f69f78fc3ddd..51b0eb52c014 100644
--- a/arch/arm/mach-sa1100/lart.c
+++ b/arch/arm/mach-sa1100/lart.c
@@ -24,9 +24,6 @@
24 24
25#include "generic.h" 25#include "generic.h"
26 26
27
28#warning "include/asm/arch-sa1100/ide.h needs fixing for lart"
29
30static struct mcp_plat_data lart_mcp_data = { 27static struct mcp_plat_data lart_mcp_data = {
31 .mccr0 = MCCR0_ADM, 28 .mccr0 = MCCR0_ADM,
32 .sclk_rate = 11981000, 29 .sclk_rate = 11981000,
@@ -174,6 +171,6 @@ MACHINE_START(LART, "LART")
174 .init_irq = sa1100_init_irq, 171 .init_irq = sa1100_init_irq,
175 .init_machine = lart_init, 172 .init_machine = lart_init,
176 .init_late = sa11x0_init_late, 173 .init_late = sa11x0_init_late,
177 .timer = &sa1100_timer, 174 .init_time = sa1100_timer_init,
178 .restart = sa11x0_restart, 175 .restart = sa11x0_restart,
179MACHINE_END 176MACHINE_END
diff --git a/arch/arm/mach-sa1100/nanoengine.c b/arch/arm/mach-sa1100/nanoengine.c
index 102e08f7b109..f1cb3784d525 100644
--- a/arch/arm/mach-sa1100/nanoengine.c
+++ b/arch/arm/mach-sa1100/nanoengine.c
@@ -110,7 +110,7 @@ MACHINE_START(NANOENGINE, "BSE nanoEngine")
110 .map_io = nanoengine_map_io, 110 .map_io = nanoengine_map_io,
111 .nr_irqs = SA1100_NR_IRQS, 111 .nr_irqs = SA1100_NR_IRQS,
112 .init_irq = sa1100_init_irq, 112 .init_irq = sa1100_init_irq,
113 .timer = &sa1100_timer, 113 .init_time = sa1100_timer_init,
114 .init_machine = nanoengine_init, 114 .init_machine = nanoengine_init,
115 .init_late = sa11x0_init_late, 115 .init_late = sa11x0_init_late,
116 .restart = sa11x0_restart, 116 .restart = sa11x0_restart,
diff --git a/arch/arm/mach-sa1100/pleb.c b/arch/arm/mach-sa1100/pleb.c
index c51bb63f90fb..091261878eff 100644
--- a/arch/arm/mach-sa1100/pleb.c
+++ b/arch/arm/mach-sa1100/pleb.c
@@ -133,7 +133,7 @@ MACHINE_START(PLEB, "PLEB")
133 .map_io = pleb_map_io, 133 .map_io = pleb_map_io,
134 .nr_irqs = SA1100_NR_IRQS, 134 .nr_irqs = SA1100_NR_IRQS,
135 .init_irq = sa1100_init_irq, 135 .init_irq = sa1100_init_irq,
136 .timer = &sa1100_timer, 136 .init_time = sa1100_timer_init,
137 .init_machine = pleb_init, 137 .init_machine = pleb_init,
138 .init_late = sa11x0_init_late, 138 .init_late = sa11x0_init_late,
139 .restart = sa11x0_restart, 139 .restart = sa11x0_restart,
diff --git a/arch/arm/mach-sa1100/shannon.c b/arch/arm/mach-sa1100/shannon.c
index 6460d25fbb88..c8866bce7386 100644
--- a/arch/arm/mach-sa1100/shannon.c
+++ b/arch/arm/mach-sa1100/shannon.c
@@ -102,7 +102,7 @@ MACHINE_START(SHANNON, "Shannon (AKA: Tuxscreen)")
102 .map_io = shannon_map_io, 102 .map_io = shannon_map_io,
103 .nr_irqs = SA1100_NR_IRQS, 103 .nr_irqs = SA1100_NR_IRQS,
104 .init_irq = sa1100_init_irq, 104 .init_irq = sa1100_init_irq,
105 .timer = &sa1100_timer, 105 .init_time = sa1100_timer_init,
106 .init_machine = shannon_init, 106 .init_machine = shannon_init,
107 .init_late = sa11x0_init_late, 107 .init_late = sa11x0_init_late,
108 .restart = sa11x0_restart, 108 .restart = sa11x0_restart,
diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c
index 6d65f65fcb23..bcbc94540e45 100644
--- a/arch/arm/mach-sa1100/simpad.c
+++ b/arch/arm/mach-sa1100/simpad.c
@@ -396,6 +396,6 @@ MACHINE_START(SIMPAD, "Simpad")
396 .nr_irqs = SA1100_NR_IRQS, 396 .nr_irqs = SA1100_NR_IRQS,
397 .init_irq = sa1100_init_irq, 397 .init_irq = sa1100_init_irq,
398 .init_late = sa11x0_init_late, 398 .init_late = sa11x0_init_late,
399 .timer = &sa1100_timer, 399 .init_time = sa1100_timer_init,
400 .restart = sa11x0_restart, 400 .restart = sa11x0_restart,
401MACHINE_END 401MACHINE_END
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c
index 80702c9ecc77..a59a13a665a6 100644
--- a/arch/arm/mach-sa1100/time.c
+++ b/arch/arm/mach-sa1100/time.c
@@ -69,46 +69,10 @@ sa1100_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *c)
69 } 69 }
70} 70}
71 71
72static struct clock_event_device ckevt_sa1100_osmr0 = {
73 .name = "osmr0",
74 .features = CLOCK_EVT_FEAT_ONESHOT,
75 .rating = 200,
76 .set_next_event = sa1100_osmr0_set_next_event,
77 .set_mode = sa1100_osmr0_set_mode,
78};
79
80static struct irqaction sa1100_timer_irq = {
81 .name = "ost0",
82 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
83 .handler = sa1100_ost0_interrupt,
84 .dev_id = &ckevt_sa1100_osmr0,
85};
86
87static void __init sa1100_timer_init(void)
88{
89 writel_relaxed(0, OIER);
90 writel_relaxed(OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3, OSSR);
91
92 setup_sched_clock(sa1100_read_sched_clock, 32, 3686400);
93
94 clockevents_calc_mult_shift(&ckevt_sa1100_osmr0, 3686400, 4);
95 ckevt_sa1100_osmr0.max_delta_ns =
96 clockevent_delta2ns(0x7fffffff, &ckevt_sa1100_osmr0);
97 ckevt_sa1100_osmr0.min_delta_ns =
98 clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_sa1100_osmr0) + 1;
99 ckevt_sa1100_osmr0.cpumask = cpumask_of(0);
100
101 setup_irq(IRQ_OST0, &sa1100_timer_irq);
102
103 clocksource_mmio_init(OSCR, "oscr", CLOCK_TICK_RATE, 200, 32,
104 clocksource_mmio_readl_up);
105 clockevents_register_device(&ckevt_sa1100_osmr0);
106}
107
108#ifdef CONFIG_PM 72#ifdef CONFIG_PM
109unsigned long osmr[4], oier; 73unsigned long osmr[4], oier;
110 74
111static void sa1100_timer_suspend(void) 75static void sa1100_timer_suspend(struct clock_event_device *cedev)
112{ 76{
113 osmr[0] = readl_relaxed(OSMR0); 77 osmr[0] = readl_relaxed(OSMR0);
114 osmr[1] = readl_relaxed(OSMR1); 78 osmr[1] = readl_relaxed(OSMR1);
@@ -117,7 +81,7 @@ static void sa1100_timer_suspend(void)
117 oier = readl_relaxed(OIER); 81 oier = readl_relaxed(OIER);
118} 82}
119 83
120static void sa1100_timer_resume(void) 84static void sa1100_timer_resume(struct clock_event_device *cedev)
121{ 85{
122 writel_relaxed(0x0f, OSSR); 86 writel_relaxed(0x0f, OSSR);
123 writel_relaxed(osmr[0], OSMR0); 87 writel_relaxed(osmr[0], OSMR0);
@@ -136,8 +100,36 @@ static void sa1100_timer_resume(void)
136#define sa1100_timer_resume NULL 100#define sa1100_timer_resume NULL
137#endif 101#endif
138 102
139struct sys_timer sa1100_timer = { 103static struct clock_event_device ckevt_sa1100_osmr0 = {
140 .init = sa1100_timer_init, 104 .name = "osmr0",
105 .features = CLOCK_EVT_FEAT_ONESHOT,
106 .rating = 200,
107 .set_next_event = sa1100_osmr0_set_next_event,
108 .set_mode = sa1100_osmr0_set_mode,
141 .suspend = sa1100_timer_suspend, 109 .suspend = sa1100_timer_suspend,
142 .resume = sa1100_timer_resume, 110 .resume = sa1100_timer_resume,
143}; 111};
112
113static struct irqaction sa1100_timer_irq = {
114 .name = "ost0",
115 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
116 .handler = sa1100_ost0_interrupt,
117 .dev_id = &ckevt_sa1100_osmr0,
118};
119
120void __init sa1100_timer_init(void)
121{
122 writel_relaxed(0, OIER);
123 writel_relaxed(OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3, OSSR);
124
125 setup_sched_clock(sa1100_read_sched_clock, 32, 3686400);
126
127 ckevt_sa1100_osmr0.cpumask = cpumask_of(0);
128
129 setup_irq(IRQ_OST0, &sa1100_timer_irq);
130
131 clocksource_mmio_init(OSCR, "oscr", CLOCK_TICK_RATE, 200, 32,
132 clocksource_mmio_readl_up);
133 clockevents_config_and_register(&ckevt_sa1100_osmr0, 3686400,
134 MIN_OSCR_DELTA * 2, 0x7fffffff);
135}
diff --git a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c
index 9ad2e9737fb5..b63dec848195 100644
--- a/arch/arm/mach-shark/core.c
+++ b/arch/arm/mach-shark/core.c
@@ -128,10 +128,6 @@ static void __init shark_timer_init(void)
128 setup_irq(IRQ_TIMER, &shark_timer_irq); 128 setup_irq(IRQ_TIMER, &shark_timer_irq);
129} 129}
130 130
131static struct sys_timer shark_timer = {
132 .init = shark_timer_init,
133};
134
135static void shark_init_early(void) 131static void shark_init_early(void)
136{ 132{
137 disable_hlt(); 133 disable_hlt();
@@ -142,7 +138,7 @@ MACHINE_START(SHARK, "Shark")
142 .atag_offset = 0x3000, 138 .atag_offset = 0x3000,
143 .init_early = shark_init_early, 139 .init_early = shark_init_early,
144 .init_irq = shark_init_irq, 140 .init_irq = shark_init_irq,
145 .timer = &shark_timer, 141 .init_time = shark_timer_init,
146 .dma_zone_size = SZ_4M, 142 .dma_zone_size = SZ_4M,
147 .restart = shark_restart, 143 .restart = shark_restart,
148MACHINE_END 144MACHINE_END
diff --git a/arch/arm/mach-shark/include/mach/uncompress.h b/arch/arm/mach-shark/include/mach/uncompress.h
index 22ccab4c3c5e..a168435aecc9 100644
--- a/arch/arm/mach-shark/include/mach/uncompress.h
+++ b/arch/arm/mach-shark/include/mach/uncompress.h
@@ -48,4 +48,3 @@ static void putr()
48 * nothing to do 48 * nothing to do
49 */ 49 */
50#define arch_decomp_setup() 50#define arch_decomp_setup()
51#define arch_decomp_wdog()
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 0b7147928aa3..e1fac57514b9 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -15,17 +15,10 @@ obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o clock-emev2.o
15# SMP objects 15# SMP objects
16smp-y := platsmp.o headsmp.o 16smp-y := platsmp.o headsmp.o
17smp-$(CONFIG_HOTPLUG_CPU) += hotplug.o 17smp-$(CONFIG_HOTPLUG_CPU) += hotplug.o
18smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o 18smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o headsmp-sh73a0.o
19smp-$(CONFIG_ARCH_R8A7779) += smp-r8a7779.o 19smp-$(CONFIG_ARCH_R8A7779) += smp-r8a7779.o
20smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o 20smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o
21 21
22# Pinmux setup
23pfc-y :=
24pfc-$(CONFIG_ARCH_SH7372) += pfc-sh7372.o
25pfc-$(CONFIG_ARCH_SH73A0) += pfc-sh73a0.o
26pfc-$(CONFIG_ARCH_R8A7740) += pfc-r8a7740.o
27pfc-$(CONFIG_ARCH_R8A7779) += pfc-r8a7779.o
28
29# IRQ objects 22# IRQ objects
30obj-$(CONFIG_ARCH_SH7372) += entry-intc.o 23obj-$(CONFIG_ARCH_SH7372) += entry-intc.o
31obj-$(CONFIG_ARCH_R8A7740) += entry-intc.o 24obj-$(CONFIG_ARCH_R8A7740) += entry-intc.o
@@ -37,6 +30,7 @@ obj-$(CONFIG_ARCH_SHMOBILE) += pm-rmobile.o
37obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o sleep-sh7372.o 30obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o sleep-sh7372.o
38obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o 31obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o
39obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o 32obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o
33obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o
40 34
41# Board objects 35# Board objects
42obj-$(CONFIG_MACH_AP4EVB) += board-ap4evb.o 36obj-$(CONFIG_MACH_AP4EVB) += board-ap4evb.o
@@ -51,4 +45,3 @@ obj-$(CONFIG_MACH_KZM9G) += board-kzm9g.o
51 45
52# Framework support 46# Framework support
53obj-$(CONFIG_SMP) += $(smp-y) 47obj-$(CONFIG_SMP) += $(smp-y)
54obj-$(CONFIG_GENERIC_GPIO) += $(pfc-y)
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index 032d10817e79..8ff53a19c48c 100644
--- a/arch/arm/mach-shmobile/board-ag5evm.c
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -40,6 +40,7 @@
40#include <linux/mmc/sh_mobile_sdhi.h> 40#include <linux/mmc/sh_mobile_sdhi.h>
41#include <linux/mfd/tmio.h> 41#include <linux/mfd/tmio.h>
42#include <linux/sh_clk.h> 42#include <linux/sh_clk.h>
43#include <linux/irqchip/arm-gic.h>
43#include <video/sh_mobile_lcdc.h> 44#include <video/sh_mobile_lcdc.h>
44#include <video/sh_mipi_dsi.h> 45#include <video/sh_mipi_dsi.h>
45#include <sound/sh_fsi.h> 46#include <sound/sh_fsi.h>
@@ -49,7 +50,6 @@
49#include <mach/common.h> 50#include <mach/common.h>
50#include <asm/mach-types.h> 51#include <asm/mach-types.h>
51#include <asm/mach/arch.h> 52#include <asm/mach/arch.h>
52#include <asm/hardware/gic.h>
53#include <asm/hardware/cache-l2x0.h> 53#include <asm/hardware/cache-l2x0.h>
54#include <asm/traps.h> 54#include <asm/traps.h>
55 55
@@ -479,11 +479,10 @@ static void ag5evm_sdhi1_set_pwr(struct platform_device *pdev, int state)
479 static int power_gpio = -EINVAL; 479 static int power_gpio = -EINVAL;
480 480
481 if (power_gpio < 0) { 481 if (power_gpio < 0) {
482 int ret = gpio_request(GPIO_PORT114, "sdhi1_power"); 482 int ret = gpio_request_one(GPIO_PORT114, GPIOF_OUT_INIT_LOW,
483 if (!ret) { 483 "sdhi1_power");
484 if (!ret)
484 power_gpio = GPIO_PORT114; 485 power_gpio = GPIO_PORT114;
485 gpio_direction_output(power_gpio, 0);
486 }
487 } 486 }
488 487
489 /* 488 /*
@@ -604,14 +603,11 @@ static void __init ag5evm_init(void)
604 gpio_request(GPIO_FN_MMCD0_5_PU, NULL); 603 gpio_request(GPIO_FN_MMCD0_5_PU, NULL);
605 gpio_request(GPIO_FN_MMCD0_6_PU, NULL); 604 gpio_request(GPIO_FN_MMCD0_6_PU, NULL);
606 gpio_request(GPIO_FN_MMCD0_7_PU, NULL); 605 gpio_request(GPIO_FN_MMCD0_7_PU, NULL);
607 gpio_request(GPIO_PORT208, NULL); /* Reset */ 606 gpio_request_one(GPIO_PORT208, GPIOF_OUT_INIT_HIGH, NULL); /* Reset */
608 gpio_direction_output(GPIO_PORT208, 1);
609 607
610 /* enable SMSC911X */ 608 /* enable SMSC911X */
611 gpio_request(GPIO_PORT144, NULL); /* PINTA2 */ 609 gpio_request_one(GPIO_PORT144, GPIOF_IN, NULL); /* PINTA2 */
612 gpio_direction_input(GPIO_PORT144); 610 gpio_request_one(GPIO_PORT145, GPIOF_OUT_INIT_HIGH, NULL); /* RESET */
613 gpio_request(GPIO_PORT145, NULL); /* RESET */
614 gpio_direction_output(GPIO_PORT145, 1);
615 611
616 /* FSI A */ 612 /* FSI A */
617 gpio_request(GPIO_FN_FSIACK, NULL); 613 gpio_request(GPIO_FN_FSIACK, NULL);
@@ -626,15 +622,13 @@ static void __init ag5evm_init(void)
626 gpio_request(GPIO_FN_PORT243_IRDA_FIRSEL, NULL); 622 gpio_request(GPIO_FN_PORT243_IRDA_FIRSEL, NULL);
627 623
628 /* LCD panel */ 624 /* LCD panel */
629 gpio_request(GPIO_PORT217, NULL); /* RESET */ 625 gpio_request_one(GPIO_PORT217, GPIOF_OUT_INIT_LOW, NULL); /* RESET */
630 gpio_direction_output(GPIO_PORT217, 0);
631 mdelay(1); 626 mdelay(1);
632 gpio_set_value(GPIO_PORT217, 1); 627 gpio_set_value(GPIO_PORT217, 1);
633 mdelay(100); 628 mdelay(100);
634 629
635 /* LCD backlight controller */ 630 /* LCD backlight controller */
636 gpio_request(GPIO_PORT235, NULL); /* RESET */ 631 gpio_request_one(GPIO_PORT235, GPIOF_OUT_INIT_LOW, NULL); /* RESET */
637 gpio_direction_output(GPIO_PORT235, 0);
638 lcd_backlight_set_brightness(0); 632 lcd_backlight_set_brightness(0);
639 633
640 /* enable SDHI0 on CN15 [SD I/F] */ 634 /* enable SDHI0 on CN15 [SD I/F] */
@@ -668,8 +662,7 @@ MACHINE_START(AG5EVM, "ag5evm")
668 .init_early = sh73a0_add_early_devices, 662 .init_early = sh73a0_add_early_devices,
669 .nr_irqs = NR_IRQS_LEGACY, 663 .nr_irqs = NR_IRQS_LEGACY,
670 .init_irq = sh73a0_init_irq, 664 .init_irq = sh73a0_init_irq,
671 .handle_irq = gic_handle_irq,
672 .init_machine = ag5evm_init, 665 .init_machine = ag5evm_init,
673 .init_late = shmobile_init_late, 666 .init_late = shmobile_init_late,
674 .timer = &shmobile_timer, 667 .init_time = sh73a0_earlytimer_init,
675MACHINE_END 668MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 99ef190d0909..38f1259a0daf 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -143,6 +143,10 @@
143 * 143 *
144 * SW41 : ON : SH-Mobile AP4 Audio Mode 144 * SW41 : ON : SH-Mobile AP4 Audio Mode
145 * : OFF : Bluetooth Audio Mode 145 * : OFF : Bluetooth Audio Mode
146 *
147 * it needs amixer settings for playing
148 *
149 * amixer set "Headphone Enable" on
146 */ 150 */
147 151
148/* 152/*
@@ -657,14 +661,8 @@ static struct platform_device lcdc_device = {
657/* FSI */ 661/* FSI */
658#define IRQ_FSI evt2irq(0x1840) 662#define IRQ_FSI evt2irq(0x1840)
659static struct sh_fsi_platform_info fsi_info = { 663static struct sh_fsi_platform_info fsi_info = {
660 .port_a = {
661 .flags = SH_FSI_BRS_INV,
662 },
663 .port_b = { 664 .port_b = {
664 .flags = SH_FSI_BRS_INV | 665 .flags = SH_FSI_CLK_CPG |
665 SH_FSI_BRM_INV |
666 SH_FSI_LRS_INV |
667 SH_FSI_CLK_CPG |
668 SH_FSI_FMT_SPDIF, 666 SH_FSI_FMT_SPDIF,
669 }, 667 },
670}; 668};
@@ -692,21 +690,21 @@ static struct platform_device fsi_device = {
692 }, 690 },
693}; 691};
694 692
695static struct asoc_simple_dai_init_info fsi2_ak4643_init_info = {
696 .fmt = SND_SOC_DAIFMT_LEFT_J,
697 .codec_daifmt = SND_SOC_DAIFMT_CBM_CFM,
698 .cpu_daifmt = SND_SOC_DAIFMT_CBS_CFS,
699 .sysclk = 11289600,
700};
701
702static struct asoc_simple_card_info fsi2_ak4643_info = { 693static struct asoc_simple_card_info fsi2_ak4643_info = {
703 .name = "AK4643", 694 .name = "AK4643",
704 .card = "FSI2A-AK4643", 695 .card = "FSI2A-AK4643",
705 .cpu_dai = "fsia-dai",
706 .codec = "ak4642-codec.0-0013", 696 .codec = "ak4642-codec.0-0013",
707 .platform = "sh_fsi2", 697 .platform = "sh_fsi2",
708 .codec_dai = "ak4642-hifi", 698 .daifmt = SND_SOC_DAIFMT_LEFT_J,
709 .init = &fsi2_ak4643_init_info, 699 .cpu_dai = {
700 .name = "fsia-dai",
701 .fmt = SND_SOC_DAIFMT_CBS_CFS,
702 },
703 .codec_dai = {
704 .name = "ak4642-hifi",
705 .fmt = SND_SOC_DAIFMT_CBM_CFM,
706 .sysclk = 11289600,
707 },
710}; 708};
711 709
712static struct platform_device fsi_ak4643_device = { 710static struct platform_device fsi_ak4643_device = {
@@ -815,18 +813,18 @@ static struct platform_device lcdc1_device = {
815 }, 813 },
816}; 814};
817 815
818static struct asoc_simple_dai_init_info fsi2_hdmi_init_info = {
819 .cpu_daifmt = SND_SOC_DAIFMT_CBM_CFM,
820};
821
822static struct asoc_simple_card_info fsi2_hdmi_info = { 816static struct asoc_simple_card_info fsi2_hdmi_info = {
823 .name = "HDMI", 817 .name = "HDMI",
824 .card = "FSI2B-HDMI", 818 .card = "FSI2B-HDMI",
825 .cpu_dai = "fsib-dai",
826 .codec = "sh-mobile-hdmi", 819 .codec = "sh-mobile-hdmi",
827 .platform = "sh_fsi2", 820 .platform = "sh_fsi2",
828 .codec_dai = "sh_mobile_hdmi-hifi", 821 .cpu_dai = {
829 .init = &fsi2_hdmi_init_info, 822 .name = "fsib-dai",
823 .fmt = SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_IB_NF,
824 },
825 .codec_dai = {
826 .name = "sh_mobile_hdmi-hifi",
827 },
830}; 828};
831 829
832static struct platform_device fsi_hdmi_device = { 830static struct platform_device fsi_hdmi_device = {
@@ -1042,9 +1040,7 @@ static int ts_get_pendown_state(void)
1042 1040
1043 gpio_free(GPIO_TSC_IRQ); 1041 gpio_free(GPIO_TSC_IRQ);
1044 1042
1045 gpio_request(GPIO_TSC_PORT, NULL); 1043 gpio_request_one(GPIO_TSC_PORT, GPIOF_IN, NULL);
1046
1047 gpio_direction_input(GPIO_TSC_PORT);
1048 1044
1049 val = gpio_get_value(GPIO_TSC_PORT); 1045 val = gpio_get_value(GPIO_TSC_PORT);
1050 1046
@@ -1125,18 +1121,10 @@ static void __init ap4evb_init(void)
1125 gpio_request(GPIO_FN_IRQ6_39, NULL); 1121 gpio_request(GPIO_FN_IRQ6_39, NULL);
1126 1122
1127 /* enable Debug switch (S6) */ 1123 /* enable Debug switch (S6) */
1128 gpio_request(GPIO_PORT32, NULL); 1124 gpio_request_one(GPIO_PORT32, GPIOF_IN | GPIOF_EXPORT, NULL);
1129 gpio_request(GPIO_PORT33, NULL); 1125 gpio_request_one(GPIO_PORT33, GPIOF_IN | GPIOF_EXPORT, NULL);
1130 gpio_request(GPIO_PORT34, NULL); 1126 gpio_request_one(GPIO_PORT34, GPIOF_IN | GPIOF_EXPORT, NULL);
1131 gpio_request(GPIO_PORT35, NULL); 1127 gpio_request_one(GPIO_PORT35, GPIOF_IN | GPIOF_EXPORT, NULL);
1132 gpio_direction_input(GPIO_PORT32);
1133 gpio_direction_input(GPIO_PORT33);
1134 gpio_direction_input(GPIO_PORT34);
1135 gpio_direction_input(GPIO_PORT35);
1136 gpio_export(GPIO_PORT32, 0);
1137 gpio_export(GPIO_PORT33, 0);
1138 gpio_export(GPIO_PORT34, 0);
1139 gpio_export(GPIO_PORT35, 0);
1140 1128
1141 /* SDHI0 */ 1129 /* SDHI0 */
1142 gpio_request(GPIO_FN_SDHICD0, NULL); 1130 gpio_request(GPIO_FN_SDHICD0, NULL);
@@ -1184,8 +1172,7 @@ static void __init ap4evb_init(void)
1184 gpio_request(GPIO_FN_FSIAILR, NULL); 1172 gpio_request(GPIO_FN_FSIAILR, NULL);
1185 gpio_request(GPIO_FN_FSIAISLD, NULL); 1173 gpio_request(GPIO_FN_FSIAISLD, NULL);
1186 gpio_request(GPIO_FN_FSIAOSLD, NULL); 1174 gpio_request(GPIO_FN_FSIAOSLD, NULL);
1187 gpio_request(GPIO_PORT161, NULL); 1175 gpio_request_one(GPIO_PORT161, GPIOF_OUT_INIT_LOW, NULL); /* slave */
1188 gpio_direction_output(GPIO_PORT161, 0); /* slave */
1189 1176
1190 gpio_request(GPIO_PORT9, NULL); 1177 gpio_request(GPIO_PORT9, NULL);
1191 gpio_request(GPIO_PORT10, NULL); 1178 gpio_request(GPIO_PORT10, NULL);
@@ -1193,8 +1180,7 @@ static void __init ap4evb_init(void)
1193 gpio_direction_none(GPIO_PORT10CR); /* FSIAOLR needs no direction */ 1180 gpio_direction_none(GPIO_PORT10CR); /* FSIAOLR needs no direction */
1194 1181
1195 /* card detect pin for MMC slot (CN7) */ 1182 /* card detect pin for MMC slot (CN7) */
1196 gpio_request(GPIO_PORT41, NULL); 1183 gpio_request_one(GPIO_PORT41, GPIOF_IN, NULL);
1197 gpio_direction_input(GPIO_PORT41);
1198 1184
1199 /* setup FSI2 port B (HDMI) */ 1185 /* setup FSI2 port B (HDMI) */
1200 gpio_request(GPIO_FN_FSIBCK, NULL); 1186 gpio_request(GPIO_FN_FSIBCK, NULL);
@@ -1282,11 +1268,8 @@ static void __init ap4evb_init(void)
1282 gpio_request(GPIO_FN_LCDDISP, NULL); 1268 gpio_request(GPIO_FN_LCDDISP, NULL);
1283 gpio_request(GPIO_FN_LCDDCK, NULL); 1269 gpio_request(GPIO_FN_LCDDCK, NULL);
1284 1270
1285 gpio_request(GPIO_PORT189, NULL); /* backlight */ 1271 gpio_request_one(GPIO_PORT189, GPIOF_OUT_INIT_HIGH, NULL); /* backlight */
1286 gpio_direction_output(GPIO_PORT189, 1); 1272 gpio_request_one(GPIO_PORT151, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */
1287
1288 gpio_request(GPIO_PORT151, NULL); /* LCDDON */
1289 gpio_direction_output(GPIO_PORT151, 1);
1290 1273
1291 lcdc_info.clock_source = LCDC_CLK_BUS; 1274 lcdc_info.clock_source = LCDC_CLK_BUS;
1292 lcdc_info.ch[0].interface_type = RGB18; 1275 lcdc_info.ch[0].interface_type = RGB18;
@@ -1350,5 +1333,5 @@ MACHINE_START(AP4EVB, "ap4evb")
1350 .handle_irq = shmobile_handle_irq_intc, 1333 .handle_irq = shmobile_handle_irq_intc,
1351 .init_machine = ap4evb_init, 1334 .init_machine = ap4evb_init,
1352 .init_late = sh7372_pm_init_late, 1335 .init_late = sh7372_pm_init_late,
1353 .timer = &shmobile_timer, 1336 .init_time = sh7372_earlytimer_init,
1354MACHINE_END 1337MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 5353adf6b828..f2ec0777cfbe 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -124,6 +124,14 @@
124 * this command is required when playback. 124 * this command is required when playback.
125 * 125 *
126 * # amixer set "Headphone" 50 126 * # amixer set "Headphone" 50
127 *
128 * this command is required when capture.
129 *
130 * # amixer set "Input PGA" 15
131 * # amixer set "Left Input Mixer MicP" on
132 * # amixer set "Left Input Mixer MicN" on
133 * # amixer set "Right Input Mixer MicN" on
134 * # amixer set "Right Input Mixer MicP" on
127 */ 135 */
128 136
129/* 137/*
@@ -700,9 +708,9 @@ static int mt9t111_power(struct device *dev, int mode)
700 /* video1 (= CON1 camera) expect 24MHz */ 708 /* video1 (= CON1 camera) expect 24MHz */
701 clk_set_rate(mclk, clk_round_rate(mclk, 24000000)); 709 clk_set_rate(mclk, clk_round_rate(mclk, 24000000));
702 clk_enable(mclk); 710 clk_enable(mclk);
703 gpio_direction_output(GPIO_PORT158, 1); 711 gpio_set_value(GPIO_PORT158, 1);
704 } else { 712 } else {
705 gpio_direction_output(GPIO_PORT158, 0); 713 gpio_set_value(GPIO_PORT158, 0);
706 clk_disable(mclk); 714 clk_disable(mclk);
707 } 715 }
708 716
@@ -806,21 +814,21 @@ static struct platform_device fsi_device = {
806}; 814};
807 815
808/* FSI-WM8978 */ 816/* FSI-WM8978 */
809static struct asoc_simple_dai_init_info fsi_wm8978_init_info = {
810 .fmt = SND_SOC_DAIFMT_I2S,
811 .codec_daifmt = SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_NB_NF,
812 .cpu_daifmt = SND_SOC_DAIFMT_CBS_CFS,
813 .sysclk = 12288000,
814};
815
816static struct asoc_simple_card_info fsi_wm8978_info = { 817static struct asoc_simple_card_info fsi_wm8978_info = {
817 .name = "wm8978", 818 .name = "wm8978",
818 .card = "FSI2A-WM8978", 819 .card = "FSI2A-WM8978",
819 .cpu_dai = "fsia-dai",
820 .codec = "wm8978.0-001a", 820 .codec = "wm8978.0-001a",
821 .platform = "sh_fsi2", 821 .platform = "sh_fsi2",
822 .codec_dai = "wm8978-hifi", 822 .daifmt = SND_SOC_DAIFMT_I2S,
823 .init = &fsi_wm8978_init_info, 823 .cpu_dai = {
824 .name = "fsia-dai",
825 .fmt = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_IB_NF,
826 },
827 .codec_dai = {
828 .name = "wm8978-hifi",
829 .fmt = SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_NB_NF,
830 .sysclk = 12288000,
831 },
824}; 832};
825 833
826static struct platform_device fsi_wm8978_device = { 834static struct platform_device fsi_wm8978_device = {
@@ -832,18 +840,18 @@ static struct platform_device fsi_wm8978_device = {
832}; 840};
833 841
834/* FSI-HDMI */ 842/* FSI-HDMI */
835static struct asoc_simple_dai_init_info fsi2_hdmi_init_info = {
836 .cpu_daifmt = SND_SOC_DAIFMT_CBM_CFM,
837};
838
839static struct asoc_simple_card_info fsi2_hdmi_info = { 843static struct asoc_simple_card_info fsi2_hdmi_info = {
840 .name = "HDMI", 844 .name = "HDMI",
841 .card = "FSI2B-HDMI", 845 .card = "FSI2B-HDMI",
842 .cpu_dai = "fsib-dai",
843 .codec = "sh-mobile-hdmi", 846 .codec = "sh-mobile-hdmi",
844 .platform = "sh_fsi2", 847 .platform = "sh_fsi2",
845 .codec_dai = "sh_mobile_hdmi-hifi", 848 .cpu_dai = {
846 .init = &fsi2_hdmi_init_info, 849 .name = "fsib-dai",
850 .fmt = SND_SOC_DAIFMT_CBM_CFM,
851 },
852 .codec_dai = {
853 .name = "sh_mobile_hdmi-hifi",
854 },
847}; 855};
848 856
849static struct platform_device fsi_hdmi_device = { 857static struct platform_device fsi_hdmi_device = {
@@ -992,16 +1000,12 @@ static void __init eva_init(void)
992 gpio_request(GPIO_FN_LCD0_DISP, NULL); 1000 gpio_request(GPIO_FN_LCD0_DISP, NULL);
993 gpio_request(GPIO_FN_LCD0_LCLK_PORT165, NULL); 1001 gpio_request(GPIO_FN_LCD0_LCLK_PORT165, NULL);
994 1002
995 gpio_request(GPIO_PORT61, NULL); /* LCDDON */ 1003 gpio_request_one(GPIO_PORT61, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */
996 gpio_direction_output(GPIO_PORT61, 1); 1004 gpio_request_one(GPIO_PORT202, GPIOF_OUT_INIT_LOW, NULL); /* LCD0_LED_CONT */
997
998 gpio_request(GPIO_PORT202, NULL); /* LCD0_LED_CONT */
999 gpio_direction_output(GPIO_PORT202, 0);
1000 1005
1001 /* Touchscreen */ 1006 /* Touchscreen */
1002 gpio_request(GPIO_FN_IRQ10, NULL); /* TP_INT */ 1007 gpio_request(GPIO_FN_IRQ10, NULL); /* TP_INT */
1003 gpio_request(GPIO_PORT166, NULL); /* TP_RST_B */ 1008 gpio_request_one(GPIO_PORT166, GPIOF_OUT_INIT_HIGH, NULL); /* TP_RST_B */
1004 gpio_direction_output(GPIO_PORT166, 1);
1005 1009
1006 /* GETHER */ 1010 /* GETHER */
1007 gpio_request(GPIO_FN_ET_CRS, NULL); 1011 gpio_request(GPIO_FN_ET_CRS, NULL);
@@ -1024,12 +1028,10 @@ static void __init eva_init(void)
1024 gpio_request(GPIO_FN_ET_RX_DV, NULL); 1028 gpio_request(GPIO_FN_ET_RX_DV, NULL);
1025 gpio_request(GPIO_FN_ET_RX_CLK, NULL); 1029 gpio_request(GPIO_FN_ET_RX_CLK, NULL);
1026 1030
1027 gpio_request(GPIO_PORT18, NULL); /* PHY_RST */ 1031 gpio_request_one(GPIO_PORT18, GPIOF_OUT_INIT_HIGH, NULL); /* PHY_RST */
1028 gpio_direction_output(GPIO_PORT18, 1);
1029 1032
1030 /* USB */ 1033 /* USB */
1031 gpio_request(GPIO_PORT159, NULL); /* USB_DEVICE_MODE */ 1034 gpio_request_one(GPIO_PORT159, GPIOF_IN, NULL); /* USB_DEVICE_MODE */
1032 gpio_direction_input(GPIO_PORT159);
1033 1035
1034 if (gpio_get_value(GPIO_PORT159)) { 1036 if (gpio_get_value(GPIO_PORT159)) {
1035 /* USB Host */ 1037 /* USB Host */
@@ -1043,8 +1045,7 @@ static void __init eva_init(void)
1043 * and select GPIO_PORT209 here 1045 * and select GPIO_PORT209 here
1044 */ 1046 */
1045 gpio_request(GPIO_FN_IRQ7_PORT209, NULL); 1047 gpio_request(GPIO_FN_IRQ7_PORT209, NULL);
1046 gpio_request(GPIO_PORT209, NULL); 1048 gpio_request_one(GPIO_PORT209, GPIOF_IN, NULL);
1047 gpio_direction_input(GPIO_PORT209);
1048 1049
1049 platform_device_register(&usbhsf_device); 1050 platform_device_register(&usbhsf_device);
1050 usb = &usbhsf_device; 1051 usb = &usbhsf_device;
@@ -1059,12 +1060,9 @@ static void __init eva_init(void)
1059 gpio_request(GPIO_FN_SDHI0_D3, NULL); 1060 gpio_request(GPIO_FN_SDHI0_D3, NULL);
1060 gpio_request(GPIO_FN_SDHI0_WP, NULL); 1061 gpio_request(GPIO_FN_SDHI0_WP, NULL);
1061 1062
1062 gpio_request(GPIO_PORT17, NULL); /* SDHI0_18/33_B */ 1063 gpio_request_one(GPIO_PORT17, GPIOF_OUT_INIT_LOW, NULL); /* SDHI0_18/33_B */
1063 gpio_request(GPIO_PORT74, NULL); /* SDHI0_PON */ 1064 gpio_request_one(GPIO_PORT74, GPIOF_OUT_INIT_HIGH, NULL); /* SDHI0_PON */
1064 gpio_request(GPIO_PORT75, NULL); /* SDSLOT1_PON */ 1065 gpio_request_one(GPIO_PORT75, GPIOF_OUT_INIT_HIGH, NULL); /* SDSLOT1_PON */
1065 gpio_direction_output(GPIO_PORT17, 0);
1066 gpio_direction_output(GPIO_PORT74, 1);
1067 gpio_direction_output(GPIO_PORT75, 1);
1068 1066
1069 /* we can use GPIO_FN_IRQ31_PORT167 here for SDHI0 CD irq */ 1067 /* we can use GPIO_FN_IRQ31_PORT167 here for SDHI0 CD irq */
1070 1068
@@ -1101,12 +1099,10 @@ static void __init eva_init(void)
1101 gpio_request(GPIO_FN_VIO_CKO, NULL); 1099 gpio_request(GPIO_FN_VIO_CKO, NULL);
1102 1100
1103 /* CON1/CON15 Camera */ 1101 /* CON1/CON15 Camera */
1104 gpio_request(GPIO_PORT173, NULL); /* STANDBY */ 1102 gpio_request_one(GPIO_PORT173, GPIOF_OUT_INIT_LOW, NULL); /* STANDBY */
1105 gpio_request(GPIO_PORT172, NULL); /* RST */ 1103 gpio_request_one(GPIO_PORT172, GPIOF_OUT_INIT_HIGH, NULL); /* RST */
1106 gpio_request(GPIO_PORT158, NULL); /* CAM_PON */ 1104 /* see mt9t111_power() */
1107 gpio_direction_output(GPIO_PORT173, 0); 1105 gpio_request_one(GPIO_PORT158, GPIOF_OUT_INIT_LOW, NULL); /* CAM_PON */
1108 gpio_direction_output(GPIO_PORT172, 1);
1109 gpio_direction_output(GPIO_PORT158, 0); /* see mt9t111_power() */
1110 1106
1111 /* FSI-WM8978 */ 1107 /* FSI-WM8978 */
1112 gpio_request(GPIO_FN_FSIAIBT, NULL); 1108 gpio_request(GPIO_FN_FSIAIBT, NULL);
@@ -1133,15 +1129,13 @@ static void __init eva_init(void)
1133 * DBGMD/LCDC0/FSIA MUX 1129 * DBGMD/LCDC0/FSIA MUX
1134 * DBGMD_SELECT_B should be set after setting PFC Function. 1130 * DBGMD_SELECT_B should be set after setting PFC Function.
1135 */ 1131 */
1136 gpio_request(GPIO_PORT176, NULL); 1132 gpio_request_one(GPIO_PORT176, GPIOF_OUT_INIT_HIGH, NULL);
1137 gpio_direction_output(GPIO_PORT176, 1);
1138 1133
1139 /* 1134 /*
1140 * We can switch CON8/CON14 by SW1.5, 1135 * We can switch CON8/CON14 by SW1.5,
1141 * but it needs after DBGMD_SELECT_B 1136 * but it needs after DBGMD_SELECT_B
1142 */ 1137 */
1143 gpio_request(GPIO_PORT6, NULL); 1138 gpio_request_one(GPIO_PORT6, GPIOF_IN, NULL);
1144 gpio_direction_input(GPIO_PORT6);
1145 if (gpio_get_value(GPIO_PORT6)) { 1139 if (gpio_get_value(GPIO_PORT6)) {
1146 /* CON14 enable */ 1140 /* CON14 enable */
1147 } else { 1141 } else {
@@ -1155,8 +1149,8 @@ static void __init eva_init(void)
1155 gpio_request(GPIO_FN_SDHI1_CD, NULL); 1149 gpio_request(GPIO_FN_SDHI1_CD, NULL);
1156 gpio_request(GPIO_FN_SDHI1_WP, NULL); 1150 gpio_request(GPIO_FN_SDHI1_WP, NULL);
1157 1151
1158 gpio_request(GPIO_PORT16, NULL); /* SDSLOT2_PON */ 1152 /* SDSLOT2_PON */
1159 gpio_direction_output(GPIO_PORT16, 1); 1153 gpio_request_one(GPIO_PORT16, GPIOF_OUT_INIT_HIGH, NULL);
1160 1154
1161 platform_device_register(&sdhi1_device); 1155 platform_device_register(&sdhi1_device);
1162 } 1156 }
@@ -1175,26 +1169,26 @@ static void __init eva_init(void)
1175 platform_add_devices(eva_devices, 1169 platform_add_devices(eva_devices,
1176 ARRAY_SIZE(eva_devices)); 1170 ARRAY_SIZE(eva_devices));
1177 1171
1178 eva_clock_init();
1179
1180 rmobile_add_device_to_domain("A4LC", &lcdc0_device); 1172 rmobile_add_device_to_domain("A4LC", &lcdc0_device);
1181 rmobile_add_device_to_domain("A4LC", &hdmi_lcdc_device); 1173 rmobile_add_device_to_domain("A4LC", &hdmi_lcdc_device);
1182 if (usb) 1174 if (usb)
1183 rmobile_add_device_to_domain("A3SP", usb); 1175 rmobile_add_device_to_domain("A3SP", usb);
1176
1177 r8a7740_pm_init();
1184} 1178}
1185 1179
1186static void __init eva_earlytimer_init(void) 1180static void __init eva_earlytimer_init(void)
1187{ 1181{
1188 r8a7740_clock_init(MD_CK0 | MD_CK2); 1182 r8a7740_clock_init(MD_CK0 | MD_CK2);
1189 shmobile_earlytimer_init(); 1183 shmobile_earlytimer_init();
1184
1185 /* the rate of extal1 clock must be set before late_time_init */
1186 eva_clock_init();
1190} 1187}
1191 1188
1192static void __init eva_add_early_devices(void) 1189static void __init eva_add_early_devices(void)
1193{ 1190{
1194 r8a7740_add_early_devices(); 1191 r8a7740_add_early_devices();
1195
1196 /* override timer setup with board-specific code */
1197 shmobile_timer.init = eva_earlytimer_init;
1198} 1192}
1199 1193
1200#define RESCNT2 IOMEM(0xe6188020) 1194#define RESCNT2 IOMEM(0xe6188020)
@@ -1216,7 +1210,7 @@ DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva")
1216 .handle_irq = shmobile_handle_irq_intc, 1210 .handle_irq = shmobile_handle_irq_intc,
1217 .init_machine = eva_init, 1211 .init_machine = eva_init,
1218 .init_late = shmobile_init_late, 1212 .init_late = shmobile_init_late,
1219 .timer = &shmobile_timer, 1213 .init_time = eva_earlytimer_init,
1220 .dt_compat = eva_boards_compat_dt, 1214 .dt_compat = eva_boards_compat_dt,
1221 .restart = eva_restart, 1215 .restart = eva_restart,
1222MACHINE_END 1216MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-bonito.c b/arch/arm/mach-shmobile/board-bonito.c
index cb8c994e1430..e50f86691539 100644
--- a/arch/arm/mach-shmobile/board-bonito.c
+++ b/arch/arm/mach-shmobile/board-bonito.c
@@ -392,8 +392,7 @@ static void __init bonito_init(void)
392 /* 392 /*
393 * base board settings 393 * base board settings
394 */ 394 */
395 gpio_request(GPIO_PORT176, NULL); 395 gpio_request_one(GPIO_PORT176, GPIOF_IN, NULL);
396 gpio_direction_input(GPIO_PORT176);
397 if (!gpio_get_value(GPIO_PORT176)) { 396 if (!gpio_get_value(GPIO_PORT176)) {
398 u16 bsw2; 397 u16 bsw2;
399 u16 bsw3; 398 u16 bsw3;
@@ -462,8 +461,8 @@ static void __init bonito_init(void)
462 gpio_request(GPIO_FN_LCD0_DISP, NULL); 461 gpio_request(GPIO_FN_LCD0_DISP, NULL);
463 gpio_request(GPIO_FN_LCD0_LCLK_PORT165, NULL); 462 gpio_request(GPIO_FN_LCD0_LCLK_PORT165, NULL);
464 463
465 gpio_request(GPIO_PORT61, NULL); /* LCDDON */ 464 gpio_request_one(GPIO_PORT61, GPIOF_OUT_INIT_HIGH,
466 gpio_direction_output(GPIO_PORT61, 1); 465 NULL); /* LCDDON */
467 466
468 /* backlight on */ 467 /* backlight on */
469 bonito_fpga_write(LCDCR, 1); 468 bonito_fpga_write(LCDCR, 1);
@@ -499,9 +498,6 @@ static void __init bonito_earlytimer_init(void)
499static void __init bonito_add_early_devices(void) 498static void __init bonito_add_early_devices(void)
500{ 499{
501 r8a7740_add_early_devices(); 500 r8a7740_add_early_devices();
502
503 /* override timer setup with board-specific code */
504 shmobile_timer.init = bonito_earlytimer_init;
505} 501}
506 502
507MACHINE_START(BONITO, "bonito") 503MACHINE_START(BONITO, "bonito")
@@ -511,5 +507,5 @@ MACHINE_START(BONITO, "bonito")
511 .handle_irq = shmobile_handle_irq_intc, 507 .handle_irq = shmobile_handle_irq_intc,
512 .init_machine = bonito_init, 508 .init_machine = bonito_init,
513 .init_late = shmobile_init_late, 509 .init_late = shmobile_init_late,
514 .timer = &shmobile_timer, 510 .init_time = bonito_earlytimer_init,
515MACHINE_END 511MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-kota2.c b/arch/arm/mach-shmobile/board-kota2.c
index bf88f9a8b7ac..2ccc860403ef 100644
--- a/arch/arm/mach-shmobile/board-kota2.c
+++ b/arch/arm/mach-shmobile/board-kota2.c
@@ -35,6 +35,7 @@
35#include <linux/input/sh_keysc.h> 35#include <linux/input/sh_keysc.h>
36#include <linux/gpio_keys.h> 36#include <linux/gpio_keys.h>
37#include <linux/leds.h> 37#include <linux/leds.h>
38#include <linux/irqchip/arm-gic.h>
38#include <linux/platform_data/leds-renesas-tpu.h> 39#include <linux/platform_data/leds-renesas-tpu.h>
39#include <linux/mmc/host.h> 40#include <linux/mmc/host.h>
40#include <linux/mmc/sh_mmcif.h> 41#include <linux/mmc/sh_mmcif.h>
@@ -47,7 +48,6 @@
47#include <asm/mach-types.h> 48#include <asm/mach-types.h>
48#include <asm/mach/arch.h> 49#include <asm/mach/arch.h>
49#include <asm/mach/time.h> 50#include <asm/mach/time.h>
50#include <asm/hardware/gic.h>
51#include <asm/hardware/cache-l2x0.h> 51#include <asm/hardware/cache-l2x0.h>
52#include <asm/traps.h> 52#include <asm/traps.h>
53 53
@@ -474,10 +474,8 @@ static void __init kota2_init(void)
474 gpio_request(GPIO_FN_D15_NAF15, NULL); 474 gpio_request(GPIO_FN_D15_NAF15, NULL);
475 gpio_request(GPIO_FN_CS5A_, NULL); 475 gpio_request(GPIO_FN_CS5A_, NULL);
476 gpio_request(GPIO_FN_WE0__FWE, NULL); 476 gpio_request(GPIO_FN_WE0__FWE, NULL);
477 gpio_request(GPIO_PORT144, NULL); /* PINTA2 */ 477 gpio_request_one(GPIO_PORT144, GPIOF_IN, NULL); /* PINTA2 */
478 gpio_direction_input(GPIO_PORT144); 478 gpio_request_one(GPIO_PORT145, GPIOF_OUT_INIT_HIGH, NULL); /* RESET */
479 gpio_request(GPIO_PORT145, NULL); /* RESET */
480 gpio_direction_output(GPIO_PORT145, 1);
481 479
482 /* KEYSC */ 480 /* KEYSC */
483 gpio_request(GPIO_FN_KEYIN0_PU, NULL); 481 gpio_request(GPIO_FN_KEYIN0_PU, NULL);
@@ -509,8 +507,7 @@ static void __init kota2_init(void)
509 gpio_request(GPIO_FN_MMCD0_6, NULL); 507 gpio_request(GPIO_FN_MMCD0_6, NULL);
510 gpio_request(GPIO_FN_MMCD0_7, NULL); 508 gpio_request(GPIO_FN_MMCD0_7, NULL);
511 gpio_request(GPIO_FN_MMCCMD0, NULL); 509 gpio_request(GPIO_FN_MMCCMD0, NULL);
512 gpio_request(GPIO_PORT208, NULL); /* Reset */ 510 gpio_request_one(GPIO_PORT208, GPIOF_OUT_INIT_HIGH, NULL); /* Reset */
513 gpio_direction_output(GPIO_PORT208, 1);
514 511
515 /* SDHI0 (microSD) */ 512 /* SDHI0 (microSD) */
516 gpio_request(GPIO_FN_SDHICD0_PU, NULL); 513 gpio_request(GPIO_FN_SDHICD0_PU, NULL);
@@ -550,8 +547,7 @@ MACHINE_START(KOTA2, "kota2")
550 .init_early = sh73a0_add_early_devices, 547 .init_early = sh73a0_add_early_devices,
551 .nr_irqs = NR_IRQS_LEGACY, 548 .nr_irqs = NR_IRQS_LEGACY,
552 .init_irq = sh73a0_init_irq, 549 .init_irq = sh73a0_init_irq,
553 .handle_irq = gic_handle_irq,
554 .init_machine = kota2_init, 550 .init_machine = kota2_init,
555 .init_late = shmobile_init_late, 551 .init_late = shmobile_init_late,
556 .timer = &shmobile_timer, 552 .init_time = sh73a0_earlytimer_init,
557MACHINE_END 553MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-kzm9d.c b/arch/arm/mach-shmobile/board-kzm9d.c
index b52bc0d1273f..c254782aa727 100644
--- a/arch/arm/mach-shmobile/board-kzm9d.c
+++ b/arch/arm/mach-shmobile/board-kzm9d.c
@@ -28,7 +28,6 @@
28#include <mach/emev2.h> 28#include <mach/emev2.h>
29#include <asm/mach-types.h> 29#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31#include <asm/hardware/gic.h>
32 31
33/* Dummy supplies, where voltage doesn't matter */ 32/* Dummy supplies, where voltage doesn't matter */
34static struct regulator_consumer_supply dummy_supplies[] = { 33static struct regulator_consumer_supply dummy_supplies[] = {
@@ -89,9 +88,8 @@ DT_MACHINE_START(KZM9D_DT, "kzm9d")
89 .init_early = emev2_add_early_devices, 88 .init_early = emev2_add_early_devices,
90 .nr_irqs = NR_IRQS_LEGACY, 89 .nr_irqs = NR_IRQS_LEGACY,
91 .init_irq = emev2_init_irq, 90 .init_irq = emev2_init_irq,
92 .handle_irq = gic_handle_irq,
93 .init_machine = kzm9d_add_standard_devices, 91 .init_machine = kzm9d_add_standard_devices,
94 .init_late = shmobile_init_late, 92 .init_late = shmobile_init_late,
95 .timer = &shmobile_timer, 93 .init_time = shmobile_timer_init,
96 .dt_compat = kzm9d_boards_compat_dt, 94 .dt_compat = kzm9d_boards_compat_dt,
97MACHINE_END 95MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index c02448d6847f..7f3a6b7e7b7c 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -25,6 +25,7 @@
25#include <linux/i2c.h> 25#include <linux/i2c.h>
26#include <linux/i2c/pcf857x.h> 26#include <linux/i2c/pcf857x.h>
27#include <linux/input.h> 27#include <linux/input.h>
28#include <linux/irqchip/arm-gic.h>
28#include <linux/mmc/host.h> 29#include <linux/mmc/host.h>
29#include <linux/mmc/sh_mmcif.h> 30#include <linux/mmc/sh_mmcif.h>
30#include <linux/mmc/sh_mobile_sdhi.h> 31#include <linux/mmc/sh_mobile_sdhi.h>
@@ -42,7 +43,6 @@
42#include <mach/sh73a0.h> 43#include <mach/sh73a0.h>
43#include <mach/common.h> 44#include <mach/common.h>
44#include <asm/hardware/cache-l2x0.h> 45#include <asm/hardware/cache-l2x0.h>
45#include <asm/hardware/gic.h>
46#include <asm/mach-types.h> 46#include <asm/mach-types.h>
47#include <asm/mach/arch.h> 47#include <asm/mach/arch.h>
48#include <video/sh_mobile_lcdc.h> 48#include <video/sh_mobile_lcdc.h>
@@ -525,21 +525,21 @@ static struct platform_device fsi_device = {
525 }, 525 },
526}; 526};
527 527
528static struct asoc_simple_dai_init_info fsi2_ak4648_init_info = {
529 .fmt = SND_SOC_DAIFMT_LEFT_J,
530 .codec_daifmt = SND_SOC_DAIFMT_CBM_CFM,
531 .cpu_daifmt = SND_SOC_DAIFMT_CBS_CFS,
532 .sysclk = 11289600,
533};
534
535static struct asoc_simple_card_info fsi2_ak4648_info = { 528static struct asoc_simple_card_info fsi2_ak4648_info = {
536 .name = "AK4648", 529 .name = "AK4648",
537 .card = "FSI2A-AK4648", 530 .card = "FSI2A-AK4648",
538 .cpu_dai = "fsia-dai",
539 .codec = "ak4642-codec.0-0012", 531 .codec = "ak4642-codec.0-0012",
540 .platform = "sh_fsi2", 532 .platform = "sh_fsi2",
541 .codec_dai = "ak4642-hifi", 533 .daifmt = SND_SOC_DAIFMT_LEFT_J,
542 .init = &fsi2_ak4648_init_info, 534 .cpu_dai = {
535 .name = "fsia-dai",
536 .fmt = SND_SOC_DAIFMT_CBS_CFS,
537 },
538 .codec_dai = {
539 .name = "ak4642-hifi",
540 .fmt = SND_SOC_DAIFMT_CBM_CFM,
541 .sysclk = 11289600,
542 },
543}; 543};
544 544
545static struct platform_device fsi_ak4648_device = { 545static struct platform_device fsi_ak4648_device = {
@@ -623,7 +623,7 @@ static int __init as3711_enable_lcdc_backlight(void)
623 0x45, 0xf0, 623 0x45, 0xf0,
624 }; 624 };
625 625
626 if (!machine_is_kzm9g()) 626 if (!of_machine_is_compatible("renesas,kzm9g"))
627 return 0; 627 return 0;
628 628
629 if (!a) 629 if (!a)
@@ -672,8 +672,7 @@ static void __init kzm_init(void)
672 gpio_request(GPIO_FN_CS4_, NULL); /* CS4 */ 672 gpio_request(GPIO_FN_CS4_, NULL); /* CS4 */
673 673
674 /* SMSC */ 674 /* SMSC */
675 gpio_request(GPIO_PORT224, NULL); /* IRQ3 */ 675 gpio_request_one(GPIO_PORT224, GPIOF_IN, NULL); /* IRQ3 */
676 gpio_direction_input(GPIO_PORT224);
677 676
678 /* LCDC */ 677 /* LCDC */
679 gpio_request(GPIO_FN_LCDD23, NULL); 678 gpio_request(GPIO_FN_LCDD23, NULL);
@@ -703,14 +702,11 @@ static void __init kzm_init(void)
703 gpio_request(GPIO_FN_LCDDISP, NULL); 702 gpio_request(GPIO_FN_LCDDISP, NULL);
704 gpio_request(GPIO_FN_LCDDCK, NULL); 703 gpio_request(GPIO_FN_LCDDCK, NULL);
705 704
706 gpio_request(GPIO_PORT222, NULL); /* LCDCDON */ 705 gpio_request_one(GPIO_PORT222, GPIOF_OUT_INIT_HIGH, NULL); /* LCDCDON */
707 gpio_request(GPIO_PORT226, NULL); /* SC */ 706 gpio_request_one(GPIO_PORT226, GPIOF_OUT_INIT_HIGH, NULL); /* SC */
708 gpio_direction_output(GPIO_PORT222, 1);
709 gpio_direction_output(GPIO_PORT226, 1);
710 707
711 /* Touchscreen */ 708 /* Touchscreen */
712 gpio_request(GPIO_PORT223, NULL); /* IRQ8 */ 709 gpio_request_one(GPIO_PORT223, GPIOF_IN, NULL); /* IRQ8 */
713 gpio_direction_input(GPIO_PORT223);
714 710
715 /* enable MMCIF */ 711 /* enable MMCIF */
716 gpio_request(GPIO_FN_MMCCLK0, NULL); 712 gpio_request(GPIO_FN_MMCCLK0, NULL);
@@ -734,8 +730,7 @@ static void __init kzm_init(void)
734 gpio_request(GPIO_FN_SDHID0_1, NULL); 730 gpio_request(GPIO_FN_SDHID0_1, NULL);
735 gpio_request(GPIO_FN_SDHID0_0, NULL); 731 gpio_request(GPIO_FN_SDHID0_0, NULL);
736 gpio_request(GPIO_FN_SDHI0_VCCQ_MC0_ON, NULL); 732 gpio_request(GPIO_FN_SDHI0_VCCQ_MC0_ON, NULL);
737 gpio_request(GPIO_PORT15, NULL); 733 gpio_request_one(GPIO_PORT15, GPIOF_OUT_INIT_HIGH, NULL); /* power */
738 gpio_direction_output(GPIO_PORT15, 1); /* power */
739 734
740 /* enable Micro SD */ 735 /* enable Micro SD */
741 gpio_request(GPIO_FN_SDHID2_0, NULL); 736 gpio_request(GPIO_FN_SDHID2_0, NULL);
@@ -744,8 +739,7 @@ static void __init kzm_init(void)
744 gpio_request(GPIO_FN_SDHID2_3, NULL); 739 gpio_request(GPIO_FN_SDHID2_3, NULL);
745 gpio_request(GPIO_FN_SDHICMD2, NULL); 740 gpio_request(GPIO_FN_SDHICMD2, NULL);
746 gpio_request(GPIO_FN_SDHICLK2, NULL); 741 gpio_request(GPIO_FN_SDHICLK2, NULL);
747 gpio_request(GPIO_PORT14, NULL); 742 gpio_request_one(GPIO_PORT14, GPIOF_OUT_INIT_HIGH, NULL); /* power */
748 gpio_direction_output(GPIO_PORT14, 1); /* power */
749 743
750 /* I2C 3 */ 744 /* I2C 3 */
751 gpio_request(GPIO_FN_PORT27_I2C_SCL3, NULL); 745 gpio_request(GPIO_FN_PORT27_I2C_SCL3, NULL);
@@ -772,6 +766,8 @@ static void __init kzm_init(void)
772 766
773 sh73a0_add_standard_devices(); 767 sh73a0_add_standard_devices();
774 platform_add_devices(kzm_devices, ARRAY_SIZE(kzm_devices)); 768 platform_add_devices(kzm_devices, ARRAY_SIZE(kzm_devices));
769
770 sh73a0_pm_init();
775} 771}
776 772
777static void kzm9g_restart(char mode, const char *cmd) 773static void kzm9g_restart(char mode, const char *cmd)
@@ -792,10 +788,9 @@ DT_MACHINE_START(KZM9G_DT, "kzm9g")
792 .init_early = sh73a0_add_early_devices, 788 .init_early = sh73a0_add_early_devices,
793 .nr_irqs = NR_IRQS_LEGACY, 789 .nr_irqs = NR_IRQS_LEGACY,
794 .init_irq = sh73a0_init_irq, 790 .init_irq = sh73a0_init_irq,
795 .handle_irq = gic_handle_irq,
796 .init_machine = kzm_init, 791 .init_machine = kzm_init,
797 .init_late = shmobile_init_late, 792 .init_late = shmobile_init_late,
798 .timer = &shmobile_timer, 793 .init_time = sh73a0_earlytimer_init,
799 .restart = kzm9g_restart, 794 .restart = kzm9g_restart,
800 .dt_compat = kzm9g_boards_compat_dt, 795 .dt_compat = kzm9g_boards_compat_dt,
801MACHINE_END 796MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 2fed62f66045..db968a585ff0 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -202,9 +202,7 @@
202 * 202 *
203 * it needs amixer settings for playing 203 * it needs amixer settings for playing
204 * 204 *
205 * amixer set "Headphone" on 205 * amixer set "Headphone Enable" on
206 * amixer set "HPOUTL Mixer DACH" on
207 * amixer set "HPOUTR Mixer DACH" on
208 */ 206 */
209 207
210/* Fixed 3.3V and 1.8V regulators to be used by multiple devices */ 208/* Fixed 3.3V and 1.8V regulators to be used by multiple devices */
@@ -502,18 +500,18 @@ static struct platform_device hdmi_lcdc_device = {
502 }, 500 },
503}; 501};
504 502
505static struct asoc_simple_dai_init_info fsi2_hdmi_init_info = {
506 .cpu_daifmt = SND_SOC_DAIFMT_CBM_CFM,
507};
508
509static struct asoc_simple_card_info fsi2_hdmi_info = { 503static struct asoc_simple_card_info fsi2_hdmi_info = {
510 .name = "HDMI", 504 .name = "HDMI",
511 .card = "FSI2B-HDMI", 505 .card = "FSI2B-HDMI",
512 .cpu_dai = "fsib-dai",
513 .codec = "sh-mobile-hdmi", 506 .codec = "sh-mobile-hdmi",
514 .platform = "sh_fsi2", 507 .platform = "sh_fsi2",
515 .codec_dai = "sh_mobile_hdmi-hifi", 508 .cpu_dai = {
516 .init = &fsi2_hdmi_init_info, 509 .name = "fsib-dai",
510 .fmt = SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_IB_NF,
511 },
512 .codec_dai = {
513 .name = "sh_mobile_hdmi-hifi",
514 },
517}; 515};
518 516
519static struct platform_device fsi_hdmi_device = { 517static struct platform_device fsi_hdmi_device = {
@@ -858,16 +856,12 @@ static struct platform_device leds_device = {
858#define IRQ_FSI evt2irq(0x1840) 856#define IRQ_FSI evt2irq(0x1840)
859static struct sh_fsi_platform_info fsi_info = { 857static struct sh_fsi_platform_info fsi_info = {
860 .port_a = { 858 .port_a = {
861 .flags = SH_FSI_BRS_INV,
862 .tx_id = SHDMA_SLAVE_FSIA_TX, 859 .tx_id = SHDMA_SLAVE_FSIA_TX,
863 .rx_id = SHDMA_SLAVE_FSIA_RX, 860 .rx_id = SHDMA_SLAVE_FSIA_RX,
864 }, 861 },
865 .port_b = { 862 .port_b = {
866 .flags = SH_FSI_BRS_INV | 863 .flags = SH_FSI_CLK_CPG |
867 SH_FSI_BRM_INV | 864 SH_FSI_FMT_SPDIF,
868 SH_FSI_LRS_INV |
869 SH_FSI_CLK_CPG |
870 SH_FSI_FMT_SPDIF,
871 } 865 }
872}; 866};
873 867
@@ -896,21 +890,21 @@ static struct platform_device fsi_device = {
896 }, 890 },
897}; 891};
898 892
899static struct asoc_simple_dai_init_info fsi2_ak4643_init_info = {
900 .fmt = SND_SOC_DAIFMT_LEFT_J,
901 .codec_daifmt = SND_SOC_DAIFMT_CBM_CFM,
902 .cpu_daifmt = SND_SOC_DAIFMT_CBS_CFS,
903 .sysclk = 11289600,
904};
905
906static struct asoc_simple_card_info fsi2_ak4643_info = { 893static struct asoc_simple_card_info fsi2_ak4643_info = {
907 .name = "AK4643", 894 .name = "AK4643",
908 .card = "FSI2A-AK4643", 895 .card = "FSI2A-AK4643",
909 .cpu_dai = "fsia-dai",
910 .codec = "ak4642-codec.0-0013", 896 .codec = "ak4642-codec.0-0013",
911 .platform = "sh_fsi2", 897 .platform = "sh_fsi2",
912 .codec_dai = "ak4642-hifi", 898 .daifmt = SND_SOC_DAIFMT_LEFT_J,
913 .init = &fsi2_ak4643_init_info, 899 .cpu_dai = {
900 .name = "fsia-dai",
901 .fmt = SND_SOC_DAIFMT_CBS_CFS,
902 },
903 .codec_dai = {
904 .name = "ak4642-hifi",
905 .fmt = SND_SOC_DAIFMT_CBM_CFM,
906 .sysclk = 11289600,
907 },
914}; 908};
915 909
916static struct platform_device fsi_ak4643_device = { 910static struct platform_device fsi_ak4643_device = {
@@ -1408,11 +1402,10 @@ static void __init mackerel_init(void)
1408 gpio_request(GPIO_FN_LCDDISP, NULL); 1402 gpio_request(GPIO_FN_LCDDISP, NULL);
1409 gpio_request(GPIO_FN_LCDDCK, NULL); 1403 gpio_request(GPIO_FN_LCDDCK, NULL);
1410 1404
1411 gpio_request(GPIO_PORT31, NULL); /* backlight */ 1405 /* backlight, off by default */
1412 gpio_direction_output(GPIO_PORT31, 0); /* off by default */ 1406 gpio_request_one(GPIO_PORT31, GPIOF_OUT_INIT_LOW, NULL);
1413 1407
1414 gpio_request(GPIO_PORT151, NULL); /* LCDDON */ 1408 gpio_request_one(GPIO_PORT151, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */
1415 gpio_direction_output(GPIO_PORT151, 1);
1416 1409
1417 /* USBHS0 */ 1410 /* USBHS0 */
1418 gpio_request(GPIO_FN_VBUS0_0, NULL); 1411 gpio_request(GPIO_FN_VBUS0_0, NULL);
@@ -1428,8 +1421,7 @@ static void __init mackerel_init(void)
1428 gpio_request(GPIO_FN_FSIAILR, NULL); 1421 gpio_request(GPIO_FN_FSIAILR, NULL);
1429 gpio_request(GPIO_FN_FSIAISLD, NULL); 1422 gpio_request(GPIO_FN_FSIAISLD, NULL);
1430 gpio_request(GPIO_FN_FSIAOSLD, NULL); 1423 gpio_request(GPIO_FN_FSIAOSLD, NULL);
1431 gpio_request(GPIO_PORT161, NULL); 1424 gpio_request_one(GPIO_PORT161, GPIOF_OUT_INIT_LOW, NULL); /* slave */
1432 gpio_direction_output(GPIO_PORT161, 0); /* slave */
1433 1425
1434 gpio_request(GPIO_PORT9, NULL); 1426 gpio_request(GPIO_PORT9, NULL);
1435 gpio_request(GPIO_PORT10, NULL); 1427 gpio_request(GPIO_PORT10, NULL);
@@ -1483,8 +1475,7 @@ static void __init mackerel_init(void)
1483 gpio_request(GPIO_FN_SDHID1_0, NULL); 1475 gpio_request(GPIO_FN_SDHID1_0, NULL);
1484#endif 1476#endif
1485 /* card detect pin for MMC slot (CN7) */ 1477 /* card detect pin for MMC slot (CN7) */
1486 gpio_request(GPIO_PORT41, NULL); 1478 gpio_request_one(GPIO_PORT41, GPIOF_IN, NULL);
1487 gpio_direction_input(GPIO_PORT41);
1488 1479
1489 /* enable SDHI2 */ 1480 /* enable SDHI2 */
1490 gpio_request(GPIO_FN_SDHICMD2, NULL); 1481 gpio_request(GPIO_FN_SDHICMD2, NULL);
@@ -1495,8 +1486,7 @@ static void __init mackerel_init(void)
1495 gpio_request(GPIO_FN_SDHID2_0, NULL); 1486 gpio_request(GPIO_FN_SDHID2_0, NULL);
1496 1487
1497 /* card detect pin for microSD slot (CN23) */ 1488 /* card detect pin for microSD slot (CN23) */
1498 gpio_request(GPIO_PORT162, NULL); 1489 gpio_request_one(GPIO_PORT162, GPIOF_IN, NULL);
1499 gpio_direction_input(GPIO_PORT162);
1500 1490
1501 /* MMCIF */ 1491 /* MMCIF */
1502 gpio_request(GPIO_FN_MMCD0_0, NULL); 1492 gpio_request(GPIO_FN_MMCD0_0, NULL);
@@ -1593,6 +1583,6 @@ DT_MACHINE_START(MACKEREL_DT, "mackerel")
1593 .handle_irq = shmobile_handle_irq_intc, 1583 .handle_irq = shmobile_handle_irq_intc,
1594 .init_machine = mackerel_init, 1584 .init_machine = mackerel_init,
1595 .init_late = sh7372_pm_init_late, 1585 .init_late = sh7372_pm_init_late,
1596 .timer = &shmobile_timer, 1586 .init_time = sh7372_earlytimer_init,
1597 .dt_compat = mackerel_boards_compat_dt, 1587 .dt_compat = mackerel_boards_compat_dt,
1598MACHINE_END 1588MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index 449f9289567d..cdcb799e802f 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -44,7 +44,6 @@
44#include <mach/irqs.h> 44#include <mach/irqs.h>
45#include <asm/mach-types.h> 45#include <asm/mach-types.h>
46#include <asm/mach/arch.h> 46#include <asm/mach/arch.h>
47#include <asm/hardware/gic.h>
48#include <asm/traps.h> 47#include <asm/traps.h>
49 48
50/* Fixed 3.3V regulator to be used by SDHI0 */ 49/* Fixed 3.3V regulator to be used by SDHI0 */
@@ -382,8 +381,7 @@ MACHINE_START(MARZEN, "marzen")
382 .init_early = r8a7779_add_early_devices, 381 .init_early = r8a7779_add_early_devices,
383 .nr_irqs = NR_IRQS_LEGACY, 382 .nr_irqs = NR_IRQS_LEGACY,
384 .init_irq = r8a7779_init_irq, 383 .init_irq = r8a7779_init_irq,
385 .handle_irq = gic_handle_irq,
386 .init_machine = marzen_init, 384 .init_machine = marzen_init,
387 .init_late = marzen_init_late, 385 .init_late = marzen_init_late,
388 .timer = &shmobile_timer, 386 .init_time = r8a7779_earlytimer_init,
389MACHINE_END 387MACHINE_END
diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c
index eac49d59782f..19ce885a3b43 100644
--- a/arch/arm/mach-shmobile/clock-r8a7740.c
+++ b/arch/arm/mach-shmobile/clock-r8a7740.c
@@ -581,10 +581,14 @@ static struct clk_lookup lookups[] = {
581 581
582 /* MSTP32 clocks */ 582 /* MSTP32 clocks */
583 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), 583 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]),
584 CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP111]), 584 CLKDEV_DEV_ID("sh_tmu.3", &mstp_clks[MSTP111]),
585 CLKDEV_DEV_ID("sh_tmu.4", &mstp_clks[MSTP111]),
586 CLKDEV_DEV_ID("sh_tmu.5", &mstp_clks[MSTP111]),
585 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), 587 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]),
586 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.1", &mstp_clks[MSTP117]), 588 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.1", &mstp_clks[MSTP117]),
587 CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP125]), 589 CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP125]),
590 CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP125]),
591 CLKDEV_DEV_ID("sh_tmu.2", &mstp_clks[MSTP125]),
588 CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]), 592 CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]),
589 CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[MSTP128]), 593 CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[MSTP128]),
590 594
diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c
index c019609da660..1db36537255c 100644
--- a/arch/arm/mach-shmobile/clock-r8a7779.c
+++ b/arch/arm/mach-shmobile/clock-r8a7779.c
@@ -162,6 +162,7 @@ static struct clk_lookup lookups[] = {
162 CLKDEV_DEV_ID("ohci-platform.0", &mstp_clks[MSTP100]), /* USB OHCI port0/1 */ 162 CLKDEV_DEV_ID("ohci-platform.0", &mstp_clks[MSTP100]), /* USB OHCI port0/1 */
163 CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP016]), /* TMU00 */ 163 CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP016]), /* TMU00 */
164 CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP016]), /* TMU01 */ 164 CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP016]), /* TMU01 */
165 CLKDEV_DEV_ID("sh_tmu.2", &mstp_clks[MSTP016]), /* TMU02 */
165 CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP030]), /* I2C0 */ 166 CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP030]), /* I2C0 */
166 CLKDEV_DEV_ID("i2c-rcar.1", &mstp_clks[MSTP029]), /* I2C1 */ 167 CLKDEV_DEV_ID("i2c-rcar.1", &mstp_clks[MSTP029]), /* I2C1 */
167 CLKDEV_DEV_ID("i2c-rcar.2", &mstp_clks[MSTP028]), /* I2C2 */ 168 CLKDEV_DEV_ID("i2c-rcar.2", &mstp_clks[MSTP028]), /* I2C2 */
diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c
index 3ca6757b129a..45d21fe317f4 100644
--- a/arch/arm/mach-shmobile/clock-sh7372.c
+++ b/arch/arm/mach-shmobile/clock-sh7372.c
@@ -544,6 +544,7 @@ static struct clk_lookup lookups[] = {
544 544
545 /* MSTP32 clocks */ 545 /* MSTP32 clocks */
546 CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* IIC2 */ 546 CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* IIC2 */
547 CLKDEV_DEV_ID("fff30000.i2c", &mstp_clks[MSTP001]), /* IIC2 */
547 CLKDEV_DEV_ID("spi_sh_msiof.0", &mstp_clks[MSTP000]), /* MSIOF0 */ 548 CLKDEV_DEV_ID("spi_sh_msiof.0", &mstp_clks[MSTP000]), /* MSIOF0 */
548 CLKDEV_DEV_ID("uio_pdrv_genirq.4", &mstp_clks[MSTP131]), /* VEU3 */ 549 CLKDEV_DEV_ID("uio_pdrv_genirq.4", &mstp_clks[MSTP131]), /* VEU3 */
549 CLKDEV_DEV_ID("uio_pdrv_genirq.3", &mstp_clks[MSTP130]), /* VEU2 */ 550 CLKDEV_DEV_ID("uio_pdrv_genirq.3", &mstp_clks[MSTP130]), /* VEU2 */
@@ -556,6 +557,7 @@ static struct clk_lookup lookups[] = {
556 CLKDEV_DEV_ID("sh-mipi-dsi.0", &mstp_clks[MSTP118]), /* DSITX0 */ 557 CLKDEV_DEV_ID("sh-mipi-dsi.0", &mstp_clks[MSTP118]), /* DSITX0 */
557 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.1", &mstp_clks[MSTP117]), /* LCDC1 */ 558 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.1", &mstp_clks[MSTP117]), /* LCDC1 */
558 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* IIC0 */ 559 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* IIC0 */
560 CLKDEV_DEV_ID("fff20000.i2c", &mstp_clks[MSTP116]), /* IIC0 */
559 CLKDEV_DEV_ID("sh_mobile_meram.0", &mstp_clks[MSTP113]), /* MERAM */ 561 CLKDEV_DEV_ID("sh_mobile_meram.0", &mstp_clks[MSTP113]), /* MERAM */
560 CLKDEV_DEV_ID("uio_pdrv_genirq.5", &mstp_clks[MSTP106]), /* JPU */ 562 CLKDEV_DEV_ID("uio_pdrv_genirq.5", &mstp_clks[MSTP106]), /* JPU */
561 CLKDEV_DEV_ID("uio_pdrv_genirq.0", &mstp_clks[MSTP101]), /* VPU */ 563 CLKDEV_DEV_ID("uio_pdrv_genirq.0", &mstp_clks[MSTP101]), /* VPU */
@@ -577,18 +579,25 @@ static struct clk_lookup lookups[] = {
577 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */ 579 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */
578 CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI2 */ 580 CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI2 */
579 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* IIC1 */ 581 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* IIC1 */
582 CLKDEV_DEV_ID("e6c20000.i2c", &mstp_clks[MSTP323]), /* IIC1 */
580 CLKDEV_DEV_ID("r8a66597_hcd.0", &mstp_clks[MSTP322]), /* USB0 */ 583 CLKDEV_DEV_ID("r8a66597_hcd.0", &mstp_clks[MSTP322]), /* USB0 */
581 CLKDEV_DEV_ID("r8a66597_udc.0", &mstp_clks[MSTP322]), /* USB0 */ 584 CLKDEV_DEV_ID("r8a66597_udc.0", &mstp_clks[MSTP322]), /* USB0 */
582 CLKDEV_DEV_ID("renesas_usbhs.0", &mstp_clks[MSTP322]), /* USB0 */ 585 CLKDEV_DEV_ID("renesas_usbhs.0", &mstp_clks[MSTP322]), /* USB0 */
583 CLKDEV_DEV_ID("sh_flctl.0", &mstp_clks[MSTP315]), /* FLCTL */ 586 CLKDEV_DEV_ID("sh_flctl.0", &mstp_clks[MSTP315]), /* FLCTL */
584 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), /* SDHI0 */ 587 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), /* SDHI0 */
588 CLKDEV_DEV_ID("e6850000.sdhi", &mstp_clks[MSTP314]), /* SDHI0 */
585 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */ 589 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */
590 CLKDEV_DEV_ID("e6860000.sdhi", &mstp_clks[MSTP313]), /* SDHI1 */
586 CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMC */ 591 CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMC */
592 CLKDEV_DEV_ID("e6bd0000.mmcif", &mstp_clks[MSTP312]), /* MMC */
587 CLKDEV_DEV_ID("sh-mipi-dsi.1", &mstp_clks[MSTP423]), /* DSITX1 */ 593 CLKDEV_DEV_ID("sh-mipi-dsi.1", &mstp_clks[MSTP423]), /* DSITX1 */
588 CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP415]), /* SDHI2 */ 594 CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP415]), /* SDHI2 */
595 CLKDEV_DEV_ID("e6870000.sdhi", &mstp_clks[MSTP415]), /* SDHI2 */
589 CLKDEV_DEV_ID("sh-mobile-hdmi", &mstp_clks[MSTP413]), /* HDMI */ 596 CLKDEV_DEV_ID("sh-mobile-hdmi", &mstp_clks[MSTP413]), /* HDMI */
590 CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* IIC3 */ 597 CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* IIC3 */
598 CLKDEV_DEV_ID("e6d20000.i2c", &mstp_clks[MSTP411]), /* IIC3 */
591 CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* IIC4 */ 599 CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* IIC4 */
600 CLKDEV_DEV_ID("e6d30000.i2c", &mstp_clks[MSTP410]), /* IIC4 */
592 CLKDEV_DEV_ID("sh-dma-engine.4", &mstp_clks[MSTP407]), /* USB-DMAC1 */ 601 CLKDEV_DEV_ID("sh-dma-engine.4", &mstp_clks[MSTP407]), /* USB-DMAC1 */
593 CLKDEV_DEV_ID("r8a66597_hcd.1", &mstp_clks[MSTP406]), /* USB1 */ 602 CLKDEV_DEV_ID("r8a66597_hcd.1", &mstp_clks[MSTP406]), /* USB1 */
594 CLKDEV_DEV_ID("r8a66597_udc.1", &mstp_clks[MSTP406]), /* USB1 */ 603 CLKDEV_DEV_ID("r8a66597_udc.1", &mstp_clks[MSTP406]), /* USB1 */
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
index 516ff7f3e434..afa5423a0f93 100644
--- a/arch/arm/mach-shmobile/clock-sh73a0.c
+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
@@ -264,17 +264,17 @@ enum { DIV4_I, DIV4_ZG, DIV4_M3, DIV4_B, DIV4_M1, DIV4_M2,
264 SH_CLK_DIV4(&pll1_clk, _reg, _bit, _mask, _flags) 264 SH_CLK_DIV4(&pll1_clk, _reg, _bit, _mask, _flags)
265 265
266static struct clk div4_clks[DIV4_NR] = { 266static struct clk div4_clks[DIV4_NR] = {
267 [DIV4_I] = DIV4(FRQCRA, 20, 0xfff, CLK_ENABLE_ON_INIT), 267 [DIV4_I] = DIV4(FRQCRA, 20, 0xdff, CLK_ENABLE_ON_INIT),
268 [DIV4_ZG] = DIV4(FRQCRA, 16, 0xbff, CLK_ENABLE_ON_INIT), 268 [DIV4_ZG] = DIV4(FRQCRA, 16, 0xd7f, CLK_ENABLE_ON_INIT),
269 [DIV4_M3] = DIV4(FRQCRA, 12, 0xfff, CLK_ENABLE_ON_INIT), 269 [DIV4_M3] = DIV4(FRQCRA, 12, 0x1dff, CLK_ENABLE_ON_INIT),
270 [DIV4_B] = DIV4(FRQCRA, 8, 0xfff, CLK_ENABLE_ON_INIT), 270 [DIV4_B] = DIV4(FRQCRA, 8, 0xdff, CLK_ENABLE_ON_INIT),
271 [DIV4_M1] = DIV4(FRQCRA, 4, 0xfff, 0), 271 [DIV4_M1] = DIV4(FRQCRA, 4, 0x1dff, 0),
272 [DIV4_M2] = DIV4(FRQCRA, 0, 0xfff, 0), 272 [DIV4_M2] = DIV4(FRQCRA, 0, 0x1dff, 0),
273 [DIV4_Z] = DIV4(FRQCRB, 24, 0xbff, 0), 273 [DIV4_Z] = DIV4(FRQCRB, 24, 0x97f, 0),
274 [DIV4_ZTR] = DIV4(FRQCRB, 20, 0xfff, 0), 274 [DIV4_ZTR] = DIV4(FRQCRB, 20, 0xdff, 0),
275 [DIV4_ZT] = DIV4(FRQCRB, 16, 0xfff, 0), 275 [DIV4_ZT] = DIV4(FRQCRB, 16, 0xdff, 0),
276 [DIV4_ZX] = DIV4(FRQCRB, 12, 0xfff, 0), 276 [DIV4_ZX] = DIV4(FRQCRB, 12, 0xdff, 0),
277 [DIV4_HP] = DIV4(FRQCRB, 4, 0xfff, 0), 277 [DIV4_HP] = DIV4(FRQCRB, 4, 0xdff, 0),
278}; 278};
279 279
280enum { DIV6_VCK1, DIV6_VCK2, DIV6_VCK3, DIV6_ZB1, 280enum { DIV6_VCK1, DIV6_VCK2, DIV6_VCK3, DIV6_ZB1,
@@ -525,6 +525,13 @@ static struct clk mstp_clks[MSTP_NR] = {
525 [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */ 525 [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */
526}; 526};
527 527
528/* The lookups structure below includes duplicate entries for some clocks
529 * with alternate names.
530 * - The traditional name used when a device is initialised with platform data
531 * - The name used when a device is initialised using device tree
532 * The longer-term aim is to remove these duplicates, and indeed the
533 * lookups table entirely, by describing clocks using device tree.
534 */
528static struct clk_lookup lookups[] = { 535static struct clk_lookup lookups[] = {
529 /* main clocks */ 536 /* main clocks */
530 CLKDEV_CON_ID("r_clk", &r_clk), 537 CLKDEV_CON_ID("r_clk", &r_clk),
@@ -545,6 +552,7 @@ static struct clk_lookup lookups[] = {
545 552
546 /* MSTP32 clocks */ 553 /* MSTP32 clocks */
547 CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */ 554 CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */
555 CLKDEV_DEV_ID("e6824000.i2c", &mstp_clks[MSTP001]), /* I2C2 */
548 CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[MSTP129]), /* CEU1 */ 556 CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[MSTP129]), /* CEU1 */
549 CLKDEV_DEV_ID("sh-mobile-csi2.1", &mstp_clks[MSTP128]), /* CSI2-RX1 */ 557 CLKDEV_DEV_ID("sh-mobile-csi2.1", &mstp_clks[MSTP128]), /* CSI2-RX1 */
550 CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]), /* CEU0 */ 558 CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]), /* CEU0 */
@@ -553,6 +561,7 @@ static struct clk_lookup lookups[] = {
553 CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP125]), /* TMU01 */ 561 CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP125]), /* TMU01 */
554 CLKDEV_DEV_ID("sh-mipi-dsi.0", &mstp_clks[MSTP118]), /* DSITX */ 562 CLKDEV_DEV_ID("sh-mipi-dsi.0", &mstp_clks[MSTP118]), /* DSITX */
555 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* I2C0 */ 563 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* I2C0 */
564 CLKDEV_DEV_ID("e6820000.i2c", &mstp_clks[MSTP116]), /* I2C0 */
556 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), /* LCDC0 */ 565 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), /* LCDC0 */
557 CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP219]), /* SCIFA7 */ 566 CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP219]), /* SCIFA7 */
558 CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), /* SY-DMAC */ 567 CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), /* SY-DMAC */
@@ -569,17 +578,21 @@ static struct clk_lookup lookups[] = {
569 CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI */ 578 CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI */
570 CLKDEV_DEV_ID("sh_irda.0", &mstp_clks[MSTP325]), /* IrDA */ 579 CLKDEV_DEV_ID("sh_irda.0", &mstp_clks[MSTP325]), /* IrDA */
571 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */ 580 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */
581 CLKDEV_DEV_ID("e6822000.i2c", &mstp_clks[MSTP323]), /* I2C1 */
572 CLKDEV_DEV_ID("renesas_usbhs", &mstp_clks[MSTP322]), /* USB */ 582 CLKDEV_DEV_ID("renesas_usbhs", &mstp_clks[MSTP322]), /* USB */
573 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), /* SDHI0 */ 583 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), /* SDHI0 */
574 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */ 584 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */
575 CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMCIF0 */ 585 CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMCIF0 */
586 CLKDEV_DEV_ID("e6bd0000.mmcif", &mstp_clks[MSTP312]), /* MMCIF0 */
576 CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP311]), /* SDHI2 */ 587 CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP311]), /* SDHI2 */
577 CLKDEV_DEV_ID("leds-renesas-tpu.12", &mstp_clks[MSTP303]), /* TPU1 */ 588 CLKDEV_DEV_ID("leds-renesas-tpu.12", &mstp_clks[MSTP303]), /* TPU1 */
578 CLKDEV_DEV_ID("leds-renesas-tpu.21", &mstp_clks[MSTP302]), /* TPU2 */ 589 CLKDEV_DEV_ID("leds-renesas-tpu.21", &mstp_clks[MSTP302]), /* TPU2 */
579 CLKDEV_DEV_ID("leds-renesas-tpu.30", &mstp_clks[MSTP301]), /* TPU3 */ 590 CLKDEV_DEV_ID("leds-renesas-tpu.30", &mstp_clks[MSTP301]), /* TPU3 */
580 CLKDEV_DEV_ID("leds-renesas-tpu.41", &mstp_clks[MSTP300]), /* TPU4 */ 591 CLKDEV_DEV_ID("leds-renesas-tpu.41", &mstp_clks[MSTP300]), /* TPU4 */
581 CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* I2C3 */ 592 CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* I2C3 */
593 CLKDEV_DEV_ID("e6826000.i2c", &mstp_clks[MSTP411]), /* I2C3 */
582 CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* I2C4 */ 594 CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* I2C4 */
595 CLKDEV_DEV_ID("e6828000.i2c", &mstp_clks[MSTP410]), /* I2C4 */
583 CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */ 596 CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */
584}; 597};
585 598
diff --git a/arch/arm/mach-shmobile/headsmp-sh73a0.S b/arch/arm/mach-shmobile/headsmp-sh73a0.S
new file mode 100644
index 000000000000..bec4c0d9b713
--- /dev/null
+++ b/arch/arm/mach-shmobile/headsmp-sh73a0.S
@@ -0,0 +1,50 @@
1/*
2 * SMP support for SoC sh73a0
3 *
4 * Copyright (C) 2012 Bastian Hecht
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; either version 2 of
9 * the License, or (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,
19 * MA 02111-1307 USA
20 */
21
22#include <linux/linkage.h>
23#include <linux/init.h>
24#include <asm/memory.h>
25
26 __CPUINIT
27/*
28 * Reset vector for secondary CPUs.
29 *
30 * First we turn on L1 cache coherency for our CPU. Then we jump to
31 * shmobile_invalidate_start that invalidates the cache and hands over control
32 * to the common ARM startup code.
33 * This function will be mapped to address 0 by the SBAR register.
34 * A normal branch is out of range here so we need a long jump. We jump to
35 * the physical address as the MMU is still turned off.
36 */
37 .align 12
38ENTRY(sh73a0_secondary_vector)
39 mrc p15, 0, r0, c0, c0, 5 @ read MIPDR
40 and r0, r0, #3 @ mask out cpu ID
41 lsl r0, r0, #3 @ we will shift by cpu_id * 8 bits
42 mov r1, #0xf0000000 @ SCU base address
43 ldr r2, [r1, #8] @ SCU Power Status Register
44 mov r3, #3
45 bic r2, r2, r3, lsl r0 @ Clear bits of our CPU (Run Mode)
46 str r2, [r1, #8] @ write back
47
48 ldr pc, 1f
491: .long shmobile_invalidate_start - PAGE_OFFSET + PLAT_PHYS_OFFSET
50ENDPROC(sh73a0_secondary_vector)
diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S
index b202c1272526..96001fd49b6c 100644
--- a/arch/arm/mach-shmobile/headsmp.S
+++ b/arch/arm/mach-shmobile/headsmp.S
@@ -16,54 +16,6 @@
16 16
17 __CPUINIT 17 __CPUINIT
18 18
19/* Cache invalidation nicked from arch/arm/mach-imx/head-v7.S, thanks!
20 *
21 * The secondary kernel init calls v7_flush_dcache_all before it enables
22 * the L1; however, the L1 comes out of reset in an undefined state, so
23 * the clean + invalidate performed by v7_flush_dcache_all causes a bunch
24 * of cache lines with uninitialized data and uninitialized tags to get
25 * written out to memory, which does really unpleasant things to the main
26 * processor. We fix this by performing an invalidate, rather than a
27 * clean + invalidate, before jumping into the kernel.
28 *
29 * This funciton is cloned from arch/arm/mach-tegra/headsmp.S, and needs
30 * to be called for both secondary cores startup and primary core resume
31 * procedures. Ideally, it should be moved into arch/arm/mm/cache-v7.S.
32 */
33ENTRY(v7_invalidate_l1)
34 mov r0, #0
35 mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache
36 mcr p15, 2, r0, c0, c0, 0
37 mrc p15, 1, r0, c0, c0, 0
38
39 ldr r1, =0x7fff
40 and r2, r1, r0, lsr #13
41
42 ldr r1, =0x3ff
43
44 and r3, r1, r0, lsr #3 @ NumWays - 1
45 add r2, r2, #1 @ NumSets
46
47 and r0, r0, #0x7
48 add r0, r0, #4 @ SetShift
49
50 clz r1, r3 @ WayShift
51 add r4, r3, #1 @ NumWays
521: sub r2, r2, #1 @ NumSets--
53 mov r3, r4 @ Temp = NumWays
542: subs r3, r3, #1 @ Temp--
55 mov r5, r3, lsl r1
56 mov r6, r2, lsl r0
57 orr r5, r5, r6 @ Reg = (Temp<<WayShift)|(NumSets<<SetShift)
58 mcr p15, 0, r5, c7, c6, 2
59 bgt 2b
60 cmp r2, #0
61 bgt 1b
62 dsb
63 isb
64 mov pc, lr
65ENDPROC(v7_invalidate_l1)
66
67ENTRY(shmobile_invalidate_start) 19ENTRY(shmobile_invalidate_start)
68 bl v7_invalidate_l1 20 bl v7_invalidate_l1
69 b secondary_startup 21 b secondary_startup
diff --git a/arch/arm/mach-shmobile/hotplug.c b/arch/arm/mach-shmobile/hotplug.c
index b09a0bdbf813..a1524e3367b0 100644
--- a/arch/arm/mach-shmobile/hotplug.c
+++ b/arch/arm/mach-shmobile/hotplug.c
@@ -56,6 +56,12 @@ int shmobile_cpu_disable(unsigned int cpu)
56 return cpu == 0 ? -EPERM : 0; 56 return cpu == 0 ? -EPERM : 0;
57} 57}
58 58
59int shmobile_cpu_disable_any(unsigned int cpu)
60{
61 cpumask_clear_cpu(cpu, &dead_cpus);
62 return 0;
63}
64
59int shmobile_cpu_is_dead(unsigned int cpu) 65int shmobile_cpu_is_dead(unsigned int cpu)
60{ 66{
61 return cpumask_test_cpu(cpu, &dead_cpus); 67 return cpumask_test_cpu(cpu, &dead_cpus);
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
index dfeca79e9e96..e48606d8a2be 100644
--- a/arch/arm/mach-shmobile/include/mach/common.h
+++ b/arch/arm/mach-shmobile/include/mach/common.h
@@ -2,7 +2,7 @@
2#define __ARCH_MACH_COMMON_H 2#define __ARCH_MACH_COMMON_H
3 3
4extern void shmobile_earlytimer_init(void); 4extern void shmobile_earlytimer_init(void);
5extern struct sys_timer shmobile_timer; 5extern void shmobile_timer_init(void);
6extern void shmobile_setup_delay(unsigned int max_cpu_core_mhz, 6extern void shmobile_setup_delay(unsigned int max_cpu_core_mhz,
7 unsigned int mult, unsigned int div); 7 unsigned int mult, unsigned int div);
8struct twd_local_timer; 8struct twd_local_timer;
@@ -20,8 +20,11 @@ extern void shmobile_cpuidle_set_driver(struct cpuidle_driver *drv);
20 20
21extern void sh7372_init_irq(void); 21extern void sh7372_init_irq(void);
22extern void sh7372_map_io(void); 22extern void sh7372_map_io(void);
23extern void sh7372_earlytimer_init(void);
23extern void sh7372_add_early_devices(void); 24extern void sh7372_add_early_devices(void);
24extern void sh7372_add_standard_devices(void); 25extern void sh7372_add_standard_devices(void);
26extern void sh7372_add_early_devices_dt(void);
27extern void sh7372_add_standard_devices_dt(void);
25extern void sh7372_clock_init(void); 28extern void sh7372_clock_init(void);
26extern void sh7372_pinmux_init(void); 29extern void sh7372_pinmux_init(void);
27extern void sh7372_pm_init(void); 30extern void sh7372_pm_init(void);
@@ -31,11 +34,17 @@ extern struct clk sh7372_extal1_clk;
31extern struct clk sh7372_extal2_clk; 34extern struct clk sh7372_extal2_clk;
32 35
33extern void sh73a0_init_irq(void); 36extern void sh73a0_init_irq(void);
37extern void sh73a0_init_irq_dt(void);
34extern void sh73a0_map_io(void); 38extern void sh73a0_map_io(void);
39extern void sh73a0_earlytimer_init(void);
35extern void sh73a0_add_early_devices(void); 40extern void sh73a0_add_early_devices(void);
41extern void sh73a0_add_early_devices_dt(void);
36extern void sh73a0_add_standard_devices(void); 42extern void sh73a0_add_standard_devices(void);
43extern void sh73a0_add_standard_devices_dt(void);
37extern void sh73a0_clock_init(void); 44extern void sh73a0_clock_init(void);
38extern void sh73a0_pinmux_init(void); 45extern void sh73a0_pinmux_init(void);
46extern void sh73a0_pm_init(void);
47extern void sh73a0_secondary_vector(void);
39extern struct clk sh73a0_extal1_clk; 48extern struct clk sh73a0_extal1_clk;
40extern struct clk sh73a0_extal2_clk; 49extern struct clk sh73a0_extal2_clk;
41extern struct clk sh73a0_extcki_clk; 50extern struct clk sh73a0_extcki_clk;
@@ -47,9 +56,11 @@ extern void r8a7740_add_early_devices(void);
47extern void r8a7740_add_standard_devices(void); 56extern void r8a7740_add_standard_devices(void);
48extern void r8a7740_clock_init(u8 md_ck); 57extern void r8a7740_clock_init(u8 md_ck);
49extern void r8a7740_pinmux_init(void); 58extern void r8a7740_pinmux_init(void);
59extern void r8a7740_pm_init(void);
50 60
51extern void r8a7779_init_irq(void); 61extern void r8a7779_init_irq(void);
52extern void r8a7779_map_io(void); 62extern void r8a7779_map_io(void);
63extern void r8a7779_earlytimer_init(void);
53extern void r8a7779_add_early_devices(void); 64extern void r8a7779_add_early_devices(void);
54extern void r8a7779_add_standard_devices(void); 65extern void r8a7779_add_standard_devices(void);
55extern void r8a7779_clock_init(void); 66extern void r8a7779_clock_init(void);
@@ -73,6 +84,7 @@ static inline int shmobile_cpuidle_init(void) { return 0; }
73 84
74extern void shmobile_cpu_die(unsigned int cpu); 85extern void shmobile_cpu_die(unsigned int cpu);
75extern int shmobile_cpu_disable(unsigned int cpu); 86extern int shmobile_cpu_disable(unsigned int cpu);
87extern int shmobile_cpu_disable_any(unsigned int cpu);
76 88
77#ifdef CONFIG_HOTPLUG_CPU 89#ifdef CONFIG_HOTPLUG_CPU
78extern int shmobile_cpu_is_dead(unsigned int cpu); 90extern int shmobile_cpu_is_dead(unsigned int cpu);
diff --git a/arch/arm/mach-shmobile/include/mach/uncompress.h b/arch/arm/mach-shmobile/include/mach/uncompress.h
index 0bd7556b1387..f1aee56781e7 100644
--- a/arch/arm/mach-shmobile/include/mach/uncompress.h
+++ b/arch/arm/mach-shmobile/include/mach/uncompress.h
@@ -16,6 +16,4 @@ static void arch_decomp_setup(void)
16{ 16{
17} 17}
18 18
19#define arch_decomp_wdog()
20
21#endif /* __ASM_MACH_UNCOMPRESS_H */ 19#endif /* __ASM_MACH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-shmobile/intc-r8a7779.c b/arch/arm/mach-shmobile/intc-r8a7779.c
index ef66f1a8aa2e..8807c27f71f9 100644
--- a/arch/arm/mach-shmobile/intc-r8a7779.c
+++ b/arch/arm/mach-shmobile/intc-r8a7779.c
@@ -22,10 +22,10 @@
22#include <linux/interrupt.h> 22#include <linux/interrupt.h>
23#include <linux/irq.h> 23#include <linux/irq.h>
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/irqchip/arm-gic.h>
25#include <mach/common.h> 26#include <mach/common.h>
26#include <mach/intc.h> 27#include <mach/intc.h>
27#include <mach/r8a7779.h> 28#include <mach/r8a7779.h>
28#include <asm/hardware/gic.h>
29#include <asm/mach-types.h> 29#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31 31
diff --git a/arch/arm/mach-shmobile/intc-sh73a0.c b/arch/arm/mach-shmobile/intc-sh73a0.c
index f0c5e5190601..91faba666d46 100644
--- a/arch/arm/mach-shmobile/intc-sh73a0.c
+++ b/arch/arm/mach-shmobile/intc-sh73a0.c
@@ -23,10 +23,11 @@
23#include <linux/irq.h> 23#include <linux/irq.h>
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/sh_intc.h> 25#include <linux/sh_intc.h>
26#include <linux/irqchip.h>
27#include <linux/irqchip/arm-gic.h>
26#include <mach/intc.h> 28#include <mach/intc.h>
27#include <mach/irqs.h> 29#include <mach/irqs.h>
28#include <mach/sh73a0.h> 30#include <mach/sh73a0.h>
29#include <asm/hardware/gic.h>
30#include <asm/mach-types.h> 31#include <asm/mach-types.h>
31#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
32 33
@@ -315,11 +316,6 @@ static int intca_gic_set_type(struct irq_data *data, unsigned int type)
315 return irq_cbp(irq_set_type, to_intca_reloc_irq(data), type); 316 return irq_cbp(irq_set_type, to_intca_reloc_irq(data), type);
316} 317}
317 318
318static int intca_gic_set_wake(struct irq_data *data, unsigned int on)
319{
320 return irq_cbp(irq_set_wake, to_intca_reloc_irq(data), on);
321}
322
323#ifdef CONFIG_SMP 319#ifdef CONFIG_SMP
324static int intca_gic_set_affinity(struct irq_data *data, 320static int intca_gic_set_affinity(struct irq_data *data,
325 const struct cpumask *cpumask, 321 const struct cpumask *cpumask,
@@ -339,7 +335,7 @@ struct irq_chip intca_gic_irq_chip = {
339 .irq_disable = intca_gic_disable, 335 .irq_disable = intca_gic_disable,
340 .irq_shutdown = intca_gic_disable, 336 .irq_shutdown = intca_gic_disable,
341 .irq_set_type = intca_gic_set_type, 337 .irq_set_type = intca_gic_set_type,
342 .irq_set_wake = intca_gic_set_wake, 338 .irq_set_wake = sh73a0_set_wake,
343#ifdef CONFIG_SMP 339#ifdef CONFIG_SMP
344 .irq_set_affinity = intca_gic_set_affinity, 340 .irq_set_affinity = intca_gic_set_affinity,
345#endif 341#endif
@@ -464,3 +460,11 @@ void __init sh73a0_init_irq(void)
464 sh73a0_pint1_cascade.handler = sh73a0_pint1_demux; 460 sh73a0_pint1_cascade.handler = sh73a0_pint1_demux;
465 setup_irq(gic_spi(34), &sh73a0_pint1_cascade); 461 setup_irq(gic_spi(34), &sh73a0_pint1_cascade);
466} 462}
463
464#ifdef CONFIG_OF
465void __init sh73a0_init_irq_dt(void)
466{
467 irqchip_init();
468 gic_arch_extn.irq_set_wake = sh73a0_set_wake;
469}
470#endif
diff --git a/arch/arm/mach-shmobile/pfc-r8a7740.c b/arch/arm/mach-shmobile/pfc-r8a7740.c
deleted file mode 100644
index 134d1b9a8821..000000000000
--- a/arch/arm/mach-shmobile/pfc-r8a7740.c
+++ /dev/null
@@ -1,2617 +0,0 @@
1/*
2 * R8A7740 processor support
3 *
4 * Copyright (C) 2011 Renesas Solutions Corp.
5 * Copyright (C) 2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
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 as
9 * published by the Free Software Foundation; version 2 of the
10 * License.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21#include <linux/init.h>
22#include <linux/kernel.h>
23#include <linux/sh_pfc.h>
24#include <mach/r8a7740.h>
25#include <mach/irqs.h>
26
27#define CPU_ALL_PORT(fn, pfx, sfx) \
28 PORT_10(fn, pfx, sfx), PORT_90(fn, pfx, sfx), \
29 PORT_10(fn, pfx##10, sfx), PORT_90(fn, pfx##1, sfx), \
30 PORT_10(fn, pfx##20, sfx), \
31 PORT_1(fn, pfx##210, sfx), PORT_1(fn, pfx##211, sfx)
32
33enum {
34 PINMUX_RESERVED = 0,
35
36 /* PORT0_DATA -> PORT211_DATA */
37 PINMUX_DATA_BEGIN,
38 PORT_ALL(DATA),
39 PINMUX_DATA_END,
40
41 /* PORT0_IN -> PORT211_IN */
42 PINMUX_INPUT_BEGIN,
43 PORT_ALL(IN),
44 PINMUX_INPUT_END,
45
46 /* PORT0_IN_PU -> PORT211_IN_PU */
47 PINMUX_INPUT_PULLUP_BEGIN,
48 PORT_ALL(IN_PU),
49 PINMUX_INPUT_PULLUP_END,
50
51 /* PORT0_IN_PD -> PORT211_IN_PD */
52 PINMUX_INPUT_PULLDOWN_BEGIN,
53 PORT_ALL(IN_PD),
54 PINMUX_INPUT_PULLDOWN_END,
55
56 /* PORT0_OUT -> PORT211_OUT */
57 PINMUX_OUTPUT_BEGIN,
58 PORT_ALL(OUT),
59 PINMUX_OUTPUT_END,
60
61 PINMUX_FUNCTION_BEGIN,
62 PORT_ALL(FN_IN), /* PORT0_FN_IN -> PORT211_FN_IN */
63 PORT_ALL(FN_OUT), /* PORT0_FN_OUT -> PORT211_FN_OUT */
64 PORT_ALL(FN0), /* PORT0_FN0 -> PORT211_FN0 */
65 PORT_ALL(FN1), /* PORT0_FN1 -> PORT211_FN1 */
66 PORT_ALL(FN2), /* PORT0_FN2 -> PORT211_FN2 */
67 PORT_ALL(FN3), /* PORT0_FN3 -> PORT211_FN3 */
68 PORT_ALL(FN4), /* PORT0_FN4 -> PORT211_FN4 */
69 PORT_ALL(FN5), /* PORT0_FN5 -> PORT211_FN5 */
70 PORT_ALL(FN6), /* PORT0_FN6 -> PORT211_FN6 */
71 PORT_ALL(FN7), /* PORT0_FN7 -> PORT211_FN7 */
72
73 MSEL1CR_31_0, MSEL1CR_31_1,
74 MSEL1CR_30_0, MSEL1CR_30_1,
75 MSEL1CR_29_0, MSEL1CR_29_1,
76 MSEL1CR_28_0, MSEL1CR_28_1,
77 MSEL1CR_27_0, MSEL1CR_27_1,
78 MSEL1CR_26_0, MSEL1CR_26_1,
79 MSEL1CR_16_0, MSEL1CR_16_1,
80 MSEL1CR_15_0, MSEL1CR_15_1,
81 MSEL1CR_14_0, MSEL1CR_14_1,
82 MSEL1CR_13_0, MSEL1CR_13_1,
83 MSEL1CR_12_0, MSEL1CR_12_1,
84 MSEL1CR_9_0, MSEL1CR_9_1,
85 MSEL1CR_7_0, MSEL1CR_7_1,
86 MSEL1CR_6_0, MSEL1CR_6_1,
87 MSEL1CR_5_0, MSEL1CR_5_1,
88 MSEL1CR_4_0, MSEL1CR_4_1,
89 MSEL1CR_3_0, MSEL1CR_3_1,
90 MSEL1CR_2_0, MSEL1CR_2_1,
91 MSEL1CR_0_0, MSEL1CR_0_1,
92
93 MSEL3CR_15_0, MSEL3CR_15_1, /* Trace / Debug ? */
94 MSEL3CR_6_0, MSEL3CR_6_1,
95
96 MSEL4CR_19_0, MSEL4CR_19_1,
97 MSEL4CR_18_0, MSEL4CR_18_1,
98 MSEL4CR_15_0, MSEL4CR_15_1,
99 MSEL4CR_10_0, MSEL4CR_10_1,
100 MSEL4CR_6_0, MSEL4CR_6_1,
101 MSEL4CR_4_0, MSEL4CR_4_1,
102 MSEL4CR_1_0, MSEL4CR_1_1,
103
104 MSEL5CR_31_0, MSEL5CR_31_1, /* irq/fiq output */
105 MSEL5CR_30_0, MSEL5CR_30_1,
106 MSEL5CR_29_0, MSEL5CR_29_1,
107 MSEL5CR_27_0, MSEL5CR_27_1,
108 MSEL5CR_25_0, MSEL5CR_25_1,
109 MSEL5CR_23_0, MSEL5CR_23_1,
110 MSEL5CR_21_0, MSEL5CR_21_1,
111 MSEL5CR_19_0, MSEL5CR_19_1,
112 MSEL5CR_17_0, MSEL5CR_17_1,
113 MSEL5CR_15_0, MSEL5CR_15_1,
114 MSEL5CR_14_0, MSEL5CR_14_1,
115 MSEL5CR_13_0, MSEL5CR_13_1,
116 MSEL5CR_12_0, MSEL5CR_12_1,
117 MSEL5CR_11_0, MSEL5CR_11_1,
118 MSEL5CR_10_0, MSEL5CR_10_1,
119 MSEL5CR_8_0, MSEL5CR_8_1,
120 MSEL5CR_7_0, MSEL5CR_7_1,
121 MSEL5CR_6_0, MSEL5CR_6_1,
122 MSEL5CR_5_0, MSEL5CR_5_1,
123 MSEL5CR_4_0, MSEL5CR_4_1,
124 MSEL5CR_3_0, MSEL5CR_3_1,
125 MSEL5CR_2_0, MSEL5CR_2_1,
126 MSEL5CR_0_0, MSEL5CR_0_1,
127 PINMUX_FUNCTION_END,
128
129 PINMUX_MARK_BEGIN,
130
131 /* IRQ */
132 IRQ0_PORT2_MARK, IRQ0_PORT13_MARK,
133 IRQ1_MARK,
134 IRQ2_PORT11_MARK, IRQ2_PORT12_MARK,
135 IRQ3_PORT10_MARK, IRQ3_PORT14_MARK,
136 IRQ4_PORT15_MARK, IRQ4_PORT172_MARK,
137 IRQ5_PORT0_MARK, IRQ5_PORT1_MARK,
138 IRQ6_PORT121_MARK, IRQ6_PORT173_MARK,
139 IRQ7_PORT120_MARK, IRQ7_PORT209_MARK,
140 IRQ8_MARK,
141 IRQ9_PORT118_MARK, IRQ9_PORT210_MARK,
142 IRQ10_MARK,
143 IRQ11_MARK,
144 IRQ12_PORT42_MARK, IRQ12_PORT97_MARK,
145 IRQ13_PORT64_MARK, IRQ13_PORT98_MARK,
146 IRQ14_PORT63_MARK, IRQ14_PORT99_MARK,
147 IRQ15_PORT62_MARK, IRQ15_PORT100_MARK,
148 IRQ16_PORT68_MARK, IRQ16_PORT211_MARK,
149 IRQ17_MARK,
150 IRQ18_MARK,
151 IRQ19_MARK,
152 IRQ20_MARK,
153 IRQ21_MARK,
154 IRQ22_MARK,
155 IRQ23_MARK,
156 IRQ24_MARK,
157 IRQ25_MARK,
158 IRQ26_PORT58_MARK, IRQ26_PORT81_MARK,
159 IRQ27_PORT57_MARK, IRQ27_PORT168_MARK,
160 IRQ28_PORT56_MARK, IRQ28_PORT169_MARK,
161 IRQ29_PORT50_MARK, IRQ29_PORT170_MARK,
162 IRQ30_PORT49_MARK, IRQ30_PORT171_MARK,
163 IRQ31_PORT41_MARK, IRQ31_PORT167_MARK,
164
165 /* Function */
166
167 /* DBGT */
168 DBGMDT2_MARK, DBGMDT1_MARK, DBGMDT0_MARK,
169 DBGMD10_MARK, DBGMD11_MARK, DBGMD20_MARK,
170 DBGMD21_MARK,
171
172 /* FSI-A */
173 FSIAISLD_PORT0_MARK, /* FSIAISLD Port 0/5 */
174 FSIAISLD_PORT5_MARK,
175 FSIASPDIF_PORT9_MARK, /* FSIASPDIF Port 9/18 */
176 FSIASPDIF_PORT18_MARK,
177 FSIAOSLD1_MARK, FSIAOSLD2_MARK, FSIAOLR_MARK,
178 FSIAOBT_MARK, FSIAOSLD_MARK, FSIAOMC_MARK,
179 FSIACK_MARK, FSIAILR_MARK, FSIAIBT_MARK,
180
181 /* FSI-B */
182 FSIBCK_MARK,
183
184 /* FMSI */
185 FMSISLD_PORT1_MARK, /* FMSISLD Port 1/6 */
186 FMSISLD_PORT6_MARK,
187 FMSIILR_MARK, FMSIIBT_MARK, FMSIOLR_MARK, FMSIOBT_MARK,
188 FMSICK_MARK, FMSOILR_MARK, FMSOIBT_MARK, FMSOOLR_MARK,
189 FMSOOBT_MARK, FMSOSLD_MARK, FMSOCK_MARK,
190
191 /* SCIFA0 */
192 SCIFA0_SCK_MARK, SCIFA0_CTS_MARK, SCIFA0_RTS_MARK,
193 SCIFA0_RXD_MARK, SCIFA0_TXD_MARK,
194
195 /* SCIFA1 */
196 SCIFA1_CTS_MARK, SCIFA1_SCK_MARK, SCIFA1_RXD_MARK,
197 SCIFA1_TXD_MARK, SCIFA1_RTS_MARK,
198
199 /* SCIFA2 */
200 SCIFA2_SCK_PORT22_MARK, /* SCIFA2_SCK Port 22/199 */
201 SCIFA2_SCK_PORT199_MARK,
202 SCIFA2_RXD_MARK, SCIFA2_TXD_MARK,
203 SCIFA2_CTS_MARK, SCIFA2_RTS_MARK,
204
205 /* SCIFA3 */
206 SCIFA3_RTS_PORT105_MARK, /* MSEL5CR_8_0 */
207 SCIFA3_SCK_PORT116_MARK,
208 SCIFA3_CTS_PORT117_MARK,
209 SCIFA3_RXD_PORT174_MARK,
210 SCIFA3_TXD_PORT175_MARK,
211
212 SCIFA3_RTS_PORT161_MARK, /* MSEL5CR_8_1 */
213 SCIFA3_SCK_PORT158_MARK,
214 SCIFA3_CTS_PORT162_MARK,
215 SCIFA3_RXD_PORT159_MARK,
216 SCIFA3_TXD_PORT160_MARK,
217
218 /* SCIFA4 */
219 SCIFA4_RXD_PORT12_MARK, /* MSEL5CR[12:11] = 00 */
220 SCIFA4_TXD_PORT13_MARK,
221
222 SCIFA4_RXD_PORT204_MARK, /* MSEL5CR[12:11] = 01 */
223 SCIFA4_TXD_PORT203_MARK,
224
225 SCIFA4_RXD_PORT94_MARK, /* MSEL5CR[12:11] = 10 */
226 SCIFA4_TXD_PORT93_MARK,
227
228 SCIFA4_SCK_PORT21_MARK, /* SCIFA4_SCK Port 21/205 */
229 SCIFA4_SCK_PORT205_MARK,
230
231 /* SCIFA5 */
232 SCIFA5_TXD_PORT20_MARK, /* MSEL5CR[15:14] = 00 */
233 SCIFA5_RXD_PORT10_MARK,
234
235 SCIFA5_RXD_PORT207_MARK, /* MSEL5CR[15:14] = 01 */
236 SCIFA5_TXD_PORT208_MARK,
237
238 SCIFA5_TXD_PORT91_MARK, /* MSEL5CR[15:14] = 10 */
239 SCIFA5_RXD_PORT92_MARK,
240
241 SCIFA5_SCK_PORT23_MARK, /* SCIFA5_SCK Port 23/206 */
242 SCIFA5_SCK_PORT206_MARK,
243
244 /* SCIFA6 */
245 SCIFA6_SCK_MARK, SCIFA6_RXD_MARK, SCIFA6_TXD_MARK,
246
247 /* SCIFA7 */
248 SCIFA7_TXD_MARK, SCIFA7_RXD_MARK,
249
250 /* SCIFAB */
251 SCIFB_SCK_PORT190_MARK, /* MSEL5CR_17_0 */
252 SCIFB_RXD_PORT191_MARK,
253 SCIFB_TXD_PORT192_MARK,
254 SCIFB_RTS_PORT186_MARK,
255 SCIFB_CTS_PORT187_MARK,
256
257 SCIFB_SCK_PORT2_MARK, /* MSEL5CR_17_1 */
258 SCIFB_RXD_PORT3_MARK,
259 SCIFB_TXD_PORT4_MARK,
260 SCIFB_RTS_PORT172_MARK,
261 SCIFB_CTS_PORT173_MARK,
262
263 /* LCD0 */
264 LCDC0_SELECT_MARK,
265
266 LCD0_D0_MARK, LCD0_D1_MARK, LCD0_D2_MARK, LCD0_D3_MARK,
267 LCD0_D4_MARK, LCD0_D5_MARK, LCD0_D6_MARK, LCD0_D7_MARK,
268 LCD0_D8_MARK, LCD0_D9_MARK, LCD0_D10_MARK, LCD0_D11_MARK,
269 LCD0_D12_MARK, LCD0_D13_MARK, LCD0_D14_MARK, LCD0_D15_MARK,
270 LCD0_D16_MARK, LCD0_D17_MARK,
271 LCD0_DON_MARK, LCD0_VCPWC_MARK, LCD0_VEPWC_MARK,
272 LCD0_DCK_MARK, LCD0_VSYN_MARK, /* for RGB */
273 LCD0_HSYN_MARK, LCD0_DISP_MARK, /* for RGB */
274 LCD0_WR_MARK, LCD0_RD_MARK, /* for SYS */
275 LCD0_CS_MARK, LCD0_RS_MARK, /* for SYS */
276
277 LCD0_D21_PORT158_MARK, LCD0_D23_PORT159_MARK, /* MSEL5CR_6_1 */
278 LCD0_D22_PORT160_MARK, LCD0_D20_PORT161_MARK,
279 LCD0_D19_PORT162_MARK, LCD0_D18_PORT163_MARK,
280 LCD0_LCLK_PORT165_MARK,
281
282 LCD0_D18_PORT40_MARK, LCD0_D22_PORT0_MARK, /* MSEL5CR_6_0 */
283 LCD0_D23_PORT1_MARK, LCD0_D21_PORT2_MARK,
284 LCD0_D20_PORT3_MARK, LCD0_D19_PORT4_MARK,
285 LCD0_LCLK_PORT102_MARK,
286
287 /* LCD1 */
288 LCDC1_SELECT_MARK,
289
290 LCD1_D0_MARK, LCD1_D1_MARK, LCD1_D2_MARK, LCD1_D3_MARK,
291 LCD1_D4_MARK, LCD1_D5_MARK, LCD1_D6_MARK, LCD1_D7_MARK,
292 LCD1_D8_MARK, LCD1_D9_MARK, LCD1_D10_MARK, LCD1_D11_MARK,
293 LCD1_D12_MARK, LCD1_D13_MARK, LCD1_D14_MARK, LCD1_D15_MARK,
294 LCD1_D16_MARK, LCD1_D17_MARK, LCD1_D18_MARK, LCD1_D19_MARK,
295 LCD1_D20_MARK, LCD1_D21_MARK, LCD1_D22_MARK, LCD1_D23_MARK,
296 LCD1_DON_MARK, LCD1_VCPWC_MARK,
297 LCD1_LCLK_MARK, LCD1_VEPWC_MARK,
298
299 LCD1_DCK_MARK, LCD1_VSYN_MARK, /* for RGB */
300 LCD1_HSYN_MARK, LCD1_DISP_MARK, /* for RGB */
301 LCD1_RS_MARK, LCD1_CS_MARK, /* for SYS */
302 LCD1_RD_MARK, LCD1_WR_MARK, /* for SYS */
303
304 /* RSPI */
305 RSPI_SSL0_A_MARK, RSPI_SSL1_A_MARK, RSPI_SSL2_A_MARK,
306 RSPI_SSL3_A_MARK, RSPI_CK_A_MARK, RSPI_MOSI_A_MARK,
307 RSPI_MISO_A_MARK,
308
309 /* VIO CKO */
310 VIO_CKO1_MARK, /* needs fixup */
311 VIO_CKO2_MARK,
312 VIO_CKO_1_MARK,
313 VIO_CKO_MARK,
314
315 /* VIO0 */
316 VIO0_D0_MARK, VIO0_D1_MARK, VIO0_D2_MARK, VIO0_D3_MARK,
317 VIO0_D4_MARK, VIO0_D5_MARK, VIO0_D6_MARK, VIO0_D7_MARK,
318 VIO0_D8_MARK, VIO0_D9_MARK, VIO0_D10_MARK, VIO0_D11_MARK,
319 VIO0_D12_MARK, VIO0_VD_MARK, VIO0_HD_MARK, VIO0_CLK_MARK,
320 VIO0_FIELD_MARK,
321
322 VIO0_D13_PORT26_MARK, /* MSEL5CR_27_0 */
323 VIO0_D14_PORT25_MARK,
324 VIO0_D15_PORT24_MARK,
325
326 VIO0_D13_PORT22_MARK, /* MSEL5CR_27_1 */
327 VIO0_D14_PORT95_MARK,
328 VIO0_D15_PORT96_MARK,
329
330 /* VIO1 */
331 VIO1_D0_MARK, VIO1_D1_MARK, VIO1_D2_MARK, VIO1_D3_MARK,
332 VIO1_D4_MARK, VIO1_D5_MARK, VIO1_D6_MARK, VIO1_D7_MARK,
333 VIO1_VD_MARK, VIO1_HD_MARK, VIO1_CLK_MARK, VIO1_FIELD_MARK,
334
335 /* TPU0 */
336 TPU0TO0_MARK, TPU0TO1_MARK, TPU0TO3_MARK,
337 TPU0TO2_PORT66_MARK, /* TPU0TO2 Port 66/202 */
338 TPU0TO2_PORT202_MARK,
339
340 /* SSP1 0 */
341 STP0_IPD0_MARK, STP0_IPD1_MARK, STP0_IPD2_MARK, STP0_IPD3_MARK,
342 STP0_IPD4_MARK, STP0_IPD5_MARK, STP0_IPD6_MARK, STP0_IPD7_MARK,
343 STP0_IPEN_MARK, STP0_IPCLK_MARK, STP0_IPSYNC_MARK,
344
345 /* SSP1 1 */
346 STP1_IPD1_MARK, STP1_IPD2_MARK, STP1_IPD3_MARK, STP1_IPD4_MARK,
347 STP1_IPD5_MARK, STP1_IPD6_MARK, STP1_IPD7_MARK, STP1_IPCLK_MARK,
348 STP1_IPSYNC_MARK,
349
350 STP1_IPD0_PORT186_MARK, /* MSEL5CR_23_0 */
351 STP1_IPEN_PORT187_MARK,
352
353 STP1_IPD0_PORT194_MARK, /* MSEL5CR_23_1 */
354 STP1_IPEN_PORT193_MARK,
355
356 /* SIM */
357 SIM_RST_MARK, SIM_CLK_MARK,
358 SIM_D_PORT22_MARK, /* SIM_D Port 22/199 */
359 SIM_D_PORT199_MARK,
360
361 /* SDHI0 */
362 SDHI0_D0_MARK, SDHI0_D1_MARK, SDHI0_D2_MARK, SDHI0_D3_MARK,
363 SDHI0_CD_MARK, SDHI0_WP_MARK, SDHI0_CMD_MARK, SDHI0_CLK_MARK,
364
365 /* SDHI1 */
366 SDHI1_D0_MARK, SDHI1_D1_MARK, SDHI1_D2_MARK, SDHI1_D3_MARK,
367 SDHI1_CD_MARK, SDHI1_WP_MARK, SDHI1_CMD_MARK, SDHI1_CLK_MARK,
368
369 /* SDHI2 */
370 SDHI2_D0_MARK, SDHI2_D1_MARK, SDHI2_D2_MARK, SDHI2_D3_MARK,
371 SDHI2_CLK_MARK, SDHI2_CMD_MARK,
372
373 SDHI2_CD_PORT24_MARK, /* MSEL5CR_19_0 */
374 SDHI2_WP_PORT25_MARK,
375
376 SDHI2_WP_PORT177_MARK, /* MSEL5CR_19_1 */
377 SDHI2_CD_PORT202_MARK,
378
379 /* MSIOF2 */
380 MSIOF2_TXD_MARK, MSIOF2_RXD_MARK, MSIOF2_TSCK_MARK,
381 MSIOF2_SS2_MARK, MSIOF2_TSYNC_MARK, MSIOF2_SS1_MARK,
382 MSIOF2_MCK1_MARK, MSIOF2_MCK0_MARK, MSIOF2_RSYNC_MARK,
383 MSIOF2_RSCK_MARK,
384
385 /* KEYSC */
386 KEYIN4_MARK, KEYIN5_MARK, KEYIN6_MARK, KEYIN7_MARK,
387 KEYOUT0_MARK, KEYOUT1_MARK, KEYOUT2_MARK, KEYOUT3_MARK,
388 KEYOUT4_MARK, KEYOUT5_MARK, KEYOUT6_MARK, KEYOUT7_MARK,
389
390 KEYIN0_PORT43_MARK, /* MSEL4CR_18_0 */
391 KEYIN1_PORT44_MARK,
392 KEYIN2_PORT45_MARK,
393 KEYIN3_PORT46_MARK,
394
395 KEYIN0_PORT58_MARK, /* MSEL4CR_18_1 */
396 KEYIN1_PORT57_MARK,
397 KEYIN2_PORT56_MARK,
398 KEYIN3_PORT55_MARK,
399
400 /* VOU */
401 DV_D0_MARK, DV_D1_MARK, DV_D2_MARK, DV_D3_MARK,
402 DV_D4_MARK, DV_D5_MARK, DV_D6_MARK, DV_D7_MARK,
403 DV_D8_MARK, DV_D9_MARK, DV_D10_MARK, DV_D11_MARK,
404 DV_D12_MARK, DV_D13_MARK, DV_D14_MARK, DV_D15_MARK,
405 DV_CLK_MARK, DV_VSYNC_MARK, DV_HSYNC_MARK,
406
407 /* MEMC */
408 MEMC_AD0_MARK, MEMC_AD1_MARK, MEMC_AD2_MARK, MEMC_AD3_MARK,
409 MEMC_AD4_MARK, MEMC_AD5_MARK, MEMC_AD6_MARK, MEMC_AD7_MARK,
410 MEMC_AD8_MARK, MEMC_AD9_MARK, MEMC_AD10_MARK, MEMC_AD11_MARK,
411 MEMC_AD12_MARK, MEMC_AD13_MARK, MEMC_AD14_MARK, MEMC_AD15_MARK,
412 MEMC_CS0_MARK, MEMC_INT_MARK, MEMC_NWE_MARK, MEMC_NOE_MARK,
413
414 MEMC_CS1_MARK, /* MSEL4CR_6_0 */
415 MEMC_ADV_MARK,
416 MEMC_WAIT_MARK,
417 MEMC_BUSCLK_MARK,
418
419 MEMC_A1_MARK, /* MSEL4CR_6_1 */
420 MEMC_DREQ0_MARK,
421 MEMC_DREQ1_MARK,
422 MEMC_A0_MARK,
423
424 /* MMC */
425 MMC0_D0_PORT68_MARK, MMC0_D1_PORT69_MARK, MMC0_D2_PORT70_MARK,
426 MMC0_D3_PORT71_MARK, MMC0_D4_PORT72_MARK, MMC0_D5_PORT73_MARK,
427 MMC0_D6_PORT74_MARK, MMC0_D7_PORT75_MARK, MMC0_CLK_PORT66_MARK,
428 MMC0_CMD_PORT67_MARK, /* MSEL4CR_15_0 */
429
430 MMC1_D0_PORT149_MARK, MMC1_D1_PORT148_MARK, MMC1_D2_PORT147_MARK,
431 MMC1_D3_PORT146_MARK, MMC1_D4_PORT145_MARK, MMC1_D5_PORT144_MARK,
432 MMC1_D6_PORT143_MARK, MMC1_D7_PORT142_MARK, MMC1_CLK_PORT103_MARK,
433 MMC1_CMD_PORT104_MARK, /* MSEL4CR_15_1 */
434
435 /* MSIOF0 */
436 MSIOF0_SS1_MARK, MSIOF0_SS2_MARK, MSIOF0_RXD_MARK,
437 MSIOF0_TXD_MARK, MSIOF0_MCK0_MARK, MSIOF0_MCK1_MARK,
438 MSIOF0_RSYNC_MARK, MSIOF0_RSCK_MARK, MSIOF0_TSCK_MARK,
439 MSIOF0_TSYNC_MARK,
440
441 /* MSIOF1 */
442 MSIOF1_RSCK_MARK, MSIOF1_RSYNC_MARK,
443 MSIOF1_MCK0_MARK, MSIOF1_MCK1_MARK,
444
445 MSIOF1_SS2_PORT116_MARK, MSIOF1_SS1_PORT117_MARK,
446 MSIOF1_RXD_PORT118_MARK, MSIOF1_TXD_PORT119_MARK,
447 MSIOF1_TSYNC_PORT120_MARK,
448 MSIOF1_TSCK_PORT121_MARK, /* MSEL4CR_10_0 */
449
450 MSIOF1_SS1_PORT67_MARK, MSIOF1_TSCK_PORT72_MARK,
451 MSIOF1_TSYNC_PORT73_MARK, MSIOF1_TXD_PORT74_MARK,
452 MSIOF1_RXD_PORT75_MARK,
453 MSIOF1_SS2_PORT202_MARK, /* MSEL4CR_10_1 */
454
455 /* GPIO */
456 GPO0_MARK, GPI0_MARK, GPO1_MARK, GPI1_MARK,
457
458 /* USB0 */
459 USB0_OCI_MARK, USB0_PPON_MARK, VBUS_MARK,
460
461 /* USB1 */
462 USB1_OCI_MARK, USB1_PPON_MARK,
463
464 /* BBIF1 */
465 BBIF1_RXD_MARK, BBIF1_TXD_MARK, BBIF1_TSYNC_MARK,
466 BBIF1_TSCK_MARK, BBIF1_RSCK_MARK, BBIF1_RSYNC_MARK,
467 BBIF1_FLOW_MARK, BBIF1_RX_FLOW_N_MARK,
468
469 /* BBIF2 */
470 BBIF2_TXD2_PORT5_MARK, /* MSEL5CR_0_0 */
471 BBIF2_RXD2_PORT60_MARK,
472 BBIF2_TSYNC2_PORT6_MARK,
473 BBIF2_TSCK2_PORT59_MARK,
474
475 BBIF2_RXD2_PORT90_MARK, /* MSEL5CR_0_1 */
476 BBIF2_TXD2_PORT183_MARK,
477 BBIF2_TSCK2_PORT89_MARK,
478 BBIF2_TSYNC2_PORT184_MARK,
479
480 /* BSC / FLCTL / PCMCIA */
481 CS0_MARK, CS2_MARK, CS4_MARK,
482 CS5B_MARK, CS6A_MARK,
483 CS5A_PORT105_MARK, /* CS5A PORT 19/105 */
484 CS5A_PORT19_MARK,
485 IOIS16_MARK, /* ? */
486
487 A0_MARK, A1_MARK, A2_MARK, A3_MARK,
488 A4_FOE_MARK, /* share with FLCTL */
489 A5_FCDE_MARK, /* share with FLCTL */
490 A6_MARK, A7_MARK, A8_MARK, A9_MARK,
491 A10_MARK, A11_MARK, A12_MARK, A13_MARK,
492 A14_MARK, A15_MARK, A16_MARK, A17_MARK,
493 A18_MARK, A19_MARK, A20_MARK, A21_MARK,
494 A22_MARK, A23_MARK, A24_MARK, A25_MARK,
495 A26_MARK,
496
497 D0_NAF0_MARK, D1_NAF1_MARK, D2_NAF2_MARK, /* share with FLCTL */
498 D3_NAF3_MARK, D4_NAF4_MARK, D5_NAF5_MARK, /* share with FLCTL */
499 D6_NAF6_MARK, D7_NAF7_MARK, D8_NAF8_MARK, /* share with FLCTL */
500 D9_NAF9_MARK, D10_NAF10_MARK, D11_NAF11_MARK, /* share with FLCTL */
501 D12_NAF12_MARK, D13_NAF13_MARK, D14_NAF14_MARK, /* share with FLCTL */
502 D15_NAF15_MARK, /* share with FLCTL */
503 D16_MARK, D17_MARK, D18_MARK, D19_MARK,
504 D20_MARK, D21_MARK, D22_MARK, D23_MARK,
505 D24_MARK, D25_MARK, D26_MARK, D27_MARK,
506 D28_MARK, D29_MARK, D30_MARK, D31_MARK,
507
508 WE0_FWE_MARK, /* share with FLCTL */
509 WE1_MARK,
510 WE2_ICIORD_MARK, /* share with PCMCIA */
511 WE3_ICIOWR_MARK, /* share with PCMCIA */
512 CKO_MARK, BS_MARK, RDWR_MARK,
513 RD_FSC_MARK, /* share with FLCTL */
514 WAIT_PORT177_MARK, /* WAIT Port 90/177 */
515 WAIT_PORT90_MARK,
516
517 FCE0_MARK, FCE1_MARK, FRB_MARK, /* FLCTL */
518
519 /* IRDA */
520 IRDA_FIRSEL_MARK, IRDA_IN_MARK, IRDA_OUT_MARK,
521
522 /* ATAPI */
523 IDE_D0_MARK, IDE_D1_MARK, IDE_D2_MARK, IDE_D3_MARK,
524 IDE_D4_MARK, IDE_D5_MARK, IDE_D6_MARK, IDE_D7_MARK,
525 IDE_D8_MARK, IDE_D9_MARK, IDE_D10_MARK, IDE_D11_MARK,
526 IDE_D12_MARK, IDE_D13_MARK, IDE_D14_MARK, IDE_D15_MARK,
527 IDE_A0_MARK, IDE_A1_MARK, IDE_A2_MARK, IDE_CS0_MARK,
528 IDE_CS1_MARK, IDE_IOWR_MARK, IDE_IORD_MARK, IDE_IORDY_MARK,
529 IDE_INT_MARK, IDE_RST_MARK, IDE_DIRECTION_MARK,
530 IDE_EXBUF_ENB_MARK, IDE_IODACK_MARK, IDE_IODREQ_MARK,
531
532 /* RMII */
533 RMII_CRS_DV_MARK, RMII_RX_ER_MARK, RMII_RXD0_MARK,
534 RMII_RXD1_MARK, RMII_TX_EN_MARK, RMII_TXD0_MARK,
535 RMII_MDC_MARK, RMII_TXD1_MARK, RMII_MDIO_MARK,
536 RMII_REF50CK_MARK, /* for RMII */
537 RMII_REF125CK_MARK, /* for GMII */
538
539 /* GEther */
540 ET_TX_CLK_MARK, ET_TX_EN_MARK, ET_ETXD0_MARK, ET_ETXD1_MARK,
541 ET_ETXD2_MARK, ET_ETXD3_MARK,
542 ET_ETXD4_MARK, ET_ETXD5_MARK, /* for GEther */
543 ET_ETXD6_MARK, ET_ETXD7_MARK, /* for GEther */
544 ET_COL_MARK, ET_TX_ER_MARK, ET_RX_CLK_MARK, ET_RX_DV_MARK,
545 ET_ERXD0_MARK, ET_ERXD1_MARK, ET_ERXD2_MARK, ET_ERXD3_MARK,
546 ET_ERXD4_MARK, ET_ERXD5_MARK, /* for GEther */
547 ET_ERXD6_MARK, ET_ERXD7_MARK, /* for GEther */
548 ET_RX_ER_MARK, ET_CRS_MARK, ET_MDC_MARK, ET_MDIO_MARK,
549 ET_LINK_MARK, ET_PHY_INT_MARK, ET_WOL_MARK, ET_GTX_CLK_MARK,
550
551 /* DMA0 */
552 DREQ0_MARK, DACK0_MARK,
553
554 /* DMA1 */
555 DREQ1_MARK, DACK1_MARK,
556
557 /* SYSC */
558 RESETOUTS_MARK, RESETP_PULLUP_MARK, RESETP_PLAIN_MARK,
559
560 /* IRREM */
561 IROUT_MARK,
562
563 /* SDENC */
564 SDENC_CPG_MARK, SDENC_DV_CLKI_MARK,
565
566 /* HDMI */
567 HDMI_HPD_MARK, HDMI_CEC_MARK,
568
569 /* DEBUG */
570 EDEBGREQ_PULLUP_MARK, /* for JTAG */
571 EDEBGREQ_PULLDOWN_MARK,
572
573 TRACEAUD_FROM_VIO_MARK, /* for TRACE/AUD */
574 TRACEAUD_FROM_LCDC0_MARK,
575 TRACEAUD_FROM_MEMC_MARK,
576
577 PINMUX_MARK_END,
578};
579
580static pinmux_enum_t pinmux_data[] = {
581 /* specify valid pin states for each pin in GPIO mode */
582
583 /* I/O and Pull U/D */
584 PORT_DATA_IO_PD(0), PORT_DATA_IO_PD(1),
585 PORT_DATA_IO_PD(2), PORT_DATA_IO_PD(3),
586 PORT_DATA_IO_PD(4), PORT_DATA_IO_PD(5),
587 PORT_DATA_IO_PD(6), PORT_DATA_IO(7),
588 PORT_DATA_IO(8), PORT_DATA_IO(9),
589
590 PORT_DATA_IO_PD(10), PORT_DATA_IO_PD(11),
591 PORT_DATA_IO_PD(12), PORT_DATA_IO_PU_PD(13),
592 PORT_DATA_IO_PD(14), PORT_DATA_IO_PD(15),
593 PORT_DATA_IO_PD(16), PORT_DATA_IO_PD(17),
594 PORT_DATA_IO(18), PORT_DATA_IO_PU(19),
595
596 PORT_DATA_IO_PU_PD(20), PORT_DATA_IO_PD(21),
597 PORT_DATA_IO_PU_PD(22), PORT_DATA_IO(23),
598 PORT_DATA_IO_PU(24), PORT_DATA_IO_PU(25),
599 PORT_DATA_IO_PU(26), PORT_DATA_IO_PU(27),
600 PORT_DATA_IO_PU(28), PORT_DATA_IO_PU(29),
601
602 PORT_DATA_IO_PU(30), PORT_DATA_IO_PD(31),
603 PORT_DATA_IO_PD(32), PORT_DATA_IO_PD(33),
604 PORT_DATA_IO_PD(34), PORT_DATA_IO_PU(35),
605 PORT_DATA_IO_PU(36), PORT_DATA_IO_PD(37),
606 PORT_DATA_IO_PU(38), PORT_DATA_IO_PD(39),
607
608 PORT_DATA_IO_PU_PD(40), PORT_DATA_IO_PD(41),
609 PORT_DATA_IO_PD(42), PORT_DATA_IO_PU_PD(43),
610 PORT_DATA_IO_PU_PD(44), PORT_DATA_IO_PU_PD(45),
611 PORT_DATA_IO_PU_PD(46), PORT_DATA_IO_PU_PD(47),
612 PORT_DATA_IO_PU_PD(48), PORT_DATA_IO_PU_PD(49),
613
614 PORT_DATA_IO_PU_PD(50), PORT_DATA_IO_PD(51),
615 PORT_DATA_IO_PD(52), PORT_DATA_IO_PD(53),
616 PORT_DATA_IO_PD(54), PORT_DATA_IO_PU_PD(55),
617 PORT_DATA_IO_PU_PD(56), PORT_DATA_IO_PU_PD(57),
618 PORT_DATA_IO_PU_PD(58), PORT_DATA_IO_PU_PD(59),
619
620 PORT_DATA_IO_PU_PD(60), PORT_DATA_IO_PD(61),
621 PORT_DATA_IO_PD(62), PORT_DATA_IO_PD(63),
622 PORT_DATA_IO_PD(64), PORT_DATA_IO_PD(65),
623 PORT_DATA_IO_PU_PD(66), PORT_DATA_IO_PU_PD(67),
624 PORT_DATA_IO_PU_PD(68), PORT_DATA_IO_PU_PD(69),
625
626 PORT_DATA_IO_PU_PD(70), PORT_DATA_IO_PU_PD(71),
627 PORT_DATA_IO_PU_PD(72), PORT_DATA_IO_PU_PD(73),
628 PORT_DATA_IO_PU_PD(74), PORT_DATA_IO_PU_PD(75),
629 PORT_DATA_IO_PU_PD(76), PORT_DATA_IO_PU_PD(77),
630 PORT_DATA_IO_PU_PD(78), PORT_DATA_IO_PU_PD(79),
631
632 PORT_DATA_IO_PU_PD(80), PORT_DATA_IO_PU_PD(81),
633 PORT_DATA_IO(82), PORT_DATA_IO_PU_PD(83),
634 PORT_DATA_IO(84), PORT_DATA_IO_PD(85),
635 PORT_DATA_IO_PD(86), PORT_DATA_IO_PD(87),
636 PORT_DATA_IO_PD(88), PORT_DATA_IO_PD(89),
637
638 PORT_DATA_IO_PD(90), PORT_DATA_IO_PU_PD(91),
639 PORT_DATA_IO_PU_PD(92), PORT_DATA_IO_PU_PD(93),
640 PORT_DATA_IO_PU_PD(94), PORT_DATA_IO_PU_PD(95),
641 PORT_DATA_IO_PU_PD(96), PORT_DATA_IO_PU_PD(97),
642 PORT_DATA_IO_PU_PD(98), PORT_DATA_IO_PU_PD(99),
643
644 PORT_DATA_IO_PU_PD(100), PORT_DATA_IO(101),
645 PORT_DATA_IO_PU(102), PORT_DATA_IO_PU_PD(103),
646 PORT_DATA_IO_PU(104), PORT_DATA_IO_PU(105),
647 PORT_DATA_IO_PU_PD(106), PORT_DATA_IO(107),
648 PORT_DATA_IO(108), PORT_DATA_IO(109),
649
650 PORT_DATA_IO(110), PORT_DATA_IO(111),
651 PORT_DATA_IO(112), PORT_DATA_IO(113),
652 PORT_DATA_IO_PU_PD(114), PORT_DATA_IO(115),
653 PORT_DATA_IO_PD(116), PORT_DATA_IO_PD(117),
654 PORT_DATA_IO_PD(118), PORT_DATA_IO_PD(119),
655
656 PORT_DATA_IO_PD(120), PORT_DATA_IO_PD(121),
657 PORT_DATA_IO_PD(122), PORT_DATA_IO_PD(123),
658 PORT_DATA_IO_PD(124), PORT_DATA_IO(125),
659 PORT_DATA_IO(126), PORT_DATA_IO(127),
660 PORT_DATA_IO(128), PORT_DATA_IO(129),
661
662 PORT_DATA_IO(130), PORT_DATA_IO(131),
663 PORT_DATA_IO(132), PORT_DATA_IO(133),
664 PORT_DATA_IO(134), PORT_DATA_IO(135),
665 PORT_DATA_IO(136), PORT_DATA_IO(137),
666 PORT_DATA_IO(138), PORT_DATA_IO(139),
667
668 PORT_DATA_IO(140), PORT_DATA_IO(141),
669 PORT_DATA_IO_PU(142), PORT_DATA_IO_PU(143),
670 PORT_DATA_IO_PU(144), PORT_DATA_IO_PU(145),
671 PORT_DATA_IO_PU(146), PORT_DATA_IO_PU(147),
672 PORT_DATA_IO_PU(148), PORT_DATA_IO_PU(149),
673
674 PORT_DATA_IO_PU(150), PORT_DATA_IO_PU(151),
675 PORT_DATA_IO_PU(152), PORT_DATA_IO_PU(153),
676 PORT_DATA_IO_PU(154), PORT_DATA_IO_PU(155),
677 PORT_DATA_IO_PU(156), PORT_DATA_IO_PU(157),
678 PORT_DATA_IO_PD(158), PORT_DATA_IO_PD(159),
679
680 PORT_DATA_IO_PU_PD(160), PORT_DATA_IO_PD(161),
681 PORT_DATA_IO_PD(162), PORT_DATA_IO_PD(163),
682 PORT_DATA_IO_PD(164), PORT_DATA_IO_PD(165),
683 PORT_DATA_IO_PU(166), PORT_DATA_IO_PU(167),
684 PORT_DATA_IO_PU(168), PORT_DATA_IO_PU(169),
685
686 PORT_DATA_IO_PU(170), PORT_DATA_IO_PU(171),
687 PORT_DATA_IO_PD(172), PORT_DATA_IO_PD(173),
688 PORT_DATA_IO_PD(174), PORT_DATA_IO_PD(175),
689 PORT_DATA_IO_PU(176), PORT_DATA_IO_PU_PD(177),
690 PORT_DATA_IO_PU(178), PORT_DATA_IO_PD(179),
691
692 PORT_DATA_IO_PD(180), PORT_DATA_IO_PU(181),
693 PORT_DATA_IO_PU(182), PORT_DATA_IO(183),
694 PORT_DATA_IO_PD(184), PORT_DATA_IO_PD(185),
695 PORT_DATA_IO_PD(186), PORT_DATA_IO_PD(187),
696 PORT_DATA_IO_PD(188), PORT_DATA_IO_PD(189),
697
698 PORT_DATA_IO_PD(190), PORT_DATA_IO_PD(191),
699 PORT_DATA_IO_PD(192), PORT_DATA_IO_PU_PD(193),
700 PORT_DATA_IO_PU_PD(194), PORT_DATA_IO_PD(195),
701 PORT_DATA_IO_PU_PD(196), PORT_DATA_IO_PD(197),
702 PORT_DATA_IO_PU_PD(198), PORT_DATA_IO_PU_PD(199),
703
704 PORT_DATA_IO_PU_PD(200), PORT_DATA_IO_PU(201),
705 PORT_DATA_IO_PU_PD(202), PORT_DATA_IO(203),
706 PORT_DATA_IO_PU_PD(204), PORT_DATA_IO_PU_PD(205),
707 PORT_DATA_IO_PU_PD(206), PORT_DATA_IO_PU_PD(207),
708 PORT_DATA_IO_PU_PD(208), PORT_DATA_IO_PD(209),
709
710 PORT_DATA_IO_PD(210), PORT_DATA_IO_PD(211),
711
712 /* Port0 */
713 PINMUX_DATA(DBGMDT2_MARK, PORT0_FN1),
714 PINMUX_DATA(FSIAISLD_PORT0_MARK, PORT0_FN2, MSEL5CR_3_0),
715 PINMUX_DATA(FSIAOSLD1_MARK, PORT0_FN3),
716 PINMUX_DATA(LCD0_D22_PORT0_MARK, PORT0_FN4, MSEL5CR_6_0),
717 PINMUX_DATA(SCIFA7_RXD_MARK, PORT0_FN6),
718 PINMUX_DATA(LCD1_D4_MARK, PORT0_FN7),
719 PINMUX_DATA(IRQ5_PORT0_MARK, PORT0_FN0, MSEL1CR_5_0),
720
721 /* Port1 */
722 PINMUX_DATA(DBGMDT1_MARK, PORT1_FN1),
723 PINMUX_DATA(FMSISLD_PORT1_MARK, PORT1_FN2, MSEL5CR_5_0),
724 PINMUX_DATA(FSIAOSLD2_MARK, PORT1_FN3),
725 PINMUX_DATA(LCD0_D23_PORT1_MARK, PORT1_FN4, MSEL5CR_6_0),
726 PINMUX_DATA(SCIFA7_TXD_MARK, PORT1_FN6),
727 PINMUX_DATA(LCD1_D3_MARK, PORT1_FN7),
728 PINMUX_DATA(IRQ5_PORT1_MARK, PORT1_FN0, MSEL1CR_5_1),
729
730 /* Port2 */
731 PINMUX_DATA(DBGMDT0_MARK, PORT2_FN1),
732 PINMUX_DATA(SCIFB_SCK_PORT2_MARK, PORT2_FN2, MSEL5CR_17_1),
733 PINMUX_DATA(LCD0_D21_PORT2_MARK, PORT2_FN4, MSEL5CR_6_0),
734 PINMUX_DATA(LCD1_D2_MARK, PORT2_FN7),
735 PINMUX_DATA(IRQ0_PORT2_MARK, PORT2_FN0, MSEL1CR_0_1),
736
737 /* Port3 */
738 PINMUX_DATA(DBGMD21_MARK, PORT3_FN1),
739 PINMUX_DATA(SCIFB_RXD_PORT3_MARK, PORT3_FN2, MSEL5CR_17_1),
740 PINMUX_DATA(LCD0_D20_PORT3_MARK, PORT3_FN4, MSEL5CR_6_0),
741 PINMUX_DATA(LCD1_D1_MARK, PORT3_FN7),
742
743 /* Port4 */
744 PINMUX_DATA(DBGMD20_MARK, PORT4_FN1),
745 PINMUX_DATA(SCIFB_TXD_PORT4_MARK, PORT4_FN2, MSEL5CR_17_1),
746 PINMUX_DATA(LCD0_D19_PORT4_MARK, PORT4_FN4, MSEL5CR_6_0),
747 PINMUX_DATA(LCD1_D0_MARK, PORT4_FN7),
748
749 /* Port5 */
750 PINMUX_DATA(DBGMD11_MARK, PORT5_FN1),
751 PINMUX_DATA(BBIF2_TXD2_PORT5_MARK, PORT5_FN2, MSEL5CR_0_0),
752 PINMUX_DATA(FSIAISLD_PORT5_MARK, PORT5_FN4, MSEL5CR_3_1),
753 PINMUX_DATA(RSPI_SSL0_A_MARK, PORT5_FN6),
754 PINMUX_DATA(LCD1_VCPWC_MARK, PORT5_FN7),
755
756 /* Port6 */
757 PINMUX_DATA(DBGMD10_MARK, PORT6_FN1),
758 PINMUX_DATA(BBIF2_TSYNC2_PORT6_MARK, PORT6_FN2, MSEL5CR_0_0),
759 PINMUX_DATA(FMSISLD_PORT6_MARK, PORT6_FN4, MSEL5CR_5_1),
760 PINMUX_DATA(RSPI_SSL1_A_MARK, PORT6_FN6),
761 PINMUX_DATA(LCD1_VEPWC_MARK, PORT6_FN7),
762
763 /* Port7 */
764 PINMUX_DATA(FSIAOLR_MARK, PORT7_FN1),
765
766 /* Port8 */
767 PINMUX_DATA(FSIAOBT_MARK, PORT8_FN1),
768
769 /* Port9 */
770 PINMUX_DATA(FSIAOSLD_MARK, PORT9_FN1),
771 PINMUX_DATA(FSIASPDIF_PORT9_MARK, PORT9_FN2, MSEL5CR_4_0),
772
773 /* Port10 */
774 PINMUX_DATA(FSIAOMC_MARK, PORT10_FN1),
775 PINMUX_DATA(SCIFA5_RXD_PORT10_MARK, PORT10_FN3, MSEL5CR_14_0, MSEL5CR_15_0),
776 PINMUX_DATA(IRQ3_PORT10_MARK, PORT10_FN0, MSEL1CR_3_0),
777
778 /* Port11 */
779 PINMUX_DATA(FSIACK_MARK, PORT11_FN1),
780 PINMUX_DATA(FSIBCK_MARK, PORT11_FN2),
781 PINMUX_DATA(IRQ2_PORT11_MARK, PORT11_FN0, MSEL1CR_2_0),
782
783 /* Port12 */
784 PINMUX_DATA(FSIAILR_MARK, PORT12_FN1),
785 PINMUX_DATA(SCIFA4_RXD_PORT12_MARK, PORT12_FN2, MSEL5CR_12_0, MSEL5CR_11_0),
786 PINMUX_DATA(LCD1_RS_MARK, PORT12_FN6),
787 PINMUX_DATA(LCD1_DISP_MARK, PORT12_FN7),
788 PINMUX_DATA(IRQ2_PORT12_MARK, PORT12_FN0, MSEL1CR_2_1),
789
790 /* Port13 */
791 PINMUX_DATA(FSIAIBT_MARK, PORT13_FN1),
792 PINMUX_DATA(SCIFA4_TXD_PORT13_MARK, PORT13_FN2, MSEL5CR_12_0, MSEL5CR_11_0),
793 PINMUX_DATA(LCD1_RD_MARK, PORT13_FN7),
794 PINMUX_DATA(IRQ0_PORT13_MARK, PORT13_FN0, MSEL1CR_0_0),
795
796 /* Port14 */
797 PINMUX_DATA(FMSOILR_MARK, PORT14_FN1),
798 PINMUX_DATA(FMSIILR_MARK, PORT14_FN2),
799 PINMUX_DATA(VIO_CKO1_MARK, PORT14_FN3),
800 PINMUX_DATA(LCD1_D23_MARK, PORT14_FN7),
801 PINMUX_DATA(IRQ3_PORT14_MARK, PORT14_FN0, MSEL1CR_3_1),
802
803 /* Port15 */
804 PINMUX_DATA(FMSOIBT_MARK, PORT15_FN1),
805 PINMUX_DATA(FMSIIBT_MARK, PORT15_FN2),
806 PINMUX_DATA(VIO_CKO2_MARK, PORT15_FN3),
807 PINMUX_DATA(LCD1_D22_MARK, PORT15_FN7),
808 PINMUX_DATA(IRQ4_PORT15_MARK, PORT15_FN0, MSEL1CR_4_0),
809
810 /* Port16 */
811 PINMUX_DATA(FMSOOLR_MARK, PORT16_FN1),
812 PINMUX_DATA(FMSIOLR_MARK, PORT16_FN2),
813
814 /* Port17 */
815 PINMUX_DATA(FMSOOBT_MARK, PORT17_FN1),
816 PINMUX_DATA(FMSIOBT_MARK, PORT17_FN2),
817
818 /* Port18 */
819 PINMUX_DATA(FMSOSLD_MARK, PORT18_FN1),
820 PINMUX_DATA(FSIASPDIF_PORT18_MARK, PORT18_FN2, MSEL5CR_4_1),
821
822 /* Port19 */
823 PINMUX_DATA(FMSICK_MARK, PORT19_FN1),
824 PINMUX_DATA(CS5A_PORT19_MARK, PORT19_FN7, MSEL5CR_2_1),
825 PINMUX_DATA(IRQ10_MARK, PORT19_FN0),
826
827 /* Port20 */
828 PINMUX_DATA(FMSOCK_MARK, PORT20_FN1),
829 PINMUX_DATA(SCIFA5_TXD_PORT20_MARK, PORT20_FN3, MSEL5CR_15_0, MSEL5CR_14_0),
830 PINMUX_DATA(IRQ1_MARK, PORT20_FN0),
831
832 /* Port21 */
833 PINMUX_DATA(SCIFA1_CTS_MARK, PORT21_FN1),
834 PINMUX_DATA(SCIFA4_SCK_PORT21_MARK, PORT21_FN2, MSEL5CR_10_0),
835 PINMUX_DATA(TPU0TO1_MARK, PORT21_FN4),
836 PINMUX_DATA(VIO1_FIELD_MARK, PORT21_FN5),
837 PINMUX_DATA(STP0_IPD5_MARK, PORT21_FN6),
838 PINMUX_DATA(LCD1_D10_MARK, PORT21_FN7),
839
840 /* Port22 */
841 PINMUX_DATA(SCIFA2_SCK_PORT22_MARK, PORT22_FN1, MSEL5CR_7_0),
842 PINMUX_DATA(SIM_D_PORT22_MARK, PORT22_FN4, MSEL5CR_21_0),
843 PINMUX_DATA(VIO0_D13_PORT22_MARK, PORT22_FN7, MSEL5CR_27_1),
844
845 /* Port23 */
846 PINMUX_DATA(SCIFA1_RTS_MARK, PORT23_FN1),
847 PINMUX_DATA(SCIFA5_SCK_PORT23_MARK, PORT23_FN3, MSEL5CR_13_0),
848 PINMUX_DATA(TPU0TO0_MARK, PORT23_FN4),
849 PINMUX_DATA(VIO_CKO_1_MARK, PORT23_FN5),
850 PINMUX_DATA(STP0_IPD2_MARK, PORT23_FN6),
851 PINMUX_DATA(LCD1_D7_MARK, PORT23_FN7),
852
853 /* Port24 */
854 PINMUX_DATA(VIO0_D15_PORT24_MARK, PORT24_FN1, MSEL5CR_27_0),
855 PINMUX_DATA(VIO1_D7_MARK, PORT24_FN5),
856 PINMUX_DATA(SCIFA6_SCK_MARK, PORT24_FN6),
857 PINMUX_DATA(SDHI2_CD_PORT24_MARK, PORT24_FN7, MSEL5CR_19_0),
858
859 /* Port25 */
860 PINMUX_DATA(VIO0_D14_PORT25_MARK, PORT25_FN1, MSEL5CR_27_0),
861 PINMUX_DATA(VIO1_D6_MARK, PORT25_FN5),
862 PINMUX_DATA(SCIFA6_RXD_MARK, PORT25_FN6),
863 PINMUX_DATA(SDHI2_WP_PORT25_MARK, PORT25_FN7, MSEL5CR_19_0),
864
865 /* Port26 */
866 PINMUX_DATA(VIO0_D13_PORT26_MARK, PORT26_FN1, MSEL5CR_27_0),
867 PINMUX_DATA(VIO1_D5_MARK, PORT26_FN5),
868 PINMUX_DATA(SCIFA6_TXD_MARK, PORT26_FN6),
869
870 /* Port27 - Port39 Function */
871 PINMUX_DATA(VIO0_D7_MARK, PORT27_FN1),
872 PINMUX_DATA(VIO0_D6_MARK, PORT28_FN1),
873 PINMUX_DATA(VIO0_D5_MARK, PORT29_FN1),
874 PINMUX_DATA(VIO0_D4_MARK, PORT30_FN1),
875 PINMUX_DATA(VIO0_D3_MARK, PORT31_FN1),
876 PINMUX_DATA(VIO0_D2_MARK, PORT32_FN1),
877 PINMUX_DATA(VIO0_D1_MARK, PORT33_FN1),
878 PINMUX_DATA(VIO0_D0_MARK, PORT34_FN1),
879 PINMUX_DATA(VIO0_CLK_MARK, PORT35_FN1),
880 PINMUX_DATA(VIO_CKO_MARK, PORT36_FN1),
881 PINMUX_DATA(VIO0_HD_MARK, PORT37_FN1),
882 PINMUX_DATA(VIO0_FIELD_MARK, PORT38_FN1),
883 PINMUX_DATA(VIO0_VD_MARK, PORT39_FN1),
884
885 /* Port38 IRQ */
886 PINMUX_DATA(IRQ25_MARK, PORT38_FN0),
887
888 /* Port40 */
889 PINMUX_DATA(LCD0_D18_PORT40_MARK, PORT40_FN4, MSEL5CR_6_0),
890 PINMUX_DATA(RSPI_CK_A_MARK, PORT40_FN6),
891 PINMUX_DATA(LCD1_LCLK_MARK, PORT40_FN7),
892
893 /* Port41 */
894 PINMUX_DATA(LCD0_D17_MARK, PORT41_FN1),
895 PINMUX_DATA(MSIOF2_SS1_MARK, PORT41_FN2),
896 PINMUX_DATA(IRQ31_PORT41_MARK, PORT41_FN0, MSEL1CR_31_1),
897
898 /* Port42 */
899 PINMUX_DATA(LCD0_D16_MARK, PORT42_FN1),
900 PINMUX_DATA(MSIOF2_MCK1_MARK, PORT42_FN2),
901 PINMUX_DATA(IRQ12_PORT42_MARK, PORT42_FN0, MSEL1CR_12_1),
902
903 /* Port43 */
904 PINMUX_DATA(LCD0_D15_MARK, PORT43_FN1),
905 PINMUX_DATA(MSIOF2_MCK0_MARK, PORT43_FN2),
906 PINMUX_DATA(KEYIN0_PORT43_MARK, PORT43_FN3, MSEL4CR_18_0),
907 PINMUX_DATA(DV_D15_MARK, PORT43_FN6),
908
909 /* Port44 */
910 PINMUX_DATA(LCD0_D14_MARK, PORT44_FN1),
911 PINMUX_DATA(MSIOF2_RSYNC_MARK, PORT44_FN2),
912 PINMUX_DATA(KEYIN1_PORT44_MARK, PORT44_FN3, MSEL4CR_18_0),
913 PINMUX_DATA(DV_D14_MARK, PORT44_FN6),
914
915 /* Port45 */
916 PINMUX_DATA(LCD0_D13_MARK, PORT45_FN1),
917 PINMUX_DATA(MSIOF2_RSCK_MARK, PORT45_FN2),
918 PINMUX_DATA(KEYIN2_PORT45_MARK, PORT45_FN3, MSEL4CR_18_0),
919 PINMUX_DATA(DV_D13_MARK, PORT45_FN6),
920
921 /* Port46 */
922 PINMUX_DATA(LCD0_D12_MARK, PORT46_FN1),
923 PINMUX_DATA(KEYIN3_PORT46_MARK, PORT46_FN3, MSEL4CR_18_0),
924 PINMUX_DATA(DV_D12_MARK, PORT46_FN6),
925
926 /* Port47 */
927 PINMUX_DATA(LCD0_D11_MARK, PORT47_FN1),
928 PINMUX_DATA(KEYIN4_MARK, PORT47_FN3),
929 PINMUX_DATA(DV_D11_MARK, PORT47_FN6),
930
931 /* Port48 */
932 PINMUX_DATA(LCD0_D10_MARK, PORT48_FN1),
933 PINMUX_DATA(KEYIN5_MARK, PORT48_FN3),
934 PINMUX_DATA(DV_D10_MARK, PORT48_FN6),
935
936 /* Port49 */
937 PINMUX_DATA(LCD0_D9_MARK, PORT49_FN1),
938 PINMUX_DATA(KEYIN6_MARK, PORT49_FN3),
939 PINMUX_DATA(DV_D9_MARK, PORT49_FN6),
940 PINMUX_DATA(IRQ30_PORT49_MARK, PORT49_FN0, MSEL1CR_30_1),
941
942 /* Port50 */
943 PINMUX_DATA(LCD0_D8_MARK, PORT50_FN1),
944 PINMUX_DATA(KEYIN7_MARK, PORT50_FN3),
945 PINMUX_DATA(DV_D8_MARK, PORT50_FN6),
946 PINMUX_DATA(IRQ29_PORT50_MARK, PORT50_FN0, MSEL1CR_29_1),
947
948 /* Port51 */
949 PINMUX_DATA(LCD0_D7_MARK, PORT51_FN1),
950 PINMUX_DATA(KEYOUT0_MARK, PORT51_FN3),
951 PINMUX_DATA(DV_D7_MARK, PORT51_FN6),
952
953 /* Port52 */
954 PINMUX_DATA(LCD0_D6_MARK, PORT52_FN1),
955 PINMUX_DATA(KEYOUT1_MARK, PORT52_FN3),
956 PINMUX_DATA(DV_D6_MARK, PORT52_FN6),
957
958 /* Port53 */
959 PINMUX_DATA(LCD0_D5_MARK, PORT53_FN1),
960 PINMUX_DATA(KEYOUT2_MARK, PORT53_FN3),
961 PINMUX_DATA(DV_D5_MARK, PORT53_FN6),
962
963 /* Port54 */
964 PINMUX_DATA(LCD0_D4_MARK, PORT54_FN1),
965 PINMUX_DATA(KEYOUT3_MARK, PORT54_FN3),
966 PINMUX_DATA(DV_D4_MARK, PORT54_FN6),
967
968 /* Port55 */
969 PINMUX_DATA(LCD0_D3_MARK, PORT55_FN1),
970 PINMUX_DATA(KEYOUT4_MARK, PORT55_FN3),
971 PINMUX_DATA(KEYIN3_PORT55_MARK, PORT55_FN4, MSEL4CR_18_1),
972 PINMUX_DATA(DV_D3_MARK, PORT55_FN6),
973
974 /* Port56 */
975 PINMUX_DATA(LCD0_D2_MARK, PORT56_FN1),
976 PINMUX_DATA(KEYOUT5_MARK, PORT56_FN3),
977 PINMUX_DATA(KEYIN2_PORT56_MARK, PORT56_FN4, MSEL4CR_18_1),
978 PINMUX_DATA(DV_D2_MARK, PORT56_FN6),
979 PINMUX_DATA(IRQ28_PORT56_MARK, PORT56_FN0, MSEL1CR_28_1),
980
981 /* Port57 */
982 PINMUX_DATA(LCD0_D1_MARK, PORT57_FN1),
983 PINMUX_DATA(KEYOUT6_MARK, PORT57_FN3),
984 PINMUX_DATA(KEYIN1_PORT57_MARK, PORT57_FN4, MSEL4CR_18_1),
985 PINMUX_DATA(DV_D1_MARK, PORT57_FN6),
986 PINMUX_DATA(IRQ27_PORT57_MARK, PORT57_FN0, MSEL1CR_27_1),
987
988 /* Port58 */
989 PINMUX_DATA(LCD0_D0_MARK, PORT58_FN1),
990 PINMUX_DATA(KEYOUT7_MARK, PORT58_FN3),
991 PINMUX_DATA(KEYIN0_PORT58_MARK, PORT58_FN4, MSEL4CR_18_1),
992 PINMUX_DATA(DV_D0_MARK, PORT58_FN6),
993 PINMUX_DATA(IRQ26_PORT58_MARK, PORT58_FN0, MSEL1CR_26_1),
994
995 /* Port59 */
996 PINMUX_DATA(LCD0_VCPWC_MARK, PORT59_FN1),
997 PINMUX_DATA(BBIF2_TSCK2_PORT59_MARK, PORT59_FN2, MSEL5CR_0_0),
998 PINMUX_DATA(RSPI_MOSI_A_MARK, PORT59_FN6),
999
1000 /* Port60 */
1001 PINMUX_DATA(LCD0_VEPWC_MARK, PORT60_FN1),
1002 PINMUX_DATA(BBIF2_RXD2_PORT60_MARK, PORT60_FN2, MSEL5CR_0_0),
1003 PINMUX_DATA(RSPI_MISO_A_MARK, PORT60_FN6),
1004
1005 /* Port61 */
1006 PINMUX_DATA(LCD0_DON_MARK, PORT61_FN1),
1007 PINMUX_DATA(MSIOF2_TXD_MARK, PORT61_FN2),
1008
1009 /* Port62 */
1010 PINMUX_DATA(LCD0_DCK_MARK, PORT62_FN1),
1011 PINMUX_DATA(LCD0_WR_MARK, PORT62_FN4),
1012 PINMUX_DATA(DV_CLK_MARK, PORT62_FN6),
1013 PINMUX_DATA(IRQ15_PORT62_MARK, PORT62_FN0, MSEL1CR_15_1),
1014
1015 /* Port63 */
1016 PINMUX_DATA(LCD0_VSYN_MARK, PORT63_FN1),
1017 PINMUX_DATA(DV_VSYNC_MARK, PORT63_FN6),
1018 PINMUX_DATA(IRQ14_PORT63_MARK, PORT63_FN0, MSEL1CR_14_1),
1019
1020 /* Port64 */
1021 PINMUX_DATA(LCD0_HSYN_MARK, PORT64_FN1),
1022 PINMUX_DATA(LCD0_CS_MARK, PORT64_FN4),
1023 PINMUX_DATA(DV_HSYNC_MARK, PORT64_FN6),
1024 PINMUX_DATA(IRQ13_PORT64_MARK, PORT64_FN0, MSEL1CR_13_1),
1025
1026 /* Port65 */
1027 PINMUX_DATA(LCD0_DISP_MARK, PORT65_FN1),
1028 PINMUX_DATA(MSIOF2_TSCK_MARK, PORT65_FN2),
1029 PINMUX_DATA(LCD0_RS_MARK, PORT65_FN4),
1030
1031 /* Port66 */
1032 PINMUX_DATA(MEMC_INT_MARK, PORT66_FN1),
1033 PINMUX_DATA(TPU0TO2_PORT66_MARK, PORT66_FN3, MSEL5CR_25_0),
1034 PINMUX_DATA(MMC0_CLK_PORT66_MARK, PORT66_FN4, MSEL4CR_15_0),
1035 PINMUX_DATA(SDHI1_CLK_MARK, PORT66_FN6),
1036
1037 /* Port67 - Port73 Function1 */
1038 PINMUX_DATA(MEMC_CS0_MARK, PORT67_FN1),
1039 PINMUX_DATA(MEMC_AD8_MARK, PORT68_FN1),
1040 PINMUX_DATA(MEMC_AD9_MARK, PORT69_FN1),
1041 PINMUX_DATA(MEMC_AD10_MARK, PORT70_FN1),
1042 PINMUX_DATA(MEMC_AD11_MARK, PORT71_FN1),
1043 PINMUX_DATA(MEMC_AD12_MARK, PORT72_FN1),
1044 PINMUX_DATA(MEMC_AD13_MARK, PORT73_FN1),
1045
1046 /* Port67 - Port73 Function2 */
1047 PINMUX_DATA(MSIOF1_SS1_PORT67_MARK, PORT67_FN2, MSEL4CR_10_1),
1048 PINMUX_DATA(MSIOF1_RSCK_MARK, PORT68_FN2),
1049 PINMUX_DATA(MSIOF1_RSYNC_MARK, PORT69_FN2),
1050 PINMUX_DATA(MSIOF1_MCK0_MARK, PORT70_FN2),
1051 PINMUX_DATA(MSIOF1_MCK1_MARK, PORT71_FN2),
1052 PINMUX_DATA(MSIOF1_TSCK_PORT72_MARK, PORT72_FN2, MSEL4CR_10_1),
1053 PINMUX_DATA(MSIOF1_TSYNC_PORT73_MARK, PORT73_FN2, MSEL4CR_10_1),
1054
1055 /* Port67 - Port73 Function4 */
1056 PINMUX_DATA(MMC0_CMD_PORT67_MARK, PORT67_FN4, MSEL4CR_15_0),
1057 PINMUX_DATA(MMC0_D0_PORT68_MARK, PORT68_FN4, MSEL4CR_15_0),
1058 PINMUX_DATA(MMC0_D1_PORT69_MARK, PORT69_FN4, MSEL4CR_15_0),
1059 PINMUX_DATA(MMC0_D2_PORT70_MARK, PORT70_FN4, MSEL4CR_15_0),
1060 PINMUX_DATA(MMC0_D3_PORT71_MARK, PORT71_FN4, MSEL4CR_15_0),
1061 PINMUX_DATA(MMC0_D4_PORT72_MARK, PORT72_FN4, MSEL4CR_15_0),
1062 PINMUX_DATA(MMC0_D5_PORT73_MARK, PORT73_FN4, MSEL4CR_15_0),
1063
1064 /* Port67 - Port73 Function6 */
1065 PINMUX_DATA(SDHI1_CMD_MARK, PORT67_FN6),
1066 PINMUX_DATA(SDHI1_D0_MARK, PORT68_FN6),
1067 PINMUX_DATA(SDHI1_D1_MARK, PORT69_FN6),
1068 PINMUX_DATA(SDHI1_D2_MARK, PORT70_FN6),
1069 PINMUX_DATA(SDHI1_D3_MARK, PORT71_FN6),
1070 PINMUX_DATA(SDHI1_CD_MARK, PORT72_FN6),
1071 PINMUX_DATA(SDHI1_WP_MARK, PORT73_FN6),
1072
1073 /* Port67 - Port71 IRQ */
1074 PINMUX_DATA(IRQ20_MARK, PORT67_FN0),
1075 PINMUX_DATA(IRQ16_PORT68_MARK, PORT68_FN0, MSEL1CR_16_0),
1076 PINMUX_DATA(IRQ17_MARK, PORT69_FN0),
1077 PINMUX_DATA(IRQ18_MARK, PORT70_FN0),
1078 PINMUX_DATA(IRQ19_MARK, PORT71_FN0),
1079
1080 /* Port74 */
1081 PINMUX_DATA(MEMC_AD14_MARK, PORT74_FN1),
1082 PINMUX_DATA(MSIOF1_TXD_PORT74_MARK, PORT74_FN2, MSEL4CR_10_1),
1083 PINMUX_DATA(MMC0_D6_PORT74_MARK, PORT74_FN4, MSEL4CR_15_0),
1084 PINMUX_DATA(STP1_IPD7_MARK, PORT74_FN6),
1085 PINMUX_DATA(LCD1_D21_MARK, PORT74_FN7),
1086
1087 /* Port75 */
1088 PINMUX_DATA(MEMC_AD15_MARK, PORT75_FN1),
1089 PINMUX_DATA(MSIOF1_RXD_PORT75_MARK, PORT75_FN2, MSEL4CR_10_1),
1090 PINMUX_DATA(MMC0_D7_PORT75_MARK, PORT75_FN4, MSEL4CR_15_0),
1091 PINMUX_DATA(STP1_IPD6_MARK, PORT75_FN6),
1092 PINMUX_DATA(LCD1_D20_MARK, PORT75_FN7),
1093
1094 /* Port76 - Port80 Function */
1095 PINMUX_DATA(SDHI0_CMD_MARK, PORT76_FN1),
1096 PINMUX_DATA(SDHI0_D0_MARK, PORT77_FN1),
1097 PINMUX_DATA(SDHI0_D1_MARK, PORT78_FN1),
1098 PINMUX_DATA(SDHI0_D2_MARK, PORT79_FN1),
1099 PINMUX_DATA(SDHI0_D3_MARK, PORT80_FN1),
1100
1101 /* Port81 */
1102 PINMUX_DATA(SDHI0_CD_MARK, PORT81_FN1),
1103 PINMUX_DATA(IRQ26_PORT81_MARK, PORT81_FN0, MSEL1CR_26_0),
1104
1105 /* Port82 - Port88 Function */
1106 PINMUX_DATA(SDHI0_CLK_MARK, PORT82_FN1),
1107 PINMUX_DATA(SDHI0_WP_MARK, PORT83_FN1),
1108 PINMUX_DATA(RESETOUTS_MARK, PORT84_FN1),
1109 PINMUX_DATA(USB0_PPON_MARK, PORT85_FN1),
1110 PINMUX_DATA(USB0_OCI_MARK, PORT86_FN1),
1111 PINMUX_DATA(USB1_PPON_MARK, PORT87_FN1),
1112 PINMUX_DATA(USB1_OCI_MARK, PORT88_FN1),
1113
1114 /* Port89 */
1115 PINMUX_DATA(DREQ0_MARK, PORT89_FN1),
1116 PINMUX_DATA(BBIF2_TSCK2_PORT89_MARK, PORT89_FN2, MSEL5CR_0_1),
1117 PINMUX_DATA(RSPI_SSL3_A_MARK, PORT89_FN6),
1118
1119 /* Port90 */
1120 PINMUX_DATA(DACK0_MARK, PORT90_FN1),
1121 PINMUX_DATA(BBIF2_RXD2_PORT90_MARK, PORT90_FN2, MSEL5CR_0_1),
1122 PINMUX_DATA(RSPI_SSL2_A_MARK, PORT90_FN6),
1123 PINMUX_DATA(WAIT_PORT90_MARK, PORT90_FN7, MSEL5CR_2_1),
1124
1125 /* Port91 */
1126 PINMUX_DATA(MEMC_AD0_MARK, PORT91_FN1),
1127 PINMUX_DATA(BBIF1_RXD_MARK, PORT91_FN2),
1128 PINMUX_DATA(SCIFA5_TXD_PORT91_MARK, PORT91_FN3, MSEL5CR_15_1, MSEL5CR_14_0),
1129 PINMUX_DATA(LCD1_D5_MARK, PORT91_FN7),
1130
1131 /* Port92 */
1132 PINMUX_DATA(MEMC_AD1_MARK, PORT92_FN1),
1133 PINMUX_DATA(BBIF1_TSYNC_MARK, PORT92_FN2),
1134 PINMUX_DATA(SCIFA5_RXD_PORT92_MARK, PORT92_FN3, MSEL5CR_15_1, MSEL5CR_14_0),
1135 PINMUX_DATA(STP0_IPD1_MARK, PORT92_FN6),
1136 PINMUX_DATA(LCD1_D6_MARK, PORT92_FN7),
1137
1138 /* Port93 */
1139 PINMUX_DATA(MEMC_AD2_MARK, PORT93_FN1),
1140 PINMUX_DATA(BBIF1_TSCK_MARK, PORT93_FN2),
1141 PINMUX_DATA(SCIFA4_TXD_PORT93_MARK, PORT93_FN3, MSEL5CR_12_1, MSEL5CR_11_0),
1142 PINMUX_DATA(STP0_IPD3_MARK, PORT93_FN6),
1143 PINMUX_DATA(LCD1_D8_MARK, PORT93_FN7),
1144
1145 /* Port94 */
1146 PINMUX_DATA(MEMC_AD3_MARK, PORT94_FN1),
1147 PINMUX_DATA(BBIF1_TXD_MARK, PORT94_FN2),
1148 PINMUX_DATA(SCIFA4_RXD_PORT94_MARK, PORT94_FN3, MSEL5CR_12_1, MSEL5CR_11_0),
1149 PINMUX_DATA(STP0_IPD4_MARK, PORT94_FN6),
1150 PINMUX_DATA(LCD1_D9_MARK, PORT94_FN7),
1151
1152 /* Port95 */
1153 PINMUX_DATA(MEMC_CS1_MARK, PORT95_FN1, MSEL4CR_6_0),
1154 PINMUX_DATA(MEMC_A1_MARK, PORT95_FN1, MSEL4CR_6_1),
1155
1156 PINMUX_DATA(SCIFA2_CTS_MARK, PORT95_FN2),
1157 PINMUX_DATA(SIM_RST_MARK, PORT95_FN4),
1158 PINMUX_DATA(VIO0_D14_PORT95_MARK, PORT95_FN7, MSEL5CR_27_1),
1159 PINMUX_DATA(IRQ22_MARK, PORT95_FN0),
1160
1161 /* Port96 */
1162 PINMUX_DATA(MEMC_ADV_MARK, PORT96_FN1, MSEL4CR_6_0),
1163 PINMUX_DATA(MEMC_DREQ0_MARK, PORT96_FN1, MSEL4CR_6_1),
1164
1165 PINMUX_DATA(SCIFA2_RTS_MARK, PORT96_FN2),
1166 PINMUX_DATA(SIM_CLK_MARK, PORT96_FN4),
1167 PINMUX_DATA(VIO0_D15_PORT96_MARK, PORT96_FN7, MSEL5CR_27_1),
1168 PINMUX_DATA(IRQ23_MARK, PORT96_FN0),
1169
1170 /* Port97 */
1171 PINMUX_DATA(MEMC_AD4_MARK, PORT97_FN1),
1172 PINMUX_DATA(BBIF1_RSCK_MARK, PORT97_FN2),
1173 PINMUX_DATA(LCD1_CS_MARK, PORT97_FN6),
1174 PINMUX_DATA(LCD1_HSYN_MARK, PORT97_FN7),
1175 PINMUX_DATA(IRQ12_PORT97_MARK, PORT97_FN0, MSEL1CR_12_0),
1176
1177 /* Port98 */
1178 PINMUX_DATA(MEMC_AD5_MARK, PORT98_FN1),
1179 PINMUX_DATA(BBIF1_RSYNC_MARK, PORT98_FN2),
1180 PINMUX_DATA(LCD1_VSYN_MARK, PORT98_FN7),
1181 PINMUX_DATA(IRQ13_PORT98_MARK, PORT98_FN0, MSEL1CR_13_0),
1182
1183 /* Port99 */
1184 PINMUX_DATA(MEMC_AD6_MARK, PORT99_FN1),
1185 PINMUX_DATA(BBIF1_FLOW_MARK, PORT99_FN2),
1186 PINMUX_DATA(LCD1_WR_MARK, PORT99_FN6),
1187 PINMUX_DATA(LCD1_DCK_MARK, PORT99_FN7),
1188 PINMUX_DATA(IRQ14_PORT99_MARK, PORT99_FN0, MSEL1CR_14_0),
1189
1190 /* Port100 */
1191 PINMUX_DATA(MEMC_AD7_MARK, PORT100_FN1),
1192 PINMUX_DATA(BBIF1_RX_FLOW_N_MARK, PORT100_FN2),
1193 PINMUX_DATA(LCD1_DON_MARK, PORT100_FN7),
1194 PINMUX_DATA(IRQ15_PORT100_MARK, PORT100_FN0, MSEL1CR_15_0),
1195
1196 /* Port101 */
1197 PINMUX_DATA(FCE0_MARK, PORT101_FN1),
1198
1199 /* Port102 */
1200 PINMUX_DATA(FRB_MARK, PORT102_FN1),
1201 PINMUX_DATA(LCD0_LCLK_PORT102_MARK, PORT102_FN4, MSEL5CR_6_0),
1202
1203 /* Port103 */
1204 PINMUX_DATA(CS5B_MARK, PORT103_FN1),
1205 PINMUX_DATA(FCE1_MARK, PORT103_FN2),
1206 PINMUX_DATA(MMC1_CLK_PORT103_MARK, PORT103_FN3, MSEL4CR_15_1),
1207
1208 /* Port104 */
1209 PINMUX_DATA(CS6A_MARK, PORT104_FN1),
1210 PINMUX_DATA(MMC1_CMD_PORT104_MARK, PORT104_FN3, MSEL4CR_15_1),
1211 PINMUX_DATA(IRQ11_MARK, PORT104_FN0),
1212
1213 /* Port105 */
1214 PINMUX_DATA(CS5A_PORT105_MARK, PORT105_FN1, MSEL5CR_2_0),
1215 PINMUX_DATA(SCIFA3_RTS_PORT105_MARK, PORT105_FN4, MSEL5CR_8_0),
1216
1217 /* Port106 */
1218 PINMUX_DATA(IOIS16_MARK, PORT106_FN1),
1219 PINMUX_DATA(IDE_EXBUF_ENB_MARK, PORT106_FN6),
1220
1221 /* Port107 - Port115 Function */
1222 PINMUX_DATA(WE3_ICIOWR_MARK, PORT107_FN1),
1223 PINMUX_DATA(WE2_ICIORD_MARK, PORT108_FN1),
1224 PINMUX_DATA(CS0_MARK, PORT109_FN1),
1225 PINMUX_DATA(CS2_MARK, PORT110_FN1),
1226 PINMUX_DATA(CS4_MARK, PORT111_FN1),
1227 PINMUX_DATA(WE1_MARK, PORT112_FN1),
1228 PINMUX_DATA(WE0_FWE_MARK, PORT113_FN1),
1229 PINMUX_DATA(RDWR_MARK, PORT114_FN1),
1230 PINMUX_DATA(RD_FSC_MARK, PORT115_FN1),
1231
1232 /* Port116 */
1233 PINMUX_DATA(A25_MARK, PORT116_FN1),
1234 PINMUX_DATA(MSIOF0_SS2_MARK, PORT116_FN2),
1235 PINMUX_DATA(MSIOF1_SS2_PORT116_MARK, PORT116_FN3, MSEL4CR_10_0),
1236 PINMUX_DATA(SCIFA3_SCK_PORT116_MARK, PORT116_FN4, MSEL5CR_8_0),
1237 PINMUX_DATA(GPO1_MARK, PORT116_FN5),
1238
1239 /* Port117 */
1240 PINMUX_DATA(A24_MARK, PORT117_FN1),
1241 PINMUX_DATA(MSIOF0_SS1_MARK, PORT117_FN2),
1242 PINMUX_DATA(MSIOF1_SS1_PORT117_MARK, PORT117_FN3, MSEL4CR_10_0),
1243 PINMUX_DATA(SCIFA3_CTS_PORT117_MARK, PORT117_FN4, MSEL5CR_8_0),
1244 PINMUX_DATA(GPO0_MARK, PORT117_FN5),
1245
1246 /* Port118 */
1247 PINMUX_DATA(A23_MARK, PORT118_FN1),
1248 PINMUX_DATA(MSIOF0_MCK1_MARK, PORT118_FN2),
1249 PINMUX_DATA(MSIOF1_RXD_PORT118_MARK, PORT118_FN3, MSEL4CR_10_0),
1250 PINMUX_DATA(GPI1_MARK, PORT118_FN5),
1251 PINMUX_DATA(IRQ9_PORT118_MARK, PORT118_FN0, MSEL1CR_9_0),
1252
1253 /* Port119 */
1254 PINMUX_DATA(A22_MARK, PORT119_FN1),
1255 PINMUX_DATA(MSIOF0_MCK0_MARK, PORT119_FN2),
1256 PINMUX_DATA(MSIOF1_TXD_PORT119_MARK, PORT119_FN3, MSEL4CR_10_0),
1257 PINMUX_DATA(GPI0_MARK, PORT119_FN5),
1258 PINMUX_DATA(IRQ8_MARK, PORT119_FN0),
1259
1260 /* Port120 */
1261 PINMUX_DATA(A21_MARK, PORT120_FN1),
1262 PINMUX_DATA(MSIOF0_RSYNC_MARK, PORT120_FN2),
1263 PINMUX_DATA(MSIOF1_TSYNC_PORT120_MARK, PORT120_FN3, MSEL4CR_10_0),
1264 PINMUX_DATA(IRQ7_PORT120_MARK, PORT120_FN0, MSEL1CR_7_1),
1265
1266 /* Port121 */
1267 PINMUX_DATA(A20_MARK, PORT121_FN1),
1268 PINMUX_DATA(MSIOF0_RSCK_MARK, PORT121_FN2),
1269 PINMUX_DATA(MSIOF1_TSCK_PORT121_MARK, PORT121_FN3, MSEL4CR_10_0),
1270 PINMUX_DATA(IRQ6_PORT121_MARK, PORT121_FN0, MSEL1CR_6_0),
1271
1272 /* Port122 */
1273 PINMUX_DATA(A19_MARK, PORT122_FN1),
1274 PINMUX_DATA(MSIOF0_RXD_MARK, PORT122_FN2),
1275
1276 /* Port123 */
1277 PINMUX_DATA(A18_MARK, PORT123_FN1),
1278 PINMUX_DATA(MSIOF0_TSCK_MARK, PORT123_FN2),
1279
1280 /* Port124 */
1281 PINMUX_DATA(A17_MARK, PORT124_FN1),
1282 PINMUX_DATA(MSIOF0_TSYNC_MARK, PORT124_FN2),
1283
1284 /* Port125 - Port141 Function */
1285 PINMUX_DATA(A16_MARK, PORT125_FN1),
1286 PINMUX_DATA(A15_MARK, PORT126_FN1),
1287 PINMUX_DATA(A14_MARK, PORT127_FN1),
1288 PINMUX_DATA(A13_MARK, PORT128_FN1),
1289 PINMUX_DATA(A12_MARK, PORT129_FN1),
1290 PINMUX_DATA(A11_MARK, PORT130_FN1),
1291 PINMUX_DATA(A10_MARK, PORT131_FN1),
1292 PINMUX_DATA(A9_MARK, PORT132_FN1),
1293 PINMUX_DATA(A8_MARK, PORT133_FN1),
1294 PINMUX_DATA(A7_MARK, PORT134_FN1),
1295 PINMUX_DATA(A6_MARK, PORT135_FN1),
1296 PINMUX_DATA(A5_FCDE_MARK, PORT136_FN1),
1297 PINMUX_DATA(A4_FOE_MARK, PORT137_FN1),
1298 PINMUX_DATA(A3_MARK, PORT138_FN1),
1299 PINMUX_DATA(A2_MARK, PORT139_FN1),
1300 PINMUX_DATA(A1_MARK, PORT140_FN1),
1301 PINMUX_DATA(CKO_MARK, PORT141_FN1),
1302
1303 /* Port142 - Port157 Function1 */
1304 PINMUX_DATA(D15_NAF15_MARK, PORT142_FN1),
1305 PINMUX_DATA(D14_NAF14_MARK, PORT143_FN1),
1306 PINMUX_DATA(D13_NAF13_MARK, PORT144_FN1),
1307 PINMUX_DATA(D12_NAF12_MARK, PORT145_FN1),
1308 PINMUX_DATA(D11_NAF11_MARK, PORT146_FN1),
1309 PINMUX_DATA(D10_NAF10_MARK, PORT147_FN1),
1310 PINMUX_DATA(D9_NAF9_MARK, PORT148_FN1),
1311 PINMUX_DATA(D8_NAF8_MARK, PORT149_FN1),
1312 PINMUX_DATA(D7_NAF7_MARK, PORT150_FN1),
1313 PINMUX_DATA(D6_NAF6_MARK, PORT151_FN1),
1314 PINMUX_DATA(D5_NAF5_MARK, PORT152_FN1),
1315 PINMUX_DATA(D4_NAF4_MARK, PORT153_FN1),
1316 PINMUX_DATA(D3_NAF3_MARK, PORT154_FN1),
1317 PINMUX_DATA(D2_NAF2_MARK, PORT155_FN1),
1318 PINMUX_DATA(D1_NAF1_MARK, PORT156_FN1),
1319 PINMUX_DATA(D0_NAF0_MARK, PORT157_FN1),
1320
1321 /* Port142 - Port149 Function3 */
1322 PINMUX_DATA(MMC1_D7_PORT142_MARK, PORT142_FN3, MSEL4CR_15_1),
1323 PINMUX_DATA(MMC1_D6_PORT143_MARK, PORT143_FN3, MSEL4CR_15_1),
1324 PINMUX_DATA(MMC1_D5_PORT144_MARK, PORT144_FN3, MSEL4CR_15_1),
1325 PINMUX_DATA(MMC1_D4_PORT145_MARK, PORT145_FN3, MSEL4CR_15_1),
1326 PINMUX_DATA(MMC1_D3_PORT146_MARK, PORT146_FN3, MSEL4CR_15_1),
1327 PINMUX_DATA(MMC1_D2_PORT147_MARK, PORT147_FN3, MSEL4CR_15_1),
1328 PINMUX_DATA(MMC1_D1_PORT148_MARK, PORT148_FN3, MSEL4CR_15_1),
1329 PINMUX_DATA(MMC1_D0_PORT149_MARK, PORT149_FN3, MSEL4CR_15_1),
1330
1331 /* Port158 */
1332 PINMUX_DATA(D31_MARK, PORT158_FN1),
1333 PINMUX_DATA(SCIFA3_SCK_PORT158_MARK, PORT158_FN2, MSEL5CR_8_1),
1334 PINMUX_DATA(RMII_REF125CK_MARK, PORT158_FN3),
1335 PINMUX_DATA(LCD0_D21_PORT158_MARK, PORT158_FN4, MSEL5CR_6_1),
1336 PINMUX_DATA(IRDA_FIRSEL_MARK, PORT158_FN5),
1337 PINMUX_DATA(IDE_D15_MARK, PORT158_FN6),
1338
1339 /* Port159 */
1340 PINMUX_DATA(D30_MARK, PORT159_FN1),
1341 PINMUX_DATA(SCIFA3_RXD_PORT159_MARK, PORT159_FN2, MSEL5CR_8_1),
1342 PINMUX_DATA(RMII_REF50CK_MARK, PORT159_FN3),
1343 PINMUX_DATA(LCD0_D23_PORT159_MARK, PORT159_FN4, MSEL5CR_6_1),
1344 PINMUX_DATA(IDE_D14_MARK, PORT159_FN6),
1345
1346 /* Port160 */
1347 PINMUX_DATA(D29_MARK, PORT160_FN1),
1348 PINMUX_DATA(SCIFA3_TXD_PORT160_MARK, PORT160_FN2, MSEL5CR_8_1),
1349 PINMUX_DATA(LCD0_D22_PORT160_MARK, PORT160_FN4, MSEL5CR_6_1),
1350 PINMUX_DATA(VIO1_HD_MARK, PORT160_FN5),
1351 PINMUX_DATA(IDE_D13_MARK, PORT160_FN6),
1352
1353 /* Port161 */
1354 PINMUX_DATA(D28_MARK, PORT161_FN1),
1355 PINMUX_DATA(SCIFA3_RTS_PORT161_MARK, PORT161_FN2, MSEL5CR_8_1),
1356 PINMUX_DATA(ET_RX_DV_MARK, PORT161_FN3),
1357 PINMUX_DATA(LCD0_D20_PORT161_MARK, PORT161_FN4, MSEL5CR_6_1),
1358 PINMUX_DATA(IRDA_IN_MARK, PORT161_FN5),
1359 PINMUX_DATA(IDE_D12_MARK, PORT161_FN6),
1360
1361 /* Port162 */
1362 PINMUX_DATA(D27_MARK, PORT162_FN1),
1363 PINMUX_DATA(SCIFA3_CTS_PORT162_MARK, PORT162_FN2, MSEL5CR_8_1),
1364 PINMUX_DATA(LCD0_D19_PORT162_MARK, PORT162_FN4, MSEL5CR_6_1),
1365 PINMUX_DATA(IRDA_OUT_MARK, PORT162_FN5),
1366 PINMUX_DATA(IDE_D11_MARK, PORT162_FN6),
1367
1368 /* Port163 */
1369 PINMUX_DATA(D26_MARK, PORT163_FN1),
1370 PINMUX_DATA(MSIOF2_SS2_MARK, PORT163_FN2),
1371 PINMUX_DATA(ET_COL_MARK, PORT163_FN3),
1372 PINMUX_DATA(LCD0_D18_PORT163_MARK, PORT163_FN4, MSEL5CR_6_1),
1373 PINMUX_DATA(IROUT_MARK, PORT163_FN5),
1374 PINMUX_DATA(IDE_D10_MARK, PORT163_FN6),
1375
1376 /* Port164 */
1377 PINMUX_DATA(D25_MARK, PORT164_FN1),
1378 PINMUX_DATA(MSIOF2_TSYNC_MARK, PORT164_FN2),
1379 PINMUX_DATA(ET_PHY_INT_MARK, PORT164_FN3),
1380 PINMUX_DATA(LCD0_RD_MARK, PORT164_FN4),
1381 PINMUX_DATA(IDE_D9_MARK, PORT164_FN6),
1382
1383 /* Port165 */
1384 PINMUX_DATA(D24_MARK, PORT165_FN1),
1385 PINMUX_DATA(MSIOF2_RXD_MARK, PORT165_FN2),
1386 PINMUX_DATA(LCD0_LCLK_PORT165_MARK, PORT165_FN4, MSEL5CR_6_1),
1387 PINMUX_DATA(IDE_D8_MARK, PORT165_FN6),
1388
1389 /* Port166 - Port171 Function1 */
1390 PINMUX_DATA(D21_MARK, PORT166_FN1),
1391 PINMUX_DATA(D20_MARK, PORT167_FN1),
1392 PINMUX_DATA(D19_MARK, PORT168_FN1),
1393 PINMUX_DATA(D18_MARK, PORT169_FN1),
1394 PINMUX_DATA(D17_MARK, PORT170_FN1),
1395 PINMUX_DATA(D16_MARK, PORT171_FN1),
1396
1397 /* Port166 - Port171 Function3 */
1398 PINMUX_DATA(ET_ETXD5_MARK, PORT166_FN3),
1399 PINMUX_DATA(ET_ETXD4_MARK, PORT167_FN3),
1400 PINMUX_DATA(ET_ETXD3_MARK, PORT168_FN3),
1401 PINMUX_DATA(ET_ETXD2_MARK, PORT169_FN3),
1402 PINMUX_DATA(ET_ETXD1_MARK, PORT170_FN3),
1403 PINMUX_DATA(ET_ETXD0_MARK, PORT171_FN3),
1404
1405 /* Port166 - Port171 Function6 */
1406 PINMUX_DATA(IDE_D5_MARK, PORT166_FN6),
1407 PINMUX_DATA(IDE_D4_MARK, PORT167_FN6),
1408 PINMUX_DATA(IDE_D3_MARK, PORT168_FN6),
1409 PINMUX_DATA(IDE_D2_MARK, PORT169_FN6),
1410 PINMUX_DATA(IDE_D1_MARK, PORT170_FN6),
1411 PINMUX_DATA(IDE_D0_MARK, PORT171_FN6),
1412
1413 /* Port167 - Port171 IRQ */
1414 PINMUX_DATA(IRQ31_PORT167_MARK, PORT167_FN0, MSEL1CR_31_0),
1415 PINMUX_DATA(IRQ27_PORT168_MARK, PORT168_FN0, MSEL1CR_27_0),
1416 PINMUX_DATA(IRQ28_PORT169_MARK, PORT169_FN0, MSEL1CR_28_0),
1417 PINMUX_DATA(IRQ29_PORT170_MARK, PORT170_FN0, MSEL1CR_29_0),
1418 PINMUX_DATA(IRQ30_PORT171_MARK, PORT171_FN0, MSEL1CR_30_0),
1419
1420 /* Port172 */
1421 PINMUX_DATA(D23_MARK, PORT172_FN1),
1422 PINMUX_DATA(SCIFB_RTS_PORT172_MARK, PORT172_FN2, MSEL5CR_17_1),
1423 PINMUX_DATA(ET_ETXD7_MARK, PORT172_FN3),
1424 PINMUX_DATA(IDE_D7_MARK, PORT172_FN6),
1425 PINMUX_DATA(IRQ4_PORT172_MARK, PORT172_FN0, MSEL1CR_4_1),
1426
1427 /* Port173 */
1428 PINMUX_DATA(D22_MARK, PORT173_FN1),
1429 PINMUX_DATA(SCIFB_CTS_PORT173_MARK, PORT173_FN2, MSEL5CR_17_1),
1430 PINMUX_DATA(ET_ETXD6_MARK, PORT173_FN3),
1431 PINMUX_DATA(IDE_D6_MARK, PORT173_FN6),
1432 PINMUX_DATA(IRQ6_PORT173_MARK, PORT173_FN0, MSEL1CR_6_1),
1433
1434 /* Port174 */
1435 PINMUX_DATA(A26_MARK, PORT174_FN1),
1436 PINMUX_DATA(MSIOF0_TXD_MARK, PORT174_FN2),
1437 PINMUX_DATA(ET_RX_CLK_MARK, PORT174_FN3),
1438 PINMUX_DATA(SCIFA3_RXD_PORT174_MARK, PORT174_FN4, MSEL5CR_8_0),
1439
1440 /* Port175 */
1441 PINMUX_DATA(A0_MARK, PORT175_FN1),
1442 PINMUX_DATA(BS_MARK, PORT175_FN2),
1443 PINMUX_DATA(ET_WOL_MARK, PORT175_FN3),
1444 PINMUX_DATA(SCIFA3_TXD_PORT175_MARK, PORT175_FN4, MSEL5CR_8_0),
1445
1446 /* Port176 */
1447 PINMUX_DATA(ET_GTX_CLK_MARK, PORT176_FN3),
1448
1449 /* Port177 */
1450 PINMUX_DATA(WAIT_PORT177_MARK, PORT177_FN1, MSEL5CR_2_0),
1451 PINMUX_DATA(ET_LINK_MARK, PORT177_FN3),
1452 PINMUX_DATA(IDE_IOWR_MARK, PORT177_FN6),
1453 PINMUX_DATA(SDHI2_WP_PORT177_MARK, PORT177_FN7, MSEL5CR_19_1),
1454
1455 /* Port178 */
1456 PINMUX_DATA(VIO0_D12_MARK, PORT178_FN1),
1457 PINMUX_DATA(VIO1_D4_MARK, PORT178_FN5),
1458 PINMUX_DATA(IDE_IORD_MARK, PORT178_FN6),
1459
1460 /* Port179 */
1461 PINMUX_DATA(VIO0_D11_MARK, PORT179_FN1),
1462 PINMUX_DATA(VIO1_D3_MARK, PORT179_FN5),
1463 PINMUX_DATA(IDE_IORDY_MARK, PORT179_FN6),
1464
1465 /* Port180 */
1466 PINMUX_DATA(VIO0_D10_MARK, PORT180_FN1),
1467 PINMUX_DATA(TPU0TO3_MARK, PORT180_FN4),
1468 PINMUX_DATA(VIO1_D2_MARK, PORT180_FN5),
1469 PINMUX_DATA(IDE_INT_MARK, PORT180_FN6),
1470 PINMUX_DATA(IRQ24_MARK, PORT180_FN0),
1471
1472 /* Port181 */
1473 PINMUX_DATA(VIO0_D9_MARK, PORT181_FN1),
1474 PINMUX_DATA(VIO1_D1_MARK, PORT181_FN5),
1475 PINMUX_DATA(IDE_RST_MARK, PORT181_FN6),
1476
1477 /* Port182 */
1478 PINMUX_DATA(VIO0_D8_MARK, PORT182_FN1),
1479 PINMUX_DATA(VIO1_D0_MARK, PORT182_FN5),
1480 PINMUX_DATA(IDE_DIRECTION_MARK, PORT182_FN6),
1481
1482 /* Port183 */
1483 PINMUX_DATA(DREQ1_MARK, PORT183_FN1),
1484 PINMUX_DATA(BBIF2_TXD2_PORT183_MARK, PORT183_FN2, MSEL5CR_0_1),
1485 PINMUX_DATA(ET_TX_EN_MARK, PORT183_FN3),
1486
1487 /* Port184 */
1488 PINMUX_DATA(DACK1_MARK, PORT184_FN1),
1489 PINMUX_DATA(BBIF2_TSYNC2_PORT184_MARK, PORT184_FN2, MSEL5CR_0_1),
1490 PINMUX_DATA(ET_TX_CLK_MARK, PORT184_FN3),
1491
1492 /* Port185 - Port192 Function1 */
1493 PINMUX_DATA(SCIFA1_SCK_MARK, PORT185_FN1),
1494 PINMUX_DATA(SCIFB_RTS_PORT186_MARK, PORT186_FN1, MSEL5CR_17_0),
1495 PINMUX_DATA(SCIFB_CTS_PORT187_MARK, PORT187_FN1, MSEL5CR_17_0),
1496 PINMUX_DATA(SCIFA0_SCK_MARK, PORT188_FN1),
1497 PINMUX_DATA(SCIFB_SCK_PORT190_MARK, PORT190_FN1, MSEL5CR_17_0),
1498 PINMUX_DATA(SCIFB_RXD_PORT191_MARK, PORT191_FN1, MSEL5CR_17_0),
1499 PINMUX_DATA(SCIFB_TXD_PORT192_MARK, PORT192_FN1, MSEL5CR_17_0),
1500
1501 /* Port185 - Port192 Function3 */
1502 PINMUX_DATA(ET_ERXD0_MARK, PORT185_FN3),
1503 PINMUX_DATA(ET_ERXD1_MARK, PORT186_FN3),
1504 PINMUX_DATA(ET_ERXD2_MARK, PORT187_FN3),
1505 PINMUX_DATA(ET_ERXD3_MARK, PORT188_FN3),
1506 PINMUX_DATA(ET_ERXD4_MARK, PORT189_FN3),
1507 PINMUX_DATA(ET_ERXD5_MARK, PORT190_FN3),
1508 PINMUX_DATA(ET_ERXD6_MARK, PORT191_FN3),
1509 PINMUX_DATA(ET_ERXD7_MARK, PORT192_FN3),
1510
1511 /* Port185 - Port192 Function6 */
1512 PINMUX_DATA(STP1_IPCLK_MARK, PORT185_FN6),
1513 PINMUX_DATA(STP1_IPD0_PORT186_MARK, PORT186_FN6, MSEL5CR_23_0),
1514 PINMUX_DATA(STP1_IPEN_PORT187_MARK, PORT187_FN6, MSEL5CR_23_0),
1515 PINMUX_DATA(STP1_IPSYNC_MARK, PORT188_FN6),
1516 PINMUX_DATA(STP0_IPCLK_MARK, PORT189_FN6),
1517 PINMUX_DATA(STP0_IPD0_MARK, PORT190_FN6),
1518 PINMUX_DATA(STP0_IPEN_MARK, PORT191_FN6),
1519 PINMUX_DATA(STP0_IPSYNC_MARK, PORT192_FN6),
1520
1521 /* Port193 */
1522 PINMUX_DATA(SCIFA0_CTS_MARK, PORT193_FN1),
1523 PINMUX_DATA(RMII_CRS_DV_MARK, PORT193_FN3),
1524 PINMUX_DATA(STP1_IPEN_PORT193_MARK, PORT193_FN6, MSEL5CR_23_1), /* ? */
1525 PINMUX_DATA(LCD1_D17_MARK, PORT193_FN7),
1526
1527 /* Port194 */
1528 PINMUX_DATA(SCIFA0_RTS_MARK, PORT194_FN1),
1529 PINMUX_DATA(RMII_RX_ER_MARK, PORT194_FN3),
1530 PINMUX_DATA(STP1_IPD0_PORT194_MARK, PORT194_FN6, MSEL5CR_23_1), /* ? */
1531 PINMUX_DATA(LCD1_D16_MARK, PORT194_FN7),
1532
1533 /* Port195 */
1534 PINMUX_DATA(SCIFA1_RXD_MARK, PORT195_FN1),
1535 PINMUX_DATA(RMII_RXD0_MARK, PORT195_FN3),
1536 PINMUX_DATA(STP1_IPD3_MARK, PORT195_FN6),
1537 PINMUX_DATA(LCD1_D15_MARK, PORT195_FN7),
1538
1539 /* Port196 */
1540 PINMUX_DATA(SCIFA1_TXD_MARK, PORT196_FN1),
1541 PINMUX_DATA(RMII_RXD1_MARK, PORT196_FN3),
1542 PINMUX_DATA(STP1_IPD2_MARK, PORT196_FN6),
1543 PINMUX_DATA(LCD1_D14_MARK, PORT196_FN7),
1544
1545 /* Port197 */
1546 PINMUX_DATA(SCIFA0_RXD_MARK, PORT197_FN1),
1547 PINMUX_DATA(VIO1_CLK_MARK, PORT197_FN5),
1548 PINMUX_DATA(STP1_IPD5_MARK, PORT197_FN6),
1549 PINMUX_DATA(LCD1_D19_MARK, PORT197_FN7),
1550
1551 /* Port198 */
1552 PINMUX_DATA(SCIFA0_TXD_MARK, PORT198_FN1),
1553 PINMUX_DATA(VIO1_VD_MARK, PORT198_FN5),
1554 PINMUX_DATA(STP1_IPD4_MARK, PORT198_FN6),
1555 PINMUX_DATA(LCD1_D18_MARK, PORT198_FN7),
1556
1557 /* Port199 */
1558 PINMUX_DATA(MEMC_NWE_MARK, PORT199_FN1),
1559 PINMUX_DATA(SCIFA2_SCK_PORT199_MARK, PORT199_FN2, MSEL5CR_7_1),
1560 PINMUX_DATA(RMII_TX_EN_MARK, PORT199_FN3),
1561 PINMUX_DATA(SIM_D_PORT199_MARK, PORT199_FN4, MSEL5CR_21_1),
1562 PINMUX_DATA(STP1_IPD1_MARK, PORT199_FN6),
1563 PINMUX_DATA(LCD1_D13_MARK, PORT199_FN7),
1564
1565 /* Port200 */
1566 PINMUX_DATA(MEMC_NOE_MARK, PORT200_FN1),
1567 PINMUX_DATA(SCIFA2_RXD_MARK, PORT200_FN2),
1568 PINMUX_DATA(RMII_TXD0_MARK, PORT200_FN3),
1569 PINMUX_DATA(STP0_IPD7_MARK, PORT200_FN6),
1570 PINMUX_DATA(LCD1_D12_MARK, PORT200_FN7),
1571
1572 /* Port201 */
1573 PINMUX_DATA(MEMC_WAIT_MARK, PORT201_FN1, MSEL4CR_6_0),
1574 PINMUX_DATA(MEMC_DREQ1_MARK, PORT201_FN1, MSEL4CR_6_1),
1575
1576 PINMUX_DATA(SCIFA2_TXD_MARK, PORT201_FN2),
1577 PINMUX_DATA(RMII_TXD1_MARK, PORT201_FN3),
1578 PINMUX_DATA(STP0_IPD6_MARK, PORT201_FN6),
1579 PINMUX_DATA(LCD1_D11_MARK, PORT201_FN7),
1580
1581 /* Port202 */
1582 PINMUX_DATA(MEMC_BUSCLK_MARK, PORT202_FN1, MSEL4CR_6_0),
1583 PINMUX_DATA(MEMC_A0_MARK, PORT202_FN1, MSEL4CR_6_1),
1584
1585 PINMUX_DATA(MSIOF1_SS2_PORT202_MARK, PORT202_FN2, MSEL4CR_10_1),
1586 PINMUX_DATA(RMII_MDC_MARK, PORT202_FN3),
1587 PINMUX_DATA(TPU0TO2_PORT202_MARK, PORT202_FN4, MSEL5CR_25_1),
1588 PINMUX_DATA(IDE_CS0_MARK, PORT202_FN6),
1589 PINMUX_DATA(SDHI2_CD_PORT202_MARK, PORT202_FN7, MSEL5CR_19_1),
1590 PINMUX_DATA(IRQ21_MARK, PORT202_FN0),
1591
1592 /* Port203 - Port208 Function1 */
1593 PINMUX_DATA(SDHI2_CLK_MARK, PORT203_FN1),
1594 PINMUX_DATA(SDHI2_CMD_MARK, PORT204_FN1),
1595 PINMUX_DATA(SDHI2_D0_MARK, PORT205_FN1),
1596 PINMUX_DATA(SDHI2_D1_MARK, PORT206_FN1),
1597 PINMUX_DATA(SDHI2_D2_MARK, PORT207_FN1),
1598 PINMUX_DATA(SDHI2_D3_MARK, PORT208_FN1),
1599
1600 /* Port203 - Port208 Function3 */
1601 PINMUX_DATA(ET_TX_ER_MARK, PORT203_FN3),
1602 PINMUX_DATA(ET_RX_ER_MARK, PORT204_FN3),
1603 PINMUX_DATA(ET_CRS_MARK, PORT205_FN3),
1604 PINMUX_DATA(ET_MDC_MARK, PORT206_FN3),
1605 PINMUX_DATA(ET_MDIO_MARK, PORT207_FN3),
1606 PINMUX_DATA(RMII_MDIO_MARK, PORT208_FN3),
1607
1608 /* Port203 - Port208 Function6 */
1609 PINMUX_DATA(IDE_A2_MARK, PORT203_FN6),
1610 PINMUX_DATA(IDE_A1_MARK, PORT204_FN6),
1611 PINMUX_DATA(IDE_A0_MARK, PORT205_FN6),
1612 PINMUX_DATA(IDE_IODACK_MARK, PORT206_FN6),
1613 PINMUX_DATA(IDE_IODREQ_MARK, PORT207_FN6),
1614 PINMUX_DATA(IDE_CS1_MARK, PORT208_FN6),
1615
1616 /* Port203 - Port208 Function7 */
1617 PINMUX_DATA(SCIFA4_TXD_PORT203_MARK, PORT203_FN7, MSEL5CR_12_0, MSEL5CR_11_1),
1618 PINMUX_DATA(SCIFA4_RXD_PORT204_MARK, PORT204_FN7, MSEL5CR_12_0, MSEL5CR_11_1),
1619 PINMUX_DATA(SCIFA4_SCK_PORT205_MARK, PORT205_FN7, MSEL5CR_10_1),
1620 PINMUX_DATA(SCIFA5_SCK_PORT206_MARK, PORT206_FN7, MSEL5CR_13_1),
1621 PINMUX_DATA(SCIFA5_RXD_PORT207_MARK, PORT207_FN7, MSEL5CR_15_0, MSEL5CR_14_1),
1622 PINMUX_DATA(SCIFA5_TXD_PORT208_MARK, PORT208_FN7, MSEL5CR_15_0, MSEL5CR_14_1),
1623
1624 /* Port209 */
1625 PINMUX_DATA(VBUS_MARK, PORT209_FN1),
1626 PINMUX_DATA(IRQ7_PORT209_MARK, PORT209_FN0, MSEL1CR_7_0),
1627
1628 /* Port210 */
1629 PINMUX_DATA(IRQ9_PORT210_MARK, PORT210_FN0, MSEL1CR_9_1),
1630 PINMUX_DATA(HDMI_HPD_MARK, PORT210_FN1),
1631
1632 /* Port211 */
1633 PINMUX_DATA(IRQ16_PORT211_MARK, PORT211_FN0, MSEL1CR_16_1),
1634 PINMUX_DATA(HDMI_CEC_MARK, PORT211_FN1),
1635
1636 /* LCDC select */
1637 PINMUX_DATA(LCDC0_SELECT_MARK, MSEL3CR_6_0),
1638 PINMUX_DATA(LCDC1_SELECT_MARK, MSEL3CR_6_1),
1639
1640 /* SDENC */
1641 PINMUX_DATA(SDENC_CPG_MARK, MSEL4CR_19_0),
1642 PINMUX_DATA(SDENC_DV_CLKI_MARK, MSEL4CR_19_1),
1643
1644 /* SYSC */
1645 PINMUX_DATA(RESETP_PULLUP_MARK, MSEL4CR_4_0),
1646 PINMUX_DATA(RESETP_PLAIN_MARK, MSEL4CR_4_1),
1647
1648 /* DEBUG */
1649 PINMUX_DATA(EDEBGREQ_PULLDOWN_MARK, MSEL4CR_1_0),
1650 PINMUX_DATA(EDEBGREQ_PULLUP_MARK, MSEL4CR_1_1),
1651
1652 PINMUX_DATA(TRACEAUD_FROM_VIO_MARK, MSEL5CR_30_0, MSEL5CR_29_0),
1653 PINMUX_DATA(TRACEAUD_FROM_LCDC0_MARK, MSEL5CR_30_0, MSEL5CR_29_1),
1654 PINMUX_DATA(TRACEAUD_FROM_MEMC_MARK, MSEL5CR_30_1, MSEL5CR_29_0),
1655};
1656
1657static struct pinmux_gpio pinmux_gpios[] = {
1658
1659 /* PORT */
1660 GPIO_PORT_ALL(),
1661
1662 /* IRQ */
1663 GPIO_FN(IRQ0_PORT2), GPIO_FN(IRQ0_PORT13),
1664 GPIO_FN(IRQ1),
1665 GPIO_FN(IRQ2_PORT11), GPIO_FN(IRQ2_PORT12),
1666 GPIO_FN(IRQ3_PORT10), GPIO_FN(IRQ3_PORT14),
1667 GPIO_FN(IRQ4_PORT15), GPIO_FN(IRQ4_PORT172),
1668 GPIO_FN(IRQ5_PORT0), GPIO_FN(IRQ5_PORT1),
1669 GPIO_FN(IRQ6_PORT121), GPIO_FN(IRQ6_PORT173),
1670 GPIO_FN(IRQ7_PORT120), GPIO_FN(IRQ7_PORT209),
1671 GPIO_FN(IRQ8),
1672 GPIO_FN(IRQ9_PORT118), GPIO_FN(IRQ9_PORT210),
1673 GPIO_FN(IRQ10),
1674 GPIO_FN(IRQ11),
1675 GPIO_FN(IRQ12_PORT42), GPIO_FN(IRQ12_PORT97),
1676 GPIO_FN(IRQ13_PORT64), GPIO_FN(IRQ13_PORT98),
1677 GPIO_FN(IRQ14_PORT63), GPIO_FN(IRQ14_PORT99),
1678 GPIO_FN(IRQ15_PORT62), GPIO_FN(IRQ15_PORT100),
1679 GPIO_FN(IRQ16_PORT68), GPIO_FN(IRQ16_PORT211),
1680 GPIO_FN(IRQ17),
1681 GPIO_FN(IRQ18),
1682 GPIO_FN(IRQ19),
1683 GPIO_FN(IRQ20),
1684 GPIO_FN(IRQ21),
1685 GPIO_FN(IRQ22),
1686 GPIO_FN(IRQ23),
1687 GPIO_FN(IRQ24),
1688 GPIO_FN(IRQ25),
1689 GPIO_FN(IRQ26_PORT58), GPIO_FN(IRQ26_PORT81),
1690 GPIO_FN(IRQ27_PORT57), GPIO_FN(IRQ27_PORT168),
1691 GPIO_FN(IRQ28_PORT56), GPIO_FN(IRQ28_PORT169),
1692 GPIO_FN(IRQ29_PORT50), GPIO_FN(IRQ29_PORT170),
1693 GPIO_FN(IRQ30_PORT49), GPIO_FN(IRQ30_PORT171),
1694 GPIO_FN(IRQ31_PORT41), GPIO_FN(IRQ31_PORT167),
1695
1696 /* Function */
1697
1698 /* DBGT */
1699 GPIO_FN(DBGMDT2), GPIO_FN(DBGMDT1), GPIO_FN(DBGMDT0),
1700 GPIO_FN(DBGMD10), GPIO_FN(DBGMD11), GPIO_FN(DBGMD20),
1701 GPIO_FN(DBGMD21),
1702
1703 /* FSI-A */
1704 GPIO_FN(FSIAISLD_PORT0), /* FSIAISLD Port 0/5 */
1705 GPIO_FN(FSIAISLD_PORT5),
1706 GPIO_FN(FSIASPDIF_PORT9), /* FSIASPDIF Port 9/18 */
1707 GPIO_FN(FSIASPDIF_PORT18),
1708 GPIO_FN(FSIAOSLD1), GPIO_FN(FSIAOSLD2), GPIO_FN(FSIAOLR),
1709 GPIO_FN(FSIAOBT), GPIO_FN(FSIAOSLD), GPIO_FN(FSIAOMC),
1710 GPIO_FN(FSIACK), GPIO_FN(FSIAILR), GPIO_FN(FSIAIBT),
1711
1712 /* FSI-B */
1713 GPIO_FN(FSIBCK),
1714
1715 /* FMSI */
1716 GPIO_FN(FMSISLD_PORT1), /* FMSISLD Port 1/6 */
1717 GPIO_FN(FMSISLD_PORT6),
1718 GPIO_FN(FMSIILR), GPIO_FN(FMSIIBT), GPIO_FN(FMSIOLR),
1719 GPIO_FN(FMSIOBT), GPIO_FN(FMSICK), GPIO_FN(FMSOILR),
1720 GPIO_FN(FMSOIBT), GPIO_FN(FMSOOLR), GPIO_FN(FMSOOBT),
1721 GPIO_FN(FMSOSLD), GPIO_FN(FMSOCK),
1722
1723 /* SCIFA0 */
1724 GPIO_FN(SCIFA0_SCK), GPIO_FN(SCIFA0_CTS), GPIO_FN(SCIFA0_RTS),
1725 GPIO_FN(SCIFA0_RXD), GPIO_FN(SCIFA0_TXD),
1726
1727 /* SCIFA1 */
1728 GPIO_FN(SCIFA1_CTS), GPIO_FN(SCIFA1_SCK),
1729 GPIO_FN(SCIFA1_RXD), GPIO_FN(SCIFA1_TXD), GPIO_FN(SCIFA1_RTS),
1730
1731 /* SCIFA2 */
1732 GPIO_FN(SCIFA2_SCK_PORT22), /* SCIFA2_SCK Port 22/199 */
1733 GPIO_FN(SCIFA2_SCK_PORT199),
1734 GPIO_FN(SCIFA2_RXD), GPIO_FN(SCIFA2_TXD),
1735 GPIO_FN(SCIFA2_CTS), GPIO_FN(SCIFA2_RTS),
1736
1737 /* SCIFA3 */
1738 GPIO_FN(SCIFA3_RTS_PORT105), /* MSEL5CR_8_0 */
1739 GPIO_FN(SCIFA3_SCK_PORT116),
1740 GPIO_FN(SCIFA3_CTS_PORT117),
1741 GPIO_FN(SCIFA3_RXD_PORT174),
1742 GPIO_FN(SCIFA3_TXD_PORT175),
1743
1744 GPIO_FN(SCIFA3_RTS_PORT161), /* MSEL5CR_8_1 */
1745 GPIO_FN(SCIFA3_SCK_PORT158),
1746 GPIO_FN(SCIFA3_CTS_PORT162),
1747 GPIO_FN(SCIFA3_RXD_PORT159),
1748 GPIO_FN(SCIFA3_TXD_PORT160),
1749
1750 /* SCIFA4 */
1751 GPIO_FN(SCIFA4_RXD_PORT12), /* MSEL5CR[12:11] = 00 */
1752 GPIO_FN(SCIFA4_TXD_PORT13),
1753
1754 GPIO_FN(SCIFA4_RXD_PORT204), /* MSEL5CR[12:11] = 01 */
1755 GPIO_FN(SCIFA4_TXD_PORT203),
1756
1757 GPIO_FN(SCIFA4_RXD_PORT94), /* MSEL5CR[12:11] = 10 */
1758 GPIO_FN(SCIFA4_TXD_PORT93),
1759
1760 GPIO_FN(SCIFA4_SCK_PORT21), /* SCIFA4_SCK Port 21/205 */
1761 GPIO_FN(SCIFA4_SCK_PORT205),
1762
1763 /* SCIFA5 */
1764 GPIO_FN(SCIFA5_TXD_PORT20), /* MSEL5CR[15:14] = 00 */
1765 GPIO_FN(SCIFA5_RXD_PORT10),
1766
1767 GPIO_FN(SCIFA5_RXD_PORT207), /* MSEL5CR[15:14] = 01 */
1768 GPIO_FN(SCIFA5_TXD_PORT208),
1769
1770 GPIO_FN(SCIFA5_TXD_PORT91), /* MSEL5CR[15:14] = 10 */
1771 GPIO_FN(SCIFA5_RXD_PORT92),
1772
1773 GPIO_FN(SCIFA5_SCK_PORT23), /* SCIFA5_SCK Port 23/206 */
1774 GPIO_FN(SCIFA5_SCK_PORT206),
1775
1776 /* SCIFA6 */
1777 GPIO_FN(SCIFA6_SCK), GPIO_FN(SCIFA6_RXD), GPIO_FN(SCIFA6_TXD),
1778
1779 /* SCIFA7 */
1780 GPIO_FN(SCIFA7_TXD), GPIO_FN(SCIFA7_RXD),
1781
1782 /* SCIFAB */
1783 GPIO_FN(SCIFB_SCK_PORT190), /* MSEL5CR_17_0 */
1784 GPIO_FN(SCIFB_RXD_PORT191),
1785 GPIO_FN(SCIFB_TXD_PORT192),
1786 GPIO_FN(SCIFB_RTS_PORT186),
1787 GPIO_FN(SCIFB_CTS_PORT187),
1788
1789 GPIO_FN(SCIFB_SCK_PORT2), /* MSEL5CR_17_1 */
1790 GPIO_FN(SCIFB_RXD_PORT3),
1791 GPIO_FN(SCIFB_TXD_PORT4),
1792 GPIO_FN(SCIFB_RTS_PORT172),
1793 GPIO_FN(SCIFB_CTS_PORT173),
1794
1795 /* LCD0 */
1796 GPIO_FN(LCD0_D0), GPIO_FN(LCD0_D1), GPIO_FN(LCD0_D2),
1797 GPIO_FN(LCD0_D3), GPIO_FN(LCD0_D4), GPIO_FN(LCD0_D5),
1798 GPIO_FN(LCD0_D6), GPIO_FN(LCD0_D7), GPIO_FN(LCD0_D8),
1799 GPIO_FN(LCD0_D9), GPIO_FN(LCD0_D10), GPIO_FN(LCD0_D11),
1800 GPIO_FN(LCD0_D12), GPIO_FN(LCD0_D13), GPIO_FN(LCD0_D14),
1801 GPIO_FN(LCD0_D15), GPIO_FN(LCD0_D16), GPIO_FN(LCD0_D17),
1802 GPIO_FN(LCD0_DON), GPIO_FN(LCD0_VCPWC), GPIO_FN(LCD0_VEPWC),
1803 GPIO_FN(LCD0_DCK), GPIO_FN(LCD0_VSYN),
1804 GPIO_FN(LCD0_HSYN), GPIO_FN(LCD0_DISP),
1805 GPIO_FN(LCD0_WR), GPIO_FN(LCD0_RD),
1806 GPIO_FN(LCD0_CS), GPIO_FN(LCD0_RS),
1807
1808 GPIO_FN(LCD0_D18_PORT163), GPIO_FN(LCD0_D19_PORT162),
1809 GPIO_FN(LCD0_D20_PORT161), GPIO_FN(LCD0_D21_PORT158),
1810 GPIO_FN(LCD0_D22_PORT160), GPIO_FN(LCD0_D23_PORT159),
1811 GPIO_FN(LCD0_LCLK_PORT165), /* MSEL5CR_6_1 */
1812
1813 GPIO_FN(LCD0_D18_PORT40), GPIO_FN(LCD0_D19_PORT4),
1814 GPIO_FN(LCD0_D20_PORT3), GPIO_FN(LCD0_D21_PORT2),
1815 GPIO_FN(LCD0_D22_PORT0), GPIO_FN(LCD0_D23_PORT1),
1816 GPIO_FN(LCD0_LCLK_PORT102), /* MSEL5CR_6_0 */
1817
1818 /* LCD1 */
1819 GPIO_FN(LCD1_D0), GPIO_FN(LCD1_D1), GPIO_FN(LCD1_D2),
1820 GPIO_FN(LCD1_D3), GPIO_FN(LCD1_D4), GPIO_FN(LCD1_D5),
1821 GPIO_FN(LCD1_D6), GPIO_FN(LCD1_D7), GPIO_FN(LCD1_D8),
1822 GPIO_FN(LCD1_D9), GPIO_FN(LCD1_D10), GPIO_FN(LCD1_D11),
1823 GPIO_FN(LCD1_D12), GPIO_FN(LCD1_D13), GPIO_FN(LCD1_D14),
1824 GPIO_FN(LCD1_D15), GPIO_FN(LCD1_D16), GPIO_FN(LCD1_D17),
1825 GPIO_FN(LCD1_D18), GPIO_FN(LCD1_D19), GPIO_FN(LCD1_D20),
1826 GPIO_FN(LCD1_D21), GPIO_FN(LCD1_D22), GPIO_FN(LCD1_D23),
1827 GPIO_FN(LCD1_RS), GPIO_FN(LCD1_RD), GPIO_FN(LCD1_CS),
1828 GPIO_FN(LCD1_WR), GPIO_FN(LCD1_DCK), GPIO_FN(LCD1_DON),
1829 GPIO_FN(LCD1_VCPWC), GPIO_FN(LCD1_LCLK), GPIO_FN(LCD1_HSYN),
1830 GPIO_FN(LCD1_VSYN), GPIO_FN(LCD1_VEPWC), GPIO_FN(LCD1_DISP),
1831
1832 /* RSPI */
1833 GPIO_FN(RSPI_SSL0_A), GPIO_FN(RSPI_SSL1_A), GPIO_FN(RSPI_SSL2_A),
1834 GPIO_FN(RSPI_SSL3_A), GPIO_FN(RSPI_CK_A), GPIO_FN(RSPI_MOSI_A),
1835 GPIO_FN(RSPI_MISO_A),
1836
1837 /* VIO CKO */
1838 GPIO_FN(VIO_CKO1),
1839 GPIO_FN(VIO_CKO2),
1840 GPIO_FN(VIO_CKO_1),
1841 GPIO_FN(VIO_CKO),
1842
1843 /* VIO0 */
1844 GPIO_FN(VIO0_D0), GPIO_FN(VIO0_D1), GPIO_FN(VIO0_D2),
1845 GPIO_FN(VIO0_D3), GPIO_FN(VIO0_D4), GPIO_FN(VIO0_D5),
1846 GPIO_FN(VIO0_D6), GPIO_FN(VIO0_D7), GPIO_FN(VIO0_D8),
1847 GPIO_FN(VIO0_D9), GPIO_FN(VIO0_D10), GPIO_FN(VIO0_D11),
1848 GPIO_FN(VIO0_D12), GPIO_FN(VIO0_VD), GPIO_FN(VIO0_HD),
1849 GPIO_FN(VIO0_CLK), GPIO_FN(VIO0_FIELD),
1850
1851 GPIO_FN(VIO0_D13_PORT26), /* MSEL5CR_27_0 */
1852 GPIO_FN(VIO0_D14_PORT25),
1853 GPIO_FN(VIO0_D15_PORT24),
1854
1855 GPIO_FN(VIO0_D13_PORT22), /* MSEL5CR_27_1 */
1856 GPIO_FN(VIO0_D14_PORT95),
1857 GPIO_FN(VIO0_D15_PORT96),
1858
1859 /* VIO1 */
1860 GPIO_FN(VIO1_D0), GPIO_FN(VIO1_D1), GPIO_FN(VIO1_D2),
1861 GPIO_FN(VIO1_D3), GPIO_FN(VIO1_D4), GPIO_FN(VIO1_D5),
1862 GPIO_FN(VIO1_D6), GPIO_FN(VIO1_D7), GPIO_FN(VIO1_VD),
1863 GPIO_FN(VIO1_HD), GPIO_FN(VIO1_CLK), GPIO_FN(VIO1_FIELD),
1864
1865 /* TPU0 */
1866 GPIO_FN(TPU0TO0), GPIO_FN(TPU0TO1), GPIO_FN(TPU0TO3),
1867 GPIO_FN(TPU0TO2_PORT66), /* TPU0TO2 Port 66/202 */
1868 GPIO_FN(TPU0TO2_PORT202),
1869
1870 /* SSP1 0 */
1871 GPIO_FN(STP0_IPD0), GPIO_FN(STP0_IPD1), GPIO_FN(STP0_IPD2),
1872 GPIO_FN(STP0_IPD3), GPIO_FN(STP0_IPD4), GPIO_FN(STP0_IPD5),
1873 GPIO_FN(STP0_IPD6), GPIO_FN(STP0_IPD7), GPIO_FN(STP0_IPEN),
1874 GPIO_FN(STP0_IPCLK), GPIO_FN(STP0_IPSYNC),
1875
1876 /* SSP1 1 */
1877 GPIO_FN(STP1_IPD1), GPIO_FN(STP1_IPD2), GPIO_FN(STP1_IPD3),
1878 GPIO_FN(STP1_IPD4), GPIO_FN(STP1_IPD5), GPIO_FN(STP1_IPD6),
1879 GPIO_FN(STP1_IPD7), GPIO_FN(STP1_IPCLK), GPIO_FN(STP1_IPSYNC),
1880
1881 GPIO_FN(STP1_IPD0_PORT186), /* MSEL5CR_23_0 */
1882 GPIO_FN(STP1_IPEN_PORT187),
1883
1884 GPIO_FN(STP1_IPD0_PORT194), /* MSEL5CR_23_1 */
1885 GPIO_FN(STP1_IPEN_PORT193),
1886
1887 /* SIM */
1888 GPIO_FN(SIM_RST), GPIO_FN(SIM_CLK),
1889 GPIO_FN(SIM_D_PORT22), /* SIM_D Port 22/199 */
1890 GPIO_FN(SIM_D_PORT199),
1891
1892 /* SDHI0 */
1893 GPIO_FN(SDHI0_D0), GPIO_FN(SDHI0_D1), GPIO_FN(SDHI0_D2),
1894 GPIO_FN(SDHI0_D3), GPIO_FN(SDHI0_CD), GPIO_FN(SDHI0_WP),
1895 GPIO_FN(SDHI0_CMD), GPIO_FN(SDHI0_CLK),
1896
1897 /* SDHI1 */
1898 GPIO_FN(SDHI1_D0), GPIO_FN(SDHI1_D1), GPIO_FN(SDHI1_D2),
1899 GPIO_FN(SDHI1_D3), GPIO_FN(SDHI1_CD), GPIO_FN(SDHI1_WP),
1900 GPIO_FN(SDHI1_CMD), GPIO_FN(SDHI1_CLK),
1901
1902 /* SDHI2 */
1903 GPIO_FN(SDHI2_D0), GPIO_FN(SDHI2_D1), GPIO_FN(SDHI2_D2),
1904 GPIO_FN(SDHI2_D3), GPIO_FN(SDHI2_CLK), GPIO_FN(SDHI2_CMD),
1905
1906 GPIO_FN(SDHI2_CD_PORT24), /* MSEL5CR_19_0 */
1907 GPIO_FN(SDHI2_WP_PORT25),
1908
1909 GPIO_FN(SDHI2_WP_PORT177), /* MSEL5CR_19_1 */
1910 GPIO_FN(SDHI2_CD_PORT202),
1911
1912 /* MSIOF2 */
1913 GPIO_FN(MSIOF2_TXD), GPIO_FN(MSIOF2_RXD), GPIO_FN(MSIOF2_TSCK),
1914 GPIO_FN(MSIOF2_SS2), GPIO_FN(MSIOF2_TSYNC), GPIO_FN(MSIOF2_SS1),
1915 GPIO_FN(MSIOF2_MCK1), GPIO_FN(MSIOF2_MCK0), GPIO_FN(MSIOF2_RSYNC),
1916 GPIO_FN(MSIOF2_RSCK),
1917
1918 /* KEYSC */
1919 GPIO_FN(KEYIN4), GPIO_FN(KEYIN5),
1920 GPIO_FN(KEYIN6), GPIO_FN(KEYIN7),
1921 GPIO_FN(KEYOUT0), GPIO_FN(KEYOUT1), GPIO_FN(KEYOUT2),
1922 GPIO_FN(KEYOUT3), GPIO_FN(KEYOUT4), GPIO_FN(KEYOUT5),
1923 GPIO_FN(KEYOUT6), GPIO_FN(KEYOUT7),
1924
1925 GPIO_FN(KEYIN0_PORT43), /* MSEL4CR_18_0 */
1926 GPIO_FN(KEYIN1_PORT44),
1927 GPIO_FN(KEYIN2_PORT45),
1928 GPIO_FN(KEYIN3_PORT46),
1929
1930 GPIO_FN(KEYIN0_PORT58), /* MSEL4CR_18_1 */
1931 GPIO_FN(KEYIN1_PORT57),
1932 GPIO_FN(KEYIN2_PORT56),
1933 GPIO_FN(KEYIN3_PORT55),
1934
1935 /* VOU */
1936 GPIO_FN(DV_D0), GPIO_FN(DV_D1), GPIO_FN(DV_D2),
1937 GPIO_FN(DV_D3), GPIO_FN(DV_D4), GPIO_FN(DV_D5),
1938 GPIO_FN(DV_D6), GPIO_FN(DV_D7), GPIO_FN(DV_D8),
1939 GPIO_FN(DV_D9), GPIO_FN(DV_D10), GPIO_FN(DV_D11),
1940 GPIO_FN(DV_D12), GPIO_FN(DV_D13), GPIO_FN(DV_D14),
1941 GPIO_FN(DV_D15), GPIO_FN(DV_CLK),
1942 GPIO_FN(DV_VSYNC), GPIO_FN(DV_HSYNC),
1943
1944 /* MEMC */
1945 GPIO_FN(MEMC_AD0), GPIO_FN(MEMC_AD1), GPIO_FN(MEMC_AD2),
1946 GPIO_FN(MEMC_AD3), GPIO_FN(MEMC_AD4), GPIO_FN(MEMC_AD5),
1947 GPIO_FN(MEMC_AD6), GPIO_FN(MEMC_AD7), GPIO_FN(MEMC_AD8),
1948 GPIO_FN(MEMC_AD9), GPIO_FN(MEMC_AD10), GPIO_FN(MEMC_AD11),
1949 GPIO_FN(MEMC_AD12), GPIO_FN(MEMC_AD13), GPIO_FN(MEMC_AD14),
1950 GPIO_FN(MEMC_AD15), GPIO_FN(MEMC_CS0), GPIO_FN(MEMC_INT),
1951 GPIO_FN(MEMC_NWE), GPIO_FN(MEMC_NOE), GPIO_FN(MEMC_CS1),
1952 GPIO_FN(MEMC_A1), GPIO_FN(MEMC_ADV), GPIO_FN(MEMC_DREQ0),
1953 GPIO_FN(MEMC_WAIT), GPIO_FN(MEMC_DREQ1), GPIO_FN(MEMC_BUSCLK),
1954 GPIO_FN(MEMC_A0),
1955
1956 /* MMC */
1957 GPIO_FN(MMC0_D0_PORT68), GPIO_FN(MMC0_D1_PORT69),
1958 GPIO_FN(MMC0_D2_PORT70), GPIO_FN(MMC0_D3_PORT71),
1959 GPIO_FN(MMC0_D4_PORT72), GPIO_FN(MMC0_D5_PORT73),
1960 GPIO_FN(MMC0_D6_PORT74), GPIO_FN(MMC0_D7_PORT75),
1961 GPIO_FN(MMC0_CLK_PORT66),
1962 GPIO_FN(MMC0_CMD_PORT67), /* MSEL4CR_15_0 */
1963
1964 GPIO_FN(MMC1_D0_PORT149), GPIO_FN(MMC1_D1_PORT148),
1965 GPIO_FN(MMC1_D2_PORT147), GPIO_FN(MMC1_D3_PORT146),
1966 GPIO_FN(MMC1_D4_PORT145), GPIO_FN(MMC1_D5_PORT144),
1967 GPIO_FN(MMC1_D6_PORT143), GPIO_FN(MMC1_D7_PORT142),
1968 GPIO_FN(MMC1_CLK_PORT103),
1969 GPIO_FN(MMC1_CMD_PORT104), /* MSEL4CR_15_1 */
1970
1971 /* MSIOF0 */
1972 GPIO_FN(MSIOF0_SS1), GPIO_FN(MSIOF0_SS2), GPIO_FN(MSIOF0_RXD),
1973 GPIO_FN(MSIOF0_TXD), GPIO_FN(MSIOF0_MCK0), GPIO_FN(MSIOF0_MCK1),
1974 GPIO_FN(MSIOF0_RSYNC), GPIO_FN(MSIOF0_RSCK), GPIO_FN(MSIOF0_TSCK),
1975 GPIO_FN(MSIOF0_TSYNC),
1976
1977 /* MSIOF1 */
1978 GPIO_FN(MSIOF1_RSCK), GPIO_FN(MSIOF1_RSYNC),
1979 GPIO_FN(MSIOF1_MCK0), GPIO_FN(MSIOF1_MCK1),
1980
1981 GPIO_FN(MSIOF1_SS2_PORT116), GPIO_FN(MSIOF1_SS1_PORT117),
1982 GPIO_FN(MSIOF1_RXD_PORT118), GPIO_FN(MSIOF1_TXD_PORT119),
1983 GPIO_FN(MSIOF1_TSYNC_PORT120),
1984 GPIO_FN(MSIOF1_TSCK_PORT121), /* MSEL4CR_10_0 */
1985
1986 GPIO_FN(MSIOF1_SS1_PORT67), GPIO_FN(MSIOF1_TSCK_PORT72),
1987 GPIO_FN(MSIOF1_TSYNC_PORT73), GPIO_FN(MSIOF1_TXD_PORT74),
1988 GPIO_FN(MSIOF1_RXD_PORT75),
1989 GPIO_FN(MSIOF1_SS2_PORT202), /* MSEL4CR_10_1 */
1990
1991 /* GPIO */
1992 GPIO_FN(GPO0), GPIO_FN(GPI0),
1993 GPIO_FN(GPO1), GPIO_FN(GPI1),
1994
1995 /* USB0 */
1996 GPIO_FN(USB0_OCI), GPIO_FN(USB0_PPON), GPIO_FN(VBUS),
1997
1998 /* USB1 */
1999 GPIO_FN(USB1_OCI), GPIO_FN(USB1_PPON),
2000
2001 /* BBIF1 */
2002 GPIO_FN(BBIF1_RXD), GPIO_FN(BBIF1_TXD), GPIO_FN(BBIF1_TSYNC),
2003 GPIO_FN(BBIF1_TSCK), GPIO_FN(BBIF1_RSCK), GPIO_FN(BBIF1_RSYNC),
2004 GPIO_FN(BBIF1_FLOW), GPIO_FN(BBIF1_RX_FLOW_N),
2005
2006 /* BBIF2 */
2007 GPIO_FN(BBIF2_TXD2_PORT5), /* MSEL5CR_0_0 */
2008 GPIO_FN(BBIF2_RXD2_PORT60),
2009 GPIO_FN(BBIF2_TSYNC2_PORT6),
2010 GPIO_FN(BBIF2_TSCK2_PORT59),
2011
2012 GPIO_FN(BBIF2_RXD2_PORT90), /* MSEL5CR_0_1 */
2013 GPIO_FN(BBIF2_TXD2_PORT183),
2014 GPIO_FN(BBIF2_TSCK2_PORT89),
2015 GPIO_FN(BBIF2_TSYNC2_PORT184),
2016
2017 /* BSC / FLCTL / PCMCIA */
2018 GPIO_FN(CS0), GPIO_FN(CS2), GPIO_FN(CS4),
2019 GPIO_FN(CS5B), GPIO_FN(CS6A),
2020 GPIO_FN(CS5A_PORT105), /* CS5A PORT 19/105 */
2021 GPIO_FN(CS5A_PORT19),
2022 GPIO_FN(IOIS16), /* ? */
2023
2024 GPIO_FN(A0), GPIO_FN(A1), GPIO_FN(A2), GPIO_FN(A3),
2025 GPIO_FN(A4_FOE), GPIO_FN(A5_FCDE), /* share with FLCTL */
2026 GPIO_FN(A6), GPIO_FN(A7), GPIO_FN(A8), GPIO_FN(A9),
2027 GPIO_FN(A10), GPIO_FN(A11), GPIO_FN(A12), GPIO_FN(A13),
2028 GPIO_FN(A14), GPIO_FN(A15), GPIO_FN(A16), GPIO_FN(A17),
2029 GPIO_FN(A18), GPIO_FN(A19), GPIO_FN(A20), GPIO_FN(A21),
2030 GPIO_FN(A22), GPIO_FN(A23), GPIO_FN(A24), GPIO_FN(A25),
2031 GPIO_FN(A26),
2032
2033 GPIO_FN(D0_NAF0), GPIO_FN(D1_NAF1), /* share with FLCTL */
2034 GPIO_FN(D2_NAF2), GPIO_FN(D3_NAF3), /* share with FLCTL */
2035 GPIO_FN(D4_NAF4), GPIO_FN(D5_NAF5), /* share with FLCTL */
2036 GPIO_FN(D6_NAF6), GPIO_FN(D7_NAF7), /* share with FLCTL */
2037 GPIO_FN(D8_NAF8), GPIO_FN(D9_NAF9), /* share with FLCTL */
2038 GPIO_FN(D10_NAF10), GPIO_FN(D11_NAF11), /* share with FLCTL */
2039 GPIO_FN(D12_NAF12), GPIO_FN(D13_NAF13), /* share with FLCTL */
2040 GPIO_FN(D14_NAF14), GPIO_FN(D15_NAF15), /* share with FLCTL */
2041 GPIO_FN(D16), GPIO_FN(D17), GPIO_FN(D18), GPIO_FN(D19),
2042 GPIO_FN(D20), GPIO_FN(D21), GPIO_FN(D22), GPIO_FN(D23),
2043 GPIO_FN(D24), GPIO_FN(D25), GPIO_FN(D26), GPIO_FN(D27),
2044 GPIO_FN(D28), GPIO_FN(D29), GPIO_FN(D30), GPIO_FN(D31),
2045
2046 GPIO_FN(WE0_FWE), /* share with FLCTL */
2047 GPIO_FN(WE1),
2048 GPIO_FN(WE2_ICIORD), /* share with PCMCIA */
2049 GPIO_FN(WE3_ICIOWR), /* share with PCMCIA */
2050 GPIO_FN(CKO), GPIO_FN(BS), GPIO_FN(RDWR),
2051 GPIO_FN(RD_FSC), /* share with FLCTL */
2052 GPIO_FN(WAIT_PORT177), /* WAIT Port 90/177 */
2053 GPIO_FN(WAIT_PORT90),
2054
2055 GPIO_FN(FCE0), GPIO_FN(FCE1), GPIO_FN(FRB), /* FLCTL */
2056
2057 /* IRDA */
2058 GPIO_FN(IRDA_FIRSEL), GPIO_FN(IRDA_IN), GPIO_FN(IRDA_OUT),
2059
2060 /* ATAPI */
2061 GPIO_FN(IDE_D0), GPIO_FN(IDE_D1), GPIO_FN(IDE_D2),
2062 GPIO_FN(IDE_D3), GPIO_FN(IDE_D4), GPIO_FN(IDE_D5),
2063 GPIO_FN(IDE_D6), GPIO_FN(IDE_D7), GPIO_FN(IDE_D8),
2064 GPIO_FN(IDE_D9), GPIO_FN(IDE_D10), GPIO_FN(IDE_D11),
2065 GPIO_FN(IDE_D12), GPIO_FN(IDE_D13), GPIO_FN(IDE_D14),
2066 GPIO_FN(IDE_D15), GPIO_FN(IDE_A0), GPIO_FN(IDE_A1),
2067 GPIO_FN(IDE_A2), GPIO_FN(IDE_CS0), GPIO_FN(IDE_CS1),
2068 GPIO_FN(IDE_IOWR), GPIO_FN(IDE_IORD), GPIO_FN(IDE_IORDY),
2069 GPIO_FN(IDE_INT), GPIO_FN(IDE_RST), GPIO_FN(IDE_DIRECTION),
2070 GPIO_FN(IDE_EXBUF_ENB), GPIO_FN(IDE_IODACK), GPIO_FN(IDE_IODREQ),
2071
2072 /* RMII */
2073 GPIO_FN(RMII_CRS_DV), GPIO_FN(RMII_RX_ER), GPIO_FN(RMII_RXD0),
2074 GPIO_FN(RMII_RXD1), GPIO_FN(RMII_TX_EN), GPIO_FN(RMII_TXD0),
2075 GPIO_FN(RMII_MDC), GPIO_FN(RMII_TXD1), GPIO_FN(RMII_MDIO),
2076 GPIO_FN(RMII_REF50CK), GPIO_FN(RMII_REF125CK), /* for GMII */
2077
2078 /* GEther */
2079 GPIO_FN(ET_TX_CLK), GPIO_FN(ET_TX_EN), GPIO_FN(ET_ETXD0),
2080 GPIO_FN(ET_ETXD1), GPIO_FN(ET_ETXD2), GPIO_FN(ET_ETXD3),
2081 GPIO_FN(ET_ETXD4), GPIO_FN(ET_ETXD5), /* for GEther */
2082 GPIO_FN(ET_ETXD6), GPIO_FN(ET_ETXD7), /* for GEther */
2083 GPIO_FN(ET_COL), GPIO_FN(ET_TX_ER), GPIO_FN(ET_RX_CLK),
2084 GPIO_FN(ET_RX_DV), GPIO_FN(ET_ERXD0), GPIO_FN(ET_ERXD1),
2085 GPIO_FN(ET_ERXD2), GPIO_FN(ET_ERXD3),
2086 GPIO_FN(ET_ERXD4), GPIO_FN(ET_ERXD5), /* for GEther */
2087 GPIO_FN(ET_ERXD6), GPIO_FN(ET_ERXD7), /* for GEther */
2088 GPIO_FN(ET_RX_ER), GPIO_FN(ET_CRS), GPIO_FN(ET_MDC),
2089 GPIO_FN(ET_MDIO), GPIO_FN(ET_LINK), GPIO_FN(ET_PHY_INT),
2090 GPIO_FN(ET_WOL), GPIO_FN(ET_GTX_CLK),
2091
2092 /* DMA0 */
2093 GPIO_FN(DREQ0), GPIO_FN(DACK0),
2094
2095 /* DMA1 */
2096 GPIO_FN(DREQ1), GPIO_FN(DACK1),
2097
2098 /* SYSC */
2099 GPIO_FN(RESETOUTS),
2100
2101 /* IRREM */
2102 GPIO_FN(IROUT),
2103
2104 /* LCDC */
2105 GPIO_FN(LCDC0_SELECT),
2106 GPIO_FN(LCDC1_SELECT),
2107
2108 /* SDENC */
2109 GPIO_FN(SDENC_CPG),
2110 GPIO_FN(SDENC_DV_CLKI),
2111
2112 /* HDMI */
2113 GPIO_FN(HDMI_HPD),
2114 GPIO_FN(HDMI_CEC),
2115
2116 /* SYSC */
2117 GPIO_FN(RESETP_PULLUP),
2118 GPIO_FN(RESETP_PLAIN),
2119
2120 /* DEBUG */
2121 GPIO_FN(EDEBGREQ_PULLDOWN),
2122 GPIO_FN(EDEBGREQ_PULLUP),
2123
2124 GPIO_FN(TRACEAUD_FROM_VIO),
2125 GPIO_FN(TRACEAUD_FROM_LCDC0),
2126 GPIO_FN(TRACEAUD_FROM_MEMC),
2127};
2128
2129static struct pinmux_cfg_reg pinmux_config_regs[] = {
2130 PORTCR(0, 0xe6050000), /* PORT0CR */
2131 PORTCR(1, 0xe6050001), /* PORT1CR */
2132 PORTCR(2, 0xe6050002), /* PORT2CR */
2133 PORTCR(3, 0xe6050003), /* PORT3CR */
2134 PORTCR(4, 0xe6050004), /* PORT4CR */
2135 PORTCR(5, 0xe6050005), /* PORT5CR */
2136 PORTCR(6, 0xe6050006), /* PORT6CR */
2137 PORTCR(7, 0xe6050007), /* PORT7CR */
2138 PORTCR(8, 0xe6050008), /* PORT8CR */
2139 PORTCR(9, 0xe6050009), /* PORT9CR */
2140 PORTCR(10, 0xe605000a), /* PORT10CR */
2141 PORTCR(11, 0xe605000b), /* PORT11CR */
2142 PORTCR(12, 0xe605000c), /* PORT12CR */
2143 PORTCR(13, 0xe605000d), /* PORT13CR */
2144 PORTCR(14, 0xe605000e), /* PORT14CR */
2145 PORTCR(15, 0xe605000f), /* PORT15CR */
2146 PORTCR(16, 0xe6050010), /* PORT16CR */
2147 PORTCR(17, 0xe6050011), /* PORT17CR */
2148 PORTCR(18, 0xe6050012), /* PORT18CR */
2149 PORTCR(19, 0xe6050013), /* PORT19CR */
2150 PORTCR(20, 0xe6050014), /* PORT20CR */
2151 PORTCR(21, 0xe6050015), /* PORT21CR */
2152 PORTCR(22, 0xe6050016), /* PORT22CR */
2153 PORTCR(23, 0xe6050017), /* PORT23CR */
2154 PORTCR(24, 0xe6050018), /* PORT24CR */
2155 PORTCR(25, 0xe6050019), /* PORT25CR */
2156 PORTCR(26, 0xe605001a), /* PORT26CR */
2157 PORTCR(27, 0xe605001b), /* PORT27CR */
2158 PORTCR(28, 0xe605001c), /* PORT28CR */
2159 PORTCR(29, 0xe605001d), /* PORT29CR */
2160 PORTCR(30, 0xe605001e), /* PORT30CR */
2161 PORTCR(31, 0xe605001f), /* PORT31CR */
2162 PORTCR(32, 0xe6050020), /* PORT32CR */
2163 PORTCR(33, 0xe6050021), /* PORT33CR */
2164 PORTCR(34, 0xe6050022), /* PORT34CR */
2165 PORTCR(35, 0xe6050023), /* PORT35CR */
2166 PORTCR(36, 0xe6050024), /* PORT36CR */
2167 PORTCR(37, 0xe6050025), /* PORT37CR */
2168 PORTCR(38, 0xe6050026), /* PORT38CR */
2169 PORTCR(39, 0xe6050027), /* PORT39CR */
2170 PORTCR(40, 0xe6050028), /* PORT40CR */
2171 PORTCR(41, 0xe6050029), /* PORT41CR */
2172 PORTCR(42, 0xe605002a), /* PORT42CR */
2173 PORTCR(43, 0xe605002b), /* PORT43CR */
2174 PORTCR(44, 0xe605002c), /* PORT44CR */
2175 PORTCR(45, 0xe605002d), /* PORT45CR */
2176 PORTCR(46, 0xe605002e), /* PORT46CR */
2177 PORTCR(47, 0xe605002f), /* PORT47CR */
2178 PORTCR(48, 0xe6050030), /* PORT48CR */
2179 PORTCR(49, 0xe6050031), /* PORT49CR */
2180 PORTCR(50, 0xe6050032), /* PORT50CR */
2181 PORTCR(51, 0xe6050033), /* PORT51CR */
2182 PORTCR(52, 0xe6050034), /* PORT52CR */
2183 PORTCR(53, 0xe6050035), /* PORT53CR */
2184 PORTCR(54, 0xe6050036), /* PORT54CR */
2185 PORTCR(55, 0xe6050037), /* PORT55CR */
2186 PORTCR(56, 0xe6050038), /* PORT56CR */
2187 PORTCR(57, 0xe6050039), /* PORT57CR */
2188 PORTCR(58, 0xe605003a), /* PORT58CR */
2189 PORTCR(59, 0xe605003b), /* PORT59CR */
2190 PORTCR(60, 0xe605003c), /* PORT60CR */
2191 PORTCR(61, 0xe605003d), /* PORT61CR */
2192 PORTCR(62, 0xe605003e), /* PORT62CR */
2193 PORTCR(63, 0xe605003f), /* PORT63CR */
2194 PORTCR(64, 0xe6050040), /* PORT64CR */
2195 PORTCR(65, 0xe6050041), /* PORT65CR */
2196 PORTCR(66, 0xe6050042), /* PORT66CR */
2197 PORTCR(67, 0xe6050043), /* PORT67CR */
2198 PORTCR(68, 0xe6050044), /* PORT68CR */
2199 PORTCR(69, 0xe6050045), /* PORT69CR */
2200 PORTCR(70, 0xe6050046), /* PORT70CR */
2201 PORTCR(71, 0xe6050047), /* PORT71CR */
2202 PORTCR(72, 0xe6050048), /* PORT72CR */
2203 PORTCR(73, 0xe6050049), /* PORT73CR */
2204 PORTCR(74, 0xe605004a), /* PORT74CR */
2205 PORTCR(75, 0xe605004b), /* PORT75CR */
2206 PORTCR(76, 0xe605004c), /* PORT76CR */
2207 PORTCR(77, 0xe605004d), /* PORT77CR */
2208 PORTCR(78, 0xe605004e), /* PORT78CR */
2209 PORTCR(79, 0xe605004f), /* PORT79CR */
2210 PORTCR(80, 0xe6050050), /* PORT80CR */
2211 PORTCR(81, 0xe6050051), /* PORT81CR */
2212 PORTCR(82, 0xe6050052), /* PORT82CR */
2213 PORTCR(83, 0xe6050053), /* PORT83CR */
2214
2215 PORTCR(84, 0xe6051054), /* PORT84CR */
2216 PORTCR(85, 0xe6051055), /* PORT85CR */
2217 PORTCR(86, 0xe6051056), /* PORT86CR */
2218 PORTCR(87, 0xe6051057), /* PORT87CR */
2219 PORTCR(88, 0xe6051058), /* PORT88CR */
2220 PORTCR(89, 0xe6051059), /* PORT89CR */
2221 PORTCR(90, 0xe605105a), /* PORT90CR */
2222 PORTCR(91, 0xe605105b), /* PORT91CR */
2223 PORTCR(92, 0xe605105c), /* PORT92CR */
2224 PORTCR(93, 0xe605105d), /* PORT93CR */
2225 PORTCR(94, 0xe605105e), /* PORT94CR */
2226 PORTCR(95, 0xe605105f), /* PORT95CR */
2227 PORTCR(96, 0xe6051060), /* PORT96CR */
2228 PORTCR(97, 0xe6051061), /* PORT97CR */
2229 PORTCR(98, 0xe6051062), /* PORT98CR */
2230 PORTCR(99, 0xe6051063), /* PORT99CR */
2231 PORTCR(100, 0xe6051064), /* PORT100CR */
2232 PORTCR(101, 0xe6051065), /* PORT101CR */
2233 PORTCR(102, 0xe6051066), /* PORT102CR */
2234 PORTCR(103, 0xe6051067), /* PORT103CR */
2235 PORTCR(104, 0xe6051068), /* PORT104CR */
2236 PORTCR(105, 0xe6051069), /* PORT105CR */
2237 PORTCR(106, 0xe605106a), /* PORT106CR */
2238 PORTCR(107, 0xe605106b), /* PORT107CR */
2239 PORTCR(108, 0xe605106c), /* PORT108CR */
2240 PORTCR(109, 0xe605106d), /* PORT109CR */
2241 PORTCR(110, 0xe605106e), /* PORT110CR */
2242 PORTCR(111, 0xe605106f), /* PORT111CR */
2243 PORTCR(112, 0xe6051070), /* PORT112CR */
2244 PORTCR(113, 0xe6051071), /* PORT113CR */
2245 PORTCR(114, 0xe6051072), /* PORT114CR */
2246
2247 PORTCR(115, 0xe6052073), /* PORT115CR */
2248 PORTCR(116, 0xe6052074), /* PORT116CR */
2249 PORTCR(117, 0xe6052075), /* PORT117CR */
2250 PORTCR(118, 0xe6052076), /* PORT118CR */
2251 PORTCR(119, 0xe6052077), /* PORT119CR */
2252 PORTCR(120, 0xe6052078), /* PORT120CR */
2253 PORTCR(121, 0xe6052079), /* PORT121CR */
2254 PORTCR(122, 0xe605207a), /* PORT122CR */
2255 PORTCR(123, 0xe605207b), /* PORT123CR */
2256 PORTCR(124, 0xe605207c), /* PORT124CR */
2257 PORTCR(125, 0xe605207d), /* PORT125CR */
2258 PORTCR(126, 0xe605207e), /* PORT126CR */
2259 PORTCR(127, 0xe605207f), /* PORT127CR */
2260 PORTCR(128, 0xe6052080), /* PORT128CR */
2261 PORTCR(129, 0xe6052081), /* PORT129CR */
2262 PORTCR(130, 0xe6052082), /* PORT130CR */
2263 PORTCR(131, 0xe6052083), /* PORT131CR */
2264 PORTCR(132, 0xe6052084), /* PORT132CR */
2265 PORTCR(133, 0xe6052085), /* PORT133CR */
2266 PORTCR(134, 0xe6052086), /* PORT134CR */
2267 PORTCR(135, 0xe6052087), /* PORT135CR */
2268 PORTCR(136, 0xe6052088), /* PORT136CR */
2269 PORTCR(137, 0xe6052089), /* PORT137CR */
2270 PORTCR(138, 0xe605208a), /* PORT138CR */
2271 PORTCR(139, 0xe605208b), /* PORT139CR */
2272 PORTCR(140, 0xe605208c), /* PORT140CR */
2273 PORTCR(141, 0xe605208d), /* PORT141CR */
2274 PORTCR(142, 0xe605208e), /* PORT142CR */
2275 PORTCR(143, 0xe605208f), /* PORT143CR */
2276 PORTCR(144, 0xe6052090), /* PORT144CR */
2277 PORTCR(145, 0xe6052091), /* PORT145CR */
2278 PORTCR(146, 0xe6052092), /* PORT146CR */
2279 PORTCR(147, 0xe6052093), /* PORT147CR */
2280 PORTCR(148, 0xe6052094), /* PORT148CR */
2281 PORTCR(149, 0xe6052095), /* PORT149CR */
2282 PORTCR(150, 0xe6052096), /* PORT150CR */
2283 PORTCR(151, 0xe6052097), /* PORT151CR */
2284 PORTCR(152, 0xe6052098), /* PORT152CR */
2285 PORTCR(153, 0xe6052099), /* PORT153CR */
2286 PORTCR(154, 0xe605209a), /* PORT154CR */
2287 PORTCR(155, 0xe605209b), /* PORT155CR */
2288 PORTCR(156, 0xe605209c), /* PORT156CR */
2289 PORTCR(157, 0xe605209d), /* PORT157CR */
2290 PORTCR(158, 0xe605209e), /* PORT158CR */
2291 PORTCR(159, 0xe605209f), /* PORT159CR */
2292 PORTCR(160, 0xe60520a0), /* PORT160CR */
2293 PORTCR(161, 0xe60520a1), /* PORT161CR */
2294 PORTCR(162, 0xe60520a2), /* PORT162CR */
2295 PORTCR(163, 0xe60520a3), /* PORT163CR */
2296 PORTCR(164, 0xe60520a4), /* PORT164CR */
2297 PORTCR(165, 0xe60520a5), /* PORT165CR */
2298 PORTCR(166, 0xe60520a6), /* PORT166CR */
2299 PORTCR(167, 0xe60520a7), /* PORT167CR */
2300 PORTCR(168, 0xe60520a8), /* PORT168CR */
2301 PORTCR(169, 0xe60520a9), /* PORT169CR */
2302 PORTCR(170, 0xe60520aa), /* PORT170CR */
2303 PORTCR(171, 0xe60520ab), /* PORT171CR */
2304 PORTCR(172, 0xe60520ac), /* PORT172CR */
2305 PORTCR(173, 0xe60520ad), /* PORT173CR */
2306 PORTCR(174, 0xe60520ae), /* PORT174CR */
2307 PORTCR(175, 0xe60520af), /* PORT175CR */
2308 PORTCR(176, 0xe60520b0), /* PORT176CR */
2309 PORTCR(177, 0xe60520b1), /* PORT177CR */
2310 PORTCR(178, 0xe60520b2), /* PORT178CR */
2311 PORTCR(179, 0xe60520b3), /* PORT179CR */
2312 PORTCR(180, 0xe60520b4), /* PORT180CR */
2313 PORTCR(181, 0xe60520b5), /* PORT181CR */
2314 PORTCR(182, 0xe60520b6), /* PORT182CR */
2315 PORTCR(183, 0xe60520b7), /* PORT183CR */
2316 PORTCR(184, 0xe60520b8), /* PORT184CR */
2317 PORTCR(185, 0xe60520b9), /* PORT185CR */
2318 PORTCR(186, 0xe60520ba), /* PORT186CR */
2319 PORTCR(187, 0xe60520bb), /* PORT187CR */
2320 PORTCR(188, 0xe60520bc), /* PORT188CR */
2321 PORTCR(189, 0xe60520bd), /* PORT189CR */
2322 PORTCR(190, 0xe60520be), /* PORT190CR */
2323 PORTCR(191, 0xe60520bf), /* PORT191CR */
2324 PORTCR(192, 0xe60520c0), /* PORT192CR */
2325 PORTCR(193, 0xe60520c1), /* PORT193CR */
2326 PORTCR(194, 0xe60520c2), /* PORT194CR */
2327 PORTCR(195, 0xe60520c3), /* PORT195CR */
2328 PORTCR(196, 0xe60520c4), /* PORT196CR */
2329 PORTCR(197, 0xe60520c5), /* PORT197CR */
2330 PORTCR(198, 0xe60520c6), /* PORT198CR */
2331 PORTCR(199, 0xe60520c7), /* PORT199CR */
2332 PORTCR(200, 0xe60520c8), /* PORT200CR */
2333 PORTCR(201, 0xe60520c9), /* PORT201CR */
2334 PORTCR(202, 0xe60520ca), /* PORT202CR */
2335 PORTCR(203, 0xe60520cb), /* PORT203CR */
2336 PORTCR(204, 0xe60520cc), /* PORT204CR */
2337 PORTCR(205, 0xe60520cd), /* PORT205CR */
2338 PORTCR(206, 0xe60520ce), /* PORT206CR */
2339 PORTCR(207, 0xe60520cf), /* PORT207CR */
2340 PORTCR(208, 0xe60520d0), /* PORT208CR */
2341 PORTCR(209, 0xe60520d1), /* PORT209CR */
2342
2343 PORTCR(210, 0xe60530d2), /* PORT210CR */
2344 PORTCR(211, 0xe60530d3), /* PORT211CR */
2345
2346 { PINMUX_CFG_REG("MSEL1CR", 0xe605800c, 32, 1) {
2347 MSEL1CR_31_0, MSEL1CR_31_1,
2348 MSEL1CR_30_0, MSEL1CR_30_1,
2349 MSEL1CR_29_0, MSEL1CR_29_1,
2350 MSEL1CR_28_0, MSEL1CR_28_1,
2351 MSEL1CR_27_0, MSEL1CR_27_1,
2352 MSEL1CR_26_0, MSEL1CR_26_1,
2353 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2354 0, 0, 0, 0, 0, 0, 0, 0,
2355 MSEL1CR_16_0, MSEL1CR_16_1,
2356 MSEL1CR_15_0, MSEL1CR_15_1,
2357 MSEL1CR_14_0, MSEL1CR_14_1,
2358 MSEL1CR_13_0, MSEL1CR_13_1,
2359 MSEL1CR_12_0, MSEL1CR_12_1,
2360 0, 0, 0, 0,
2361 MSEL1CR_9_0, MSEL1CR_9_1,
2362 0, 0,
2363 MSEL1CR_7_0, MSEL1CR_7_1,
2364 MSEL1CR_6_0, MSEL1CR_6_1,
2365 MSEL1CR_5_0, MSEL1CR_5_1,
2366 MSEL1CR_4_0, MSEL1CR_4_1,
2367 MSEL1CR_3_0, MSEL1CR_3_1,
2368 MSEL1CR_2_0, MSEL1CR_2_1,
2369 0, 0,
2370 MSEL1CR_0_0, MSEL1CR_0_1,
2371 }
2372 },
2373 { PINMUX_CFG_REG("MSEL3CR", 0xE6058020, 32, 1) {
2374 0, 0, 0, 0, 0, 0, 0, 0,
2375 0, 0, 0, 0, 0, 0, 0, 0,
2376 0, 0, 0, 0, 0, 0, 0, 0,
2377 0, 0, 0, 0, 0, 0, 0, 0,
2378 MSEL3CR_15_0, MSEL3CR_15_1,
2379 0, 0, 0, 0, 0, 0, 0, 0,
2380 0, 0, 0, 0, 0, 0, 0, 0,
2381 MSEL3CR_6_0, MSEL3CR_6_1,
2382 0, 0, 0, 0, 0, 0, 0, 0,
2383 0, 0, 0, 0,
2384 }
2385 },
2386 { PINMUX_CFG_REG("MSEL4CR", 0xE6058024, 32, 1) {
2387 0, 0, 0, 0, 0, 0, 0, 0,
2388 0, 0, 0, 0, 0, 0, 0, 0,
2389 0, 0, 0, 0, 0, 0, 0, 0,
2390 MSEL4CR_19_0, MSEL4CR_19_1,
2391 MSEL4CR_18_0, MSEL4CR_18_1,
2392 0, 0, 0, 0,
2393 MSEL4CR_15_0, MSEL4CR_15_1,
2394 0, 0, 0, 0, 0, 0, 0, 0,
2395 MSEL4CR_10_0, MSEL4CR_10_1,
2396 0, 0, 0, 0, 0, 0,
2397 MSEL4CR_6_0, MSEL4CR_6_1,
2398 0, 0,
2399 MSEL4CR_4_0, MSEL4CR_4_1,
2400 0, 0, 0, 0,
2401 MSEL4CR_1_0, MSEL4CR_1_1,
2402 0, 0,
2403 }
2404 },
2405 { PINMUX_CFG_REG("MSEL5CR", 0xE6058028, 32, 1) {
2406 MSEL5CR_31_0, MSEL5CR_31_1,
2407 MSEL5CR_30_0, MSEL5CR_30_1,
2408 MSEL5CR_29_0, MSEL5CR_29_1,
2409 0, 0,
2410 MSEL5CR_27_0, MSEL5CR_27_1,
2411 0, 0,
2412 MSEL5CR_25_0, MSEL5CR_25_1,
2413 0, 0,
2414 MSEL5CR_23_0, MSEL5CR_23_1,
2415 0, 0,
2416 MSEL5CR_21_0, MSEL5CR_21_1,
2417 0, 0,
2418 MSEL5CR_19_0, MSEL5CR_19_1,
2419 0, 0,
2420 MSEL5CR_17_0, MSEL5CR_17_1,
2421 0, 0,
2422 MSEL5CR_15_0, MSEL5CR_15_1,
2423 MSEL5CR_14_0, MSEL5CR_14_1,
2424 MSEL5CR_13_0, MSEL5CR_13_1,
2425 MSEL5CR_12_0, MSEL5CR_12_1,
2426 MSEL5CR_11_0, MSEL5CR_11_1,
2427 MSEL5CR_10_0, MSEL5CR_10_1,
2428 0, 0,
2429 MSEL5CR_8_0, MSEL5CR_8_1,
2430 MSEL5CR_7_0, MSEL5CR_7_1,
2431 MSEL5CR_6_0, MSEL5CR_6_1,
2432 MSEL5CR_5_0, MSEL5CR_5_1,
2433 MSEL5CR_4_0, MSEL5CR_4_1,
2434 MSEL5CR_3_0, MSEL5CR_3_1,
2435 MSEL5CR_2_0, MSEL5CR_2_1,
2436 0, 0,
2437 MSEL5CR_0_0, MSEL5CR_0_1,
2438 }
2439 },
2440 { },
2441};
2442
2443static struct pinmux_data_reg pinmux_data_regs[] = {
2444 { PINMUX_DATA_REG("PORTL031_000DR", 0xe6054800, 32) {
2445 PORT31_DATA, PORT30_DATA, PORT29_DATA, PORT28_DATA,
2446 PORT27_DATA, PORT26_DATA, PORT25_DATA, PORT24_DATA,
2447 PORT23_DATA, PORT22_DATA, PORT21_DATA, PORT20_DATA,
2448 PORT19_DATA, PORT18_DATA, PORT17_DATA, PORT16_DATA,
2449 PORT15_DATA, PORT14_DATA, PORT13_DATA, PORT12_DATA,
2450 PORT11_DATA, PORT10_DATA, PORT9_DATA, PORT8_DATA,
2451 PORT7_DATA, PORT6_DATA, PORT5_DATA, PORT4_DATA,
2452 PORT3_DATA, PORT2_DATA, PORT1_DATA, PORT0_DATA }
2453 },
2454 { PINMUX_DATA_REG("PORTL063_032DR", 0xe6054804, 32) {
2455 PORT63_DATA, PORT62_DATA, PORT61_DATA, PORT60_DATA,
2456 PORT59_DATA, PORT58_DATA, PORT57_DATA, PORT56_DATA,
2457 PORT55_DATA, PORT54_DATA, PORT53_DATA, PORT52_DATA,
2458 PORT51_DATA, PORT50_DATA, PORT49_DATA, PORT48_DATA,
2459 PORT47_DATA, PORT46_DATA, PORT45_DATA, PORT44_DATA,
2460 PORT43_DATA, PORT42_DATA, PORT41_DATA, PORT40_DATA,
2461 PORT39_DATA, PORT38_DATA, PORT37_DATA, PORT36_DATA,
2462 PORT35_DATA, PORT34_DATA, PORT33_DATA, PORT32_DATA }
2463 },
2464 { PINMUX_DATA_REG("PORTL095_064DR", 0xe6054808, 32) {
2465 0, 0, 0, 0,
2466 0, 0, 0, 0,
2467 0, 0, 0, 0,
2468 PORT83_DATA, PORT82_DATA, PORT81_DATA, PORT80_DATA,
2469 PORT79_DATA, PORT78_DATA, PORT77_DATA, PORT76_DATA,
2470 PORT75_DATA, PORT74_DATA, PORT73_DATA, PORT72_DATA,
2471 PORT71_DATA, PORT70_DATA, PORT69_DATA, PORT68_DATA,
2472 PORT67_DATA, PORT66_DATA, PORT65_DATA, PORT64_DATA }
2473 },
2474 { PINMUX_DATA_REG("PORTD095_064DR", 0xe6055808, 32) {
2475 PORT95_DATA, PORT94_DATA, PORT93_DATA, PORT92_DATA,
2476 PORT91_DATA, PORT90_DATA, PORT89_DATA, PORT88_DATA,
2477 PORT87_DATA, PORT86_DATA, PORT85_DATA, PORT84_DATA,
2478 0, 0, 0, 0,
2479 0, 0, 0, 0,
2480 0, 0, 0, 0,
2481 0, 0, 0, 0,
2482 0, 0, 0, 0 }
2483 },
2484 { PINMUX_DATA_REG("PORTD127_096DR", 0xe605580c, 32) {
2485 0, 0, 0, 0,
2486 0, 0, 0, 0,
2487 0, 0, 0, 0,
2488 0, PORT114_DATA, PORT113_DATA, PORT112_DATA,
2489 PORT111_DATA, PORT110_DATA, PORT109_DATA, PORT108_DATA,
2490 PORT107_DATA, PORT106_DATA, PORT105_DATA, PORT104_DATA,
2491 PORT103_DATA, PORT102_DATA, PORT101_DATA, PORT100_DATA,
2492 PORT99_DATA, PORT98_DATA, PORT97_DATA, PORT96_DATA }
2493 },
2494 { PINMUX_DATA_REG("PORTR127_096DR", 0xe605680C, 32) {
2495 PORT127_DATA, PORT126_DATA, PORT125_DATA, PORT124_DATA,
2496 PORT123_DATA, PORT122_DATA, PORT121_DATA, PORT120_DATA,
2497 PORT119_DATA, PORT118_DATA, PORT117_DATA, PORT116_DATA,
2498 PORT115_DATA, 0, 0, 0,
2499 0, 0, 0, 0,
2500 0, 0, 0, 0,
2501 0, 0, 0, 0,
2502 0, 0, 0, 0 }
2503 },
2504 { PINMUX_DATA_REG("PORTR159_128DR", 0xe6056810, 32) {
2505 PORT159_DATA, PORT158_DATA, PORT157_DATA, PORT156_DATA,
2506 PORT155_DATA, PORT154_DATA, PORT153_DATA, PORT152_DATA,
2507 PORT151_DATA, PORT150_DATA, PORT149_DATA, PORT148_DATA,
2508 PORT147_DATA, PORT146_DATA, PORT145_DATA, PORT144_DATA,
2509 PORT143_DATA, PORT142_DATA, PORT141_DATA, PORT140_DATA,
2510 PORT139_DATA, PORT138_DATA, PORT137_DATA, PORT136_DATA,
2511 PORT135_DATA, PORT134_DATA, PORT133_DATA, PORT132_DATA,
2512 PORT131_DATA, PORT130_DATA, PORT129_DATA, PORT128_DATA }
2513 },
2514 { PINMUX_DATA_REG("PORTR191_160DR", 0xe6056814, 32) {
2515 PORT191_DATA, PORT190_DATA, PORT189_DATA, PORT188_DATA,
2516 PORT187_DATA, PORT186_DATA, PORT185_DATA, PORT184_DATA,
2517 PORT183_DATA, PORT182_DATA, PORT181_DATA, PORT180_DATA,
2518 PORT179_DATA, PORT178_DATA, PORT177_DATA, PORT176_DATA,
2519 PORT175_DATA, PORT174_DATA, PORT173_DATA, PORT172_DATA,
2520 PORT171_DATA, PORT170_DATA, PORT169_DATA, PORT168_DATA,
2521 PORT167_DATA, PORT166_DATA, PORT165_DATA, PORT164_DATA,
2522 PORT163_DATA, PORT162_DATA, PORT161_DATA, PORT160_DATA }
2523 },
2524 { PINMUX_DATA_REG("PORTR223_192DR", 0xe6056818, 32) {
2525 0, 0, 0, 0,
2526 0, 0, 0, 0,
2527 0, 0, 0, 0,
2528 0, 0, PORT209_DATA, PORT208_DATA,
2529 PORT207_DATA, PORT206_DATA, PORT205_DATA, PORT204_DATA,
2530 PORT203_DATA, PORT202_DATA, PORT201_DATA, PORT200_DATA,
2531 PORT199_DATA, PORT198_DATA, PORT197_DATA, PORT196_DATA,
2532 PORT195_DATA, PORT194_DATA, PORT193_DATA, PORT192_DATA }
2533 },
2534 { PINMUX_DATA_REG("PORTU223_192DR", 0xe6057818, 32) {
2535 0, 0, 0, 0,
2536 0, 0, 0, 0,
2537 0, 0, 0, 0,
2538 PORT211_DATA, PORT210_DATA, 0, 0,
2539 0, 0, 0, 0,
2540 0, 0, 0, 0,
2541 0, 0, 0, 0,
2542 0, 0, 0, 0 }
2543 },
2544 { },
2545};
2546
2547static struct pinmux_irq pinmux_irqs[] = {
2548 PINMUX_IRQ(evt2irq(0x0200), PORT2_FN0, PORT13_FN0), /* IRQ0A */
2549 PINMUX_IRQ(evt2irq(0x0220), PORT20_FN0), /* IRQ1A */
2550 PINMUX_IRQ(evt2irq(0x0240), PORT11_FN0, PORT12_FN0), /* IRQ2A */
2551 PINMUX_IRQ(evt2irq(0x0260), PORT10_FN0, PORT14_FN0), /* IRQ3A */
2552 PINMUX_IRQ(evt2irq(0x0280), PORT15_FN0, PORT172_FN0), /* IRQ4A */
2553 PINMUX_IRQ(evt2irq(0x02A0), PORT0_FN0, PORT1_FN0), /* IRQ5A */
2554 PINMUX_IRQ(evt2irq(0x02C0), PORT121_FN0, PORT173_FN0), /* IRQ6A */
2555 PINMUX_IRQ(evt2irq(0x02E0), PORT120_FN0, PORT209_FN0), /* IRQ7A */
2556 PINMUX_IRQ(evt2irq(0x0300), PORT119_FN0), /* IRQ8A */
2557 PINMUX_IRQ(evt2irq(0x0320), PORT118_FN0, PORT210_FN0), /* IRQ9A */
2558 PINMUX_IRQ(evt2irq(0x0340), PORT19_FN0), /* IRQ10A */
2559 PINMUX_IRQ(evt2irq(0x0360), PORT104_FN0), /* IRQ11A */
2560 PINMUX_IRQ(evt2irq(0x0380), PORT42_FN0, PORT97_FN0), /* IRQ12A */
2561 PINMUX_IRQ(evt2irq(0x03A0), PORT64_FN0, PORT98_FN0), /* IRQ13A */
2562 PINMUX_IRQ(evt2irq(0x03C0), PORT63_FN0, PORT99_FN0), /* IRQ14A */
2563 PINMUX_IRQ(evt2irq(0x03E0), PORT62_FN0, PORT100_FN0), /* IRQ15A */
2564 PINMUX_IRQ(evt2irq(0x3200), PORT68_FN0, PORT211_FN0), /* IRQ16A */
2565 PINMUX_IRQ(evt2irq(0x3220), PORT69_FN0), /* IRQ17A */
2566 PINMUX_IRQ(evt2irq(0x3240), PORT70_FN0), /* IRQ18A */
2567 PINMUX_IRQ(evt2irq(0x3260), PORT71_FN0), /* IRQ19A */
2568 PINMUX_IRQ(evt2irq(0x3280), PORT67_FN0), /* IRQ20A */
2569 PINMUX_IRQ(evt2irq(0x32A0), PORT202_FN0), /* IRQ21A */
2570 PINMUX_IRQ(evt2irq(0x32C0), PORT95_FN0), /* IRQ22A */
2571 PINMUX_IRQ(evt2irq(0x32E0), PORT96_FN0), /* IRQ23A */
2572 PINMUX_IRQ(evt2irq(0x3300), PORT180_FN0), /* IRQ24A */
2573 PINMUX_IRQ(evt2irq(0x3320), PORT38_FN0), /* IRQ25A */
2574 PINMUX_IRQ(evt2irq(0x3340), PORT58_FN0, PORT81_FN0), /* IRQ26A */
2575 PINMUX_IRQ(evt2irq(0x3360), PORT57_FN0, PORT168_FN0), /* IRQ27A */
2576 PINMUX_IRQ(evt2irq(0x3380), PORT56_FN0, PORT169_FN0), /* IRQ28A */
2577 PINMUX_IRQ(evt2irq(0x33A0), PORT50_FN0, PORT170_FN0), /* IRQ29A */
2578 PINMUX_IRQ(evt2irq(0x33C0), PORT49_FN0, PORT171_FN0), /* IRQ30A */
2579 PINMUX_IRQ(evt2irq(0x33E0), PORT41_FN0, PORT167_FN0), /* IRQ31A */
2580};
2581
2582static struct pinmux_info r8a7740_pinmux_info = {
2583 .name = "r8a7740_pfc",
2584 .reserved_id = PINMUX_RESERVED,
2585 .data = { PINMUX_DATA_BEGIN,
2586 PINMUX_DATA_END },
2587 .input = { PINMUX_INPUT_BEGIN,
2588 PINMUX_INPUT_END },
2589 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN,
2590 PINMUX_INPUT_PULLUP_END },
2591 .input_pd = { PINMUX_INPUT_PULLDOWN_BEGIN,
2592 PINMUX_INPUT_PULLDOWN_END },
2593 .output = { PINMUX_OUTPUT_BEGIN,
2594 PINMUX_OUTPUT_END },
2595 .mark = { PINMUX_MARK_BEGIN,
2596 PINMUX_MARK_END },
2597 .function = { PINMUX_FUNCTION_BEGIN,
2598 PINMUX_FUNCTION_END },
2599
2600 .first_gpio = GPIO_PORT0,
2601 .last_gpio = GPIO_FN_TRACEAUD_FROM_MEMC,
2602
2603 .gpios = pinmux_gpios,
2604 .cfg_regs = pinmux_config_regs,
2605 .data_regs = pinmux_data_regs,
2606
2607 .gpio_data = pinmux_data,
2608 .gpio_data_size = ARRAY_SIZE(pinmux_data),
2609
2610 .gpio_irq = pinmux_irqs,
2611 .gpio_irq_size = ARRAY_SIZE(pinmux_irqs),
2612};
2613
2614void r8a7740_pinmux_init(void)
2615{
2616 register_pinmux(&r8a7740_pinmux_info);
2617}
diff --git a/arch/arm/mach-shmobile/pfc-r8a7779.c b/arch/arm/mach-shmobile/pfc-r8a7779.c
deleted file mode 100644
index 9513234d322b..000000000000
--- a/arch/arm/mach-shmobile/pfc-r8a7779.c
+++ /dev/null
@@ -1,2645 +0,0 @@
1/*
2 * r8a7779 processor support - PFC hardware block
3 *
4 * Copyright (C) 2011 Renesas Solutions Corp.
5 * Copyright (C) 2011 Magnus Damm
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; version 2 of the License.
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20#include <linux/init.h>
21#include <linux/kernel.h>
22#include <linux/sh_pfc.h>
23#include <linux/ioport.h>
24#include <mach/r8a7779.h>
25
26#define CPU_32_PORT(fn, pfx, sfx) \
27 PORT_10(fn, pfx, sfx), PORT_10(fn, pfx##1, sfx), \
28 PORT_10(fn, pfx##2, sfx), PORT_1(fn, pfx##30, sfx), \
29 PORT_1(fn, pfx##31, sfx)
30
31#define CPU_32_PORT6(fn, pfx, sfx) \
32 PORT_1(fn, pfx##0, sfx), PORT_1(fn, pfx##1, sfx), \
33 PORT_1(fn, pfx##2, sfx), PORT_1(fn, pfx##3, sfx), \
34 PORT_1(fn, pfx##4, sfx), PORT_1(fn, pfx##5, sfx), \
35 PORT_1(fn, pfx##6, sfx), PORT_1(fn, pfx##7, sfx), \
36 PORT_1(fn, pfx##8, sfx)
37
38#define CPU_ALL_PORT(fn, pfx, sfx) \
39 CPU_32_PORT(fn, pfx##_0_, sfx), \
40 CPU_32_PORT(fn, pfx##_1_, sfx), \
41 CPU_32_PORT(fn, pfx##_2_, sfx), \
42 CPU_32_PORT(fn, pfx##_3_, sfx), \
43 CPU_32_PORT(fn, pfx##_4_, sfx), \
44 CPU_32_PORT(fn, pfx##_5_, sfx), \
45 CPU_32_PORT6(fn, pfx##_6_, sfx)
46
47#define _GP_GPIO(pfx, sfx) PINMUX_GPIO(GPIO_GP##pfx, GP##pfx##_DATA)
48#define _GP_DATA(pfx, sfx) PINMUX_DATA(GP##pfx##_DATA, GP##pfx##_FN, \
49 GP##pfx##_IN, GP##pfx##_OUT)
50
51#define _GP_INOUTSEL(pfx, sfx) GP##pfx##_IN, GP##pfx##_OUT
52#define _GP_INDT(pfx, sfx) GP##pfx##_DATA
53
54#define GP_ALL(str) CPU_ALL_PORT(_PORT_ALL, GP, str)
55#define PINMUX_GPIO_GP_ALL() CPU_ALL_PORT(_GP_GPIO, , unused)
56#define PINMUX_DATA_GP_ALL() CPU_ALL_PORT(_GP_DATA, , unused)
57
58
59#define PORT_10_REV(fn, pfx, sfx) \
60 PORT_1(fn, pfx##9, sfx), PORT_1(fn, pfx##8, sfx), \
61 PORT_1(fn, pfx##7, sfx), PORT_1(fn, pfx##6, sfx), \
62 PORT_1(fn, pfx##5, sfx), PORT_1(fn, pfx##4, sfx), \
63 PORT_1(fn, pfx##3, sfx), PORT_1(fn, pfx##2, sfx), \
64 PORT_1(fn, pfx##1, sfx), PORT_1(fn, pfx##0, sfx)
65
66#define CPU_32_PORT_REV(fn, pfx, sfx) \
67 PORT_1(fn, pfx##31, sfx), PORT_1(fn, pfx##30, sfx), \
68 PORT_10_REV(fn, pfx##2, sfx), PORT_10_REV(fn, pfx##1, sfx), \
69 PORT_10_REV(fn, pfx, sfx)
70
71#define GP_INOUTSEL(bank) CPU_32_PORT_REV(_GP_INOUTSEL, _##bank##_, unused)
72#define GP_INDT(bank) CPU_32_PORT_REV(_GP_INDT, _##bank##_, unused)
73
74#define PINMUX_IPSR_DATA(ipsr, fn) PINMUX_DATA(fn##_MARK, FN_##ipsr, FN_##fn)
75#define PINMUX_IPSR_MODSEL_DATA(ipsr, fn, ms) PINMUX_DATA(fn##_MARK, FN_##ms, \
76 FN_##ipsr, FN_##fn)
77
78enum {
79 PINMUX_RESERVED = 0,
80
81 PINMUX_DATA_BEGIN,
82 GP_ALL(DATA), /* GP_0_0_DATA -> GP_6_8_DATA */
83 PINMUX_DATA_END,
84
85 PINMUX_INPUT_BEGIN,
86 GP_ALL(IN), /* GP_0_0_IN -> GP_6_8_IN */
87 PINMUX_INPUT_END,
88
89 PINMUX_OUTPUT_BEGIN,
90 GP_ALL(OUT), /* GP_0_0_OUT -> GP_6_8_OUT */
91 PINMUX_OUTPUT_END,
92
93 PINMUX_FUNCTION_BEGIN,
94 GP_ALL(FN), /* GP_0_0_FN -> GP_6_8_FN */
95
96 /* GPSR0 */
97 FN_AVS1, FN_AVS2, FN_IP0_7_6, FN_A17,
98 FN_A18, FN_A19, FN_IP0_9_8, FN_IP0_11_10,
99 FN_IP0_13_12, FN_IP0_15_14, FN_IP0_18_16, FN_IP0_22_19,
100 FN_IP0_24_23, FN_IP0_25, FN_IP0_27_26, FN_IP1_1_0,
101 FN_IP1_3_2, FN_IP1_6_4, FN_IP1_10_7, FN_IP1_14_11,
102 FN_IP1_18_15, FN_IP0_5_3, FN_IP0_30_28, FN_IP2_18_16,
103 FN_IP2_21_19, FN_IP2_30_28, FN_IP3_2_0, FN_IP3_11_9,
104 FN_IP3_14_12, FN_IP3_22_21, FN_IP3_26_24, FN_IP3_31_29,
105
106 /* GPSR1 */
107 FN_IP4_1_0, FN_IP4_4_2, FN_IP4_7_5, FN_IP4_10_8,
108 FN_IP4_11, FN_IP4_12, FN_IP4_13, FN_IP4_14,
109 FN_IP4_15, FN_IP4_16, FN_IP4_19_17, FN_IP4_22_20,
110 FN_IP4_23, FN_IP4_24, FN_IP4_25, FN_IP4_26,
111 FN_IP4_27, FN_IP4_28, FN_IP4_31_29, FN_IP5_2_0,
112 FN_IP5_3, FN_IP5_4, FN_IP5_5, FN_IP5_6,
113 FN_IP5_7, FN_IP5_8, FN_IP5_10_9, FN_IP5_12_11,
114 FN_IP5_14_13, FN_IP5_16_15, FN_IP5_20_17, FN_IP5_23_21,
115
116 /* GPSR2 */
117 FN_IP5_27_24, FN_IP8_20, FN_IP8_22_21, FN_IP8_24_23,
118 FN_IP8_27_25, FN_IP8_30_28, FN_IP9_1_0, FN_IP9_3_2,
119 FN_IP9_4, FN_IP9_5, FN_IP9_6, FN_IP9_7,
120 FN_IP9_9_8, FN_IP9_11_10, FN_IP9_13_12, FN_IP9_15_14,
121 FN_IP9_18_16, FN_IP9_21_19, FN_IP9_23_22, FN_IP9_25_24,
122 FN_IP9_27_26, FN_IP9_29_28, FN_IP10_2_0, FN_IP10_5_3,
123 FN_IP10_8_6, FN_IP10_11_9, FN_IP10_14_12, FN_IP10_17_15,
124 FN_IP10_20_18, FN_IP10_23_21, FN_IP10_25_24, FN_IP10_28_26,
125
126 /* GPSR3 */
127 FN_IP10_31_29, FN_IP11_2_0, FN_IP11_5_3, FN_IP11_8_6,
128 FN_IP11_11_9, FN_IP11_14_12, FN_IP11_17_15, FN_IP11_20_18,
129 FN_IP11_23_21, FN_IP11_26_24, FN_IP11_29_27, FN_IP12_2_0,
130 FN_IP12_5_3, FN_IP12_8_6, FN_IP12_11_9, FN_IP12_14_12,
131 FN_IP12_17_15, FN_IP7_16_15, FN_IP7_18_17, FN_IP7_28_27,
132 FN_IP7_30_29, FN_IP7_20_19, FN_IP7_22_21, FN_IP7_24_23,
133 FN_IP7_26_25, FN_IP1_20_19, FN_IP1_22_21, FN_IP1_24_23,
134 FN_IP5_28, FN_IP5_30_29, FN_IP6_1_0, FN_IP6_3_2,
135
136 /* GPSR4 */
137 FN_IP6_5_4, FN_IP6_7_6, FN_IP6_8, FN_IP6_11_9,
138 FN_IP6_14_12, FN_IP6_17_15, FN_IP6_19_18, FN_IP6_22_20,
139 FN_IP6_24_23, FN_IP6_26_25, FN_IP6_30_29, FN_IP7_1_0,
140 FN_IP7_3_2, FN_IP7_6_4, FN_IP7_9_7, FN_IP7_12_10,
141 FN_IP7_14_13, FN_IP2_7_4, FN_IP2_11_8, FN_IP2_15_12,
142 FN_IP1_28_25, FN_IP2_3_0, FN_IP8_3_0, FN_IP8_7_4,
143 FN_IP8_11_8, FN_IP8_15_12, FN_USB_PENC0, FN_USB_PENC1,
144 FN_IP0_2_0, FN_IP8_17_16, FN_IP8_18, FN_IP8_19,
145
146 /* GPSR5 */
147 FN_A1, FN_A2, FN_A3, FN_A4,
148 FN_A5, FN_A6, FN_A7, FN_A8,
149 FN_A9, FN_A10, FN_A11, FN_A12,
150 FN_A13, FN_A14, FN_A15, FN_A16,
151 FN_RD, FN_WE0, FN_WE1, FN_EX_WAIT0,
152 FN_IP3_23, FN_IP3_27, FN_IP3_28, FN_IP2_22,
153 FN_IP2_23, FN_IP2_24, FN_IP2_25, FN_IP2_26,
154 FN_IP2_27, FN_IP3_3, FN_IP3_4, FN_IP3_5,
155
156 /* GPSR6 */
157 FN_IP3_6, FN_IP3_7, FN_IP3_8, FN_IP3_15,
158 FN_IP3_16, FN_IP3_17, FN_IP3_18, FN_IP3_19,
159 FN_IP3_20,
160
161 /* IPSR0 */
162 FN_RD_WR, FN_FWE, FN_ATAG0, FN_VI1_R7,
163 FN_HRTS1, FN_RX4_C,
164 FN_CS1_A26, FN_HSPI_TX2, FN_SDSELF_B,
165 FN_CS0, FN_HSPI_CS2_B,
166 FN_CLKOUT, FN_TX3C_IRDA_TX_C, FN_PWM0_B,
167 FN_A25, FN_SD1_WP, FN_MMC0_D5, FN_FD5,
168 FN_HSPI_RX2, FN_VI1_R3, FN_TX5_B, FN_SSI_SDATA7_B,
169 FN_CTS0_B,
170 FN_A24, FN_SD1_CD, FN_MMC0_D4, FN_FD4,
171 FN_HSPI_CS2, FN_VI1_R2, FN_SSI_WS78_B,
172 FN_A23, FN_FCLE, FN_HSPI_CLK2, FN_VI1_R1,
173 FN_A22, FN_RX5_D, FN_HSPI_RX2_B, FN_VI1_R0,
174 FN_A21, FN_SCK5_D, FN_HSPI_CLK2_B,
175 FN_A20, FN_TX5_D, FN_HSPI_TX2_B,
176 FN_A0, FN_SD1_DAT3, FN_MMC0_D3, FN_FD3,
177 FN_BS, FN_SD1_DAT2, FN_MMC0_D2, FN_FD2,
178 FN_ATADIR0, FN_SDSELF, FN_HCTS1, FN_TX4_C,
179 FN_USB_PENC2, FN_SCK0, FN_PWM1, FN_PWMFSW0,
180 FN_SCIF_CLK, FN_TCLK0_C,
181
182 /* IPSR1 */
183 FN_EX_CS0, FN_RX3_C_IRDA_RX_C, FN_MMC0_D6,
184 FN_FD6, FN_EX_CS1, FN_MMC0_D7, FN_FD7,
185 FN_EX_CS2, FN_SD1_CLK, FN_MMC0_CLK, FN_FALE,
186 FN_ATACS00, FN_EX_CS3, FN_SD1_CMD, FN_MMC0_CMD,
187 FN_FRE, FN_ATACS10, FN_VI1_R4, FN_RX5_B,
188 FN_HSCK1, FN_SSI_SDATA8_B, FN_RTS0_B_TANS_B, FN_SSI_SDATA9,
189 FN_EX_CS4, FN_SD1_DAT0, FN_MMC0_D0, FN_FD0,
190 FN_ATARD0, FN_VI1_R5, FN_SCK5_B, FN_HTX1,
191 FN_TX2_E, FN_TX0_B, FN_SSI_SCK9, FN_EX_CS5,
192 FN_SD1_DAT1, FN_MMC0_D1, FN_FD1, FN_ATAWR0,
193 FN_VI1_R6, FN_HRX1, FN_RX2_E, FN_RX0_B,
194 FN_SSI_WS9, FN_MLB_CLK, FN_PWM2, FN_SCK4,
195 FN_MLB_SIG, FN_PWM3, FN_TX4, FN_MLB_DAT,
196 FN_PWM4, FN_RX4, FN_HTX0, FN_TX1,
197 FN_SDATA, FN_CTS0_C, FN_SUB_TCK, FN_CC5_STATE2,
198 FN_CC5_STATE10, FN_CC5_STATE18, FN_CC5_STATE26, FN_CC5_STATE34,
199
200 /* IPSR2 */
201 FN_HRX0, FN_RX1, FN_SCKZ, FN_RTS0_C_TANS_C,
202 FN_SUB_TDI, FN_CC5_STATE3, FN_CC5_STATE11, FN_CC5_STATE19,
203 FN_CC5_STATE27, FN_CC5_STATE35, FN_HSCK0, FN_SCK1,
204 FN_MTS, FN_PWM5, FN_SCK0_C, FN_SSI_SDATA9_B,
205 FN_SUB_TDO, FN_CC5_STATE0, FN_CC5_STATE8, FN_CC5_STATE16,
206 FN_CC5_STATE24, FN_CC5_STATE32, FN_HCTS0, FN_CTS1,
207 FN_STM, FN_PWM0_D, FN_RX0_C, FN_SCIF_CLK_C,
208 FN_SUB_TRST, FN_TCLK1_B, FN_CC5_OSCOUT, FN_HRTS0,
209 FN_RTS1_TANS, FN_MDATA, FN_TX0_C, FN_SUB_TMS,
210 FN_CC5_STATE1, FN_CC5_STATE9, FN_CC5_STATE17, FN_CC5_STATE25,
211 FN_CC5_STATE33, FN_DU0_DR0, FN_LCDOUT0, FN_DREQ0,
212 FN_GPS_CLK_B, FN_AUDATA0, FN_TX5_C, FN_DU0_DR1,
213 FN_LCDOUT1, FN_DACK0, FN_DRACK0, FN_GPS_SIGN_B,
214 FN_AUDATA1, FN_RX5_C, FN_DU0_DR2, FN_LCDOUT2,
215 FN_DU0_DR3, FN_LCDOUT3, FN_DU0_DR4, FN_LCDOUT4,
216 FN_DU0_DR5, FN_LCDOUT5, FN_DU0_DR6, FN_LCDOUT6,
217 FN_DU0_DR7, FN_LCDOUT7, FN_DU0_DG0, FN_LCDOUT8,
218 FN_DREQ1, FN_SCL2, FN_AUDATA2,
219
220 /* IPSR3 */
221 FN_DU0_DG1, FN_LCDOUT9, FN_DACK1, FN_SDA2,
222 FN_AUDATA3, FN_DU0_DG2, FN_LCDOUT10, FN_DU0_DG3,
223 FN_LCDOUT11, FN_DU0_DG4, FN_LCDOUT12, FN_DU0_DG5,
224 FN_LCDOUT13, FN_DU0_DG6, FN_LCDOUT14, FN_DU0_DG7,
225 FN_LCDOUT15, FN_DU0_DB0, FN_LCDOUT16, FN_EX_WAIT1,
226 FN_SCL1, FN_TCLK1, FN_AUDATA4, FN_DU0_DB1,
227 FN_LCDOUT17, FN_EX_WAIT2, FN_SDA1, FN_GPS_MAG_B,
228 FN_AUDATA5, FN_SCK5_C, FN_DU0_DB2, FN_LCDOUT18,
229 FN_DU0_DB3, FN_LCDOUT19, FN_DU0_DB4, FN_LCDOUT20,
230 FN_DU0_DB5, FN_LCDOUT21, FN_DU0_DB6, FN_LCDOUT22,
231 FN_DU0_DB7, FN_LCDOUT23, FN_DU0_DOTCLKIN, FN_QSTVA_QVS,
232 FN_TX3_D_IRDA_TX_D, FN_SCL3_B, FN_DU0_DOTCLKOUT0, FN_QCLK,
233 FN_DU0_DOTCLKOUT1, FN_QSTVB_QVE, FN_RX3_D_IRDA_RX_D, FN_SDA3_B,
234 FN_SDA2_C, FN_DACK0_B, FN_DRACK0_B, FN_DU0_EXHSYNC_DU0_HSYNC,
235 FN_QSTH_QHS, FN_DU0_EXVSYNC_DU0_VSYNC, FN_QSTB_QHE,
236 FN_DU0_EXODDF_DU0_ODDF_DISP_CDE, FN_QCPV_QDE, FN_CAN1_TX,
237 FN_TX2_C, FN_SCL2_C, FN_REMOCON,
238
239 /* IPSR4 */
240 FN_DU0_DISP, FN_QPOLA, FN_CAN_CLK_C, FN_SCK2_C,
241 FN_DU0_CDE, FN_QPOLB, FN_CAN1_RX, FN_RX2_C,
242 FN_DREQ0_B, FN_SSI_SCK78_B, FN_SCK0_B, FN_DU1_DR0,
243 FN_VI2_DATA0_VI2_B0, FN_PWM6, FN_SD3_CLK, FN_TX3_E_IRDA_TX_E,
244 FN_AUDCK, FN_PWMFSW0_B, FN_DU1_DR1, FN_VI2_DATA1_VI2_B1,
245 FN_PWM0, FN_SD3_CMD, FN_RX3_E_IRDA_RX_E, FN_AUDSYNC,
246 FN_CTS0_D, FN_DU1_DR2, FN_VI2_G0, FN_DU1_DR3,
247 FN_VI2_G1, FN_DU1_DR4, FN_VI2_G2, FN_DU1_DR5,
248 FN_VI2_G3, FN_DU1_DR6, FN_VI2_G4, FN_DU1_DR7,
249 FN_VI2_G5, FN_DU1_DG0, FN_VI2_DATA2_VI2_B2, FN_SCL1_B,
250 FN_SD3_DAT2, FN_SCK3_E, FN_AUDATA6, FN_TX0_D,
251 FN_DU1_DG1, FN_VI2_DATA3_VI2_B3, FN_SDA1_B, FN_SD3_DAT3,
252 FN_SCK5, FN_AUDATA7, FN_RX0_D, FN_DU1_DG2,
253 FN_VI2_G6, FN_DU1_DG3, FN_VI2_G7, FN_DU1_DG4,
254 FN_VI2_R0, FN_DU1_DG5, FN_VI2_R1, FN_DU1_DG6,
255 FN_VI2_R2, FN_DU1_DG7, FN_VI2_R3, FN_DU1_DB0,
256 FN_VI2_DATA4_VI2_B4, FN_SCL2_B, FN_SD3_DAT0, FN_TX5,
257 FN_SCK0_D,
258
259 /* IPSR5 */
260 FN_DU1_DB1, FN_VI2_DATA5_VI2_B5, FN_SDA2_B, FN_SD3_DAT1,
261 FN_RX5, FN_RTS0_D_TANS_D, FN_DU1_DB2, FN_VI2_R4,
262 FN_DU1_DB3, FN_VI2_R5, FN_DU1_DB4, FN_VI2_R6,
263 FN_DU1_DB5, FN_VI2_R7, FN_DU1_DB6, FN_SCL2_D,
264 FN_DU1_DB7, FN_SDA2_D, FN_DU1_DOTCLKIN, FN_VI2_CLKENB,
265 FN_HSPI_CS1, FN_SCL1_D, FN_DU1_DOTCLKOUT, FN_VI2_FIELD,
266 FN_SDA1_D, FN_DU1_EXHSYNC_DU1_HSYNC, FN_VI2_HSYNC,
267 FN_VI3_HSYNC, FN_DU1_EXVSYNC_DU1_VSYNC, FN_VI2_VSYNC, FN_VI3_VSYNC,
268 FN_DU1_EXODDF_DU1_ODDF_DISP_CDE, FN_VI2_CLK, FN_TX3_B_IRDA_TX_B,
269 FN_SD3_CD, FN_HSPI_TX1, FN_VI1_CLKENB, FN_VI3_CLKENB,
270 FN_AUDIO_CLKC, FN_TX2_D, FN_SPEEDIN, FN_GPS_SIGN_D,
271 FN_DU1_DISP, FN_VI2_DATA6_VI2_B6, FN_TCLK0, FN_QSTVA_B_QVS_B,
272 FN_HSPI_CLK1, FN_SCK2_D, FN_AUDIO_CLKOUT_B, FN_GPS_MAG_D,
273 FN_DU1_CDE, FN_VI2_DATA7_VI2_B7, FN_RX3_B_IRDA_RX_B,
274 FN_SD3_WP, FN_HSPI_RX1, FN_VI1_FIELD, FN_VI3_FIELD,
275 FN_AUDIO_CLKOUT, FN_RX2_D, FN_GPS_CLK_C, FN_GPS_CLK_D,
276 FN_AUDIO_CLKA, FN_CAN_TXCLK, FN_AUDIO_CLKB, FN_USB_OVC2,
277 FN_CAN_DEBUGOUT0, FN_MOUT0,
278
279 /* IPSR6 */
280 FN_SSI_SCK0129, FN_CAN_DEBUGOUT1, FN_MOUT1, FN_SSI_WS0129,
281 FN_CAN_DEBUGOUT2, FN_MOUT2, FN_SSI_SDATA0, FN_CAN_DEBUGOUT3,
282 FN_MOUT5, FN_SSI_SDATA1, FN_CAN_DEBUGOUT4, FN_MOUT6,
283 FN_SSI_SDATA2, FN_CAN_DEBUGOUT5, FN_SSI_SCK34, FN_CAN_DEBUGOUT6,
284 FN_CAN0_TX_B, FN_IERX, FN_SSI_SCK9_C, FN_SSI_WS34,
285 FN_CAN_DEBUGOUT7, FN_CAN0_RX_B, FN_IETX, FN_SSI_WS9_C,
286 FN_SSI_SDATA3, FN_PWM0_C, FN_CAN_DEBUGOUT8, FN_CAN_CLK_B,
287 FN_IECLK, FN_SCIF_CLK_B, FN_TCLK0_B, FN_SSI_SDATA4,
288 FN_CAN_DEBUGOUT9, FN_SSI_SDATA9_C, FN_SSI_SCK5, FN_ADICLK,
289 FN_CAN_DEBUGOUT10, FN_SCK3, FN_TCLK0_D, FN_SSI_WS5,
290 FN_ADICS_SAMP, FN_CAN_DEBUGOUT11, FN_TX3_IRDA_TX, FN_SSI_SDATA5,
291 FN_ADIDATA, FN_CAN_DEBUGOUT12, FN_RX3_IRDA_RX, FN_SSI_SCK6,
292 FN_ADICHS0, FN_CAN0_TX, FN_IERX_B,
293
294 /* IPSR7 */
295 FN_SSI_WS6, FN_ADICHS1, FN_CAN0_RX, FN_IETX_B,
296 FN_SSI_SDATA6, FN_ADICHS2, FN_CAN_CLK, FN_IECLK_B,
297 FN_SSI_SCK78, FN_CAN_DEBUGOUT13, FN_IRQ0_B, FN_SSI_SCK9_B,
298 FN_HSPI_CLK1_C, FN_SSI_WS78, FN_CAN_DEBUGOUT14, FN_IRQ1_B,
299 FN_SSI_WS9_B, FN_HSPI_CS1_C, FN_SSI_SDATA7, FN_CAN_DEBUGOUT15,
300 FN_IRQ2_B, FN_TCLK1_C, FN_HSPI_TX1_C, FN_SSI_SDATA8,
301 FN_VSP, FN_IRQ3_B, FN_HSPI_RX1_C, FN_SD0_CLK,
302 FN_ATACS01, FN_SCK1_B, FN_SD0_CMD, FN_ATACS11,
303 FN_TX1_B, FN_CC5_TDO, FN_SD0_DAT0, FN_ATADIR1,
304 FN_RX1_B, FN_CC5_TRST, FN_SD0_DAT1, FN_ATAG1,
305 FN_SCK2_B, FN_CC5_TMS, FN_SD0_DAT2, FN_ATARD1,
306 FN_TX2_B, FN_CC5_TCK, FN_SD0_DAT3, FN_ATAWR1,
307 FN_RX2_B, FN_CC5_TDI, FN_SD0_CD, FN_DREQ2,
308 FN_RTS1_B_TANS_B, FN_SD0_WP, FN_DACK2, FN_CTS1_B,
309
310 /* IPSR8 */
311 FN_HSPI_CLK0, FN_CTS0, FN_USB_OVC0, FN_AD_CLK,
312 FN_CC5_STATE4, FN_CC5_STATE12, FN_CC5_STATE20, FN_CC5_STATE28,
313 FN_CC5_STATE36, FN_HSPI_CS0, FN_RTS0_TANS, FN_USB_OVC1,
314 FN_AD_DI, FN_CC5_STATE5, FN_CC5_STATE13, FN_CC5_STATE21,
315 FN_CC5_STATE29, FN_CC5_STATE37, FN_HSPI_TX0, FN_TX0,
316 FN_CAN_DEBUG_HW_TRIGGER, FN_AD_DO, FN_CC5_STATE6, FN_CC5_STATE14,
317 FN_CC5_STATE22, FN_CC5_STATE30, FN_CC5_STATE38, FN_HSPI_RX0,
318 FN_RX0, FN_CAN_STEP0, FN_AD_NCS, FN_CC5_STATE7,
319 FN_CC5_STATE15, FN_CC5_STATE23, FN_CC5_STATE31, FN_CC5_STATE39,
320 FN_FMCLK, FN_RDS_CLK, FN_PCMOE, FN_BPFCLK,
321 FN_PCMWE, FN_FMIN, FN_RDS_DATA, FN_VI0_CLK,
322 FN_MMC1_CLK, FN_VI0_CLKENB, FN_TX1_C, FN_HTX1_B,
323 FN_MT1_SYNC, FN_VI0_FIELD, FN_RX1_C, FN_HRX1_B,
324 FN_VI0_HSYNC, FN_VI0_DATA0_B_VI0_B0_B, FN_CTS1_C, FN_TX4_D,
325 FN_MMC1_CMD, FN_HSCK1_B, FN_VI0_VSYNC, FN_VI0_DATA1_B_VI0_B1_B,
326 FN_RTS1_C_TANS_C, FN_RX4_D, FN_PWMFSW0_C,
327
328 /* IPSR9 */
329 FN_VI0_DATA0_VI0_B0, FN_HRTS1_B, FN_MT1_VCXO, FN_VI0_DATA1_VI0_B1,
330 FN_HCTS1_B, FN_MT1_PWM, FN_VI0_DATA2_VI0_B2, FN_MMC1_D0,
331 FN_VI0_DATA3_VI0_B3, FN_MMC1_D1, FN_VI0_DATA4_VI0_B4, FN_MMC1_D2,
332 FN_VI0_DATA5_VI0_B5, FN_MMC1_D3, FN_VI0_DATA6_VI0_B6, FN_MMC1_D4,
333 FN_ARM_TRACEDATA_0, FN_VI0_DATA7_VI0_B7, FN_MMC1_D5,
334 FN_ARM_TRACEDATA_1, FN_VI0_G0, FN_SSI_SCK78_C, FN_IRQ0,
335 FN_ARM_TRACEDATA_2, FN_VI0_G1, FN_SSI_WS78_C, FN_IRQ1,
336 FN_ARM_TRACEDATA_3, FN_VI0_G2, FN_ETH_TXD1, FN_MMC1_D6,
337 FN_ARM_TRACEDATA_4, FN_TS_SPSYNC0, FN_VI0_G3, FN_ETH_CRS_DV,
338 FN_MMC1_D7, FN_ARM_TRACEDATA_5, FN_TS_SDAT0, FN_VI0_G4,
339 FN_ETH_TX_EN, FN_SD2_DAT0_B, FN_ARM_TRACEDATA_6, FN_VI0_G5,
340 FN_ETH_RX_ER, FN_SD2_DAT1_B, FN_ARM_TRACEDATA_7, FN_VI0_G6,
341 FN_ETH_RXD0, FN_SD2_DAT2_B, FN_ARM_TRACEDATA_8, FN_VI0_G7,
342 FN_ETH_RXD1, FN_SD2_DAT3_B, FN_ARM_TRACEDATA_9,
343
344 /* IPSR10 */
345 FN_VI0_R0, FN_SSI_SDATA7_C, FN_SCK1_C, FN_DREQ1_B,
346 FN_ARM_TRACEDATA_10, FN_DREQ0_C, FN_VI0_R1, FN_SSI_SDATA8_C,
347 FN_DACK1_B, FN_ARM_TRACEDATA_11, FN_DACK0_C, FN_DRACK0_C,
348 FN_VI0_R2, FN_ETH_LINK, FN_SD2_CLK_B, FN_IRQ2,
349 FN_ARM_TRACEDATA_12, FN_VI0_R3, FN_ETH_MAGIC, FN_SD2_CMD_B,
350 FN_IRQ3, FN_ARM_TRACEDATA_13, FN_VI0_R4, FN_ETH_REFCLK,
351 FN_SD2_CD_B, FN_HSPI_CLK1_B, FN_ARM_TRACEDATA_14, FN_MT1_CLK,
352 FN_TS_SCK0, FN_VI0_R5, FN_ETH_TXD0, FN_SD2_WP_B, FN_HSPI_CS1_B,
353 FN_ARM_TRACEDATA_15, FN_MT1_D, FN_TS_SDEN0, FN_VI0_R6,
354 FN_ETH_MDC, FN_DREQ2_C, FN_HSPI_TX1_B, FN_TRACECLK,
355 FN_MT1_BEN, FN_PWMFSW0_D, FN_VI0_R7, FN_ETH_MDIO,
356 FN_DACK2_C, FN_HSPI_RX1_B, FN_SCIF_CLK_D, FN_TRACECTL,
357 FN_MT1_PEN, FN_VI1_CLK, FN_SIM_D, FN_SDA3,
358 FN_VI1_HSYNC, FN_VI3_CLK, FN_SSI_SCK4, FN_GPS_SIGN_C,
359 FN_PWMFSW0_E, FN_VI1_VSYNC, FN_AUDIO_CLKOUT_C, FN_SSI_WS4,
360 FN_SIM_CLK, FN_GPS_MAG_C, FN_SPV_TRST, FN_SCL3,
361
362 /* IPSR11 */
363 FN_VI1_DATA0_VI1_B0, FN_SD2_DAT0, FN_SIM_RST, FN_SPV_TCK,
364 FN_ADICLK_B, FN_VI1_DATA1_VI1_B1, FN_SD2_DAT1, FN_MT0_CLK,
365 FN_SPV_TMS, FN_ADICS_B_SAMP_B, FN_VI1_DATA2_VI1_B2, FN_SD2_DAT2,
366 FN_MT0_D, FN_SPVTDI, FN_ADIDATA_B, FN_VI1_DATA3_VI1_B3,
367 FN_SD2_DAT3, FN_MT0_BEN, FN_SPV_TDO, FN_ADICHS0_B,
368 FN_VI1_DATA4_VI1_B4, FN_SD2_CLK, FN_MT0_PEN, FN_SPA_TRST,
369 FN_HSPI_CLK1_D, FN_ADICHS1_B, FN_VI1_DATA5_VI1_B5, FN_SD2_CMD,
370 FN_MT0_SYNC, FN_SPA_TCK, FN_HSPI_CS1_D, FN_ADICHS2_B,
371 FN_VI1_DATA6_VI1_B6, FN_SD2_CD, FN_MT0_VCXO, FN_SPA_TMS,
372 FN_HSPI_TX1_D, FN_VI1_DATA7_VI1_B7, FN_SD2_WP, FN_MT0_PWM,
373 FN_SPA_TDI, FN_HSPI_RX1_D, FN_VI1_G0, FN_VI3_DATA0,
374 FN_DU1_DOTCLKOUT1, FN_TS_SCK1, FN_DREQ2_B, FN_TX2,
375 FN_SPA_TDO, FN_HCTS0_B, FN_VI1_G1, FN_VI3_DATA1,
376 FN_SSI_SCK1, FN_TS_SDEN1, FN_DACK2_B, FN_RX2, FN_HRTS0_B,
377
378 /* IPSR12 */
379 FN_VI1_G2, FN_VI3_DATA2, FN_SSI_WS1, FN_TS_SPSYNC1,
380 FN_SCK2, FN_HSCK0_B, FN_VI1_G3, FN_VI3_DATA3,
381 FN_SSI_SCK2, FN_TS_SDAT1, FN_SCL1_C, FN_HTX0_B,
382 FN_VI1_G4, FN_VI3_DATA4, FN_SSI_WS2, FN_SDA1_C,
383 FN_SIM_RST_B, FN_HRX0_B, FN_VI1_G5, FN_VI3_DATA5,
384 FN_GPS_CLK, FN_FSE, FN_TX4_B, FN_SIM_D_B,
385 FN_VI1_G6, FN_VI3_DATA6, FN_GPS_SIGN, FN_FRB,
386 FN_RX4_B, FN_SIM_CLK_B, FN_VI1_G7, FN_VI3_DATA7,
387 FN_GPS_MAG, FN_FCE, FN_SCK4_B,
388
389 FN_SEL_SCIF5_0, FN_SEL_SCIF5_1, FN_SEL_SCIF5_2, FN_SEL_SCIF5_3,
390 FN_SEL_SCIF4_0, FN_SEL_SCIF4_1, FN_SEL_SCIF4_2, FN_SEL_SCIF4_3,
391 FN_SEL_SCIF3_0, FN_SEL_SCIF3_1, FN_SEL_SCIF3_2,
392 FN_SEL_SCIF3_3, FN_SEL_SCIF3_4,
393 FN_SEL_SCIF2_0, FN_SEL_SCIF2_1, FN_SEL_SCIF2_2,
394 FN_SEL_SCIF2_3, FN_SEL_SCIF2_4,
395 FN_SEL_SCIF1_0, FN_SEL_SCIF1_1, FN_SEL_SCIF1_2,
396 FN_SEL_SCIF0_0, FN_SEL_SCIF0_1, FN_SEL_SCIF0_2, FN_SEL_SCIF0_3,
397 FN_SEL_SSI9_0, FN_SEL_SSI9_1, FN_SEL_SSI9_2,
398 FN_SEL_SSI8_0, FN_SEL_SSI8_1, FN_SEL_SSI8_2,
399 FN_SEL_SSI7_0, FN_SEL_SSI7_1, FN_SEL_SSI7_2,
400 FN_SEL_VI0_0, FN_SEL_VI0_1,
401 FN_SEL_SD2_0, FN_SEL_SD2_1,
402 FN_SEL_INT3_0, FN_SEL_INT3_1,
403 FN_SEL_INT2_0, FN_SEL_INT2_1,
404 FN_SEL_INT1_0, FN_SEL_INT1_1,
405 FN_SEL_INT0_0, FN_SEL_INT0_1,
406 FN_SEL_IE_0, FN_SEL_IE_1,
407 FN_SEL_EXBUS2_0, FN_SEL_EXBUS2_1, FN_SEL_EXBUS2_2,
408 FN_SEL_EXBUS1_0, FN_SEL_EXBUS1_1,
409 FN_SEL_EXBUS0_0, FN_SEL_EXBUS0_1, FN_SEL_EXBUS0_2,
410
411 FN_SEL_TMU1_0, FN_SEL_TMU1_1, FN_SEL_TMU1_2,
412 FN_SEL_TMU0_0, FN_SEL_TMU0_1, FN_SEL_TMU0_2, FN_SEL_TMU0_3,
413 FN_SEL_SCIF_0, FN_SEL_SCIF_1, FN_SEL_SCIF_2, FN_SEL_SCIF_3,
414 FN_SEL_CANCLK_0, FN_SEL_CANCLK_1, FN_SEL_CANCLK_2,
415 FN_SEL_CAN0_0, FN_SEL_CAN0_1,
416 FN_SEL_HSCIF1_0, FN_SEL_HSCIF1_1,
417 FN_SEL_HSCIF0_0, FN_SEL_HSCIF0_1,
418 FN_SEL_PWMFSW_0, FN_SEL_PWMFSW_1, FN_SEL_PWMFSW_2,
419 FN_SEL_PWMFSW_3, FN_SEL_PWMFSW_4,
420 FN_SEL_ADI_0, FN_SEL_ADI_1,
421 FN_SEL_GPS_0, FN_SEL_GPS_1, FN_SEL_GPS_2, FN_SEL_GPS_3,
422 FN_SEL_SIM_0, FN_SEL_SIM_1,
423 FN_SEL_HSPI2_0, FN_SEL_HSPI2_1,
424 FN_SEL_HSPI1_0, FN_SEL_HSPI1_1, FN_SEL_HSPI1_2, FN_SEL_HSPI1_3,
425 FN_SEL_I2C3_0, FN_SEL_I2C3_1,
426 FN_SEL_I2C2_0, FN_SEL_I2C2_1, FN_SEL_I2C2_2, FN_SEL_I2C2_3,
427 FN_SEL_I2C1_0, FN_SEL_I2C1_1, FN_SEL_I2C1_2, FN_SEL_I2C1_3,
428 PINMUX_FUNCTION_END,
429
430 PINMUX_MARK_BEGIN,
431 AVS1_MARK, AVS2_MARK, A17_MARK, A18_MARK,
432 A19_MARK,
433
434 RD_WR_MARK, FWE_MARK, ATAG0_MARK, VI1_R7_MARK,
435 HRTS1_MARK, RX4_C_MARK,
436 CS1_A26_MARK, HSPI_TX2_MARK, SDSELF_B_MARK,
437 CS0_MARK, HSPI_CS2_B_MARK,
438 CLKOUT_MARK, TX3C_IRDA_TX_C_MARK, PWM0_B_MARK,
439 A25_MARK, SD1_WP_MARK, MMC0_D5_MARK, FD5_MARK,
440 HSPI_RX2_MARK, VI1_R3_MARK, TX5_B_MARK, SSI_SDATA7_B_MARK, CTS0_B_MARK,
441 A24_MARK, SD1_CD_MARK, MMC0_D4_MARK, FD4_MARK,
442 HSPI_CS2_MARK, VI1_R2_MARK, SSI_WS78_B_MARK,
443 A23_MARK, FCLE_MARK, HSPI_CLK2_MARK, VI1_R1_MARK,
444 A22_MARK, RX5_D_MARK, HSPI_RX2_B_MARK, VI1_R0_MARK,
445 A21_MARK, SCK5_D_MARK, HSPI_CLK2_B_MARK,
446 A20_MARK, TX5_D_MARK, HSPI_TX2_B_MARK,
447 A0_MARK, SD1_DAT3_MARK, MMC0_D3_MARK, FD3_MARK,
448 BS_MARK, SD1_DAT2_MARK, MMC0_D2_MARK, FD2_MARK,
449 ATADIR0_MARK, SDSELF_MARK, HCTS1_MARK, TX4_C_MARK,
450 USB_PENC2_MARK, SCK0_MARK, PWM1_MARK, PWMFSW0_MARK,
451 SCIF_CLK_MARK, TCLK0_C_MARK,
452
453 EX_CS0_MARK, RX3_C_IRDA_RX_C_MARK, MMC0_D6_MARK,
454 FD6_MARK, EX_CS1_MARK, MMC0_D7_MARK, FD7_MARK,
455 EX_CS2_MARK, SD1_CLK_MARK, MMC0_CLK_MARK, FALE_MARK,
456 ATACS00_MARK, EX_CS3_MARK, SD1_CMD_MARK, MMC0_CMD_MARK,
457 FRE_MARK, ATACS10_MARK, VI1_R4_MARK, RX5_B_MARK,
458 HSCK1_MARK, SSI_SDATA8_B_MARK, RTS0_B_TANS_B_MARK, SSI_SDATA9_MARK,
459 EX_CS4_MARK, SD1_DAT0_MARK, MMC0_D0_MARK, FD0_MARK,
460 ATARD0_MARK, VI1_R5_MARK, SCK5_B_MARK, HTX1_MARK,
461 TX2_E_MARK, TX0_B_MARK, SSI_SCK9_MARK, EX_CS5_MARK,
462 SD1_DAT1_MARK, MMC0_D1_MARK, FD1_MARK, ATAWR0_MARK,
463 VI1_R6_MARK, HRX1_MARK, RX2_E_MARK, RX0_B_MARK,
464 SSI_WS9_MARK, MLB_CLK_MARK, PWM2_MARK, SCK4_MARK,
465 MLB_SIG_MARK, PWM3_MARK, TX4_MARK, MLB_DAT_MARK,
466 PWM4_MARK, RX4_MARK, HTX0_MARK, TX1_MARK,
467 SDATA_MARK, CTS0_C_MARK, SUB_TCK_MARK, CC5_STATE2_MARK,
468 CC5_STATE10_MARK, CC5_STATE18_MARK, CC5_STATE26_MARK, CC5_STATE34_MARK,
469
470 HRX0_MARK, RX1_MARK, SCKZ_MARK, RTS0_C_TANS_C_MARK,
471 SUB_TDI_MARK, CC5_STATE3_MARK, CC5_STATE11_MARK, CC5_STATE19_MARK,
472 CC5_STATE27_MARK, CC5_STATE35_MARK, HSCK0_MARK, SCK1_MARK,
473 MTS_MARK, PWM5_MARK, SCK0_C_MARK, SSI_SDATA9_B_MARK,
474 SUB_TDO_MARK, CC5_STATE0_MARK, CC5_STATE8_MARK, CC5_STATE16_MARK,
475 CC5_STATE24_MARK, CC5_STATE32_MARK, HCTS0_MARK, CTS1_MARK,
476 STM_MARK, PWM0_D_MARK, RX0_C_MARK, SCIF_CLK_C_MARK,
477 SUB_TRST_MARK, TCLK1_B_MARK, CC5_OSCOUT_MARK, HRTS0_MARK,
478 RTS1_TANS_MARK, MDATA_MARK, TX0_C_MARK, SUB_TMS_MARK,
479 CC5_STATE1_MARK, CC5_STATE9_MARK, CC5_STATE17_MARK, CC5_STATE25_MARK,
480 CC5_STATE33_MARK, DU0_DR0_MARK, LCDOUT0_MARK, DREQ0_MARK,
481 GPS_CLK_B_MARK, AUDATA0_MARK, TX5_C_MARK, DU0_DR1_MARK,
482 LCDOUT1_MARK, DACK0_MARK, DRACK0_MARK, GPS_SIGN_B_MARK,
483 AUDATA1_MARK, RX5_C_MARK, DU0_DR2_MARK, LCDOUT2_MARK,
484 DU0_DR3_MARK, LCDOUT3_MARK, DU0_DR4_MARK, LCDOUT4_MARK,
485 DU0_DR5_MARK, LCDOUT5_MARK, DU0_DR6_MARK, LCDOUT6_MARK,
486 DU0_DR7_MARK, LCDOUT7_MARK, DU0_DG0_MARK, LCDOUT8_MARK,
487 DREQ1_MARK, SCL2_MARK, AUDATA2_MARK,
488
489 DU0_DG1_MARK, LCDOUT9_MARK, DACK1_MARK, SDA2_MARK,
490 AUDATA3_MARK, DU0_DG2_MARK, LCDOUT10_MARK, DU0_DG3_MARK,
491 LCDOUT11_MARK, DU0_DG4_MARK, LCDOUT12_MARK, DU0_DG5_MARK,
492 LCDOUT13_MARK, DU0_DG6_MARK, LCDOUT14_MARK, DU0_DG7_MARK,
493 LCDOUT15_MARK, DU0_DB0_MARK, LCDOUT16_MARK, EX_WAIT1_MARK,
494 SCL1_MARK, TCLK1_MARK, AUDATA4_MARK, DU0_DB1_MARK,
495 LCDOUT17_MARK, EX_WAIT2_MARK, SDA1_MARK, GPS_MAG_B_MARK,
496 AUDATA5_MARK, SCK5_C_MARK, DU0_DB2_MARK, LCDOUT18_MARK,
497 DU0_DB3_MARK, LCDOUT19_MARK, DU0_DB4_MARK, LCDOUT20_MARK,
498 DU0_DB5_MARK, LCDOUT21_MARK, DU0_DB6_MARK, LCDOUT22_MARK,
499 DU0_DB7_MARK, LCDOUT23_MARK, DU0_DOTCLKIN_MARK, QSTVA_QVS_MARK,
500 TX3_D_IRDA_TX_D_MARK, SCL3_B_MARK, DU0_DOTCLKOUT0_MARK, QCLK_MARK,
501 DU0_DOTCLKOUT1_MARK, QSTVB_QVE_MARK, RX3_D_IRDA_RX_D_MARK, SDA3_B_MARK,
502 SDA2_C_MARK, DACK0_B_MARK, DRACK0_B_MARK, DU0_EXHSYNC_DU0_HSYNC_MARK,
503 QSTH_QHS_MARK, DU0_EXVSYNC_DU0_VSYNC_MARK, QSTB_QHE_MARK,
504 DU0_EXODDF_DU0_ODDF_DISP_CDE_MARK, QCPV_QDE_MARK, CAN1_TX_MARK,
505 TX2_C_MARK, SCL2_C_MARK, REMOCON_MARK,
506
507 DU0_DISP_MARK, QPOLA_MARK, CAN_CLK_C_MARK, SCK2_C_MARK,
508 DU0_CDE_MARK, QPOLB_MARK, CAN1_RX_MARK, RX2_C_MARK,
509 DREQ0_B_MARK, SSI_SCK78_B_MARK, SCK0_B_MARK, DU1_DR0_MARK,
510 VI2_DATA0_VI2_B0_MARK, PWM6_MARK, SD3_CLK_MARK, TX3_E_IRDA_TX_E_MARK,
511 AUDCK_MARK, PWMFSW0_B_MARK, DU1_DR1_MARK, VI2_DATA1_VI2_B1_MARK,
512 PWM0_MARK, SD3_CMD_MARK, RX3_E_IRDA_RX_E_MARK, AUDSYNC_MARK,
513 CTS0_D_MARK, DU1_DR2_MARK, VI2_G0_MARK, DU1_DR3_MARK,
514 VI2_G1_MARK, DU1_DR4_MARK, VI2_G2_MARK, DU1_DR5_MARK,
515 VI2_G3_MARK, DU1_DR6_MARK, VI2_G4_MARK, DU1_DR7_MARK,
516 VI2_G5_MARK, DU1_DG0_MARK, VI2_DATA2_VI2_B2_MARK, SCL1_B_MARK,
517 SD3_DAT2_MARK, SCK3_E_MARK, AUDATA6_MARK, TX0_D_MARK,
518 DU1_DG1_MARK, VI2_DATA3_VI2_B3_MARK, SDA1_B_MARK, SD3_DAT3_MARK,
519 SCK5_MARK, AUDATA7_MARK, RX0_D_MARK, DU1_DG2_MARK,
520 VI2_G6_MARK, DU1_DG3_MARK, VI2_G7_MARK, DU1_DG4_MARK,
521 VI2_R0_MARK, DU1_DG5_MARK, VI2_R1_MARK, DU1_DG6_MARK,
522 VI2_R2_MARK, DU1_DG7_MARK, VI2_R3_MARK, DU1_DB0_MARK,
523 VI2_DATA4_VI2_B4_MARK, SCL2_B_MARK, SD3_DAT0_MARK, TX5_MARK,
524 SCK0_D_MARK,
525
526 DU1_DB1_MARK, VI2_DATA5_VI2_B5_MARK, SDA2_B_MARK, SD3_DAT1_MARK,
527 RX5_MARK, RTS0_D_TANS_D_MARK, DU1_DB2_MARK, VI2_R4_MARK,
528 DU1_DB3_MARK, VI2_R5_MARK, DU1_DB4_MARK, VI2_R6_MARK,
529 DU1_DB5_MARK, VI2_R7_MARK, DU1_DB6_MARK, SCL2_D_MARK,
530 DU1_DB7_MARK, SDA2_D_MARK, DU1_DOTCLKIN_MARK, VI2_CLKENB_MARK,
531 HSPI_CS1_MARK, SCL1_D_MARK, DU1_DOTCLKOUT_MARK, VI2_FIELD_MARK,
532 SDA1_D_MARK, DU1_EXHSYNC_DU1_HSYNC_MARK, VI2_HSYNC_MARK,
533 VI3_HSYNC_MARK, DU1_EXVSYNC_DU1_VSYNC_MARK, VI2_VSYNC_MARK,
534 VI3_VSYNC_MARK, DU1_EXODDF_DU1_ODDF_DISP_CDE_MARK, VI2_CLK_MARK,
535 TX3_B_IRDA_TX_B_MARK, SD3_CD_MARK, HSPI_TX1_MARK, VI1_CLKENB_MARK,
536 VI3_CLKENB_MARK, AUDIO_CLKC_MARK, TX2_D_MARK, SPEEDIN_MARK,
537 GPS_SIGN_D_MARK, DU1_DISP_MARK, VI2_DATA6_VI2_B6_MARK, TCLK0_MARK,
538 QSTVA_B_QVS_B_MARK, HSPI_CLK1_MARK, SCK2_D_MARK, AUDIO_CLKOUT_B_MARK,
539 GPS_MAG_D_MARK, DU1_CDE_MARK, VI2_DATA7_VI2_B7_MARK,
540 RX3_B_IRDA_RX_B_MARK, SD3_WP_MARK, HSPI_RX1_MARK, VI1_FIELD_MARK,
541 VI3_FIELD_MARK, AUDIO_CLKOUT_MARK, RX2_D_MARK, GPS_CLK_C_MARK,
542 GPS_CLK_D_MARK, AUDIO_CLKA_MARK, CAN_TXCLK_MARK, AUDIO_CLKB_MARK,
543 USB_OVC2_MARK, CAN_DEBUGOUT0_MARK, MOUT0_MARK,
544
545 SSI_SCK0129_MARK, CAN_DEBUGOUT1_MARK, MOUT1_MARK, SSI_WS0129_MARK,
546 CAN_DEBUGOUT2_MARK, MOUT2_MARK, SSI_SDATA0_MARK, CAN_DEBUGOUT3_MARK,
547 MOUT5_MARK, SSI_SDATA1_MARK, CAN_DEBUGOUT4_MARK, MOUT6_MARK,
548 SSI_SDATA2_MARK, CAN_DEBUGOUT5_MARK, SSI_SCK34_MARK,
549 CAN_DEBUGOUT6_MARK, CAN0_TX_B_MARK, IERX_MARK, SSI_SCK9_C_MARK,
550 SSI_WS34_MARK, CAN_DEBUGOUT7_MARK, CAN0_RX_B_MARK, IETX_MARK,
551 SSI_WS9_C_MARK, SSI_SDATA3_MARK, PWM0_C_MARK, CAN_DEBUGOUT8_MARK,
552 CAN_CLK_B_MARK, IECLK_MARK, SCIF_CLK_B_MARK, TCLK0_B_MARK,
553 SSI_SDATA4_MARK, CAN_DEBUGOUT9_MARK, SSI_SDATA9_C_MARK, SSI_SCK5_MARK,
554 ADICLK_MARK, CAN_DEBUGOUT10_MARK, SCK3_MARK, TCLK0_D_MARK,
555 SSI_WS5_MARK, ADICS_SAMP_MARK, CAN_DEBUGOUT11_MARK, TX3_IRDA_TX_MARK,
556 SSI_SDATA5_MARK, ADIDATA_MARK, CAN_DEBUGOUT12_MARK, RX3_IRDA_RX_MARK,
557 SSI_SCK6_MARK, ADICHS0_MARK, CAN0_TX_MARK, IERX_B_MARK,
558
559 SSI_WS6_MARK, ADICHS1_MARK, CAN0_RX_MARK, IETX_B_MARK,
560 SSI_SDATA6_MARK, ADICHS2_MARK, CAN_CLK_MARK, IECLK_B_MARK,
561 SSI_SCK78_MARK, CAN_DEBUGOUT13_MARK, IRQ0_B_MARK, SSI_SCK9_B_MARK,
562 HSPI_CLK1_C_MARK, SSI_WS78_MARK, CAN_DEBUGOUT14_MARK, IRQ1_B_MARK,
563 SSI_WS9_B_MARK, HSPI_CS1_C_MARK, SSI_SDATA7_MARK, CAN_DEBUGOUT15_MARK,
564 IRQ2_B_MARK, TCLK1_C_MARK, HSPI_TX1_C_MARK, SSI_SDATA8_MARK,
565 VSP_MARK, IRQ3_B_MARK, HSPI_RX1_C_MARK, SD0_CLK_MARK,
566 ATACS01_MARK, SCK1_B_MARK, SD0_CMD_MARK, ATACS11_MARK,
567 TX1_B_MARK, CC5_TDO_MARK, SD0_DAT0_MARK, ATADIR1_MARK,
568 RX1_B_MARK, CC5_TRST_MARK, SD0_DAT1_MARK, ATAG1_MARK,
569 SCK2_B_MARK, CC5_TMS_MARK, SD0_DAT2_MARK, ATARD1_MARK,
570 TX2_B_MARK, CC5_TCK_MARK, SD0_DAT3_MARK, ATAWR1_MARK,
571 RX2_B_MARK, CC5_TDI_MARK, SD0_CD_MARK, DREQ2_MARK,
572 RTS1_B_TANS_B_MARK, SD0_WP_MARK, DACK2_MARK, CTS1_B_MARK,
573
574 HSPI_CLK0_MARK, CTS0_MARK, USB_OVC0_MARK, AD_CLK_MARK,
575 CC5_STATE4_MARK, CC5_STATE12_MARK, CC5_STATE20_MARK, CC5_STATE28_MARK,
576 CC5_STATE36_MARK, HSPI_CS0_MARK, RTS0_TANS_MARK, USB_OVC1_MARK,
577 AD_DI_MARK, CC5_STATE5_MARK, CC5_STATE13_MARK, CC5_STATE21_MARK,
578 CC5_STATE29_MARK, CC5_STATE37_MARK, HSPI_TX0_MARK, TX0_MARK,
579 CAN_DEBUG_HW_TRIGGER_MARK, AD_DO_MARK, CC5_STATE6_MARK,
580 CC5_STATE14_MARK, CC5_STATE22_MARK, CC5_STATE30_MARK,
581 CC5_STATE38_MARK, HSPI_RX0_MARK, RX0_MARK, CAN_STEP0_MARK,
582 AD_NCS_MARK, CC5_STATE7_MARK, CC5_STATE15_MARK, CC5_STATE23_MARK,
583 CC5_STATE31_MARK, CC5_STATE39_MARK, FMCLK_MARK, RDS_CLK_MARK,
584 PCMOE_MARK, BPFCLK_MARK, PCMWE_MARK, FMIN_MARK, RDS_DATA_MARK,
585 VI0_CLK_MARK, MMC1_CLK_MARK, VI0_CLKENB_MARK, TX1_C_MARK, HTX1_B_MARK,
586 MT1_SYNC_MARK, VI0_FIELD_MARK, RX1_C_MARK, HRX1_B_MARK,
587 VI0_HSYNC_MARK, VI0_DATA0_B_VI0_B0_B_MARK, CTS1_C_MARK, TX4_D_MARK,
588 MMC1_CMD_MARK, HSCK1_B_MARK, VI0_VSYNC_MARK, VI0_DATA1_B_VI0_B1_B_MARK,
589 RTS1_C_TANS_C_MARK, RX4_D_MARK, PWMFSW0_C_MARK,
590
591 VI0_DATA0_VI0_B0_MARK, HRTS1_B_MARK, MT1_VCXO_MARK,
592 VI0_DATA1_VI0_B1_MARK, HCTS1_B_MARK, MT1_PWM_MARK,
593 VI0_DATA2_VI0_B2_MARK, MMC1_D0_MARK, VI0_DATA3_VI0_B3_MARK,
594 MMC1_D1_MARK, VI0_DATA4_VI0_B4_MARK, MMC1_D2_MARK,
595 VI0_DATA5_VI0_B5_MARK, MMC1_D3_MARK, VI0_DATA6_VI0_B6_MARK,
596 MMC1_D4_MARK, ARM_TRACEDATA_0_MARK, VI0_DATA7_VI0_B7_MARK,
597 MMC1_D5_MARK, ARM_TRACEDATA_1_MARK, VI0_G0_MARK, SSI_SCK78_C_MARK,
598 IRQ0_MARK, ARM_TRACEDATA_2_MARK, VI0_G1_MARK, SSI_WS78_C_MARK,
599 IRQ1_MARK, ARM_TRACEDATA_3_MARK, VI0_G2_MARK, ETH_TXD1_MARK,
600 MMC1_D6_MARK, ARM_TRACEDATA_4_MARK, TS_SPSYNC0_MARK, VI0_G3_MARK,
601 ETH_CRS_DV_MARK, MMC1_D7_MARK, ARM_TRACEDATA_5_MARK, TS_SDAT0_MARK,
602 VI0_G4_MARK, ETH_TX_EN_MARK, SD2_DAT0_B_MARK, ARM_TRACEDATA_6_MARK,
603 VI0_G5_MARK, ETH_RX_ER_MARK, SD2_DAT1_B_MARK, ARM_TRACEDATA_7_MARK,
604 VI0_G6_MARK, ETH_RXD0_MARK, SD2_DAT2_B_MARK, ARM_TRACEDATA_8_MARK,
605 VI0_G7_MARK, ETH_RXD1_MARK, SD2_DAT3_B_MARK, ARM_TRACEDATA_9_MARK,
606
607 VI0_R0_MARK, SSI_SDATA7_C_MARK, SCK1_C_MARK, DREQ1_B_MARK,
608 ARM_TRACEDATA_10_MARK, DREQ0_C_MARK, VI0_R1_MARK, SSI_SDATA8_C_MARK,
609 DACK1_B_MARK, ARM_TRACEDATA_11_MARK, DACK0_C_MARK, DRACK0_C_MARK,
610 VI0_R2_MARK, ETH_LINK_MARK, SD2_CLK_B_MARK, IRQ2_MARK,
611 ARM_TRACEDATA_12_MARK, VI0_R3_MARK, ETH_MAGIC_MARK, SD2_CMD_B_MARK,
612 IRQ3_MARK, ARM_TRACEDATA_13_MARK, VI0_R4_MARK, ETH_REFCLK_MARK,
613 SD2_CD_B_MARK, HSPI_CLK1_B_MARK, ARM_TRACEDATA_14_MARK, MT1_CLK_MARK,
614 TS_SCK0_MARK, VI0_R5_MARK, ETH_TXD0_MARK, SD2_WP_B_MARK,
615 HSPI_CS1_B_MARK, ARM_TRACEDATA_15_MARK, MT1_D_MARK, TS_SDEN0_MARK,
616 VI0_R6_MARK, ETH_MDC_MARK, DREQ2_C_MARK, HSPI_TX1_B_MARK,
617 TRACECLK_MARK, MT1_BEN_MARK, PWMFSW0_D_MARK, VI0_R7_MARK,
618 ETH_MDIO_MARK, DACK2_C_MARK, HSPI_RX1_B_MARK, SCIF_CLK_D_MARK,
619 TRACECTL_MARK, MT1_PEN_MARK, VI1_CLK_MARK, SIM_D_MARK, SDA3_MARK,
620 VI1_HSYNC_MARK, VI3_CLK_MARK, SSI_SCK4_MARK, GPS_SIGN_C_MARK,
621 PWMFSW0_E_MARK, VI1_VSYNC_MARK, AUDIO_CLKOUT_C_MARK, SSI_WS4_MARK,
622 SIM_CLK_MARK, GPS_MAG_C_MARK, SPV_TRST_MARK, SCL3_MARK,
623
624 VI1_DATA0_VI1_B0_MARK, SD2_DAT0_MARK, SIM_RST_MARK, SPV_TCK_MARK,
625 ADICLK_B_MARK, VI1_DATA1_VI1_B1_MARK, SD2_DAT1_MARK, MT0_CLK_MARK,
626 SPV_TMS_MARK, ADICS_B_SAMP_B_MARK, VI1_DATA2_VI1_B2_MARK,
627 SD2_DAT2_MARK, MT0_D_MARK, SPVTDI_MARK, ADIDATA_B_MARK,
628 VI1_DATA3_VI1_B3_MARK, SD2_DAT3_MARK, MT0_BEN_MARK, SPV_TDO_MARK,
629 ADICHS0_B_MARK, VI1_DATA4_VI1_B4_MARK, SD2_CLK_MARK, MT0_PEN_MARK,
630 SPA_TRST_MARK, HSPI_CLK1_D_MARK, ADICHS1_B_MARK,
631 VI1_DATA5_VI1_B5_MARK, SD2_CMD_MARK, MT0_SYNC_MARK, SPA_TCK_MARK,
632 HSPI_CS1_D_MARK, ADICHS2_B_MARK, VI1_DATA6_VI1_B6_MARK, SD2_CD_MARK,
633 MT0_VCXO_MARK, SPA_TMS_MARK, HSPI_TX1_D_MARK, VI1_DATA7_VI1_B7_MARK,
634 SD2_WP_MARK, MT0_PWM_MARK, SPA_TDI_MARK, HSPI_RX1_D_MARK,
635 VI1_G0_MARK, VI3_DATA0_MARK, DU1_DOTCLKOUT1_MARK, TS_SCK1_MARK,
636 DREQ2_B_MARK, TX2_MARK, SPA_TDO_MARK, HCTS0_B_MARK,
637 VI1_G1_MARK, VI3_DATA1_MARK, SSI_SCK1_MARK, TS_SDEN1_MARK,
638 DACK2_B_MARK, RX2_MARK, HRTS0_B_MARK,
639
640 VI1_G2_MARK, VI3_DATA2_MARK, SSI_WS1_MARK, TS_SPSYNC1_MARK,
641 SCK2_MARK, HSCK0_B_MARK, VI1_G3_MARK, VI3_DATA3_MARK,
642 SSI_SCK2_MARK, TS_SDAT1_MARK, SCL1_C_MARK, HTX0_B_MARK,
643 VI1_G4_MARK, VI3_DATA4_MARK, SSI_WS2_MARK, SDA1_C_MARK,
644 SIM_RST_B_MARK, HRX0_B_MARK, VI1_G5_MARK, VI3_DATA5_MARK,
645 GPS_CLK_MARK, FSE_MARK, TX4_B_MARK, SIM_D_B_MARK,
646 VI1_G6_MARK, VI3_DATA6_MARK, GPS_SIGN_MARK, FRB_MARK,
647 RX4_B_MARK, SIM_CLK_B_MARK, VI1_G7_MARK, VI3_DATA7_MARK,
648 GPS_MAG_MARK, FCE_MARK, SCK4_B_MARK,
649 PINMUX_MARK_END,
650};
651
652static pinmux_enum_t pinmux_data[] = {
653 PINMUX_DATA_GP_ALL(), /* PINMUX_DATA(GP_M_N_DATA, GP_M_N_FN...), */
654
655 PINMUX_DATA(AVS1_MARK, FN_AVS1),
656 PINMUX_DATA(AVS1_MARK, FN_AVS1),
657 PINMUX_DATA(A17_MARK, FN_A17),
658 PINMUX_DATA(A18_MARK, FN_A18),
659 PINMUX_DATA(A19_MARK, FN_A19),
660
661 PINMUX_IPSR_DATA(IP0_2_0, USB_PENC2),
662 PINMUX_IPSR_MODSEL_DATA(IP0_2_0, SCK0, SEL_SCIF0_0),
663 PINMUX_IPSR_DATA(IP0_2_0, PWM1),
664 PINMUX_IPSR_MODSEL_DATA(IP0_2_0, PWMFSW0, SEL_PWMFSW_0),
665 PINMUX_IPSR_MODSEL_DATA(IP0_2_0, SCIF_CLK, SEL_SCIF_0),
666 PINMUX_IPSR_MODSEL_DATA(IP0_2_0, TCLK0_C, SEL_TMU0_2),
667 PINMUX_IPSR_DATA(IP0_5_3, BS),
668 PINMUX_IPSR_DATA(IP0_5_3, SD1_DAT2),
669 PINMUX_IPSR_DATA(IP0_5_3, MMC0_D2),
670 PINMUX_IPSR_DATA(IP0_5_3, FD2),
671 PINMUX_IPSR_DATA(IP0_5_3, ATADIR0),
672 PINMUX_IPSR_DATA(IP0_5_3, SDSELF),
673 PINMUX_IPSR_MODSEL_DATA(IP0_5_3, HCTS1, SEL_HSCIF1_0),
674 PINMUX_IPSR_DATA(IP0_5_3, TX4_C),
675 PINMUX_IPSR_DATA(IP0_7_6, A0),
676 PINMUX_IPSR_DATA(IP0_7_6, SD1_DAT3),
677 PINMUX_IPSR_DATA(IP0_7_6, MMC0_D3),
678 PINMUX_IPSR_DATA(IP0_7_6, FD3),
679 PINMUX_IPSR_DATA(IP0_9_8, A20),
680 PINMUX_IPSR_DATA(IP0_9_8, TX5_D),
681 PINMUX_IPSR_DATA(IP0_9_8, HSPI_TX2_B),
682 PINMUX_IPSR_DATA(IP0_11_10, A21),
683 PINMUX_IPSR_MODSEL_DATA(IP0_11_10, SCK5_D, SEL_SCIF5_3),
684 PINMUX_IPSR_MODSEL_DATA(IP0_11_10, HSPI_CLK2_B, SEL_HSPI2_1),
685 PINMUX_IPSR_DATA(IP0_13_12, A22),
686 PINMUX_IPSR_MODSEL_DATA(IP0_13_12, RX5_D, SEL_SCIF5_3),
687 PINMUX_IPSR_MODSEL_DATA(IP0_13_12, HSPI_RX2_B, SEL_HSPI2_1),
688 PINMUX_IPSR_DATA(IP0_13_12, VI1_R0),
689 PINMUX_IPSR_DATA(IP0_15_14, A23),
690 PINMUX_IPSR_DATA(IP0_15_14, FCLE),
691 PINMUX_IPSR_MODSEL_DATA(IP0_15_14, HSPI_CLK2, SEL_HSPI2_0),
692 PINMUX_IPSR_DATA(IP0_15_14, VI1_R1),
693 PINMUX_IPSR_DATA(IP0_18_16, A24),
694 PINMUX_IPSR_DATA(IP0_18_16, SD1_CD),
695 PINMUX_IPSR_DATA(IP0_18_16, MMC0_D4),
696 PINMUX_IPSR_DATA(IP0_18_16, FD4),
697 PINMUX_IPSR_MODSEL_DATA(IP0_18_16, HSPI_CS2, SEL_HSPI2_0),
698 PINMUX_IPSR_DATA(IP0_18_16, VI1_R2),
699 PINMUX_IPSR_MODSEL_DATA(IP0_18_16, SSI_WS78_B, SEL_SSI7_1),
700 PINMUX_IPSR_DATA(IP0_22_19, A25),
701 PINMUX_IPSR_DATA(IP0_22_19, SD1_WP),
702 PINMUX_IPSR_DATA(IP0_22_19, MMC0_D5),
703 PINMUX_IPSR_DATA(IP0_22_19, FD5),
704 PINMUX_IPSR_MODSEL_DATA(IP0_22_19, HSPI_RX2, SEL_HSPI2_0),
705 PINMUX_IPSR_DATA(IP0_22_19, VI1_R3),
706 PINMUX_IPSR_DATA(IP0_22_19, TX5_B),
707 PINMUX_IPSR_MODSEL_DATA(IP0_22_19, SSI_SDATA7_B, SEL_SSI7_1),
708 PINMUX_IPSR_MODSEL_DATA(IP0_22_19, CTS0_B, SEL_SCIF0_1),
709 PINMUX_IPSR_DATA(IP0_24_23, CLKOUT),
710 PINMUX_IPSR_DATA(IP0_24_23, TX3C_IRDA_TX_C),
711 PINMUX_IPSR_DATA(IP0_24_23, PWM0_B),
712 PINMUX_IPSR_DATA(IP0_25, CS0),
713 PINMUX_IPSR_MODSEL_DATA(IP0_25, HSPI_CS2_B, SEL_HSPI2_1),
714 PINMUX_IPSR_DATA(IP0_27_26, CS1_A26),
715 PINMUX_IPSR_DATA(IP0_27_26, HSPI_TX2),
716 PINMUX_IPSR_DATA(IP0_27_26, SDSELF_B),
717 PINMUX_IPSR_DATA(IP0_30_28, RD_WR),
718 PINMUX_IPSR_DATA(IP0_30_28, FWE),
719 PINMUX_IPSR_DATA(IP0_30_28, ATAG0),
720 PINMUX_IPSR_DATA(IP0_30_28, VI1_R7),
721 PINMUX_IPSR_MODSEL_DATA(IP0_30_28, HRTS1, SEL_HSCIF1_0),
722 PINMUX_IPSR_MODSEL_DATA(IP0_30_28, RX4_C, SEL_SCIF4_2),
723
724 PINMUX_IPSR_DATA(IP1_1_0, EX_CS0),
725 PINMUX_IPSR_MODSEL_DATA(IP1_1_0, RX3_C_IRDA_RX_C, SEL_SCIF3_2),
726 PINMUX_IPSR_DATA(IP1_1_0, MMC0_D6),
727 PINMUX_IPSR_DATA(IP1_1_0, FD6),
728 PINMUX_IPSR_DATA(IP1_3_2, EX_CS1),
729 PINMUX_IPSR_DATA(IP1_3_2, MMC0_D7),
730 PINMUX_IPSR_DATA(IP1_3_2, FD7),
731 PINMUX_IPSR_DATA(IP1_6_4, EX_CS2),
732 PINMUX_IPSR_DATA(IP1_6_4, SD1_CLK),
733 PINMUX_IPSR_DATA(IP1_6_4, MMC0_CLK),
734 PINMUX_IPSR_DATA(IP1_6_4, FALE),
735 PINMUX_IPSR_DATA(IP1_6_4, ATACS00),
736 PINMUX_IPSR_DATA(IP1_10_7, EX_CS3),
737 PINMUX_IPSR_DATA(IP1_10_7, SD1_CMD),
738 PINMUX_IPSR_DATA(IP1_10_7, MMC0_CMD),
739 PINMUX_IPSR_DATA(IP1_10_7, FRE),
740 PINMUX_IPSR_DATA(IP1_10_7, ATACS10),
741 PINMUX_IPSR_DATA(IP1_10_7, VI1_R4),
742 PINMUX_IPSR_MODSEL_DATA(IP1_10_7, RX5_B, SEL_SCIF5_1),
743 PINMUX_IPSR_MODSEL_DATA(IP1_10_7, HSCK1, SEL_HSCIF1_0),
744 PINMUX_IPSR_MODSEL_DATA(IP1_10_7, SSI_SDATA8_B, SEL_SSI8_1),
745 PINMUX_IPSR_MODSEL_DATA(IP1_10_7, RTS0_B_TANS_B, SEL_SCIF0_1),
746 PINMUX_IPSR_MODSEL_DATA(IP1_10_7, SSI_SDATA9, SEL_SSI9_0),
747 PINMUX_IPSR_DATA(IP1_14_11, EX_CS4),
748 PINMUX_IPSR_DATA(IP1_14_11, SD1_DAT0),
749 PINMUX_IPSR_DATA(IP1_14_11, MMC0_D0),
750 PINMUX_IPSR_DATA(IP1_14_11, FD0),
751 PINMUX_IPSR_DATA(IP1_14_11, ATARD0),
752 PINMUX_IPSR_DATA(IP1_14_11, VI1_R5),
753 PINMUX_IPSR_MODSEL_DATA(IP1_14_11, SCK5_B, SEL_SCIF5_1),
754 PINMUX_IPSR_DATA(IP1_14_11, HTX1),
755 PINMUX_IPSR_DATA(IP1_14_11, TX2_E),
756 PINMUX_IPSR_DATA(IP1_14_11, TX0_B),
757 PINMUX_IPSR_MODSEL_DATA(IP1_14_11, SSI_SCK9, SEL_SSI9_0),
758 PINMUX_IPSR_DATA(IP1_18_15, EX_CS5),
759 PINMUX_IPSR_DATA(IP1_18_15, SD1_DAT1),
760 PINMUX_IPSR_DATA(IP1_18_15, MMC0_D1),
761 PINMUX_IPSR_DATA(IP1_18_15, FD1),
762 PINMUX_IPSR_DATA(IP1_18_15, ATAWR0),
763 PINMUX_IPSR_DATA(IP1_18_15, VI1_R6),
764 PINMUX_IPSR_MODSEL_DATA(IP1_18_15, HRX1, SEL_HSCIF1_0),
765 PINMUX_IPSR_MODSEL_DATA(IP1_18_15, RX2_E, SEL_SCIF2_4),
766 PINMUX_IPSR_MODSEL_DATA(IP1_18_15, RX0_B, SEL_SCIF0_1),
767 PINMUX_IPSR_MODSEL_DATA(IP1_18_15, SSI_WS9, SEL_SSI9_0),
768 PINMUX_IPSR_DATA(IP1_20_19, MLB_CLK),
769 PINMUX_IPSR_DATA(IP1_20_19, PWM2),
770 PINMUX_IPSR_MODSEL_DATA(IP1_20_19, SCK4, SEL_SCIF4_0),
771 PINMUX_IPSR_DATA(IP1_22_21, MLB_SIG),
772 PINMUX_IPSR_DATA(IP1_22_21, PWM3),
773 PINMUX_IPSR_DATA(IP1_22_21, TX4),
774 PINMUX_IPSR_DATA(IP1_24_23, MLB_DAT),
775 PINMUX_IPSR_DATA(IP1_24_23, PWM4),
776 PINMUX_IPSR_MODSEL_DATA(IP1_24_23, RX4, SEL_SCIF4_0),
777 PINMUX_IPSR_DATA(IP1_28_25, HTX0),
778 PINMUX_IPSR_DATA(IP1_28_25, TX1),
779 PINMUX_IPSR_DATA(IP1_28_25, SDATA),
780 PINMUX_IPSR_MODSEL_DATA(IP1_28_25, CTS0_C, SEL_SCIF0_2),
781 PINMUX_IPSR_DATA(IP1_28_25, SUB_TCK),
782 PINMUX_IPSR_DATA(IP1_28_25, CC5_STATE2),
783 PINMUX_IPSR_DATA(IP1_28_25, CC5_STATE10),
784 PINMUX_IPSR_DATA(IP1_28_25, CC5_STATE18),
785 PINMUX_IPSR_DATA(IP1_28_25, CC5_STATE26),
786 PINMUX_IPSR_DATA(IP1_28_25, CC5_STATE34),
787
788 PINMUX_IPSR_MODSEL_DATA(IP2_3_0, HRX0, SEL_HSCIF0_0),
789 PINMUX_IPSR_MODSEL_DATA(IP2_3_0, RX1, SEL_SCIF1_0),
790 PINMUX_IPSR_DATA(IP2_3_0, SCKZ),
791 PINMUX_IPSR_MODSEL_DATA(IP2_3_0, RTS0_C_TANS_C, SEL_SCIF0_2),
792 PINMUX_IPSR_DATA(IP2_3_0, SUB_TDI),
793 PINMUX_IPSR_DATA(IP2_3_0, CC5_STATE3),
794 PINMUX_IPSR_DATA(IP2_3_0, CC5_STATE11),
795 PINMUX_IPSR_DATA(IP2_3_0, CC5_STATE19),
796 PINMUX_IPSR_DATA(IP2_3_0, CC5_STATE27),
797 PINMUX_IPSR_DATA(IP2_3_0, CC5_STATE35),
798 PINMUX_IPSR_MODSEL_DATA(IP2_7_4, HSCK0, SEL_HSCIF0_0),
799 PINMUX_IPSR_MODSEL_DATA(IP2_7_4, SCK1, SEL_SCIF1_0),
800 PINMUX_IPSR_DATA(IP2_7_4, MTS),
801 PINMUX_IPSR_DATA(IP2_7_4, PWM5),
802 PINMUX_IPSR_MODSEL_DATA(IP2_7_4, SCK0_C, SEL_SCIF0_2),
803 PINMUX_IPSR_MODSEL_DATA(IP2_7_4, SSI_SDATA9_B, SEL_SSI9_1),
804 PINMUX_IPSR_DATA(IP2_7_4, SUB_TDO),
805 PINMUX_IPSR_DATA(IP2_7_4, CC5_STATE0),
806 PINMUX_IPSR_DATA(IP2_7_4, CC5_STATE8),
807 PINMUX_IPSR_DATA(IP2_7_4, CC5_STATE16),
808 PINMUX_IPSR_DATA(IP2_7_4, CC5_STATE24),
809 PINMUX_IPSR_DATA(IP2_7_4, CC5_STATE32),
810 PINMUX_IPSR_MODSEL_DATA(IP2_11_8, HCTS0, SEL_HSCIF0_0),
811 PINMUX_IPSR_MODSEL_DATA(IP2_11_8, CTS1, SEL_SCIF1_0),
812 PINMUX_IPSR_DATA(IP2_11_8, STM),
813 PINMUX_IPSR_DATA(IP2_11_8, PWM0_D),
814 PINMUX_IPSR_MODSEL_DATA(IP2_11_8, RX0_C, SEL_SCIF0_2),
815 PINMUX_IPSR_MODSEL_DATA(IP2_11_8, SCIF_CLK_C, SEL_SCIF_2),
816 PINMUX_IPSR_DATA(IP2_11_8, SUB_TRST),
817 PINMUX_IPSR_MODSEL_DATA(IP2_11_8, TCLK1_B, SEL_TMU1_1),
818 PINMUX_IPSR_DATA(IP2_11_8, CC5_OSCOUT),
819 PINMUX_IPSR_MODSEL_DATA(IP2_15_12, HRTS0, SEL_HSCIF0_0),
820 PINMUX_IPSR_MODSEL_DATA(IP2_15_12, RTS1_TANS, SEL_SCIF1_0),
821 PINMUX_IPSR_DATA(IP2_15_12, MDATA),
822 PINMUX_IPSR_DATA(IP2_15_12, TX0_C),
823 PINMUX_IPSR_DATA(IP2_15_12, SUB_TMS),
824 PINMUX_IPSR_DATA(IP2_15_12, CC5_STATE1),
825 PINMUX_IPSR_DATA(IP2_15_12, CC5_STATE9),
826 PINMUX_IPSR_DATA(IP2_15_12, CC5_STATE17),
827 PINMUX_IPSR_DATA(IP2_15_12, CC5_STATE25),
828 PINMUX_IPSR_DATA(IP2_15_12, CC5_STATE33),
829 PINMUX_IPSR_DATA(IP2_18_16, DU0_DR0),
830 PINMUX_IPSR_DATA(IP2_18_16, LCDOUT0),
831 PINMUX_IPSR_MODSEL_DATA(IP2_18_16, DREQ0, SEL_EXBUS0_0),
832 PINMUX_IPSR_MODSEL_DATA(IP2_18_16, GPS_CLK_B, SEL_GPS_1),
833 PINMUX_IPSR_DATA(IP2_18_16, AUDATA0),
834 PINMUX_IPSR_DATA(IP2_18_16, TX5_C),
835 PINMUX_IPSR_DATA(IP2_21_19, DU0_DR1),
836 PINMUX_IPSR_DATA(IP2_21_19, LCDOUT1),
837 PINMUX_IPSR_DATA(IP2_21_19, DACK0),
838 PINMUX_IPSR_DATA(IP2_21_19, DRACK0),
839 PINMUX_IPSR_MODSEL_DATA(IP2_21_19, GPS_SIGN_B, SEL_GPS_1),
840 PINMUX_IPSR_DATA(IP2_21_19, AUDATA1),
841 PINMUX_IPSR_MODSEL_DATA(IP2_21_19, RX5_C, SEL_SCIF5_2),
842 PINMUX_IPSR_DATA(IP2_22, DU0_DR2),
843 PINMUX_IPSR_DATA(IP2_22, LCDOUT2),
844 PINMUX_IPSR_DATA(IP2_23, DU0_DR3),
845 PINMUX_IPSR_DATA(IP2_23, LCDOUT3),
846 PINMUX_IPSR_DATA(IP2_24, DU0_DR4),
847 PINMUX_IPSR_DATA(IP2_24, LCDOUT4),
848 PINMUX_IPSR_DATA(IP2_25, DU0_DR5),
849 PINMUX_IPSR_DATA(IP2_25, LCDOUT5),
850 PINMUX_IPSR_DATA(IP2_26, DU0_DR6),
851 PINMUX_IPSR_DATA(IP2_26, LCDOUT6),
852 PINMUX_IPSR_DATA(IP2_27, DU0_DR7),
853 PINMUX_IPSR_DATA(IP2_27, LCDOUT7),
854 PINMUX_IPSR_DATA(IP2_30_28, DU0_DG0),
855 PINMUX_IPSR_DATA(IP2_30_28, LCDOUT8),
856 PINMUX_IPSR_MODSEL_DATA(IP2_30_28, DREQ1, SEL_EXBUS1_0),
857 PINMUX_IPSR_MODSEL_DATA(IP2_30_28, SCL2, SEL_I2C2_0),
858 PINMUX_IPSR_DATA(IP2_30_28, AUDATA2),
859
860 PINMUX_IPSR_DATA(IP3_2_0, DU0_DG1),
861 PINMUX_IPSR_DATA(IP3_2_0, LCDOUT9),
862 PINMUX_IPSR_DATA(IP3_2_0, DACK1),
863 PINMUX_IPSR_MODSEL_DATA(IP3_2_0, SDA2, SEL_I2C2_0),
864 PINMUX_IPSR_DATA(IP3_2_0, AUDATA3),
865 PINMUX_IPSR_DATA(IP3_3, DU0_DG2),
866 PINMUX_IPSR_DATA(IP3_3, LCDOUT10),
867 PINMUX_IPSR_DATA(IP3_4, DU0_DG3),
868 PINMUX_IPSR_DATA(IP3_4, LCDOUT11),
869 PINMUX_IPSR_DATA(IP3_5, DU0_DG4),
870 PINMUX_IPSR_DATA(IP3_5, LCDOUT12),
871 PINMUX_IPSR_DATA(IP3_6, DU0_DG5),
872 PINMUX_IPSR_DATA(IP3_6, LCDOUT13),
873 PINMUX_IPSR_DATA(IP3_7, DU0_DG6),
874 PINMUX_IPSR_DATA(IP3_7, LCDOUT14),
875 PINMUX_IPSR_DATA(IP3_8, DU0_DG7),
876 PINMUX_IPSR_DATA(IP3_8, LCDOUT15),
877 PINMUX_IPSR_DATA(IP3_11_9, DU0_DB0),
878 PINMUX_IPSR_DATA(IP3_11_9, LCDOUT16),
879 PINMUX_IPSR_DATA(IP3_11_9, EX_WAIT1),
880 PINMUX_IPSR_MODSEL_DATA(IP3_11_9, SCL1, SEL_I2C1_0),
881 PINMUX_IPSR_MODSEL_DATA(IP3_11_9, TCLK1, SEL_TMU1_0),
882 PINMUX_IPSR_DATA(IP3_11_9, AUDATA4),
883 PINMUX_IPSR_DATA(IP3_14_12, DU0_DB1),
884 PINMUX_IPSR_DATA(IP3_14_12, LCDOUT17),
885 PINMUX_IPSR_DATA(IP3_14_12, EX_WAIT2),
886 PINMUX_IPSR_MODSEL_DATA(IP3_14_12, SDA1, SEL_I2C1_0),
887 PINMUX_IPSR_MODSEL_DATA(IP3_14_12, GPS_MAG_B, SEL_GPS_1),
888 PINMUX_IPSR_DATA(IP3_14_12, AUDATA5),
889 PINMUX_IPSR_MODSEL_DATA(IP3_14_12, SCK5_C, SEL_SCIF5_2),
890 PINMUX_IPSR_DATA(IP3_15, DU0_DB2),
891 PINMUX_IPSR_DATA(IP3_15, LCDOUT18),
892 PINMUX_IPSR_DATA(IP3_16, DU0_DB3),
893 PINMUX_IPSR_DATA(IP3_16, LCDOUT19),
894 PINMUX_IPSR_DATA(IP3_17, DU0_DB4),
895 PINMUX_IPSR_DATA(IP3_17, LCDOUT20),
896 PINMUX_IPSR_DATA(IP3_18, DU0_DB5),
897 PINMUX_IPSR_DATA(IP3_18, LCDOUT21),
898 PINMUX_IPSR_DATA(IP3_19, DU0_DB6),
899 PINMUX_IPSR_DATA(IP3_19, LCDOUT22),
900 PINMUX_IPSR_DATA(IP3_20, DU0_DB7),
901 PINMUX_IPSR_DATA(IP3_20, LCDOUT23),
902 PINMUX_IPSR_DATA(IP3_22_21, DU0_DOTCLKIN),
903 PINMUX_IPSR_DATA(IP3_22_21, QSTVA_QVS),
904 PINMUX_IPSR_DATA(IP3_22_21, TX3_D_IRDA_TX_D),
905 PINMUX_IPSR_MODSEL_DATA(IP3_22_21, SCL3_B, SEL_I2C3_1),
906 PINMUX_IPSR_DATA(IP3_23, DU0_DOTCLKOUT0),
907 PINMUX_IPSR_DATA(IP3_23, QCLK),
908 PINMUX_IPSR_DATA(IP3_26_24, DU0_DOTCLKOUT1),
909 PINMUX_IPSR_DATA(IP3_26_24, QSTVB_QVE),
910 PINMUX_IPSR_MODSEL_DATA(IP3_26_24, RX3_D_IRDA_RX_D, SEL_SCIF3_3),
911 PINMUX_IPSR_MODSEL_DATA(IP3_26_24, SDA3_B, SEL_I2C3_1),
912 PINMUX_IPSR_MODSEL_DATA(IP3_26_24, SDA2_C, SEL_I2C2_2),
913 PINMUX_IPSR_DATA(IP3_26_24, DACK0_B),
914 PINMUX_IPSR_DATA(IP3_26_24, DRACK0_B),
915 PINMUX_IPSR_DATA(IP3_27, DU0_EXHSYNC_DU0_HSYNC),
916 PINMUX_IPSR_DATA(IP3_27, QSTH_QHS),
917 PINMUX_IPSR_DATA(IP3_28, DU0_EXVSYNC_DU0_VSYNC),
918 PINMUX_IPSR_DATA(IP3_28, QSTB_QHE),
919 PINMUX_IPSR_DATA(IP3_31_29, DU0_EXODDF_DU0_ODDF_DISP_CDE),
920 PINMUX_IPSR_DATA(IP3_31_29, QCPV_QDE),
921 PINMUX_IPSR_DATA(IP3_31_29, CAN1_TX),
922 PINMUX_IPSR_DATA(IP3_31_29, TX2_C),
923 PINMUX_IPSR_MODSEL_DATA(IP3_31_29, SCL2_C, SEL_I2C2_2),
924 PINMUX_IPSR_DATA(IP3_31_29, REMOCON),
925
926 PINMUX_IPSR_DATA(IP4_1_0, DU0_DISP),
927 PINMUX_IPSR_DATA(IP4_1_0, QPOLA),
928 PINMUX_IPSR_MODSEL_DATA(IP4_1_0, CAN_CLK_C, SEL_CANCLK_2),
929 PINMUX_IPSR_MODSEL_DATA(IP4_1_0, SCK2_C, SEL_SCIF2_2),
930 PINMUX_IPSR_DATA(IP4_4_2, DU0_CDE),
931 PINMUX_IPSR_DATA(IP4_4_2, QPOLB),
932 PINMUX_IPSR_DATA(IP4_4_2, CAN1_RX),
933 PINMUX_IPSR_MODSEL_DATA(IP4_4_2, RX2_C, SEL_SCIF2_2),
934 PINMUX_IPSR_MODSEL_DATA(IP4_4_2, DREQ0_B, SEL_EXBUS0_1),
935 PINMUX_IPSR_MODSEL_DATA(IP4_4_2, SSI_SCK78_B, SEL_SSI7_1),
936 PINMUX_IPSR_MODSEL_DATA(IP4_4_2, SCK0_B, SEL_SCIF0_1),
937 PINMUX_IPSR_DATA(IP4_7_5, DU1_DR0),
938 PINMUX_IPSR_DATA(IP4_7_5, VI2_DATA0_VI2_B0),
939 PINMUX_IPSR_DATA(IP4_7_5, PWM6),
940 PINMUX_IPSR_DATA(IP4_7_5, SD3_CLK),
941 PINMUX_IPSR_DATA(IP4_7_5, TX3_E_IRDA_TX_E),
942 PINMUX_IPSR_DATA(IP4_7_5, AUDCK),
943 PINMUX_IPSR_MODSEL_DATA(IP4_7_5, PWMFSW0_B, SEL_PWMFSW_1),
944 PINMUX_IPSR_DATA(IP4_10_8, DU1_DR1),
945 PINMUX_IPSR_DATA(IP4_10_8, VI2_DATA1_VI2_B1),
946 PINMUX_IPSR_DATA(IP4_10_8, PWM0),
947 PINMUX_IPSR_DATA(IP4_10_8, SD3_CMD),
948 PINMUX_IPSR_MODSEL_DATA(IP4_10_8, RX3_E_IRDA_RX_E, SEL_SCIF3_4),
949 PINMUX_IPSR_DATA(IP4_10_8, AUDSYNC),
950 PINMUX_IPSR_MODSEL_DATA(IP4_10_8, CTS0_D, SEL_SCIF0_3),
951 PINMUX_IPSR_DATA(IP4_11, DU1_DR2),
952 PINMUX_IPSR_DATA(IP4_11, VI2_G0),
953 PINMUX_IPSR_DATA(IP4_12, DU1_DR3),
954 PINMUX_IPSR_DATA(IP4_12, VI2_G1),
955 PINMUX_IPSR_DATA(IP4_13, DU1_DR4),
956 PINMUX_IPSR_DATA(IP4_13, VI2_G2),
957 PINMUX_IPSR_DATA(IP4_14, DU1_DR5),
958 PINMUX_IPSR_DATA(IP4_14, VI2_G3),
959 PINMUX_IPSR_DATA(IP4_15, DU1_DR6),
960 PINMUX_IPSR_DATA(IP4_15, VI2_G4),
961 PINMUX_IPSR_DATA(IP4_16, DU1_DR7),
962 PINMUX_IPSR_DATA(IP4_16, VI2_G5),
963 PINMUX_IPSR_DATA(IP4_19_17, DU1_DG0),
964 PINMUX_IPSR_DATA(IP4_19_17, VI2_DATA2_VI2_B2),
965 PINMUX_IPSR_MODSEL_DATA(IP4_19_17, SCL1_B, SEL_I2C1_1),
966 PINMUX_IPSR_DATA(IP4_19_17, SD3_DAT2),
967 PINMUX_IPSR_MODSEL_DATA(IP4_19_17, SCK3_E, SEL_SCIF3_4),
968 PINMUX_IPSR_DATA(IP4_19_17, AUDATA6),
969 PINMUX_IPSR_DATA(IP4_19_17, TX0_D),
970 PINMUX_IPSR_DATA(IP4_22_20, DU1_DG1),
971 PINMUX_IPSR_DATA(IP4_22_20, VI2_DATA3_VI2_B3),
972 PINMUX_IPSR_MODSEL_DATA(IP4_22_20, SDA1_B, SEL_I2C1_1),
973 PINMUX_IPSR_DATA(IP4_22_20, SD3_DAT3),
974 PINMUX_IPSR_MODSEL_DATA(IP4_22_20, SCK5, SEL_SCIF5_0),
975 PINMUX_IPSR_DATA(IP4_22_20, AUDATA7),
976 PINMUX_IPSR_MODSEL_DATA(IP4_22_20, RX0_D, SEL_SCIF0_3),
977 PINMUX_IPSR_DATA(IP4_23, DU1_DG2),
978 PINMUX_IPSR_DATA(IP4_23, VI2_G6),
979 PINMUX_IPSR_DATA(IP4_24, DU1_DG3),
980 PINMUX_IPSR_DATA(IP4_24, VI2_G7),
981 PINMUX_IPSR_DATA(IP4_25, DU1_DG4),
982 PINMUX_IPSR_DATA(IP4_25, VI2_R0),
983 PINMUX_IPSR_DATA(IP4_26, DU1_DG5),
984 PINMUX_IPSR_DATA(IP4_26, VI2_R1),
985 PINMUX_IPSR_DATA(IP4_27, DU1_DG6),
986 PINMUX_IPSR_DATA(IP4_27, VI2_R2),
987 PINMUX_IPSR_DATA(IP4_28, DU1_DG7),
988 PINMUX_IPSR_DATA(IP4_28, VI2_R3),
989 PINMUX_IPSR_DATA(IP4_31_29, DU1_DB0),
990 PINMUX_IPSR_DATA(IP4_31_29, VI2_DATA4_VI2_B4),
991 PINMUX_IPSR_MODSEL_DATA(IP4_31_29, SCL2_B, SEL_I2C2_1),
992 PINMUX_IPSR_DATA(IP4_31_29, SD3_DAT0),
993 PINMUX_IPSR_DATA(IP4_31_29, TX5),
994 PINMUX_IPSR_MODSEL_DATA(IP4_31_29, SCK0_D, SEL_SCIF0_3),
995
996 PINMUX_IPSR_DATA(IP5_2_0, DU1_DB1),
997 PINMUX_IPSR_DATA(IP5_2_0, VI2_DATA5_VI2_B5),
998 PINMUX_IPSR_MODSEL_DATA(IP5_2_0, SDA2_B, SEL_I2C2_1),
999 PINMUX_IPSR_DATA(IP5_2_0, SD3_DAT1),
1000 PINMUX_IPSR_MODSEL_DATA(IP5_2_0, RX5, SEL_SCIF5_0),
1001 PINMUX_IPSR_MODSEL_DATA(IP5_2_0, RTS0_D_TANS_D, SEL_SCIF0_3),
1002 PINMUX_IPSR_DATA(IP5_3, DU1_DB2),
1003 PINMUX_IPSR_DATA(IP5_3, VI2_R4),
1004 PINMUX_IPSR_DATA(IP5_4, DU1_DB3),
1005 PINMUX_IPSR_DATA(IP5_4, VI2_R5),
1006 PINMUX_IPSR_DATA(IP5_5, DU1_DB4),
1007 PINMUX_IPSR_DATA(IP5_5, VI2_R6),
1008 PINMUX_IPSR_DATA(IP5_6, DU1_DB5),
1009 PINMUX_IPSR_DATA(IP5_6, VI2_R7),
1010 PINMUX_IPSR_DATA(IP5_7, DU1_DB6),
1011 PINMUX_IPSR_MODSEL_DATA(IP5_7, SCL2_D, SEL_I2C2_3),
1012 PINMUX_IPSR_DATA(IP5_8, DU1_DB7),
1013 PINMUX_IPSR_MODSEL_DATA(IP5_8, SDA2_D, SEL_I2C2_3),
1014 PINMUX_IPSR_DATA(IP5_10_9, DU1_DOTCLKIN),
1015 PINMUX_IPSR_DATA(IP5_10_9, VI2_CLKENB),
1016 PINMUX_IPSR_MODSEL_DATA(IP5_10_9, HSPI_CS1, SEL_HSPI1_0),
1017 PINMUX_IPSR_MODSEL_DATA(IP5_10_9, SCL1_D, SEL_I2C1_3),
1018 PINMUX_IPSR_DATA(IP5_12_11, DU1_DOTCLKOUT),
1019 PINMUX_IPSR_DATA(IP5_12_11, VI2_FIELD),
1020 PINMUX_IPSR_MODSEL_DATA(IP5_12_11, SDA1_D, SEL_I2C1_3),
1021 PINMUX_IPSR_DATA(IP5_14_13, DU1_EXHSYNC_DU1_HSYNC),
1022 PINMUX_IPSR_DATA(IP5_14_13, VI2_HSYNC),
1023 PINMUX_IPSR_DATA(IP5_14_13, VI3_HSYNC),
1024 PINMUX_IPSR_DATA(IP5_16_15, DU1_EXVSYNC_DU1_VSYNC),
1025 PINMUX_IPSR_DATA(IP5_16_15, VI2_VSYNC),
1026 PINMUX_IPSR_DATA(IP5_16_15, VI3_VSYNC),
1027 PINMUX_IPSR_DATA(IP5_20_17, DU1_EXODDF_DU1_ODDF_DISP_CDE),
1028 PINMUX_IPSR_DATA(IP5_20_17, VI2_CLK),
1029 PINMUX_IPSR_DATA(IP5_20_17, TX3_B_IRDA_TX_B),
1030 PINMUX_IPSR_DATA(IP5_20_17, SD3_CD),
1031 PINMUX_IPSR_DATA(IP5_20_17, HSPI_TX1),
1032 PINMUX_IPSR_DATA(IP5_20_17, VI1_CLKENB),
1033 PINMUX_IPSR_DATA(IP5_20_17, VI3_CLKENB),
1034 PINMUX_IPSR_DATA(IP5_20_17, AUDIO_CLKC),
1035 PINMUX_IPSR_DATA(IP5_20_17, TX2_D),
1036 PINMUX_IPSR_DATA(IP5_20_17, SPEEDIN),
1037 PINMUX_IPSR_MODSEL_DATA(IP5_20_17, GPS_SIGN_D, SEL_GPS_3),
1038 PINMUX_IPSR_DATA(IP5_23_21, DU1_DISP),
1039 PINMUX_IPSR_DATA(IP5_23_21, VI2_DATA6_VI2_B6),
1040 PINMUX_IPSR_MODSEL_DATA(IP5_23_21, TCLK0, SEL_TMU0_0),
1041 PINMUX_IPSR_DATA(IP5_23_21, QSTVA_B_QVS_B),
1042 PINMUX_IPSR_MODSEL_DATA(IP5_23_21, HSPI_CLK1, SEL_HSPI1_0),
1043 PINMUX_IPSR_MODSEL_DATA(IP5_23_21, SCK2_D, SEL_SCIF2_3),
1044 PINMUX_IPSR_DATA(IP5_23_21, AUDIO_CLKOUT_B),
1045 PINMUX_IPSR_MODSEL_DATA(IP5_23_21, GPS_MAG_D, SEL_GPS_3),
1046 PINMUX_IPSR_DATA(IP5_27_24, DU1_CDE),
1047 PINMUX_IPSR_DATA(IP5_27_24, VI2_DATA7_VI2_B7),
1048 PINMUX_IPSR_MODSEL_DATA(IP5_27_24, RX3_B_IRDA_RX_B, SEL_SCIF3_1),
1049 PINMUX_IPSR_DATA(IP5_27_24, SD3_WP),
1050 PINMUX_IPSR_MODSEL_DATA(IP5_27_24, HSPI_RX1, SEL_HSPI1_0),
1051 PINMUX_IPSR_DATA(IP5_27_24, VI1_FIELD),
1052 PINMUX_IPSR_DATA(IP5_27_24, VI3_FIELD),
1053 PINMUX_IPSR_DATA(IP5_27_24, AUDIO_CLKOUT),
1054 PINMUX_IPSR_MODSEL_DATA(IP5_27_24, RX2_D, SEL_SCIF2_3),
1055 PINMUX_IPSR_MODSEL_DATA(IP5_27_24, GPS_CLK_C, SEL_GPS_2),
1056 PINMUX_IPSR_MODSEL_DATA(IP5_27_24, GPS_CLK_D, SEL_GPS_3),
1057 PINMUX_IPSR_DATA(IP5_28, AUDIO_CLKA),
1058 PINMUX_IPSR_DATA(IP5_28, CAN_TXCLK),
1059 PINMUX_IPSR_DATA(IP5_30_29, AUDIO_CLKB),
1060 PINMUX_IPSR_DATA(IP5_30_29, USB_OVC2),
1061 PINMUX_IPSR_DATA(IP5_30_29, CAN_DEBUGOUT0),
1062 PINMUX_IPSR_DATA(IP5_30_29, MOUT0),
1063
1064 PINMUX_IPSR_DATA(IP6_1_0, SSI_SCK0129),
1065 PINMUX_IPSR_DATA(IP6_1_0, CAN_DEBUGOUT1),
1066 PINMUX_IPSR_DATA(IP6_1_0, MOUT1),
1067 PINMUX_IPSR_DATA(IP6_3_2, SSI_WS0129),
1068 PINMUX_IPSR_DATA(IP6_3_2, CAN_DEBUGOUT2),
1069 PINMUX_IPSR_DATA(IP6_3_2, MOUT2),
1070 PINMUX_IPSR_DATA(IP6_5_4, SSI_SDATA0),
1071 PINMUX_IPSR_DATA(IP6_5_4, CAN_DEBUGOUT3),
1072 PINMUX_IPSR_DATA(IP6_5_4, MOUT5),
1073 PINMUX_IPSR_DATA(IP6_7_6, SSI_SDATA1),
1074 PINMUX_IPSR_DATA(IP6_7_6, CAN_DEBUGOUT4),
1075 PINMUX_IPSR_DATA(IP6_7_6, MOUT6),
1076 PINMUX_IPSR_DATA(IP6_8, SSI_SDATA2),
1077 PINMUX_IPSR_DATA(IP6_8, CAN_DEBUGOUT5),
1078 PINMUX_IPSR_DATA(IP6_11_9, SSI_SCK34),
1079 PINMUX_IPSR_DATA(IP6_11_9, CAN_DEBUGOUT6),
1080 PINMUX_IPSR_DATA(IP6_11_9, CAN0_TX_B),
1081 PINMUX_IPSR_MODSEL_DATA(IP6_11_9, IERX, SEL_IE_0),
1082 PINMUX_IPSR_MODSEL_DATA(IP6_11_9, SSI_SCK9_C, SEL_SSI9_2),
1083 PINMUX_IPSR_DATA(IP6_14_12, SSI_WS34),
1084 PINMUX_IPSR_DATA(IP6_14_12, CAN_DEBUGOUT7),
1085 PINMUX_IPSR_MODSEL_DATA(IP6_14_12, CAN0_RX_B, SEL_CAN0_1),
1086 PINMUX_IPSR_DATA(IP6_14_12, IETX),
1087 PINMUX_IPSR_MODSEL_DATA(IP6_14_12, SSI_WS9_C, SEL_SSI9_2),
1088 PINMUX_IPSR_DATA(IP6_17_15, SSI_SDATA3),
1089 PINMUX_IPSR_DATA(IP6_17_15, PWM0_C),
1090 PINMUX_IPSR_DATA(IP6_17_15, CAN_DEBUGOUT8),
1091 PINMUX_IPSR_MODSEL_DATA(IP6_17_15, CAN_CLK_B, SEL_CANCLK_1),
1092 PINMUX_IPSR_MODSEL_DATA(IP6_17_15, IECLK, SEL_IE_0),
1093 PINMUX_IPSR_MODSEL_DATA(IP6_17_15, SCIF_CLK_B, SEL_SCIF_1),
1094 PINMUX_IPSR_MODSEL_DATA(IP6_17_15, TCLK0_B, SEL_TMU0_1),
1095 PINMUX_IPSR_DATA(IP6_19_18, SSI_SDATA4),
1096 PINMUX_IPSR_DATA(IP6_19_18, CAN_DEBUGOUT9),
1097 PINMUX_IPSR_MODSEL_DATA(IP6_19_18, SSI_SDATA9_C, SEL_SSI9_2),
1098 PINMUX_IPSR_DATA(IP6_22_20, SSI_SCK5),
1099 PINMUX_IPSR_DATA(IP6_22_20, ADICLK),
1100 PINMUX_IPSR_DATA(IP6_22_20, CAN_DEBUGOUT10),
1101 PINMUX_IPSR_MODSEL_DATA(IP6_22_20, SCK3, SEL_SCIF3_0),
1102 PINMUX_IPSR_MODSEL_DATA(IP6_22_20, TCLK0_D, SEL_TMU0_3),
1103 PINMUX_IPSR_DATA(IP6_24_23, SSI_WS5),
1104 PINMUX_IPSR_MODSEL_DATA(IP6_24_23, ADICS_SAMP, SEL_ADI_0),
1105 PINMUX_IPSR_DATA(IP6_24_23, CAN_DEBUGOUT11),
1106 PINMUX_IPSR_DATA(IP6_24_23, TX3_IRDA_TX),
1107 PINMUX_IPSR_DATA(IP6_26_25, SSI_SDATA5),
1108 PINMUX_IPSR_MODSEL_DATA(IP6_26_25, ADIDATA, SEL_ADI_0),
1109 PINMUX_IPSR_DATA(IP6_26_25, CAN_DEBUGOUT12),
1110 PINMUX_IPSR_MODSEL_DATA(IP6_26_25, RX3_IRDA_RX, SEL_SCIF3_0),
1111 PINMUX_IPSR_DATA(IP6_30_29, SSI_SCK6),
1112 PINMUX_IPSR_DATA(IP6_30_29, ADICHS0),
1113 PINMUX_IPSR_DATA(IP6_30_29, CAN0_TX),
1114 PINMUX_IPSR_MODSEL_DATA(IP6_30_29, IERX_B, SEL_IE_1),
1115
1116 PINMUX_IPSR_DATA(IP7_1_0, SSI_WS6),
1117 PINMUX_IPSR_DATA(IP7_1_0, ADICHS1),
1118 PINMUX_IPSR_MODSEL_DATA(IP7_1_0, CAN0_RX, SEL_CAN0_0),
1119 PINMUX_IPSR_DATA(IP7_1_0, IETX_B),
1120 PINMUX_IPSR_DATA(IP7_3_2, SSI_SDATA6),
1121 PINMUX_IPSR_DATA(IP7_3_2, ADICHS2),
1122 PINMUX_IPSR_MODSEL_DATA(IP7_3_2, CAN_CLK, SEL_CANCLK_0),
1123 PINMUX_IPSR_MODSEL_DATA(IP7_3_2, IECLK_B, SEL_IE_1),
1124 PINMUX_IPSR_MODSEL_DATA(IP7_6_4, SSI_SCK78, SEL_SSI7_0),
1125 PINMUX_IPSR_DATA(IP7_6_4, CAN_DEBUGOUT13),
1126 PINMUX_IPSR_MODSEL_DATA(IP7_6_4, IRQ0_B, SEL_INT0_1),
1127 PINMUX_IPSR_MODSEL_DATA(IP7_6_4, SSI_SCK9_B, SEL_SSI9_1),
1128 PINMUX_IPSR_MODSEL_DATA(IP7_6_4, HSPI_CLK1_C, SEL_HSPI1_2),
1129 PINMUX_IPSR_MODSEL_DATA(IP7_9_7, SSI_WS78, SEL_SSI7_0),
1130 PINMUX_IPSR_DATA(IP7_9_7, CAN_DEBUGOUT14),
1131 PINMUX_IPSR_MODSEL_DATA(IP7_9_7, IRQ1_B, SEL_INT1_1),
1132 PINMUX_IPSR_MODSEL_DATA(IP7_9_7, SSI_WS9_B, SEL_SSI9_1),
1133 PINMUX_IPSR_MODSEL_DATA(IP7_9_7, HSPI_CS1_C, SEL_HSPI1_2),
1134 PINMUX_IPSR_MODSEL_DATA(IP7_12_10, SSI_SDATA7, SEL_SSI7_0),
1135 PINMUX_IPSR_DATA(IP7_12_10, CAN_DEBUGOUT15),
1136 PINMUX_IPSR_MODSEL_DATA(IP7_12_10, IRQ2_B, SEL_INT2_1),
1137 PINMUX_IPSR_MODSEL_DATA(IP7_12_10, TCLK1_C, SEL_TMU1_2),
1138 PINMUX_IPSR_DATA(IP7_12_10, HSPI_TX1_C),
1139 PINMUX_IPSR_MODSEL_DATA(IP7_14_13, SSI_SDATA8, SEL_SSI8_0),
1140 PINMUX_IPSR_DATA(IP7_14_13, VSP),
1141 PINMUX_IPSR_MODSEL_DATA(IP7_14_13, IRQ3_B, SEL_INT3_1),
1142 PINMUX_IPSR_MODSEL_DATA(IP7_14_13, HSPI_RX1_C, SEL_HSPI1_2),
1143 PINMUX_IPSR_DATA(IP7_16_15, SD0_CLK),
1144 PINMUX_IPSR_DATA(IP7_16_15, ATACS01),
1145 PINMUX_IPSR_MODSEL_DATA(IP7_16_15, SCK1_B, SEL_SCIF1_1),
1146 PINMUX_IPSR_DATA(IP7_18_17, SD0_CMD),
1147 PINMUX_IPSR_DATA(IP7_18_17, ATACS11),
1148 PINMUX_IPSR_DATA(IP7_18_17, TX1_B),
1149 PINMUX_IPSR_DATA(IP7_18_17, CC5_TDO),
1150 PINMUX_IPSR_DATA(IP7_20_19, SD0_DAT0),
1151 PINMUX_IPSR_DATA(IP7_20_19, ATADIR1),
1152 PINMUX_IPSR_MODSEL_DATA(IP7_20_19, RX1_B, SEL_SCIF1_1),
1153 PINMUX_IPSR_DATA(IP7_20_19, CC5_TRST),
1154 PINMUX_IPSR_DATA(IP7_22_21, SD0_DAT1),
1155 PINMUX_IPSR_DATA(IP7_22_21, ATAG1),
1156 PINMUX_IPSR_MODSEL_DATA(IP7_22_21, SCK2_B, SEL_SCIF2_1),
1157 PINMUX_IPSR_DATA(IP7_22_21, CC5_TMS),
1158 PINMUX_IPSR_DATA(IP7_24_23, SD0_DAT2),
1159 PINMUX_IPSR_DATA(IP7_24_23, ATARD1),
1160 PINMUX_IPSR_DATA(IP7_24_23, TX2_B),
1161 PINMUX_IPSR_DATA(IP7_24_23, CC5_TCK),
1162 PINMUX_IPSR_DATA(IP7_26_25, SD0_DAT3),
1163 PINMUX_IPSR_DATA(IP7_26_25, ATAWR1),
1164 PINMUX_IPSR_MODSEL_DATA(IP7_26_25, RX2_B, SEL_SCIF2_1),
1165 PINMUX_IPSR_DATA(IP7_26_25, CC5_TDI),
1166 PINMUX_IPSR_DATA(IP7_28_27, SD0_CD),
1167 PINMUX_IPSR_MODSEL_DATA(IP7_28_27, DREQ2, SEL_EXBUS2_0),
1168 PINMUX_IPSR_MODSEL_DATA(IP7_28_27, RTS1_B_TANS_B, SEL_SCIF1_1),
1169 PINMUX_IPSR_DATA(IP7_30_29, SD0_WP),
1170 PINMUX_IPSR_DATA(IP7_30_29, DACK2),
1171 PINMUX_IPSR_MODSEL_DATA(IP7_30_29, CTS1_B, SEL_SCIF1_1),
1172
1173 PINMUX_IPSR_DATA(IP8_3_0, HSPI_CLK0),
1174 PINMUX_IPSR_MODSEL_DATA(IP8_3_0, CTS0, SEL_SCIF0_0),
1175 PINMUX_IPSR_DATA(IP8_3_0, USB_OVC0),
1176 PINMUX_IPSR_DATA(IP8_3_0, AD_CLK),
1177 PINMUX_IPSR_DATA(IP8_3_0, CC5_STATE4),
1178 PINMUX_IPSR_DATA(IP8_3_0, CC5_STATE12),
1179 PINMUX_IPSR_DATA(IP8_3_0, CC5_STATE20),
1180 PINMUX_IPSR_DATA(IP8_3_0, CC5_STATE28),
1181 PINMUX_IPSR_DATA(IP8_3_0, CC5_STATE36),
1182 PINMUX_IPSR_DATA(IP8_7_4, HSPI_CS0),
1183 PINMUX_IPSR_MODSEL_DATA(IP8_7_4, RTS0_TANS, SEL_SCIF0_0),
1184 PINMUX_IPSR_DATA(IP8_7_4, USB_OVC1),
1185 PINMUX_IPSR_DATA(IP8_7_4, AD_DI),
1186 PINMUX_IPSR_DATA(IP8_7_4, CC5_STATE5),
1187 PINMUX_IPSR_DATA(IP8_7_4, CC5_STATE13),
1188 PINMUX_IPSR_DATA(IP8_7_4, CC5_STATE21),
1189 PINMUX_IPSR_DATA(IP8_7_4, CC5_STATE29),
1190 PINMUX_IPSR_DATA(IP8_7_4, CC5_STATE37),
1191 PINMUX_IPSR_DATA(IP8_11_8, HSPI_TX0),
1192 PINMUX_IPSR_DATA(IP8_11_8, TX0),
1193 PINMUX_IPSR_DATA(IP8_11_8, CAN_DEBUG_HW_TRIGGER),
1194 PINMUX_IPSR_DATA(IP8_11_8, AD_DO),
1195 PINMUX_IPSR_DATA(IP8_11_8, CC5_STATE6),
1196 PINMUX_IPSR_DATA(IP8_11_8, CC5_STATE14),
1197 PINMUX_IPSR_DATA(IP8_11_8, CC5_STATE22),
1198 PINMUX_IPSR_DATA(IP8_11_8, CC5_STATE30),
1199 PINMUX_IPSR_DATA(IP8_11_8, CC5_STATE38),
1200 PINMUX_IPSR_DATA(IP8_15_12, HSPI_RX0),
1201 PINMUX_IPSR_MODSEL_DATA(IP8_15_12, RX0, SEL_SCIF0_0),
1202 PINMUX_IPSR_DATA(IP8_15_12, CAN_STEP0),
1203 PINMUX_IPSR_DATA(IP8_15_12, AD_NCS),
1204 PINMUX_IPSR_DATA(IP8_15_12, CC5_STATE7),
1205 PINMUX_IPSR_DATA(IP8_15_12, CC5_STATE15),
1206 PINMUX_IPSR_DATA(IP8_15_12, CC5_STATE23),
1207 PINMUX_IPSR_DATA(IP8_15_12, CC5_STATE31),
1208 PINMUX_IPSR_DATA(IP8_15_12, CC5_STATE39),
1209 PINMUX_IPSR_DATA(IP8_17_16, FMCLK),
1210 PINMUX_IPSR_DATA(IP8_17_16, RDS_CLK),
1211 PINMUX_IPSR_DATA(IP8_17_16, PCMOE),
1212 PINMUX_IPSR_DATA(IP8_18, BPFCLK),
1213 PINMUX_IPSR_DATA(IP8_18, PCMWE),
1214 PINMUX_IPSR_DATA(IP8_19, FMIN),
1215 PINMUX_IPSR_DATA(IP8_19, RDS_DATA),
1216 PINMUX_IPSR_DATA(IP8_20, VI0_CLK),
1217 PINMUX_IPSR_DATA(IP8_20, MMC1_CLK),
1218 PINMUX_IPSR_DATA(IP8_22_21, VI0_CLKENB),
1219 PINMUX_IPSR_DATA(IP8_22_21, TX1_C),
1220 PINMUX_IPSR_DATA(IP8_22_21, HTX1_B),
1221 PINMUX_IPSR_DATA(IP8_22_21, MT1_SYNC),
1222 PINMUX_IPSR_DATA(IP8_24_23, VI0_FIELD),
1223 PINMUX_IPSR_MODSEL_DATA(IP8_24_23, RX1_C, SEL_SCIF1_2),
1224 PINMUX_IPSR_MODSEL_DATA(IP8_24_23, HRX1_B, SEL_HSCIF1_1),
1225 PINMUX_IPSR_DATA(IP8_27_25, VI0_HSYNC),
1226 PINMUX_IPSR_MODSEL_DATA(IP8_27_25, VI0_DATA0_B_VI0_B0_B, SEL_VI0_1),
1227 PINMUX_IPSR_MODSEL_DATA(IP8_27_25, CTS1_C, SEL_SCIF1_2),
1228 PINMUX_IPSR_DATA(IP8_27_25, TX4_D),
1229 PINMUX_IPSR_DATA(IP8_27_25, MMC1_CMD),
1230 PINMUX_IPSR_MODSEL_DATA(IP8_27_25, HSCK1_B, SEL_HSCIF1_1),
1231 PINMUX_IPSR_DATA(IP8_30_28, VI0_VSYNC),
1232 PINMUX_IPSR_MODSEL_DATA(IP8_30_28, VI0_DATA1_B_VI0_B1_B, SEL_VI0_1),
1233 PINMUX_IPSR_MODSEL_DATA(IP8_30_28, RTS1_C_TANS_C, SEL_SCIF1_2),
1234 PINMUX_IPSR_MODSEL_DATA(IP8_30_28, RX4_D, SEL_SCIF4_3),
1235 PINMUX_IPSR_MODSEL_DATA(IP8_30_28, PWMFSW0_C, SEL_PWMFSW_2),
1236
1237 PINMUX_IPSR_MODSEL_DATA(IP9_1_0, VI0_DATA0_VI0_B0, SEL_VI0_0),
1238 PINMUX_IPSR_MODSEL_DATA(IP9_1_0, HRTS1_B, SEL_HSCIF1_1),
1239 PINMUX_IPSR_DATA(IP9_1_0, MT1_VCXO),
1240 PINMUX_IPSR_MODSEL_DATA(IP9_3_2, VI0_DATA1_VI0_B1, SEL_VI0_0),
1241 PINMUX_IPSR_MODSEL_DATA(IP9_3_2, HCTS1_B, SEL_HSCIF1_1),
1242 PINMUX_IPSR_DATA(IP9_3_2, MT1_PWM),
1243 PINMUX_IPSR_DATA(IP9_4, VI0_DATA2_VI0_B2),
1244 PINMUX_IPSR_DATA(IP9_4, MMC1_D0),
1245 PINMUX_IPSR_DATA(IP9_5, VI0_DATA3_VI0_B3),
1246 PINMUX_IPSR_DATA(IP9_5, MMC1_D1),
1247 PINMUX_IPSR_DATA(IP9_6, VI0_DATA4_VI0_B4),
1248 PINMUX_IPSR_DATA(IP9_6, MMC1_D2),
1249 PINMUX_IPSR_DATA(IP9_7, VI0_DATA5_VI0_B5),
1250 PINMUX_IPSR_DATA(IP9_7, MMC1_D3),
1251 PINMUX_IPSR_DATA(IP9_9_8, VI0_DATA6_VI0_B6),
1252 PINMUX_IPSR_DATA(IP9_9_8, MMC1_D4),
1253 PINMUX_IPSR_DATA(IP9_9_8, ARM_TRACEDATA_0),
1254 PINMUX_IPSR_DATA(IP9_11_10, VI0_DATA7_VI0_B7),
1255 PINMUX_IPSR_DATA(IP9_11_10, MMC1_D5),
1256 PINMUX_IPSR_DATA(IP9_11_10, ARM_TRACEDATA_1),
1257 PINMUX_IPSR_DATA(IP9_13_12, VI0_G0),
1258 PINMUX_IPSR_MODSEL_DATA(IP9_13_12, SSI_SCK78_C, SEL_SSI7_2),
1259 PINMUX_IPSR_MODSEL_DATA(IP9_13_12, IRQ0, SEL_INT0_0),
1260 PINMUX_IPSR_DATA(IP9_13_12, ARM_TRACEDATA_2),
1261 PINMUX_IPSR_DATA(IP9_15_14, VI0_G1),
1262 PINMUX_IPSR_MODSEL_DATA(IP9_15_14, SSI_WS78_C, SEL_SSI7_2),
1263 PINMUX_IPSR_MODSEL_DATA(IP9_15_14, IRQ1, SEL_INT1_0),
1264 PINMUX_IPSR_DATA(IP9_15_14, ARM_TRACEDATA_3),
1265 PINMUX_IPSR_DATA(IP9_18_16, VI0_G2),
1266 PINMUX_IPSR_DATA(IP9_18_16, ETH_TXD1),
1267 PINMUX_IPSR_DATA(IP9_18_16, MMC1_D6),
1268 PINMUX_IPSR_DATA(IP9_18_16, ARM_TRACEDATA_4),
1269 PINMUX_IPSR_DATA(IP9_18_16, TS_SPSYNC0),
1270 PINMUX_IPSR_DATA(IP9_21_19, VI0_G3),
1271 PINMUX_IPSR_DATA(IP9_21_19, ETH_CRS_DV),
1272 PINMUX_IPSR_DATA(IP9_21_19, MMC1_D7),
1273 PINMUX_IPSR_DATA(IP9_21_19, ARM_TRACEDATA_5),
1274 PINMUX_IPSR_DATA(IP9_21_19, TS_SDAT0),
1275 PINMUX_IPSR_DATA(IP9_23_22, VI0_G4),
1276 PINMUX_IPSR_DATA(IP9_23_22, ETH_TX_EN),
1277 PINMUX_IPSR_MODSEL_DATA(IP9_23_22, SD2_DAT0_B, SEL_SD2_1),
1278 PINMUX_IPSR_DATA(IP9_23_22, ARM_TRACEDATA_6),
1279 PINMUX_IPSR_DATA(IP9_25_24, VI0_G5),
1280 PINMUX_IPSR_DATA(IP9_25_24, ETH_RX_ER),
1281 PINMUX_IPSR_MODSEL_DATA(IP9_25_24, SD2_DAT1_B, SEL_SD2_1),
1282 PINMUX_IPSR_DATA(IP9_25_24, ARM_TRACEDATA_7),
1283 PINMUX_IPSR_DATA(IP9_27_26, VI0_G6),
1284 PINMUX_IPSR_DATA(IP9_27_26, ETH_RXD0),
1285 PINMUX_IPSR_MODSEL_DATA(IP9_27_26, SD2_DAT2_B, SEL_SD2_1),
1286 PINMUX_IPSR_DATA(IP9_27_26, ARM_TRACEDATA_8),
1287 PINMUX_IPSR_DATA(IP9_29_28, VI0_G7),
1288 PINMUX_IPSR_DATA(IP9_29_28, ETH_RXD1),
1289 PINMUX_IPSR_MODSEL_DATA(IP9_29_28, SD2_DAT3_B, SEL_SD2_1),
1290 PINMUX_IPSR_DATA(IP9_29_28, ARM_TRACEDATA_9),
1291
1292 PINMUX_IPSR_DATA(IP10_2_0, VI0_R0),
1293 PINMUX_IPSR_MODSEL_DATA(IP10_2_0, SSI_SDATA7_C, SEL_SSI7_2),
1294 PINMUX_IPSR_MODSEL_DATA(IP10_2_0, SCK1_C, SEL_SCIF1_2),
1295 PINMUX_IPSR_MODSEL_DATA(IP10_2_0, DREQ1_B, SEL_EXBUS1_0),
1296 PINMUX_IPSR_DATA(IP10_2_0, ARM_TRACEDATA_10),
1297 PINMUX_IPSR_MODSEL_DATA(IP10_2_0, DREQ0_C, SEL_EXBUS0_2),
1298 PINMUX_IPSR_DATA(IP10_5_3, VI0_R1),
1299 PINMUX_IPSR_MODSEL_DATA(IP10_5_3, SSI_SDATA8_C, SEL_SSI8_2),
1300 PINMUX_IPSR_DATA(IP10_5_3, DACK1_B),
1301 PINMUX_IPSR_DATA(IP10_5_3, ARM_TRACEDATA_11),
1302 PINMUX_IPSR_DATA(IP10_5_3, DACK0_C),
1303 PINMUX_IPSR_DATA(IP10_5_3, DRACK0_C),
1304 PINMUX_IPSR_DATA(IP10_8_6, VI0_R2),
1305 PINMUX_IPSR_DATA(IP10_8_6, ETH_LINK),
1306 PINMUX_IPSR_DATA(IP10_8_6, SD2_CLK_B),
1307 PINMUX_IPSR_MODSEL_DATA(IP10_8_6, IRQ2, SEL_INT2_0),
1308 PINMUX_IPSR_DATA(IP10_8_6, ARM_TRACEDATA_12),
1309 PINMUX_IPSR_DATA(IP10_11_9, VI0_R3),
1310 PINMUX_IPSR_DATA(IP10_11_9, ETH_MAGIC),
1311 PINMUX_IPSR_MODSEL_DATA(IP10_11_9, SD2_CMD_B, SEL_SD2_1),
1312 PINMUX_IPSR_MODSEL_DATA(IP10_11_9, IRQ3, SEL_INT3_0),
1313 PINMUX_IPSR_DATA(IP10_11_9, ARM_TRACEDATA_13),
1314 PINMUX_IPSR_DATA(IP10_14_12, VI0_R4),
1315 PINMUX_IPSR_DATA(IP10_14_12, ETH_REFCLK),
1316 PINMUX_IPSR_MODSEL_DATA(IP10_14_12, SD2_CD_B, SEL_SD2_1),
1317 PINMUX_IPSR_MODSEL_DATA(IP10_14_12, HSPI_CLK1_B, SEL_HSPI1_1),
1318 PINMUX_IPSR_DATA(IP10_14_12, ARM_TRACEDATA_14),
1319 PINMUX_IPSR_DATA(IP10_14_12, MT1_CLK),
1320 PINMUX_IPSR_DATA(IP10_14_12, TS_SCK0),
1321 PINMUX_IPSR_DATA(IP10_17_15, VI0_R5),
1322 PINMUX_IPSR_DATA(IP10_17_15, ETH_TXD0),
1323 PINMUX_IPSR_MODSEL_DATA(IP10_17_15, SD2_WP_B, SEL_SD2_1),
1324 PINMUX_IPSR_MODSEL_DATA(IP10_17_15, HSPI_CS1_B, SEL_HSPI1_1),
1325 PINMUX_IPSR_DATA(IP10_17_15, ARM_TRACEDATA_15),
1326 PINMUX_IPSR_DATA(IP10_17_15, MT1_D),
1327 PINMUX_IPSR_DATA(IP10_17_15, TS_SDEN0),
1328 PINMUX_IPSR_DATA(IP10_20_18, VI0_R6),
1329 PINMUX_IPSR_DATA(IP10_20_18, ETH_MDC),
1330 PINMUX_IPSR_MODSEL_DATA(IP10_20_18, DREQ2_C, SEL_EXBUS2_2),
1331 PINMUX_IPSR_DATA(IP10_20_18, HSPI_TX1_B),
1332 PINMUX_IPSR_DATA(IP10_20_18, TRACECLK),
1333 PINMUX_IPSR_DATA(IP10_20_18, MT1_BEN),
1334 PINMUX_IPSR_MODSEL_DATA(IP10_20_18, PWMFSW0_D, SEL_PWMFSW_3),
1335 PINMUX_IPSR_DATA(IP10_23_21, VI0_R7),
1336 PINMUX_IPSR_DATA(IP10_23_21, ETH_MDIO),
1337 PINMUX_IPSR_DATA(IP10_23_21, DACK2_C),
1338 PINMUX_IPSR_MODSEL_DATA(IP10_23_21, HSPI_RX1_B, SEL_HSPI1_1),
1339 PINMUX_IPSR_MODSEL_DATA(IP10_23_21, SCIF_CLK_D, SEL_SCIF_3),
1340 PINMUX_IPSR_DATA(IP10_23_21, TRACECTL),
1341 PINMUX_IPSR_DATA(IP10_23_21, MT1_PEN),
1342 PINMUX_IPSR_DATA(IP10_25_24, VI1_CLK),
1343 PINMUX_IPSR_MODSEL_DATA(IP10_25_24, SIM_D, SEL_SIM_0),
1344 PINMUX_IPSR_MODSEL_DATA(IP10_25_24, SDA3, SEL_I2C3_0),
1345 PINMUX_IPSR_DATA(IP10_28_26, VI1_HSYNC),
1346 PINMUX_IPSR_DATA(IP10_28_26, VI3_CLK),
1347 PINMUX_IPSR_DATA(IP10_28_26, SSI_SCK4),
1348 PINMUX_IPSR_MODSEL_DATA(IP10_28_26, GPS_SIGN_C, SEL_GPS_2),
1349 PINMUX_IPSR_MODSEL_DATA(IP10_28_26, PWMFSW0_E, SEL_PWMFSW_4),
1350 PINMUX_IPSR_DATA(IP10_31_29, VI1_VSYNC),
1351 PINMUX_IPSR_DATA(IP10_31_29, AUDIO_CLKOUT_C),
1352 PINMUX_IPSR_DATA(IP10_31_29, SSI_WS4),
1353 PINMUX_IPSR_DATA(IP10_31_29, SIM_CLK),
1354 PINMUX_IPSR_MODSEL_DATA(IP10_31_29, GPS_MAG_C, SEL_GPS_2),
1355 PINMUX_IPSR_DATA(IP10_31_29, SPV_TRST),
1356 PINMUX_IPSR_MODSEL_DATA(IP10_31_29, SCL3, SEL_I2C3_0),
1357
1358 PINMUX_IPSR_DATA(IP11_2_0, VI1_DATA0_VI1_B0),
1359 PINMUX_IPSR_MODSEL_DATA(IP11_2_0, SD2_DAT0, SEL_SD2_0),
1360 PINMUX_IPSR_DATA(IP11_2_0, SIM_RST),
1361 PINMUX_IPSR_DATA(IP11_2_0, SPV_TCK),
1362 PINMUX_IPSR_DATA(IP11_2_0, ADICLK_B),
1363 PINMUX_IPSR_DATA(IP11_5_3, VI1_DATA1_VI1_B1),
1364 PINMUX_IPSR_MODSEL_DATA(IP11_5_3, SD2_DAT1, SEL_SD2_0),
1365 PINMUX_IPSR_DATA(IP11_5_3, MT0_CLK),
1366 PINMUX_IPSR_DATA(IP11_5_3, SPV_TMS),
1367 PINMUX_IPSR_MODSEL_DATA(IP11_5_3, ADICS_B_SAMP_B, SEL_ADI_1),
1368 PINMUX_IPSR_DATA(IP11_8_6, VI1_DATA2_VI1_B2),
1369 PINMUX_IPSR_MODSEL_DATA(IP11_8_6, SD2_DAT2, SEL_SD2_0),
1370 PINMUX_IPSR_DATA(IP11_8_6, MT0_D),
1371 PINMUX_IPSR_DATA(IP11_8_6, SPVTDI),
1372 PINMUX_IPSR_MODSEL_DATA(IP11_8_6, ADIDATA_B, SEL_ADI_1),
1373 PINMUX_IPSR_DATA(IP11_11_9, VI1_DATA3_VI1_B3),
1374 PINMUX_IPSR_MODSEL_DATA(IP11_11_9, SD2_DAT3, SEL_SD2_0),
1375 PINMUX_IPSR_DATA(IP11_11_9, MT0_BEN),
1376 PINMUX_IPSR_DATA(IP11_11_9, SPV_TDO),
1377 PINMUX_IPSR_DATA(IP11_11_9, ADICHS0_B),
1378 PINMUX_IPSR_DATA(IP11_14_12, VI1_DATA4_VI1_B4),
1379 PINMUX_IPSR_DATA(IP11_14_12, SD2_CLK),
1380 PINMUX_IPSR_DATA(IP11_14_12, MT0_PEN),
1381 PINMUX_IPSR_DATA(IP11_14_12, SPA_TRST),
1382 PINMUX_IPSR_MODSEL_DATA(IP11_14_12, HSPI_CLK1_D, SEL_HSPI1_3),
1383 PINMUX_IPSR_DATA(IP11_14_12, ADICHS1_B),
1384 PINMUX_IPSR_DATA(IP11_17_15, VI1_DATA5_VI1_B5),
1385 PINMUX_IPSR_MODSEL_DATA(IP11_17_15, SD2_CMD, SEL_SD2_0),
1386 PINMUX_IPSR_DATA(IP11_17_15, MT0_SYNC),
1387 PINMUX_IPSR_DATA(IP11_17_15, SPA_TCK),
1388 PINMUX_IPSR_MODSEL_DATA(IP11_17_15, HSPI_CS1_D, SEL_HSPI1_3),
1389 PINMUX_IPSR_DATA(IP11_17_15, ADICHS2_B),
1390 PINMUX_IPSR_DATA(IP11_20_18, VI1_DATA6_VI1_B6),
1391 PINMUX_IPSR_MODSEL_DATA(IP11_20_18, SD2_CD, SEL_SD2_0),
1392 PINMUX_IPSR_DATA(IP11_20_18, MT0_VCXO),
1393 PINMUX_IPSR_DATA(IP11_20_18, SPA_TMS),
1394 PINMUX_IPSR_DATA(IP11_20_18, HSPI_TX1_D),
1395 PINMUX_IPSR_DATA(IP11_23_21, VI1_DATA7_VI1_B7),
1396 PINMUX_IPSR_MODSEL_DATA(IP11_23_21, SD2_WP, SEL_SD2_0),
1397 PINMUX_IPSR_DATA(IP11_23_21, MT0_PWM),
1398 PINMUX_IPSR_DATA(IP11_23_21, SPA_TDI),
1399 PINMUX_IPSR_MODSEL_DATA(IP11_23_21, HSPI_RX1_D, SEL_HSPI1_3),
1400 PINMUX_IPSR_DATA(IP11_26_24, VI1_G0),
1401 PINMUX_IPSR_DATA(IP11_26_24, VI3_DATA0),
1402 PINMUX_IPSR_DATA(IP11_26_24, DU1_DOTCLKOUT1),
1403 PINMUX_IPSR_DATA(IP11_26_24, TS_SCK1),
1404 PINMUX_IPSR_MODSEL_DATA(IP11_26_24, DREQ2_B, SEL_EXBUS2_1),
1405 PINMUX_IPSR_DATA(IP11_26_24, TX2),
1406 PINMUX_IPSR_DATA(IP11_26_24, SPA_TDO),
1407 PINMUX_IPSR_MODSEL_DATA(IP11_26_24, HCTS0_B, SEL_HSCIF0_1),
1408 PINMUX_IPSR_DATA(IP11_29_27, VI1_G1),
1409 PINMUX_IPSR_DATA(IP11_29_27, VI3_DATA1),
1410 PINMUX_IPSR_DATA(IP11_29_27, SSI_SCK1),
1411 PINMUX_IPSR_DATA(IP11_29_27, TS_SDEN1),
1412 PINMUX_IPSR_DATA(IP11_29_27, DACK2_B),
1413 PINMUX_IPSR_MODSEL_DATA(IP11_29_27, RX2, SEL_SCIF2_0),
1414 PINMUX_IPSR_MODSEL_DATA(IP11_29_27, HRTS0_B, SEL_HSCIF0_1),
1415
1416 PINMUX_IPSR_DATA(IP12_2_0, VI1_G2),
1417 PINMUX_IPSR_DATA(IP12_2_0, VI3_DATA2),
1418 PINMUX_IPSR_DATA(IP12_2_0, SSI_WS1),
1419 PINMUX_IPSR_DATA(IP12_2_0, TS_SPSYNC1),
1420 PINMUX_IPSR_MODSEL_DATA(IP12_2_0, SCK2, SEL_SCIF2_0),
1421 PINMUX_IPSR_MODSEL_DATA(IP12_2_0, HSCK0_B, SEL_HSCIF0_1),
1422 PINMUX_IPSR_DATA(IP12_5_3, VI1_G3),
1423 PINMUX_IPSR_DATA(IP12_5_3, VI3_DATA3),
1424 PINMUX_IPSR_DATA(IP12_5_3, SSI_SCK2),
1425 PINMUX_IPSR_DATA(IP12_5_3, TS_SDAT1),
1426 PINMUX_IPSR_MODSEL_DATA(IP12_5_3, SCL1_C, SEL_I2C1_2),
1427 PINMUX_IPSR_DATA(IP12_5_3, HTX0_B),
1428 PINMUX_IPSR_DATA(IP12_8_6, VI1_G4),
1429 PINMUX_IPSR_DATA(IP12_8_6, VI3_DATA4),
1430 PINMUX_IPSR_DATA(IP12_8_6, SSI_WS2),
1431 PINMUX_IPSR_MODSEL_DATA(IP12_8_6, SDA1_C, SEL_I2C1_2),
1432 PINMUX_IPSR_DATA(IP12_8_6, SIM_RST_B),
1433 PINMUX_IPSR_MODSEL_DATA(IP12_8_6, HRX0_B, SEL_HSCIF0_1),
1434 PINMUX_IPSR_DATA(IP12_11_9, VI1_G5),
1435 PINMUX_IPSR_DATA(IP12_11_9, VI3_DATA5),
1436 PINMUX_IPSR_MODSEL_DATA(IP12_11_9, GPS_CLK, SEL_GPS_0),
1437 PINMUX_IPSR_DATA(IP12_11_9, FSE),
1438 PINMUX_IPSR_DATA(IP12_11_9, TX4_B),
1439 PINMUX_IPSR_MODSEL_DATA(IP12_11_9, SIM_D_B, SEL_SIM_1),
1440 PINMUX_IPSR_DATA(IP12_14_12, VI1_G6),
1441 PINMUX_IPSR_DATA(IP12_14_12, VI3_DATA6),
1442 PINMUX_IPSR_MODSEL_DATA(IP12_14_12, GPS_SIGN, SEL_GPS_0),
1443 PINMUX_IPSR_DATA(IP12_14_12, FRB),
1444 PINMUX_IPSR_MODSEL_DATA(IP12_14_12, RX4_B, SEL_SCIF4_1),
1445 PINMUX_IPSR_DATA(IP12_14_12, SIM_CLK_B),
1446 PINMUX_IPSR_DATA(IP12_17_15, VI1_G7),
1447 PINMUX_IPSR_DATA(IP12_17_15, VI3_DATA7),
1448 PINMUX_IPSR_MODSEL_DATA(IP12_17_15, GPS_MAG, SEL_GPS_0),
1449 PINMUX_IPSR_DATA(IP12_17_15, FCE),
1450 PINMUX_IPSR_MODSEL_DATA(IP12_17_15, SCK4_B, SEL_SCIF4_1),
1451};
1452
1453static struct pinmux_gpio pinmux_gpios[] = {
1454 PINMUX_GPIO_GP_ALL(),
1455 GPIO_FN(AVS1), GPIO_FN(AVS2), GPIO_FN(A17), GPIO_FN(A18),
1456 GPIO_FN(A19),
1457
1458 /* IPSR0 */
1459 GPIO_FN(USB_PENC2), GPIO_FN(SCK0), GPIO_FN(PWM1), GPIO_FN(PWMFSW0),
1460 GPIO_FN(SCIF_CLK), GPIO_FN(TCLK0_C), GPIO_FN(BS), GPIO_FN(SD1_DAT2),
1461 GPIO_FN(MMC0_D2), GPIO_FN(FD2), GPIO_FN(ATADIR0), GPIO_FN(SDSELF),
1462 GPIO_FN(HCTS1), GPIO_FN(TX4_C), GPIO_FN(A0), GPIO_FN(SD1_DAT3),
1463 GPIO_FN(MMC0_D3), GPIO_FN(FD3), GPIO_FN(A20), GPIO_FN(TX5_D),
1464 GPIO_FN(HSPI_TX2_B), GPIO_FN(A21), GPIO_FN(SCK5_D),
1465 GPIO_FN(HSPI_CLK2_B), GPIO_FN(A22), GPIO_FN(RX5_D),
1466 GPIO_FN(HSPI_RX2_B), GPIO_FN(VI1_R0), GPIO_FN(A23), GPIO_FN(FCLE),
1467 GPIO_FN(HSPI_CLK2), GPIO_FN(VI1_R1), GPIO_FN(A24), GPIO_FN(SD1_CD),
1468 GPIO_FN(MMC0_D4), GPIO_FN(FD4), GPIO_FN(HSPI_CS2), GPIO_FN(VI1_R2),
1469 GPIO_FN(SSI_WS78_B), GPIO_FN(A25), GPIO_FN(SD1_WP), GPIO_FN(MMC0_D5),
1470 GPIO_FN(FD5), GPIO_FN(HSPI_RX2), GPIO_FN(VI1_R3), GPIO_FN(TX5_B),
1471 GPIO_FN(SSI_SDATA7_B), GPIO_FN(CTS0_B), GPIO_FN(CLKOUT),
1472 GPIO_FN(TX3C_IRDA_TX_C), GPIO_FN(PWM0_B), GPIO_FN(CS0),
1473 GPIO_FN(HSPI_CS2_B), GPIO_FN(CS1_A26), GPIO_FN(HSPI_TX2),
1474 GPIO_FN(SDSELF_B), GPIO_FN(RD_WR), GPIO_FN(FWE), GPIO_FN(ATAG0),
1475 GPIO_FN(VI1_R7), GPIO_FN(HRTS1), GPIO_FN(RX4_C),
1476
1477 /* IPSR1 */
1478 GPIO_FN(EX_CS0), GPIO_FN(RX3_C_IRDA_RX_C), GPIO_FN(MMC0_D6),
1479 GPIO_FN(FD6), GPIO_FN(EX_CS1), GPIO_FN(MMC0_D7), GPIO_FN(FD7),
1480 GPIO_FN(EX_CS2), GPIO_FN(SD1_CLK), GPIO_FN(MMC0_CLK), GPIO_FN(FALE),
1481 GPIO_FN(ATACS00), GPIO_FN(EX_CS3), GPIO_FN(SD1_CMD), GPIO_FN(MMC0_CMD),
1482 GPIO_FN(FRE), GPIO_FN(ATACS10), GPIO_FN(VI1_R4), GPIO_FN(RX5_B),
1483 GPIO_FN(HSCK1), GPIO_FN(SSI_SDATA8_B), GPIO_FN(RTS0_B_TANS_B),
1484 GPIO_FN(SSI_SDATA9), GPIO_FN(EX_CS4), GPIO_FN(SD1_DAT0),
1485 GPIO_FN(MMC0_D0), GPIO_FN(FD0), GPIO_FN(ATARD0), GPIO_FN(VI1_R5),
1486 GPIO_FN(SCK5_B), GPIO_FN(HTX1), GPIO_FN(TX2_E), GPIO_FN(TX0_B),
1487 GPIO_FN(SSI_SCK9), GPIO_FN(EX_CS5), GPIO_FN(SD1_DAT1),
1488 GPIO_FN(MMC0_D1), GPIO_FN(FD1), GPIO_FN(ATAWR0), GPIO_FN(VI1_R6),
1489 GPIO_FN(HRX1), GPIO_FN(RX2_E), GPIO_FN(RX0_B), GPIO_FN(SSI_WS9),
1490 GPIO_FN(MLB_CLK), GPIO_FN(PWM2), GPIO_FN(SCK4), GPIO_FN(MLB_SIG),
1491 GPIO_FN(PWM3), GPIO_FN(TX4), GPIO_FN(MLB_DAT), GPIO_FN(PWM4),
1492 GPIO_FN(RX4), GPIO_FN(HTX0), GPIO_FN(TX1), GPIO_FN(SDATA),
1493 GPIO_FN(CTS0_C), GPIO_FN(SUB_TCK), GPIO_FN(CC5_STATE2),
1494 GPIO_FN(CC5_STATE10), GPIO_FN(CC5_STATE18), GPIO_FN(CC5_STATE26),
1495 GPIO_FN(CC5_STATE34),
1496
1497 /* IPSR2 */
1498 GPIO_FN(HRX0), GPIO_FN(RX1), GPIO_FN(SCKZ), GPIO_FN(RTS0_C_TANS_C),
1499 GPIO_FN(SUB_TDI), GPIO_FN(CC5_STATE3), GPIO_FN(CC5_STATE11),
1500 GPIO_FN(CC5_STATE19), GPIO_FN(CC5_STATE27), GPIO_FN(CC5_STATE35),
1501 GPIO_FN(HSCK0), GPIO_FN(SCK1), GPIO_FN(MTS), GPIO_FN(PWM5),
1502 GPIO_FN(SCK0_C), GPIO_FN(SSI_SDATA9_B), GPIO_FN(SUB_TDO),
1503 GPIO_FN(CC5_STATE0), GPIO_FN(CC5_STATE8), GPIO_FN(CC5_STATE16),
1504 GPIO_FN(CC5_STATE24), GPIO_FN(CC5_STATE32), GPIO_FN(HCTS0),
1505 GPIO_FN(CTS1), GPIO_FN(STM), GPIO_FN(PWM0_D), GPIO_FN(RX0_C),
1506 GPIO_FN(SCIF_CLK_C), GPIO_FN(SUB_TRST), GPIO_FN(TCLK1_B),
1507 GPIO_FN(CC5_OSCOUT), GPIO_FN(HRTS0), GPIO_FN(RTS1_TANS),
1508 GPIO_FN(MDATA), GPIO_FN(TX0_C), GPIO_FN(SUB_TMS), GPIO_FN(CC5_STATE1),
1509 GPIO_FN(CC5_STATE9), GPIO_FN(CC5_STATE17), GPIO_FN(CC5_STATE25),
1510 GPIO_FN(CC5_STATE33), GPIO_FN(DU0_DR0), GPIO_FN(LCDOUT0),
1511 GPIO_FN(DREQ0), GPIO_FN(GPS_CLK_B), GPIO_FN(AUDATA0),
1512 GPIO_FN(TX5_C), GPIO_FN(DU0_DR1), GPIO_FN(LCDOUT1), GPIO_FN(DACK0),
1513 GPIO_FN(DRACK0), GPIO_FN(GPS_SIGN_B), GPIO_FN(AUDATA1), GPIO_FN(RX5_C),
1514 GPIO_FN(DU0_DR2), GPIO_FN(LCDOUT2), GPIO_FN(DU0_DR3), GPIO_FN(LCDOUT3),
1515 GPIO_FN(DU0_DR4), GPIO_FN(LCDOUT4), GPIO_FN(DU0_DR5), GPIO_FN(LCDOUT5),
1516 GPIO_FN(DU0_DR6), GPIO_FN(LCDOUT6), GPIO_FN(DU0_DR7), GPIO_FN(LCDOUT7),
1517 GPIO_FN(DU0_DG0), GPIO_FN(LCDOUT8), GPIO_FN(DREQ1), GPIO_FN(SCL2),
1518 GPIO_FN(AUDATA2),
1519
1520 /* IPSR3 */
1521 GPIO_FN(DU0_DG1), GPIO_FN(LCDOUT9), GPIO_FN(DACK1), GPIO_FN(SDA2),
1522 GPIO_FN(AUDATA3), GPIO_FN(DU0_DG2), GPIO_FN(LCDOUT10),
1523 GPIO_FN(DU0_DG3), GPIO_FN(LCDOUT11), GPIO_FN(DU0_DG4),
1524 GPIO_FN(LCDOUT12), GPIO_FN(DU0_DG5), GPIO_FN(LCDOUT13),
1525 GPIO_FN(DU0_DG6), GPIO_FN(LCDOUT14), GPIO_FN(DU0_DG7),
1526 GPIO_FN(LCDOUT15), GPIO_FN(DU0_DB0), GPIO_FN(LCDOUT16),
1527 GPIO_FN(EX_WAIT1), GPIO_FN(SCL1), GPIO_FN(TCLK1), GPIO_FN(AUDATA4),
1528 GPIO_FN(DU0_DB1), GPIO_FN(LCDOUT17), GPIO_FN(EX_WAIT2), GPIO_FN(SDA1),
1529 GPIO_FN(GPS_MAG_B), GPIO_FN(AUDATA5), GPIO_FN(SCK5_C),
1530 GPIO_FN(DU0_DB2), GPIO_FN(LCDOUT18), GPIO_FN(DU0_DB3),
1531 GPIO_FN(LCDOUT19), GPIO_FN(DU0_DB4), GPIO_FN(LCDOUT20),
1532 GPIO_FN(DU0_DB5), GPIO_FN(LCDOUT21), GPIO_FN(DU0_DB6),
1533 GPIO_FN(LCDOUT22), GPIO_FN(DU0_DB7), GPIO_FN(LCDOUT23),
1534 GPIO_FN(DU0_DOTCLKIN), GPIO_FN(QSTVA_QVS), GPIO_FN(TX3_D_IRDA_TX_D),
1535 GPIO_FN(SCL3_B), GPIO_FN(DU0_DOTCLKOUT0), GPIO_FN(QCLK),
1536 GPIO_FN(DU0_DOTCLKOUT1), GPIO_FN(QSTVB_QVE), GPIO_FN(RX3_D_IRDA_RX_D),
1537 GPIO_FN(SDA3_B), GPIO_FN(SDA2_C), GPIO_FN(DACK0_B), GPIO_FN(DRACK0_B),
1538 GPIO_FN(DU0_EXHSYNC_DU0_HSYNC), GPIO_FN(QSTH_QHS),
1539 GPIO_FN(DU0_EXVSYNC_DU0_VSYNC), GPIO_FN(QSTB_QHE),
1540 GPIO_FN(DU0_EXODDF_DU0_ODDF_DISP_CDE), GPIO_FN(QCPV_QDE),
1541 GPIO_FN(CAN1_TX), GPIO_FN(TX2_C), GPIO_FN(SCL2_C), GPIO_FN(REMOCON),
1542
1543 /* IPSR4 */
1544 GPIO_FN(DU0_DISP), GPIO_FN(QPOLA), GPIO_FN(CAN_CLK_C), GPIO_FN(SCK2_C),
1545 GPIO_FN(DU0_CDE), GPIO_FN(QPOLB), GPIO_FN(CAN1_RX), GPIO_FN(RX2_C),
1546 GPIO_FN(DREQ0_B), GPIO_FN(SSI_SCK78_B), GPIO_FN(SCK0_B),
1547 GPIO_FN(DU1_DR0), GPIO_FN(VI2_DATA0_VI2_B0), GPIO_FN(PWM6),
1548 GPIO_FN(SD3_CLK), GPIO_FN(TX3_E_IRDA_TX_E), GPIO_FN(AUDCK),
1549 GPIO_FN(PWMFSW0_B), GPIO_FN(DU1_DR1), GPIO_FN(VI2_DATA1_VI2_B1),
1550 GPIO_FN(PWM0), GPIO_FN(SD3_CMD), GPIO_FN(RX3_E_IRDA_RX_E),
1551 GPIO_FN(AUDSYNC), GPIO_FN(CTS0_D), GPIO_FN(DU1_DR2), GPIO_FN(VI2_G0),
1552 GPIO_FN(DU1_DR3), GPIO_FN(VI2_G1), GPIO_FN(DU1_DR4), GPIO_FN(VI2_G2),
1553 GPIO_FN(DU1_DR5), GPIO_FN(VI2_G3), GPIO_FN(DU1_DR6), GPIO_FN(VI2_G4),
1554 GPIO_FN(DU1_DR7), GPIO_FN(VI2_G5), GPIO_FN(DU1_DG0),
1555 GPIO_FN(VI2_DATA2_VI2_B2), GPIO_FN(SCL1_B), GPIO_FN(SD3_DAT2),
1556 GPIO_FN(SCK3_E), GPIO_FN(AUDATA6), GPIO_FN(TX0_D), GPIO_FN(DU1_DG1),
1557 GPIO_FN(VI2_DATA3_VI2_B3), GPIO_FN(SDA1_B), GPIO_FN(SD3_DAT3),
1558 GPIO_FN(SCK5), GPIO_FN(AUDATA7), GPIO_FN(RX0_D), GPIO_FN(DU1_DG2),
1559 GPIO_FN(VI2_G6), GPIO_FN(DU1_DG3), GPIO_FN(VI2_G7), GPIO_FN(DU1_DG4),
1560 GPIO_FN(VI2_R0), GPIO_FN(DU1_DG5), GPIO_FN(VI2_R1), GPIO_FN(DU1_DG6),
1561 GPIO_FN(VI2_R2), GPIO_FN(DU1_DG7), GPIO_FN(VI2_R3), GPIO_FN(DU1_DB0),
1562 GPIO_FN(VI2_DATA4_VI2_B4), GPIO_FN(SCL2_B), GPIO_FN(SD3_DAT0),
1563 GPIO_FN(TX5), GPIO_FN(SCK0_D),
1564
1565 /* IPSR5 */
1566 GPIO_FN(DU1_DB1), GPIO_FN(VI2_DATA5_VI2_B5), GPIO_FN(SDA2_B),
1567 GPIO_FN(SD3_DAT1), GPIO_FN(RX5), GPIO_FN(RTS0_D_TANS_D),
1568 GPIO_FN(DU1_DB2), GPIO_FN(VI2_R4), GPIO_FN(DU1_DB3), GPIO_FN(VI2_R5),
1569 GPIO_FN(DU1_DB4), GPIO_FN(VI2_R6), GPIO_FN(DU1_DB5), GPIO_FN(VI2_R7),
1570 GPIO_FN(DU1_DB6), GPIO_FN(SCL2_D), GPIO_FN(DU1_DB7), GPIO_FN(SDA2_D),
1571 GPIO_FN(DU1_DOTCLKIN), GPIO_FN(VI2_CLKENB), GPIO_FN(HSPI_CS1),
1572 GPIO_FN(SCL1_D), GPIO_FN(DU1_DOTCLKOUT), GPIO_FN(VI2_FIELD),
1573 GPIO_FN(SDA1_D), GPIO_FN(DU1_EXHSYNC_DU1_HSYNC), GPIO_FN(VI2_HSYNC),
1574 GPIO_FN(VI3_HSYNC), GPIO_FN(DU1_EXVSYNC_DU1_VSYNC), GPIO_FN(VI2_VSYNC),
1575 GPIO_FN(VI3_VSYNC), GPIO_FN(DU1_EXODDF_DU1_ODDF_DISP_CDE),
1576 GPIO_FN(VI2_CLK), GPIO_FN(TX3_B_IRDA_TX_B), GPIO_FN(SD3_CD),
1577 GPIO_FN(HSPI_TX1), GPIO_FN(VI1_CLKENB), GPIO_FN(VI3_CLKENB),
1578 GPIO_FN(AUDIO_CLKC), GPIO_FN(TX2_D), GPIO_FN(SPEEDIN),
1579 GPIO_FN(GPS_SIGN_D), GPIO_FN(DU1_DISP), GPIO_FN(VI2_DATA6_VI2_B6),
1580 GPIO_FN(TCLK0), GPIO_FN(QSTVA_B_QVS_B), GPIO_FN(HSPI_CLK1),
1581 GPIO_FN(SCK2_D), GPIO_FN(AUDIO_CLKOUT_B), GPIO_FN(GPS_MAG_D),
1582 GPIO_FN(DU1_CDE), GPIO_FN(VI2_DATA7_VI2_B7), GPIO_FN(RX3_B_IRDA_RX_B),
1583 GPIO_FN(SD3_WP), GPIO_FN(HSPI_RX1), GPIO_FN(VI1_FIELD),
1584 GPIO_FN(VI3_FIELD), GPIO_FN(AUDIO_CLKOUT), GPIO_FN(RX2_D),
1585 GPIO_FN(GPS_CLK_C), GPIO_FN(GPS_CLK_D), GPIO_FN(AUDIO_CLKA),
1586 GPIO_FN(CAN_TXCLK), GPIO_FN(AUDIO_CLKB), GPIO_FN(USB_OVC2),
1587 GPIO_FN(CAN_DEBUGOUT0), GPIO_FN(MOUT0),
1588
1589 /* IPSR6 */
1590 GPIO_FN(SSI_SCK0129), GPIO_FN(CAN_DEBUGOUT1), GPIO_FN(MOUT1),
1591 GPIO_FN(SSI_WS0129), GPIO_FN(CAN_DEBUGOUT2), GPIO_FN(MOUT2),
1592 GPIO_FN(SSI_SDATA0), GPIO_FN(CAN_DEBUGOUT3), GPIO_FN(MOUT5),
1593 GPIO_FN(SSI_SDATA1), GPIO_FN(CAN_DEBUGOUT4), GPIO_FN(MOUT6),
1594 GPIO_FN(SSI_SDATA2), GPIO_FN(CAN_DEBUGOUT5), GPIO_FN(SSI_SCK34),
1595 GPIO_FN(CAN_DEBUGOUT6), GPIO_FN(CAN0_TX_B), GPIO_FN(IERX),
1596 GPIO_FN(SSI_SCK9_C), GPIO_FN(SSI_WS34), GPIO_FN(CAN_DEBUGOUT7),
1597 GPIO_FN(CAN0_RX_B), GPIO_FN(IETX), GPIO_FN(SSI_WS9_C),
1598 GPIO_FN(SSI_SDATA3), GPIO_FN(PWM0_C), GPIO_FN(CAN_DEBUGOUT8),
1599 GPIO_FN(CAN_CLK_B), GPIO_FN(IECLK), GPIO_FN(SCIF_CLK_B),
1600 GPIO_FN(TCLK0_B), GPIO_FN(SSI_SDATA4), GPIO_FN(CAN_DEBUGOUT9),
1601 GPIO_FN(SSI_SDATA9_C), GPIO_FN(SSI_SCK5), GPIO_FN(ADICLK),
1602 GPIO_FN(CAN_DEBUGOUT10), GPIO_FN(SCK3), GPIO_FN(TCLK0_D),
1603 GPIO_FN(SSI_WS5), GPIO_FN(ADICS_SAMP), GPIO_FN(CAN_DEBUGOUT11),
1604 GPIO_FN(TX3_IRDA_TX), GPIO_FN(SSI_SDATA5), GPIO_FN(ADIDATA),
1605 GPIO_FN(CAN_DEBUGOUT12), GPIO_FN(RX3_IRDA_RX), GPIO_FN(SSI_SCK6),
1606 GPIO_FN(ADICHS0), GPIO_FN(CAN0_TX), GPIO_FN(IERX_B),
1607
1608 /* IPSR7 */
1609 GPIO_FN(SSI_WS6), GPIO_FN(ADICHS1), GPIO_FN(CAN0_RX), GPIO_FN(IETX_B),
1610 GPIO_FN(SSI_SDATA6), GPIO_FN(ADICHS2), GPIO_FN(CAN_CLK),
1611 GPIO_FN(IECLK_B), GPIO_FN(SSI_SCK78), GPIO_FN(CAN_DEBUGOUT13),
1612 GPIO_FN(IRQ0_B), GPIO_FN(SSI_SCK9_B), GPIO_FN(HSPI_CLK1_C),
1613 GPIO_FN(SSI_WS78), GPIO_FN(CAN_DEBUGOUT14), GPIO_FN(IRQ1_B),
1614 GPIO_FN(SSI_WS9_B), GPIO_FN(HSPI_CS1_C), GPIO_FN(SSI_SDATA7),
1615 GPIO_FN(CAN_DEBUGOUT15), GPIO_FN(IRQ2_B), GPIO_FN(TCLK1_C),
1616 GPIO_FN(HSPI_TX1_C), GPIO_FN(SSI_SDATA8), GPIO_FN(VSP),
1617 GPIO_FN(IRQ3_B), GPIO_FN(HSPI_RX1_C), GPIO_FN(SD0_CLK),
1618 GPIO_FN(ATACS01), GPIO_FN(SCK1_B), GPIO_FN(SD0_CMD), GPIO_FN(ATACS11),
1619 GPIO_FN(TX1_B), GPIO_FN(CC5_TDO), GPIO_FN(SD0_DAT0), GPIO_FN(ATADIR1),
1620 GPIO_FN(RX1_B), GPIO_FN(CC5_TRST), GPIO_FN(SD0_DAT1), GPIO_FN(ATAG1),
1621 GPIO_FN(SCK2_B), GPIO_FN(CC5_TMS), GPIO_FN(SD0_DAT2), GPIO_FN(ATARD1),
1622 GPIO_FN(TX2_B), GPIO_FN(CC5_TCK), GPIO_FN(SD0_DAT3), GPIO_FN(ATAWR1),
1623 GPIO_FN(RX2_B), GPIO_FN(CC5_TDI), GPIO_FN(SD0_CD), GPIO_FN(DREQ2),
1624 GPIO_FN(RTS1_B_TANS_B), GPIO_FN(SD0_WP), GPIO_FN(DACK2),
1625 GPIO_FN(CTS1_B),
1626
1627 /* IPSR8 */
1628 GPIO_FN(HSPI_CLK0), GPIO_FN(CTS0), GPIO_FN(USB_OVC0), GPIO_FN(AD_CLK),
1629 GPIO_FN(CC5_STATE4), GPIO_FN(CC5_STATE12), GPIO_FN(CC5_STATE20),
1630 GPIO_FN(CC5_STATE28), GPIO_FN(CC5_STATE36), GPIO_FN(HSPI_CS0),
1631 GPIO_FN(RTS0_TANS), GPIO_FN(USB_OVC1), GPIO_FN(AD_DI),
1632 GPIO_FN(CC5_STATE5), GPIO_FN(CC5_STATE13), GPIO_FN(CC5_STATE21),
1633 GPIO_FN(CC5_STATE29), GPIO_FN(CC5_STATE37), GPIO_FN(HSPI_TX0),
1634 GPIO_FN(TX0), GPIO_FN(CAN_DEBUG_HW_TRIGGER), GPIO_FN(AD_DO),
1635 GPIO_FN(CC5_STATE6), GPIO_FN(CC5_STATE14), GPIO_FN(CC5_STATE22),
1636 GPIO_FN(CC5_STATE30), GPIO_FN(CC5_STATE38), GPIO_FN(HSPI_RX0),
1637 GPIO_FN(RX0), GPIO_FN(CAN_STEP0), GPIO_FN(AD_NCS), GPIO_FN(CC5_STATE7),
1638 GPIO_FN(CC5_STATE15), GPIO_FN(CC5_STATE23), GPIO_FN(CC5_STATE31),
1639 GPIO_FN(CC5_STATE39), GPIO_FN(FMCLK), GPIO_FN(RDS_CLK), GPIO_FN(PCMOE),
1640 GPIO_FN(BPFCLK), GPIO_FN(PCMWE), GPIO_FN(FMIN), GPIO_FN(RDS_DATA),
1641 GPIO_FN(VI0_CLK), GPIO_FN(MMC1_CLK), GPIO_FN(VI0_CLKENB),
1642 GPIO_FN(TX1_C), GPIO_FN(HTX1_B), GPIO_FN(MT1_SYNC),
1643 GPIO_FN(VI0_FIELD), GPIO_FN(RX1_C), GPIO_FN(HRX1_B),
1644 GPIO_FN(VI0_HSYNC), GPIO_FN(VI0_DATA0_B_VI0_B0_B), GPIO_FN(CTS1_C),
1645 GPIO_FN(TX4_D), GPIO_FN(MMC1_CMD), GPIO_FN(HSCK1_B),
1646 GPIO_FN(VI0_VSYNC), GPIO_FN(VI0_DATA1_B_VI0_B1_B),
1647 GPIO_FN(RTS1_C_TANS_C), GPIO_FN(RX4_D), GPIO_FN(PWMFSW0_C),
1648
1649 /* IPSR9 */
1650 GPIO_FN(VI0_DATA0_VI0_B0), GPIO_FN(HRTS1_B), GPIO_FN(MT1_VCXO),
1651 GPIO_FN(VI0_DATA1_VI0_B1), GPIO_FN(HCTS1_B), GPIO_FN(MT1_PWM),
1652 GPIO_FN(VI0_DATA2_VI0_B2), GPIO_FN(MMC1_D0), GPIO_FN(VI0_DATA3_VI0_B3),
1653 GPIO_FN(MMC1_D1), GPIO_FN(VI0_DATA4_VI0_B4), GPIO_FN(MMC1_D2),
1654 GPIO_FN(VI0_DATA5_VI0_B5), GPIO_FN(MMC1_D3), GPIO_FN(VI0_DATA6_VI0_B6),
1655 GPIO_FN(MMC1_D4), GPIO_FN(ARM_TRACEDATA_0), GPIO_FN(VI0_DATA7_VI0_B7),
1656 GPIO_FN(MMC1_D5), GPIO_FN(ARM_TRACEDATA_1), GPIO_FN(VI0_G0),
1657 GPIO_FN(SSI_SCK78_C), GPIO_FN(IRQ0), GPIO_FN(ARM_TRACEDATA_2),
1658 GPIO_FN(VI0_G1), GPIO_FN(SSI_WS78_C), GPIO_FN(IRQ1),
1659 GPIO_FN(ARM_TRACEDATA_3), GPIO_FN(VI0_G2), GPIO_FN(ETH_TXD1),
1660 GPIO_FN(MMC1_D6), GPIO_FN(ARM_TRACEDATA_4), GPIO_FN(TS_SPSYNC0),
1661 GPIO_FN(VI0_G3), GPIO_FN(ETH_CRS_DV), GPIO_FN(MMC1_D7),
1662 GPIO_FN(ARM_TRACEDATA_5), GPIO_FN(TS_SDAT0), GPIO_FN(VI0_G4),
1663 GPIO_FN(ETH_TX_EN), GPIO_FN(SD2_DAT0_B), GPIO_FN(ARM_TRACEDATA_6),
1664 GPIO_FN(VI0_G5), GPIO_FN(ETH_RX_ER), GPIO_FN(SD2_DAT1_B),
1665 GPIO_FN(ARM_TRACEDATA_7), GPIO_FN(VI0_G6), GPIO_FN(ETH_RXD0),
1666 GPIO_FN(SD2_DAT2_B), GPIO_FN(ARM_TRACEDATA_8), GPIO_FN(VI0_G7),
1667 GPIO_FN(ETH_RXD1), GPIO_FN(SD2_DAT3_B), GPIO_FN(ARM_TRACEDATA_9),
1668
1669 /* IPSR10 */
1670 GPIO_FN(VI0_R0), GPIO_FN(SSI_SDATA7_C), GPIO_FN(SCK1_C),
1671 GPIO_FN(DREQ1_B), GPIO_FN(ARM_TRACEDATA_10), GPIO_FN(DREQ0_C),
1672 GPIO_FN(VI0_R1), GPIO_FN(SSI_SDATA8_C), GPIO_FN(DACK1_B),
1673 GPIO_FN(ARM_TRACEDATA_11), GPIO_FN(DACK0_C), GPIO_FN(DRACK0_C),
1674 GPIO_FN(VI0_R2), GPIO_FN(ETH_LINK), GPIO_FN(SD2_CLK_B), GPIO_FN(IRQ2),
1675 GPIO_FN(ARM_TRACEDATA_12), GPIO_FN(VI0_R3), GPIO_FN(ETH_MAGIC),
1676 GPIO_FN(SD2_CMD_B), GPIO_FN(IRQ3), GPIO_FN(ARM_TRACEDATA_13),
1677 GPIO_FN(VI0_R4), GPIO_FN(ETH_REFCLK), GPIO_FN(SD2_CD_B),
1678 GPIO_FN(HSPI_CLK1_B), GPIO_FN(ARM_TRACEDATA_14), GPIO_FN(MT1_CLK),
1679 GPIO_FN(TS_SCK0), GPIO_FN(VI0_R5), GPIO_FN(ETH_TXD0),
1680 GPIO_FN(SD2_WP_B), GPIO_FN(HSPI_CS1_B), GPIO_FN(ARM_TRACEDATA_15),
1681 GPIO_FN(MT1_D), GPIO_FN(TS_SDEN0), GPIO_FN(VI0_R6), GPIO_FN(ETH_MDC),
1682 GPIO_FN(DREQ2_C), GPIO_FN(HSPI_TX1_B), GPIO_FN(TRACECLK),
1683 GPIO_FN(MT1_BEN), GPIO_FN(PWMFSW0_D), GPIO_FN(VI0_R7),
1684 GPIO_FN(ETH_MDIO), GPIO_FN(DACK2_C), GPIO_FN(HSPI_RX1_B),
1685 GPIO_FN(SCIF_CLK_D), GPIO_FN(TRACECTL), GPIO_FN(MT1_PEN),
1686 GPIO_FN(VI1_CLK), GPIO_FN(SIM_D), GPIO_FN(SDA3), GPIO_FN(VI1_HSYNC),
1687 GPIO_FN(VI3_CLK), GPIO_FN(SSI_SCK4), GPIO_FN(GPS_SIGN_C),
1688 GPIO_FN(PWMFSW0_E), GPIO_FN(VI1_VSYNC), GPIO_FN(AUDIO_CLKOUT_C),
1689 GPIO_FN(SSI_WS4), GPIO_FN(SIM_CLK), GPIO_FN(GPS_MAG_C),
1690 GPIO_FN(SPV_TRST), GPIO_FN(SCL3),
1691
1692 /* IPSR11 */
1693 GPIO_FN(VI1_DATA0_VI1_B0), GPIO_FN(SD2_DAT0), GPIO_FN(SIM_RST),
1694 GPIO_FN(SPV_TCK), GPIO_FN(ADICLK_B), GPIO_FN(VI1_DATA1_VI1_B1),
1695 GPIO_FN(SD2_DAT1), GPIO_FN(MT0_CLK), GPIO_FN(SPV_TMS),
1696 GPIO_FN(ADICS_B_SAMP_B), GPIO_FN(VI1_DATA2_VI1_B2), GPIO_FN(SD2_DAT2),
1697 GPIO_FN(MT0_D), GPIO_FN(SPVTDI), GPIO_FN(ADIDATA_B),
1698 GPIO_FN(VI1_DATA3_VI1_B3), GPIO_FN(SD2_DAT3), GPIO_FN(MT0_BEN),
1699 GPIO_FN(SPV_TDO), GPIO_FN(ADICHS0_B), GPIO_FN(VI1_DATA4_VI1_B4),
1700 GPIO_FN(SD2_CLK), GPIO_FN(MT0_PEN), GPIO_FN(SPA_TRST),
1701 GPIO_FN(HSPI_CLK1_D), GPIO_FN(ADICHS1_B), GPIO_FN(VI1_DATA5_VI1_B5),
1702 GPIO_FN(SD2_CMD), GPIO_FN(MT0_SYNC), GPIO_FN(SPA_TCK),
1703 GPIO_FN(HSPI_CS1_D), GPIO_FN(ADICHS2_B), GPIO_FN(VI1_DATA6_VI1_B6),
1704 GPIO_FN(SD2_CD), GPIO_FN(MT0_VCXO), GPIO_FN(SPA_TMS),
1705 GPIO_FN(HSPI_TX1_D), GPIO_FN(VI1_DATA7_VI1_B7), GPIO_FN(SD2_WP),
1706 GPIO_FN(MT0_PWM), GPIO_FN(SPA_TDI), GPIO_FN(HSPI_RX1_D),
1707 GPIO_FN(VI1_G0), GPIO_FN(VI3_DATA0), GPIO_FN(DU1_DOTCLKOUT1),
1708 GPIO_FN(TS_SCK1), GPIO_FN(DREQ2_B), GPIO_FN(TX2), GPIO_FN(SPA_TDO),
1709 GPIO_FN(HCTS0_B), GPIO_FN(VI1_G1), GPIO_FN(VI3_DATA1),
1710 GPIO_FN(SSI_SCK1), GPIO_FN(TS_SDEN1), GPIO_FN(DACK2_B), GPIO_FN(RX2),
1711 GPIO_FN(HRTS0_B),
1712
1713 /* IPSR12 */
1714 GPIO_FN(VI1_G2), GPIO_FN(VI3_DATA2), GPIO_FN(SSI_WS1),
1715 GPIO_FN(TS_SPSYNC1), GPIO_FN(SCK2), GPIO_FN(HSCK0_B), GPIO_FN(VI1_G3),
1716 GPIO_FN(VI3_DATA3), GPIO_FN(SSI_SCK2), GPIO_FN(TS_SDAT1),
1717 GPIO_FN(SCL1_C), GPIO_FN(HTX0_B), GPIO_FN(VI1_G4), GPIO_FN(VI3_DATA4),
1718 GPIO_FN(SSI_WS2), GPIO_FN(SDA1_C), GPIO_FN(SIM_RST_B),
1719 GPIO_FN(HRX0_B), GPIO_FN(VI1_G5), GPIO_FN(VI3_DATA5),
1720 GPIO_FN(GPS_CLK), GPIO_FN(FSE), GPIO_FN(TX4_B), GPIO_FN(SIM_D_B),
1721 GPIO_FN(VI1_G6), GPIO_FN(VI3_DATA6), GPIO_FN(GPS_SIGN), GPIO_FN(FRB),
1722 GPIO_FN(RX4_B), GPIO_FN(SIM_CLK_B), GPIO_FN(VI1_G7),
1723 GPIO_FN(VI3_DATA7), GPIO_FN(GPS_MAG), GPIO_FN(FCE), GPIO_FN(SCK4_B),
1724};
1725
1726static struct pinmux_cfg_reg pinmux_config_regs[] = {
1727 { PINMUX_CFG_REG("GPSR0", 0xfffc0004, 32, 1) {
1728 GP_0_31_FN, FN_IP3_31_29,
1729 GP_0_30_FN, FN_IP3_26_24,
1730 GP_0_29_FN, FN_IP3_22_21,
1731 GP_0_28_FN, FN_IP3_14_12,
1732 GP_0_27_FN, FN_IP3_11_9,
1733 GP_0_26_FN, FN_IP3_2_0,
1734 GP_0_25_FN, FN_IP2_30_28,
1735 GP_0_24_FN, FN_IP2_21_19,
1736 GP_0_23_FN, FN_IP2_18_16,
1737 GP_0_22_FN, FN_IP0_30_28,
1738 GP_0_21_FN, FN_IP0_5_3,
1739 GP_0_20_FN, FN_IP1_18_15,
1740 GP_0_19_FN, FN_IP1_14_11,
1741 GP_0_18_FN, FN_IP1_10_7,
1742 GP_0_17_FN, FN_IP1_6_4,
1743 GP_0_16_FN, FN_IP1_3_2,
1744 GP_0_15_FN, FN_IP1_1_0,
1745 GP_0_14_FN, FN_IP0_27_26,
1746 GP_0_13_FN, FN_IP0_25,
1747 GP_0_12_FN, FN_IP0_24_23,
1748 GP_0_11_FN, FN_IP0_22_19,
1749 GP_0_10_FN, FN_IP0_18_16,
1750 GP_0_9_FN, FN_IP0_15_14,
1751 GP_0_8_FN, FN_IP0_13_12,
1752 GP_0_7_FN, FN_IP0_11_10,
1753 GP_0_6_FN, FN_IP0_9_8,
1754 GP_0_5_FN, FN_A19,
1755 GP_0_4_FN, FN_A18,
1756 GP_0_3_FN, FN_A17,
1757 GP_0_2_FN, FN_IP0_7_6,
1758 GP_0_1_FN, FN_AVS2,
1759 GP_0_0_FN, FN_AVS1 }
1760 },
1761 { PINMUX_CFG_REG("GPSR1", 0xfffc0008, 32, 1) {
1762 GP_1_31_FN, FN_IP5_23_21,
1763 GP_1_30_FN, FN_IP5_20_17,
1764 GP_1_29_FN, FN_IP5_16_15,
1765 GP_1_28_FN, FN_IP5_14_13,
1766 GP_1_27_FN, FN_IP5_12_11,
1767 GP_1_26_FN, FN_IP5_10_9,
1768 GP_1_25_FN, FN_IP5_8,
1769 GP_1_24_FN, FN_IP5_7,
1770 GP_1_23_FN, FN_IP5_6,
1771 GP_1_22_FN, FN_IP5_5,
1772 GP_1_21_FN, FN_IP5_4,
1773 GP_1_20_FN, FN_IP5_3,
1774 GP_1_19_FN, FN_IP5_2_0,
1775 GP_1_18_FN, FN_IP4_31_29,
1776 GP_1_17_FN, FN_IP4_28,
1777 GP_1_16_FN, FN_IP4_27,
1778 GP_1_15_FN, FN_IP4_26,
1779 GP_1_14_FN, FN_IP4_25,
1780 GP_1_13_FN, FN_IP4_24,
1781 GP_1_12_FN, FN_IP4_23,
1782 GP_1_11_FN, FN_IP4_22_20,
1783 GP_1_10_FN, FN_IP4_19_17,
1784 GP_1_9_FN, FN_IP4_16,
1785 GP_1_8_FN, FN_IP4_15,
1786 GP_1_7_FN, FN_IP4_14,
1787 GP_1_6_FN, FN_IP4_13,
1788 GP_1_5_FN, FN_IP4_12,
1789 GP_1_4_FN, FN_IP4_11,
1790 GP_1_3_FN, FN_IP4_10_8,
1791 GP_1_2_FN, FN_IP4_7_5,
1792 GP_1_1_FN, FN_IP4_4_2,
1793 GP_1_0_FN, FN_IP4_1_0 }
1794 },
1795 { PINMUX_CFG_REG("GPSR2", 0xfffc000c, 32, 1) {
1796 GP_2_31_FN, FN_IP10_28_26,
1797 GP_2_30_FN, FN_IP10_25_24,
1798 GP_2_29_FN, FN_IP10_23_21,
1799 GP_2_28_FN, FN_IP10_20_18,
1800 GP_2_27_FN, FN_IP10_17_15,
1801 GP_2_26_FN, FN_IP10_14_12,
1802 GP_2_25_FN, FN_IP10_11_9,
1803 GP_2_24_FN, FN_IP10_8_6,
1804 GP_2_23_FN, FN_IP10_5_3,
1805 GP_2_22_FN, FN_IP10_2_0,
1806 GP_2_21_FN, FN_IP9_29_28,
1807 GP_2_20_FN, FN_IP9_27_26,
1808 GP_2_19_FN, FN_IP9_25_24,
1809 GP_2_18_FN, FN_IP9_23_22,
1810 GP_2_17_FN, FN_IP9_21_19,
1811 GP_2_16_FN, FN_IP9_18_16,
1812 GP_2_15_FN, FN_IP9_15_14,
1813 GP_2_14_FN, FN_IP9_13_12,
1814 GP_2_13_FN, FN_IP9_11_10,
1815 GP_2_12_FN, FN_IP9_9_8,
1816 GP_2_11_FN, FN_IP9_7,
1817 GP_2_10_FN, FN_IP9_6,
1818 GP_2_9_FN, FN_IP9_5,
1819 GP_2_8_FN, FN_IP9_4,
1820 GP_2_7_FN, FN_IP9_3_2,
1821 GP_2_6_FN, FN_IP9_1_0,
1822 GP_2_5_FN, FN_IP8_30_28,
1823 GP_2_4_FN, FN_IP8_27_25,
1824 GP_2_3_FN, FN_IP8_24_23,
1825 GP_2_2_FN, FN_IP8_22_21,
1826 GP_2_1_FN, FN_IP8_20,
1827 GP_2_0_FN, FN_IP5_27_24 }
1828 },
1829 { PINMUX_CFG_REG("GPSR3", 0xfffc0010, 32, 1) {
1830 GP_3_31_FN, FN_IP6_3_2,
1831 GP_3_30_FN, FN_IP6_1_0,
1832 GP_3_29_FN, FN_IP5_30_29,
1833 GP_3_28_FN, FN_IP5_28,
1834 GP_3_27_FN, FN_IP1_24_23,
1835 GP_3_26_FN, FN_IP1_22_21,
1836 GP_3_25_FN, FN_IP1_20_19,
1837 GP_3_24_FN, FN_IP7_26_25,
1838 GP_3_23_FN, FN_IP7_24_23,
1839 GP_3_22_FN, FN_IP7_22_21,
1840 GP_3_21_FN, FN_IP7_20_19,
1841 GP_3_20_FN, FN_IP7_30_29,
1842 GP_3_19_FN, FN_IP7_28_27,
1843 GP_3_18_FN, FN_IP7_18_17,
1844 GP_3_17_FN, FN_IP7_16_15,
1845 GP_3_16_FN, FN_IP12_17_15,
1846 GP_3_15_FN, FN_IP12_14_12,
1847 GP_3_14_FN, FN_IP12_11_9,
1848 GP_3_13_FN, FN_IP12_8_6,
1849 GP_3_12_FN, FN_IP12_5_3,
1850 GP_3_11_FN, FN_IP12_2_0,
1851 GP_3_10_FN, FN_IP11_29_27,
1852 GP_3_9_FN, FN_IP11_26_24,
1853 GP_3_8_FN, FN_IP11_23_21,
1854 GP_3_7_FN, FN_IP11_20_18,
1855 GP_3_6_FN, FN_IP11_17_15,
1856 GP_3_5_FN, FN_IP11_14_12,
1857 GP_3_4_FN, FN_IP11_11_9,
1858 GP_3_3_FN, FN_IP11_8_6,
1859 GP_3_2_FN, FN_IP11_5_3,
1860 GP_3_1_FN, FN_IP11_2_0,
1861 GP_3_0_FN, FN_IP10_31_29 }
1862 },
1863 { PINMUX_CFG_REG("GPSR4", 0xfffc0014, 32, 1) {
1864 GP_4_31_FN, FN_IP8_19,
1865 GP_4_30_FN, FN_IP8_18,
1866 GP_4_29_FN, FN_IP8_17_16,
1867 GP_4_28_FN, FN_IP0_2_0,
1868 GP_4_27_FN, FN_USB_PENC1,
1869 GP_4_26_FN, FN_USB_PENC0,
1870 GP_4_25_FN, FN_IP8_15_12,
1871 GP_4_24_FN, FN_IP8_11_8,
1872 GP_4_23_FN, FN_IP8_7_4,
1873 GP_4_22_FN, FN_IP8_3_0,
1874 GP_4_21_FN, FN_IP2_3_0,
1875 GP_4_20_FN, FN_IP1_28_25,
1876 GP_4_19_FN, FN_IP2_15_12,
1877 GP_4_18_FN, FN_IP2_11_8,
1878 GP_4_17_FN, FN_IP2_7_4,
1879 GP_4_16_FN, FN_IP7_14_13,
1880 GP_4_15_FN, FN_IP7_12_10,
1881 GP_4_14_FN, FN_IP7_9_7,
1882 GP_4_13_FN, FN_IP7_6_4,
1883 GP_4_12_FN, FN_IP7_3_2,
1884 GP_4_11_FN, FN_IP7_1_0,
1885 GP_4_10_FN, FN_IP6_30_29,
1886 GP_4_9_FN, FN_IP6_26_25,
1887 GP_4_8_FN, FN_IP6_24_23,
1888 GP_4_7_FN, FN_IP6_22_20,
1889 GP_4_6_FN, FN_IP6_19_18,
1890 GP_4_5_FN, FN_IP6_17_15,
1891 GP_4_4_FN, FN_IP6_14_12,
1892 GP_4_3_FN, FN_IP6_11_9,
1893 GP_4_2_FN, FN_IP6_8,
1894 GP_4_1_FN, FN_IP6_7_6,
1895 GP_4_0_FN, FN_IP6_5_4 }
1896 },
1897 { PINMUX_CFG_REG("GPSR5", 0xfffc0018, 32, 1) {
1898 GP_5_31_FN, FN_IP3_5,
1899 GP_5_30_FN, FN_IP3_4,
1900 GP_5_29_FN, FN_IP3_3,
1901 GP_5_28_FN, FN_IP2_27,
1902 GP_5_27_FN, FN_IP2_26,
1903 GP_5_26_FN, FN_IP2_25,
1904 GP_5_25_FN, FN_IP2_24,
1905 GP_5_24_FN, FN_IP2_23,
1906 GP_5_23_FN, FN_IP2_22,
1907 GP_5_22_FN, FN_IP3_28,
1908 GP_5_21_FN, FN_IP3_27,
1909 GP_5_20_FN, FN_IP3_23,
1910 GP_5_19_FN, FN_EX_WAIT0,
1911 GP_5_18_FN, FN_WE1,
1912 GP_5_17_FN, FN_WE0,
1913 GP_5_16_FN, FN_RD,
1914 GP_5_15_FN, FN_A16,
1915 GP_5_14_FN, FN_A15,
1916 GP_5_13_FN, FN_A14,
1917 GP_5_12_FN, FN_A13,
1918 GP_5_11_FN, FN_A12,
1919 GP_5_10_FN, FN_A11,
1920 GP_5_9_FN, FN_A10,
1921 GP_5_8_FN, FN_A9,
1922 GP_5_7_FN, FN_A8,
1923 GP_5_6_FN, FN_A7,
1924 GP_5_5_FN, FN_A6,
1925 GP_5_4_FN, FN_A5,
1926 GP_5_3_FN, FN_A4,
1927 GP_5_2_FN, FN_A3,
1928 GP_5_1_FN, FN_A2,
1929 GP_5_0_FN, FN_A1 }
1930 },
1931 { PINMUX_CFG_REG("GPSR6", 0xfffc001c, 32, 1) {
1932 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1933 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1934 0, 0, 0, 0, 0, 0, 0, 0,
1935 0, 0,
1936 0, 0,
1937 0, 0,
1938 GP_6_8_FN, FN_IP3_20,
1939 GP_6_7_FN, FN_IP3_19,
1940 GP_6_6_FN, FN_IP3_18,
1941 GP_6_5_FN, FN_IP3_17,
1942 GP_6_4_FN, FN_IP3_16,
1943 GP_6_3_FN, FN_IP3_15,
1944 GP_6_2_FN, FN_IP3_8,
1945 GP_6_1_FN, FN_IP3_7,
1946 GP_6_0_FN, FN_IP3_6 }
1947 },
1948
1949 { PINMUX_CFG_REG_VAR("IPSR0", 0xfffc0020, 32,
1950 1, 3, 2, 1, 2, 4, 3, 2, 2, 2, 2, 2, 3, 3) {
1951 /* IP0_31 [1] */
1952 0, 0,
1953 /* IP0_30_28 [3] */
1954 FN_RD_WR, FN_FWE, FN_ATAG0, FN_VI1_R7,
1955 FN_HRTS1, FN_RX4_C, 0, 0,
1956 /* IP0_27_26 [2] */
1957 FN_CS1_A26, FN_HSPI_TX2, FN_SDSELF_B, 0,
1958 /* IP0_25 [1] */
1959 FN_CS0, FN_HSPI_CS2_B,
1960 /* IP0_24_23 [2] */
1961 FN_CLKOUT, FN_TX3C_IRDA_TX_C, FN_PWM0_B, 0,
1962 /* IP0_22_19 [4] */
1963 FN_A25, FN_SD1_WP, FN_MMC0_D5, FN_FD5,
1964 FN_HSPI_RX2, FN_VI1_R3, FN_TX5_B, FN_SSI_SDATA7_B,
1965 FN_CTS0_B, 0, 0, 0,
1966 0, 0, 0, 0,
1967 /* IP0_18_16 [3] */
1968 FN_A24, FN_SD1_CD, FN_MMC0_D4, FN_FD4,
1969 FN_HSPI_CS2, FN_VI1_R2, FN_SSI_WS78_B, 0,
1970 /* IP0_15_14 [2] */
1971 FN_A23, FN_FCLE, FN_HSPI_CLK2, FN_VI1_R1,
1972 /* IP0_13_12 [2] */
1973 FN_A22, FN_RX5_D, FN_HSPI_RX2_B, FN_VI1_R0,
1974 /* IP0_11_10 [2] */
1975 FN_A21, FN_SCK5_D, FN_HSPI_CLK2_B, 0,
1976 /* IP0_9_8 [2] */
1977 FN_A20, FN_TX5_D, FN_HSPI_TX2_B, 0,
1978 /* IP0_7_6 [2] */
1979 FN_A0, FN_SD1_DAT3, FN_MMC0_D3, FN_FD3,
1980 /* IP0_5_3 [3] */
1981 FN_BS, FN_SD1_DAT2, FN_MMC0_D2, FN_FD2,
1982 FN_ATADIR0, FN_SDSELF, FN_HCTS1, FN_TX4_C,
1983 /* IP0_2_0 [3] */
1984 FN_USB_PENC2, FN_SCK0, FN_PWM1, FN_PWMFSW0,
1985 FN_SCIF_CLK, FN_TCLK0_C, 0, 0 }
1986 },
1987 { PINMUX_CFG_REG_VAR("IPSR1", 0xfffc0024, 32,
1988 3, 4, 2, 2, 2, 4, 4, 4, 3, 2, 2) {
1989 /* IP1_31_29 [3] */
1990 0, 0, 0, 0, 0, 0, 0, 0,
1991 /* IP1_28_25 [4] */
1992 FN_HTX0, FN_TX1, FN_SDATA, FN_CTS0_C,
1993 FN_SUB_TCK, FN_CC5_STATE2, FN_CC5_STATE10, FN_CC5_STATE18,
1994 FN_CC5_STATE26, FN_CC5_STATE34, 0, 0,
1995 0, 0, 0, 0,
1996 /* IP1_24_23 [2] */
1997 FN_MLB_DAT, FN_PWM4, FN_RX4, 0,
1998 /* IP1_22_21 [2] */
1999 FN_MLB_SIG, FN_PWM3, FN_TX4, 0,
2000 /* IP1_20_19 [2] */
2001 FN_MLB_CLK, FN_PWM2, FN_SCK4, 0,
2002 /* IP1_18_15 [4] */
2003 FN_EX_CS5, FN_SD1_DAT1, FN_MMC0_D1, FN_FD1,
2004 FN_ATAWR0, FN_VI1_R6, FN_HRX1, FN_RX2_E,
2005 FN_RX0_B, FN_SSI_WS9, 0, 0,
2006 0, 0, 0, 0,
2007 /* IP1_14_11 [4] */
2008 FN_EX_CS4, FN_SD1_DAT0, FN_MMC0_D0, FN_FD0,
2009 FN_ATARD0, FN_VI1_R5, FN_SCK5_B, FN_HTX1,
2010 FN_TX2_E, FN_TX0_B, FN_SSI_SCK9, 0,
2011 0, 0, 0, 0,
2012 /* IP1_10_7 [4] */
2013 FN_EX_CS3, FN_SD1_CMD, FN_MMC0_CMD, FN_FRE,
2014 FN_ATACS10, FN_VI1_R4, FN_RX5_B, FN_HSCK1,
2015 FN_SSI_SDATA8_B, FN_RTS0_B_TANS_B, FN_SSI_SDATA9, 0,
2016 0, 0, 0, 0,
2017 /* IP1_6_4 [3] */
2018 FN_EX_CS2, FN_SD1_CLK, FN_MMC0_CLK, FN_FALE,
2019 FN_ATACS00, 0, 0, 0,
2020 /* IP1_3_2 [2] */
2021 FN_EX_CS1, FN_MMC0_D7, FN_FD7, 0,
2022 /* IP1_1_0 [2] */
2023 FN_EX_CS0, FN_RX3_C_IRDA_RX_C, FN_MMC0_D6, FN_FD6 }
2024 },
2025 { PINMUX_CFG_REG_VAR("IPSR2", 0xfffc0028, 32,
2026 1, 3, 1, 1, 1, 1, 1, 1, 3, 3, 4, 4, 4, 4) {
2027 /* IP2_31 [1] */
2028 0, 0,
2029 /* IP2_30_28 [3] */
2030 FN_DU0_DG0, FN_LCDOUT8, FN_DREQ1, FN_SCL2,
2031 FN_AUDATA2, 0, 0, 0,
2032 /* IP2_27 [1] */
2033 FN_DU0_DR7, FN_LCDOUT7,
2034 /* IP2_26 [1] */
2035 FN_DU0_DR6, FN_LCDOUT6,
2036 /* IP2_25 [1] */
2037 FN_DU0_DR5, FN_LCDOUT5,
2038 /* IP2_24 [1] */
2039 FN_DU0_DR4, FN_LCDOUT4,
2040 /* IP2_23 [1] */
2041 FN_DU0_DR3, FN_LCDOUT3,
2042 /* IP2_22 [1] */
2043 FN_DU0_DR2, FN_LCDOUT2,
2044 /* IP2_21_19 [3] */
2045 FN_DU0_DR1, FN_LCDOUT1, FN_DACK0, FN_DRACK0,
2046 FN_GPS_SIGN_B, FN_AUDATA1, FN_RX5_C, 0,
2047 /* IP2_18_16 [3] */
2048 FN_DU0_DR0, FN_LCDOUT0, FN_DREQ0, FN_GPS_CLK_B,
2049 FN_AUDATA0, FN_TX5_C, 0, 0,
2050 /* IP2_15_12 [4] */
2051 FN_HRTS0, FN_RTS1_TANS, FN_MDATA, FN_TX0_C,
2052 FN_SUB_TMS, FN_CC5_STATE1, FN_CC5_STATE9, FN_CC5_STATE17,
2053 FN_CC5_STATE25, FN_CC5_STATE33, 0, 0,
2054 0, 0, 0, 0,
2055 /* IP2_11_8 [4] */
2056 FN_HCTS0, FN_CTS1, FN_STM, FN_PWM0_D,
2057 FN_RX0_C, FN_SCIF_CLK_C, FN_SUB_TRST, FN_TCLK1_B,
2058 FN_CC5_OSCOUT, 0, 0, 0,
2059 0, 0, 0, 0,
2060 /* IP2_7_4 [4] */
2061 FN_HSCK0, FN_SCK1, FN_MTS, FN_PWM5,
2062 FN_SCK0_C, FN_SSI_SDATA9_B, FN_SUB_TDO, FN_CC5_STATE0,
2063 FN_CC5_STATE8, FN_CC5_STATE16, FN_CC5_STATE24, FN_CC5_STATE32,
2064 0, 0, 0, 0,
2065 /* IP2_3_0 [4] */
2066 FN_HRX0, FN_RX1, FN_SCKZ, FN_RTS0_C_TANS_C,
2067 FN_SUB_TDI, FN_CC5_STATE3, FN_CC5_STATE11, FN_CC5_STATE19,
2068 FN_CC5_STATE27, FN_CC5_STATE35, 0, 0,
2069 0, 0, 0, 0 }
2070 },
2071 { PINMUX_CFG_REG_VAR("IPSR3", 0xfffc002c, 32,
2072 3, 1, 1, 3, 1, 2, 1, 1, 1, 1, 1,
2073 1, 3, 3, 1, 1, 1, 1, 1, 1, 3) {
2074 /* IP3_31_29 [3] */
2075 FN_DU0_EXODDF_DU0_ODDF_DISP_CDE, FN_QCPV_QDE, FN_CAN1_TX, FN_TX2_C,
2076 FN_SCL2_C, FN_REMOCON, 0, 0,
2077 /* IP3_28 [1] */
2078 FN_DU0_EXVSYNC_DU0_VSYNC, FN_QSTB_QHE,
2079 /* IP3_27 [1] */
2080 FN_DU0_EXHSYNC_DU0_HSYNC, FN_QSTH_QHS,
2081 /* IP3_26_24 [3] */
2082 FN_DU0_DOTCLKOUT1, FN_QSTVB_QVE, FN_RX3_D_IRDA_RX_D, FN_SDA3_B,
2083 FN_SDA2_C, FN_DACK0_B, FN_DRACK0_B, 0,
2084 /* IP3_23 [1] */
2085 FN_DU0_DOTCLKOUT0, FN_QCLK,
2086 /* IP3_22_21 [2] */
2087 FN_DU0_DOTCLKIN, FN_QSTVA_QVS, FN_TX3_D_IRDA_TX_D, FN_SCL3_B,
2088 /* IP3_20 [1] */
2089 FN_DU0_DB7, FN_LCDOUT23,
2090 /* IP3_19 [1] */
2091 FN_DU0_DB6, FN_LCDOUT22,
2092 /* IP3_18 [1] */
2093 FN_DU0_DB5, FN_LCDOUT21,
2094 /* IP3_17 [1] */
2095 FN_DU0_DB4, FN_LCDOUT20,
2096 /* IP3_16 [1] */
2097 FN_DU0_DB3, FN_LCDOUT19,
2098 /* IP3_15 [1] */
2099 FN_DU0_DB2, FN_LCDOUT18,
2100 /* IP3_14_12 [3] */
2101 FN_DU0_DB1, FN_LCDOUT17, FN_EX_WAIT2, FN_SDA1,
2102 FN_GPS_MAG_B, FN_AUDATA5, FN_SCK5_C, 0,
2103 /* IP3_11_9 [3] */
2104 FN_DU0_DB0, FN_LCDOUT16, FN_EX_WAIT1, FN_SCL1,
2105 FN_TCLK1, FN_AUDATA4, 0, 0,
2106 /* IP3_8 [1] */
2107 FN_DU0_DG7, FN_LCDOUT15,
2108 /* IP3_7 [1] */
2109 FN_DU0_DG6, FN_LCDOUT14,
2110 /* IP3_6 [1] */
2111 FN_DU0_DG5, FN_LCDOUT13,
2112 /* IP3_5 [1] */
2113 FN_DU0_DG4, FN_LCDOUT12,
2114 /* IP3_4 [1] */
2115 FN_DU0_DG3, FN_LCDOUT11,
2116 /* IP3_3 [1] */
2117 FN_DU0_DG2, FN_LCDOUT10,
2118 /* IP3_2_0 [3] */
2119 FN_DU0_DG1, FN_LCDOUT9, FN_DACK1, FN_SDA2,
2120 FN_AUDATA3, 0, 0, 0 }
2121 },
2122 { PINMUX_CFG_REG_VAR("IPSR4", 0xfffc0030, 32,
2123 3, 1, 1, 1, 1, 1, 1, 3, 3,
2124 1, 1, 1, 1, 1, 1, 3, 3, 3, 2) {
2125 /* IP4_31_29 [3] */
2126 FN_DU1_DB0, FN_VI2_DATA4_VI2_B4, FN_SCL2_B, FN_SD3_DAT0,
2127 FN_TX5, FN_SCK0_D, 0, 0,
2128 /* IP4_28 [1] */
2129 FN_DU1_DG7, FN_VI2_R3,
2130 /* IP4_27 [1] */
2131 FN_DU1_DG6, FN_VI2_R2,
2132 /* IP4_26 [1] */
2133 FN_DU1_DG5, FN_VI2_R1,
2134 /* IP4_25 [1] */
2135 FN_DU1_DG4, FN_VI2_R0,
2136 /* IP4_24 [1] */
2137 FN_DU1_DG3, FN_VI2_G7,
2138 /* IP4_23 [1] */
2139 FN_DU1_DG2, FN_VI2_G6,
2140 /* IP4_22_20 [3] */
2141 FN_DU1_DG1, FN_VI2_DATA3_VI2_B3, FN_SDA1_B, FN_SD3_DAT3,
2142 FN_SCK5, FN_AUDATA7, FN_RX0_D, 0,
2143 /* IP4_19_17 [3] */
2144 FN_DU1_DG0, FN_VI2_DATA2_VI2_B2, FN_SCL1_B, FN_SD3_DAT2,
2145 FN_SCK3_E, FN_AUDATA6, FN_TX0_D, 0,
2146 /* IP4_16 [1] */
2147 FN_DU1_DR7, FN_VI2_G5,
2148 /* IP4_15 [1] */
2149 FN_DU1_DR6, FN_VI2_G4,
2150 /* IP4_14 [1] */
2151 FN_DU1_DR5, FN_VI2_G3,
2152 /* IP4_13 [1] */
2153 FN_DU1_DR4, FN_VI2_G2,
2154 /* IP4_12 [1] */
2155 FN_DU1_DR3, FN_VI2_G1,
2156 /* IP4_11 [1] */
2157 FN_DU1_DR2, FN_VI2_G0,
2158 /* IP4_10_8 [3] */
2159 FN_DU1_DR1, FN_VI2_DATA1_VI2_B1, FN_PWM0, FN_SD3_CMD,
2160 FN_RX3_E_IRDA_RX_E, FN_AUDSYNC, FN_CTS0_D, 0,
2161 /* IP4_7_5 [3] */
2162 FN_DU1_DR0, FN_VI2_DATA0_VI2_B0, FN_PWM6, FN_SD3_CLK,
2163 FN_TX3_E_IRDA_TX_E, FN_AUDCK, FN_PWMFSW0_B, 0,
2164 /* IP4_4_2 [3] */
2165 FN_DU0_CDE, FN_QPOLB, FN_CAN1_RX, FN_RX2_C,
2166 FN_DREQ0_B, FN_SSI_SCK78_B, FN_SCK0_B, 0,
2167 /* IP4_1_0 [2] */
2168 FN_DU0_DISP, FN_QPOLA, FN_CAN_CLK_C, FN_SCK2_C }
2169 },
2170 { PINMUX_CFG_REG_VAR("IPSR5", 0xfffc0034, 32,
2171 1, 2, 1, 4, 3, 4, 2, 2,
2172 2, 2, 1, 1, 1, 1, 1, 1, 3) {
2173 /* IP5_31 [1] */
2174 0, 0,
2175 /* IP5_30_29 [2] */
2176 FN_AUDIO_CLKB, FN_USB_OVC2, FN_CAN_DEBUGOUT0, FN_MOUT0,
2177 /* IP5_28 [1] */
2178 FN_AUDIO_CLKA, FN_CAN_TXCLK,
2179 /* IP5_27_24 [4] */
2180 FN_DU1_CDE, FN_VI2_DATA7_VI2_B7, FN_RX3_B_IRDA_RX_B, FN_SD3_WP,
2181 FN_HSPI_RX1, FN_VI1_FIELD, FN_VI3_FIELD, FN_AUDIO_CLKOUT,
2182 FN_RX2_D, FN_GPS_CLK_C, FN_GPS_CLK_D, 0,
2183 0, 0, 0, 0,
2184 /* IP5_23_21 [3] */
2185 FN_DU1_DISP, FN_VI2_DATA6_VI2_B6, FN_TCLK0, FN_QSTVA_B_QVS_B,
2186 FN_HSPI_CLK1, FN_SCK2_D, FN_AUDIO_CLKOUT_B, FN_GPS_MAG_D,
2187 /* IP5_20_17 [4] */
2188 FN_DU1_EXODDF_DU1_ODDF_DISP_CDE, FN_VI2_CLK, FN_TX3_B_IRDA_TX_B,
2189 FN_SD3_CD, FN_HSPI_TX1, FN_VI1_CLKENB, FN_VI3_CLKENB,
2190 FN_AUDIO_CLKC, FN_TX2_D, FN_SPEEDIN, FN_GPS_SIGN_D, 0,
2191 0, 0, 0, 0,
2192 /* IP5_16_15 [2] */
2193 FN_DU1_EXVSYNC_DU1_VSYNC, FN_VI2_VSYNC, FN_VI3_VSYNC, 0,
2194 /* IP5_14_13 [2] */
2195 FN_DU1_EXHSYNC_DU1_HSYNC, FN_VI2_HSYNC, FN_VI3_HSYNC, 0,
2196 /* IP5_12_11 [2] */
2197 FN_DU1_DOTCLKOUT, FN_VI2_FIELD, FN_SDA1_D, 0,
2198 /* IP5_10_9 [2] */
2199 FN_DU1_DOTCLKIN, FN_VI2_CLKENB, FN_HSPI_CS1, FN_SCL1_D,
2200 /* IP5_8 [1] */
2201 FN_DU1_DB7, FN_SDA2_D,
2202 /* IP5_7 [1] */
2203 FN_DU1_DB6, FN_SCL2_D,
2204 /* IP5_6 [1] */
2205 FN_DU1_DB5, FN_VI2_R7,
2206 /* IP5_5 [1] */
2207 FN_DU1_DB4, FN_VI2_R6,
2208 /* IP5_4 [1] */
2209 FN_DU1_DB3, FN_VI2_R5,
2210 /* IP5_3 [1] */
2211 FN_DU1_DB2, FN_VI2_R4,
2212 /* IP5_2_0 [3] */
2213 FN_DU1_DB1, FN_VI2_DATA5_VI2_B5, FN_SDA2_B, FN_SD3_DAT1,
2214 FN_RX5, FN_RTS0_D_TANS_D, 0, 0 }
2215 },
2216 { PINMUX_CFG_REG_VAR("IPSR6", 0xfffc0038, 32,
2217 1, 2, 2, 2, 2, 3, 2, 3, 3, 3, 1, 2, 2, 2, 2) {
2218 /* IP6_31 [1] */
2219 0, 0,
2220 /* IP6_30_29 [2] */
2221 FN_SSI_SCK6, FN_ADICHS0, FN_CAN0_TX, FN_IERX_B,
2222 /* IP_28_27 [2] */
2223 0, 0, 0, 0,
2224 /* IP6_26_25 [2] */
2225 FN_SSI_SDATA5, FN_ADIDATA, FN_CAN_DEBUGOUT12, FN_RX3_IRDA_RX,
2226 /* IP6_24_23 [2] */
2227 FN_SSI_WS5, FN_ADICS_SAMP, FN_CAN_DEBUGOUT11, FN_TX3_IRDA_TX,
2228 /* IP6_22_20 [3] */
2229 FN_SSI_SCK5, FN_ADICLK, FN_CAN_DEBUGOUT10, FN_SCK3,
2230 FN_TCLK0_D, 0, 0, 0,
2231 /* IP6_19_18 [2] */
2232 FN_SSI_SDATA4, FN_CAN_DEBUGOUT9, FN_SSI_SDATA9_C, 0,
2233 /* IP6_17_15 [3] */
2234 FN_SSI_SDATA3, FN_PWM0_C, FN_CAN_DEBUGOUT8, FN_CAN_CLK_B,
2235 FN_IECLK, FN_SCIF_CLK_B, FN_TCLK0_B, 0,
2236 /* IP6_14_12 [3] */
2237 FN_SSI_WS34, FN_CAN_DEBUGOUT7, FN_CAN0_RX_B, FN_IETX,
2238 FN_SSI_WS9_C, 0, 0, 0,
2239 /* IP6_11_9 [3] */
2240 FN_SSI_SCK34, FN_CAN_DEBUGOUT6, FN_CAN0_TX_B, FN_IERX,
2241 FN_SSI_SCK9_C, 0, 0, 0,
2242 /* IP6_8 [1] */
2243 FN_SSI_SDATA2, FN_CAN_DEBUGOUT5,
2244 /* IP6_7_6 [2] */
2245 FN_SSI_SDATA1, FN_CAN_DEBUGOUT4, FN_MOUT6, 0,
2246 /* IP6_5_4 [2] */
2247 FN_SSI_SDATA0, FN_CAN_DEBUGOUT3, FN_MOUT5, 0,
2248 /* IP6_3_2 [2] */
2249 FN_SSI_WS0129, FN_CAN_DEBUGOUT2, FN_MOUT2, 0,
2250 /* IP6_1_0 [2] */
2251 FN_SSI_SCK0129, FN_CAN_DEBUGOUT1, FN_MOUT1, 0 }
2252 },
2253 { PINMUX_CFG_REG_VAR("IPSR7", 0xfffc003c, 32,
2254 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 2, 2) {
2255 /* IP7_31 [1] */
2256 0, 0,
2257 /* IP7_30_29 [2] */
2258 FN_SD0_WP, FN_DACK2, FN_CTS1_B, 0,
2259 /* IP7_28_27 [2] */
2260 FN_SD0_CD, FN_DREQ2, FN_RTS1_B_TANS_B, 0,
2261 /* IP7_26_25 [2] */
2262 FN_SD0_DAT3, FN_ATAWR1, FN_RX2_B, FN_CC5_TDI,
2263 /* IP7_24_23 [2] */
2264 FN_SD0_DAT2, FN_ATARD1, FN_TX2_B, FN_CC5_TCK,
2265 /* IP7_22_21 [2] */
2266 FN_SD0_DAT1, FN_ATAG1, FN_SCK2_B, FN_CC5_TMS,
2267 /* IP7_20_19 [2] */
2268 FN_SD0_DAT0, FN_ATADIR1, FN_RX1_B, FN_CC5_TRST,
2269 /* IP7_18_17 [2] */
2270 FN_SD0_CMD, FN_ATACS11, FN_TX1_B, FN_CC5_TDO,
2271 /* IP7_16_15 [2] */
2272 FN_SD0_CLK, FN_ATACS01, FN_SCK1_B, 0,
2273 /* IP7_14_13 [2] */
2274 FN_SSI_SDATA8, FN_VSP, FN_IRQ3_B, FN_HSPI_RX1_C,
2275 /* IP7_12_10 [3] */
2276 FN_SSI_SDATA7, FN_CAN_DEBUGOUT15, FN_IRQ2_B, FN_TCLK1_C,
2277 FN_HSPI_TX1_C, 0, 0, 0,
2278 /* IP7_9_7 [3] */
2279 FN_SSI_WS78, FN_CAN_DEBUGOUT14, FN_IRQ1_B, FN_SSI_WS9_B,
2280 FN_HSPI_CS1_C, 0, 0, 0,
2281 /* IP7_6_4 [3] */
2282 FN_SSI_SCK78, FN_CAN_DEBUGOUT13, FN_IRQ0_B, FN_SSI_SCK9_B,
2283 FN_HSPI_CLK1_C, 0, 0, 0,
2284 /* IP7_3_2 [2] */
2285 FN_SSI_SDATA6, FN_ADICHS2, FN_CAN_CLK, FN_IECLK_B,
2286 /* IP7_1_0 [2] */
2287 FN_SSI_WS6, FN_ADICHS1, FN_CAN0_RX, FN_IETX_B }
2288 },
2289 { PINMUX_CFG_REG_VAR("IPSR8", 0xfffc0040, 32,
2290 1, 3, 3, 2, 2, 1, 1, 1, 2, 4, 4, 4, 4) {
2291 /* IP8_31 [1] */
2292 0, 0,
2293 /* IP8_30_28 [3] */
2294 FN_VI0_VSYNC, FN_VI0_DATA1_B_VI0_B1_B, FN_RTS1_C_TANS_C, FN_RX4_D,
2295 FN_PWMFSW0_C, 0, 0, 0,
2296 /* IP8_27_25 [3] */
2297 FN_VI0_HSYNC, FN_VI0_DATA0_B_VI0_B0_B, FN_CTS1_C, FN_TX4_D,
2298 FN_MMC1_CMD, FN_HSCK1_B, 0, 0,
2299 /* IP8_24_23 [2] */
2300 FN_VI0_FIELD, FN_RX1_C, FN_HRX1_B, 0,
2301 /* IP8_22_21 [2] */
2302 FN_VI0_CLKENB, FN_TX1_C, FN_HTX1_B, FN_MT1_SYNC,
2303 /* IP8_20 [1] */
2304 FN_VI0_CLK, FN_MMC1_CLK,
2305 /* IP8_19 [1] */
2306 FN_FMIN, FN_RDS_DATA,
2307 /* IP8_18 [1] */
2308 FN_BPFCLK, FN_PCMWE,
2309 /* IP8_17_16 [2] */
2310 FN_FMCLK, FN_RDS_CLK, FN_PCMOE, 0,
2311 /* IP8_15_12 [4] */
2312 FN_HSPI_RX0, FN_RX0, FN_CAN_STEP0, FN_AD_NCS,
2313 FN_CC5_STATE7, FN_CC5_STATE15, FN_CC5_STATE23, FN_CC5_STATE31,
2314 FN_CC5_STATE39, 0, 0, 0,
2315 0, 0, 0, 0,
2316 /* IP8_11_8 [4] */
2317 FN_HSPI_TX0, FN_TX0, FN_CAN_DEBUG_HW_TRIGGER, FN_AD_DO,
2318 FN_CC5_STATE6, FN_CC5_STATE14, FN_CC5_STATE22, FN_CC5_STATE30,
2319 FN_CC5_STATE38, 0, 0, 0,
2320 0, 0, 0, 0,
2321 /* IP8_7_4 [4] */
2322 FN_HSPI_CS0, FN_RTS0_TANS, FN_USB_OVC1, FN_AD_DI,
2323 FN_CC5_STATE5, FN_CC5_STATE13, FN_CC5_STATE21, FN_CC5_STATE29,
2324 FN_CC5_STATE37, 0, 0, 0,
2325 0, 0, 0, 0,
2326 /* IP8_3_0 [4] */
2327 FN_HSPI_CLK0, FN_CTS0, FN_USB_OVC0, FN_AD_CLK,
2328 FN_CC5_STATE4, FN_CC5_STATE12, FN_CC5_STATE20, FN_CC5_STATE28,
2329 FN_CC5_STATE36, 0, 0, 0,
2330 0, 0, 0, 0 }
2331 },
2332 { PINMUX_CFG_REG_VAR("IPSR9", 0xfffc0044, 32,
2333 2, 2, 2, 2, 2, 3, 3, 2, 2,
2334 2, 2, 1, 1, 1, 1, 2, 2) {
2335 /* IP9_31_30 [2] */
2336 0, 0, 0, 0,
2337 /* IP9_29_28 [2] */
2338 FN_VI0_G7, FN_ETH_RXD1, FN_SD2_DAT3_B, FN_ARM_TRACEDATA_9,
2339 /* IP9_27_26 [2] */
2340 FN_VI0_G6, FN_ETH_RXD0, FN_SD2_DAT2_B, FN_ARM_TRACEDATA_8,
2341 /* IP9_25_24 [2] */
2342 FN_VI0_G5, FN_ETH_RX_ER, FN_SD2_DAT1_B, FN_ARM_TRACEDATA_7,
2343 /* IP9_23_22 [2] */
2344 FN_VI0_G4, FN_ETH_TX_EN, FN_SD2_DAT0_B, FN_ARM_TRACEDATA_6,
2345 /* IP9_21_19 [3] */
2346 FN_VI0_G3, FN_ETH_CRS_DV, FN_MMC1_D7, FN_ARM_TRACEDATA_5,
2347 FN_TS_SDAT0, 0, 0, 0,
2348 /* IP9_18_16 [3] */
2349 FN_VI0_G2, FN_ETH_TXD1, FN_MMC1_D6, FN_ARM_TRACEDATA_4,
2350 FN_TS_SPSYNC0, 0, 0, 0,
2351 /* IP9_15_14 [2] */
2352 FN_VI0_G1, FN_SSI_WS78_C, FN_IRQ1, FN_ARM_TRACEDATA_3,
2353 /* IP9_13_12 [2] */
2354 FN_VI0_G0, FN_SSI_SCK78_C, FN_IRQ0, FN_ARM_TRACEDATA_2,
2355 /* IP9_11_10 [2] */
2356 FN_VI0_DATA7_VI0_B7, FN_MMC1_D5, FN_ARM_TRACEDATA_1, 0,
2357 /* IP9_9_8 [2] */
2358 FN_VI0_DATA6_VI0_B6, FN_MMC1_D4, FN_ARM_TRACEDATA_0, 0,
2359 /* IP9_7 [1] */
2360 FN_VI0_DATA5_VI0_B5, FN_MMC1_D3,
2361 /* IP9_6 [1] */
2362 FN_VI0_DATA4_VI0_B4, FN_MMC1_D2,
2363 /* IP9_5 [1] */
2364 FN_VI0_DATA3_VI0_B3, FN_MMC1_D1,
2365 /* IP9_4 [1] */
2366 FN_VI0_DATA2_VI0_B2, FN_MMC1_D0,
2367 /* IP9_3_2 [2] */
2368 FN_VI0_DATA1_VI0_B1, FN_HCTS1_B, FN_MT1_PWM, 0,
2369 /* IP9_1_0 [2] */
2370 FN_VI0_DATA0_VI0_B0, FN_HRTS1_B, FN_MT1_VCXO, 0 }
2371 },
2372 { PINMUX_CFG_REG_VAR("IPSR10", 0xfffc0048, 32,
2373 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3) {
2374 /* IP10_31_29 [3] */
2375 FN_VI1_VSYNC, FN_AUDIO_CLKOUT_C, FN_SSI_WS4, FN_SIM_CLK,
2376 FN_GPS_MAG_C, FN_SPV_TRST, FN_SCL3, 0,
2377 /* IP10_28_26 [3] */
2378 FN_VI1_HSYNC, FN_VI3_CLK, FN_SSI_SCK4, FN_GPS_SIGN_C,
2379 FN_PWMFSW0_E, 0, 0, 0,
2380 /* IP10_25_24 [2] */
2381 FN_VI1_CLK, FN_SIM_D, FN_SDA3, 0,
2382 /* IP10_23_21 [3] */
2383 FN_VI0_R7, FN_ETH_MDIO, FN_DACK2_C, FN_HSPI_RX1_B,
2384 FN_SCIF_CLK_D, FN_TRACECTL, FN_MT1_PEN, 0,
2385 /* IP10_20_18 [3] */
2386 FN_VI0_R6, FN_ETH_MDC, FN_DREQ2_C, FN_HSPI_TX1_B,
2387 FN_TRACECLK, FN_MT1_BEN, FN_PWMFSW0_D, 0,
2388 /* IP10_17_15 [3] */
2389 FN_VI0_R5, FN_ETH_TXD0, FN_SD2_WP_B, FN_HSPI_CS1_B,
2390 FN_ARM_TRACEDATA_15, FN_MT1_D, FN_TS_SDEN0, 0,
2391 /* IP10_14_12 [3] */
2392 FN_VI0_R4, FN_ETH_REFCLK, FN_SD2_CD_B, FN_HSPI_CLK1_B,
2393 FN_ARM_TRACEDATA_14, FN_MT1_CLK, FN_TS_SCK0, 0,
2394 /* IP10_11_9 [3] */
2395 FN_VI0_R3, FN_ETH_MAGIC, FN_SD2_CMD_B, FN_IRQ3,
2396 FN_ARM_TRACEDATA_13, 0, 0, 0,
2397 /* IP10_8_6 [3] */
2398 FN_VI0_R2, FN_ETH_LINK, FN_SD2_CLK_B, FN_IRQ2,
2399 FN_ARM_TRACEDATA_12, 0, 0, 0,
2400 /* IP10_5_3 [3] */
2401 FN_VI0_R1, FN_SSI_SDATA8_C, FN_DACK1_B, FN_ARM_TRACEDATA_11,
2402 FN_DACK0_C, FN_DRACK0_C, 0, 0,
2403 /* IP10_2_0 [3] */
2404 FN_VI0_R0, FN_SSI_SDATA7_C, FN_SCK1_C, FN_DREQ1_B,
2405 FN_ARM_TRACEDATA_10, FN_DREQ0_C, 0, 0 }
2406 },
2407 { PINMUX_CFG_REG_VAR("IPSR11", 0xfffc004c, 32,
2408 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3) {
2409 /* IP11_31_30 [2] */
2410 0, 0, 0, 0,
2411 /* IP11_29_27 [3] */
2412 FN_VI1_G1, FN_VI3_DATA1, FN_SSI_SCK1, FN_TS_SDEN1,
2413 FN_DACK2_B, FN_RX2, FN_HRTS0_B, 0,
2414 /* IP11_26_24 [3] */
2415 FN_VI1_G0, FN_VI3_DATA0, FN_DU1_DOTCLKOUT1, FN_TS_SCK1,
2416 FN_DREQ2_B, FN_TX2, FN_SPA_TDO, FN_HCTS0_B,
2417 /* IP11_23_21 [3] */
2418 FN_VI1_DATA7_VI1_B7, FN_SD2_WP, FN_MT0_PWM, FN_SPA_TDI,
2419 FN_HSPI_RX1_D, 0, 0, 0,
2420 /* IP11_20_18 [3] */
2421 FN_VI1_DATA6_VI1_B6, FN_SD2_CD, FN_MT0_VCXO, FN_SPA_TMS,
2422 FN_HSPI_TX1_D, 0, 0, 0,
2423 /* IP11_17_15 [3] */
2424 FN_VI1_DATA5_VI1_B5, FN_SD2_CMD, FN_MT0_SYNC, FN_SPA_TCK,
2425 FN_HSPI_CS1_D, FN_ADICHS2_B, 0, 0,
2426 /* IP11_14_12 [3] */
2427 FN_VI1_DATA4_VI1_B4, FN_SD2_CLK, FN_MT0_PEN, FN_SPA_TRST,
2428 FN_HSPI_CLK1_D, FN_ADICHS1_B, 0, 0,
2429 /* IP11_11_9 [3] */
2430 FN_VI1_DATA3_VI1_B3, FN_SD2_DAT3, FN_MT0_BEN, FN_SPV_TDO,
2431 FN_ADICHS0_B, 0, 0, 0,
2432 /* IP11_8_6 [3] */
2433 FN_VI1_DATA2_VI1_B2, FN_SD2_DAT2, FN_MT0_D, FN_SPVTDI,
2434 FN_ADIDATA_B, 0, 0, 0,
2435 /* IP11_5_3 [3] */
2436 FN_VI1_DATA1_VI1_B1, FN_SD2_DAT1, FN_MT0_CLK, FN_SPV_TMS,
2437 FN_ADICS_B_SAMP_B, 0, 0, 0,
2438 /* IP11_2_0 [3] */
2439 FN_VI1_DATA0_VI1_B0, FN_SD2_DAT0, FN_SIM_RST, FN_SPV_TCK,
2440 FN_ADICLK_B, 0, 0, 0 }
2441 },
2442 { PINMUX_CFG_REG_VAR("IPSR12", 0xfffc0050, 32,
2443 4, 4, 4, 2, 3, 3, 3, 3, 3, 3) {
2444 /* IP12_31_28 [4] */
2445 0, 0, 0, 0, 0, 0, 0, 0,
2446 0, 0, 0, 0, 0, 0, 0, 0,
2447 /* IP12_27_24 [4] */
2448 0, 0, 0, 0, 0, 0, 0, 0,
2449 0, 0, 0, 0, 0, 0, 0, 0,
2450 /* IP12_23_20 [4] */
2451 0, 0, 0, 0, 0, 0, 0, 0,
2452 0, 0, 0, 0, 0, 0, 0, 0,
2453 /* IP12_19_18 [2] */
2454 0, 0, 0, 0,
2455 /* IP12_17_15 [3] */
2456 FN_VI1_G7, FN_VI3_DATA7, FN_GPS_MAG, FN_FCE,
2457 FN_SCK4_B, 0, 0, 0,
2458 /* IP12_14_12 [3] */
2459 FN_VI1_G6, FN_VI3_DATA6, FN_GPS_SIGN, FN_FRB,
2460 FN_RX4_B, FN_SIM_CLK_B, 0, 0,
2461 /* IP12_11_9 [3] */
2462 FN_VI1_G5, FN_VI3_DATA5, FN_GPS_CLK, FN_FSE,
2463 FN_TX4_B, FN_SIM_D_B, 0, 0,
2464 /* IP12_8_6 [3] */
2465 FN_VI1_G4, FN_VI3_DATA4, FN_SSI_WS2, FN_SDA1_C,
2466 FN_SIM_RST_B, FN_HRX0_B, 0, 0,
2467 /* IP12_5_3 [3] */
2468 FN_VI1_G3, FN_VI3_DATA3, FN_SSI_SCK2, FN_TS_SDAT1,
2469 FN_SCL1_C, FN_HTX0_B, 0, 0,
2470 /* IP12_2_0 [3] */
2471 FN_VI1_G2, FN_VI3_DATA2, FN_SSI_WS1, FN_TS_SPSYNC1,
2472 FN_SCK2, FN_HSCK0_B, 0, 0 }
2473 },
2474 { PINMUX_CFG_REG_VAR("MOD_SEL", 0xfffc0090, 32,
2475 2, 2, 3, 3, 2, 2, 2, 2, 2,
2476 1, 1, 1, 1, 1, 1, 1, 2, 1, 2) {
2477 /* SEL_SCIF5 [2] */
2478 FN_SEL_SCIF5_0, FN_SEL_SCIF5_1, FN_SEL_SCIF5_2, FN_SEL_SCIF5_3,
2479 /* SEL_SCIF4 [2] */
2480 FN_SEL_SCIF4_0, FN_SEL_SCIF4_1, FN_SEL_SCIF4_2, FN_SEL_SCIF4_3,
2481 /* SEL_SCIF3 [3] */
2482 FN_SEL_SCIF3_0, FN_SEL_SCIF3_1, FN_SEL_SCIF3_2, FN_SEL_SCIF3_3,
2483 FN_SEL_SCIF3_4, 0, 0, 0,
2484 /* SEL_SCIF2 [3] */
2485 FN_SEL_SCIF2_0, FN_SEL_SCIF2_1, FN_SEL_SCIF2_2, FN_SEL_SCIF2_3,
2486 FN_SEL_SCIF2_4, 0, 0, 0,
2487 /* SEL_SCIF1 [2] */
2488 FN_SEL_SCIF1_0, FN_SEL_SCIF1_1, FN_SEL_SCIF1_2, 0,
2489 /* SEL_SCIF0 [2] */
2490 FN_SEL_SCIF0_0, FN_SEL_SCIF0_1, FN_SEL_SCIF0_2, FN_SEL_SCIF0_3,
2491 /* SEL_SSI9 [2] */
2492 FN_SEL_SSI9_0, FN_SEL_SSI9_1, FN_SEL_SSI9_2, 0,
2493 /* SEL_SSI8 [2] */
2494 FN_SEL_SSI8_0, FN_SEL_SSI8_1, FN_SEL_SSI8_2, 0,
2495 /* SEL_SSI7 [2] */
2496 FN_SEL_SSI7_0, FN_SEL_SSI7_1, FN_SEL_SSI7_2, 0,
2497 /* SEL_VI0 [1] */
2498 FN_SEL_VI0_0, FN_SEL_VI0_1,
2499 /* SEL_SD2 [1] */
2500 FN_SEL_SD2_0, FN_SEL_SD2_1,
2501 /* SEL_INT3 [1] */
2502 FN_SEL_INT3_0, FN_SEL_INT3_1,
2503 /* SEL_INT2 [1] */
2504 FN_SEL_INT2_0, FN_SEL_INT2_1,
2505 /* SEL_INT1 [1] */
2506 FN_SEL_INT1_0, FN_SEL_INT1_1,
2507 /* SEL_INT0 [1] */
2508 FN_SEL_INT0_0, FN_SEL_INT0_1,
2509 /* SEL_IE [1] */
2510 FN_SEL_IE_0, FN_SEL_IE_1,
2511 /* SEL_EXBUS2 [2] */
2512 FN_SEL_EXBUS2_0, FN_SEL_EXBUS2_1, FN_SEL_EXBUS2_2, 0,
2513 /* SEL_EXBUS1 [1] */
2514 FN_SEL_EXBUS1_0, FN_SEL_EXBUS1_1,
2515 /* SEL_EXBUS0 [2] */
2516 FN_SEL_EXBUS0_0, FN_SEL_EXBUS0_1, FN_SEL_EXBUS0_2, 0 }
2517 },
2518 { PINMUX_CFG_REG_VAR("MOD_SEL2", 0xfffc0094, 32,
2519 2, 2, 2, 2, 1, 1, 1, 3, 1,
2520 2, 2, 2, 2, 1, 1, 2, 1, 2, 2) {
2521 /* SEL_TMU1 [2] */
2522 FN_SEL_TMU1_0, FN_SEL_TMU1_1, FN_SEL_TMU1_2, 0,
2523 /* SEL_TMU0 [2] */
2524 FN_SEL_TMU0_0, FN_SEL_TMU0_1, FN_SEL_TMU0_2, FN_SEL_TMU0_3,
2525 /* SEL_SCIF [2] */
2526 FN_SEL_SCIF_0, FN_SEL_SCIF_1, FN_SEL_SCIF_2, FN_SEL_SCIF_3,
2527 /* SEL_CANCLK [2] */
2528 FN_SEL_CANCLK_0, FN_SEL_CANCLK_1, FN_SEL_CANCLK_2,
2529 /* SEL_CAN0 [1] */
2530 FN_SEL_CAN0_0, FN_SEL_CAN0_1,
2531 /* SEL_HSCIF1 [1] */
2532 FN_SEL_HSCIF1_0, FN_SEL_HSCIF1_1,
2533 /* SEL_HSCIF0 [1] */
2534 FN_SEL_HSCIF0_0, FN_SEL_HSCIF0_1,
2535 /* SEL_PWMFSW [3] */
2536 FN_SEL_PWMFSW_0, FN_SEL_PWMFSW_1, FN_SEL_PWMFSW_2,
2537 FN_SEL_PWMFSW_3, FN_SEL_PWMFSW_4, 0, 0, 0,
2538 /* SEL_ADI [1] */
2539 FN_SEL_ADI_0, FN_SEL_ADI_1,
2540 /* [2] */
2541 0, 0, 0, 0,
2542 /* [2] */
2543 0, 0, 0, 0,
2544 /* [2] */
2545 0, 0, 0, 0,
2546 /* SEL_GPS [2] */
2547 FN_SEL_GPS_0, FN_SEL_GPS_1, FN_SEL_GPS_2, FN_SEL_GPS_3,
2548 /* SEL_SIM [1] */
2549 FN_SEL_SIM_0, FN_SEL_SIM_1,
2550 /* SEL_HSPI2 [1] */
2551 FN_SEL_HSPI2_0, FN_SEL_HSPI2_1,
2552 /* SEL_HSPI1 [2] */
2553 FN_SEL_HSPI1_0, FN_SEL_HSPI1_1, FN_SEL_HSPI1_2, FN_SEL_HSPI1_3,
2554 /* SEL_I2C3 [1] */
2555 FN_SEL_I2C3_0, FN_SEL_I2C3_1,
2556 /* SEL_I2C2 [2] */
2557 FN_SEL_I2C2_0, FN_SEL_I2C2_1, FN_SEL_I2C2_2, FN_SEL_I2C2_3,
2558 /* SEL_I2C1 [2] */
2559 FN_SEL_I2C1_0, FN_SEL_I2C1_1, FN_SEL_I2C1_2, FN_SEL_I2C1_3 }
2560 },
2561 { PINMUX_CFG_REG("INOUTSEL0", 0xffc40004, 32, 1) { GP_INOUTSEL(0) } },
2562 { PINMUX_CFG_REG("INOUTSEL1", 0xffc41004, 32, 1) { GP_INOUTSEL(1) } },
2563 { PINMUX_CFG_REG("INOUTSEL2", 0xffc42004, 32, 1) { GP_INOUTSEL(2) } },
2564 { PINMUX_CFG_REG("INOUTSEL3", 0xffc43004, 32, 1) { GP_INOUTSEL(3) } },
2565 { PINMUX_CFG_REG("INOUTSEL4", 0xffc44004, 32, 1) { GP_INOUTSEL(4) } },
2566 { PINMUX_CFG_REG("INOUTSEL5", 0xffc45004, 32, 1) { GP_INOUTSEL(5) } },
2567 { PINMUX_CFG_REG("INOUTSEL6", 0xffc46004, 32, 1) {
2568 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2569 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2570 0, 0, 0, 0, 0, 0, 0, 0,
2571 0, 0,
2572 0, 0,
2573 0, 0,
2574 GP_6_8_IN, GP_6_8_OUT,
2575 GP_6_7_IN, GP_6_7_OUT,
2576 GP_6_6_IN, GP_6_6_OUT,
2577 GP_6_5_IN, GP_6_5_OUT,
2578 GP_6_4_IN, GP_6_4_OUT,
2579 GP_6_3_IN, GP_6_3_OUT,
2580 GP_6_2_IN, GP_6_2_OUT,
2581 GP_6_1_IN, GP_6_1_OUT,
2582 GP_6_0_IN, GP_6_0_OUT, }
2583 },
2584 { },
2585};
2586
2587static struct pinmux_data_reg pinmux_data_regs[] = {
2588 { PINMUX_DATA_REG("INDT0", 0xffc40008, 32) { GP_INDT(0) } },
2589 { PINMUX_DATA_REG("INDT1", 0xffc41008, 32) { GP_INDT(1) } },
2590 { PINMUX_DATA_REG("INDT2", 0xffc42008, 32) { GP_INDT(2) } },
2591 { PINMUX_DATA_REG("INDT3", 0xffc43008, 32) { GP_INDT(3) } },
2592 { PINMUX_DATA_REG("INDT4", 0xffc44008, 32) { GP_INDT(4) } },
2593 { PINMUX_DATA_REG("INDT5", 0xffc45008, 32) { GP_INDT(5) } },
2594 { PINMUX_DATA_REG("INDT6", 0xffc46008, 32) {
2595 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2596 0, 0, 0, 0, 0, 0, 0, GP_6_8_DATA,
2597 GP_6_7_DATA, GP_6_6_DATA, GP_6_5_DATA, GP_6_4_DATA,
2598 GP_6_3_DATA, GP_6_2_DATA, GP_6_1_DATA, GP_6_0_DATA }
2599 },
2600 { },
2601};
2602
2603static struct resource r8a7779_pfc_resources[] = {
2604 [0] = {
2605 .start = 0xfffc0000,
2606 .end = 0xfffc023b,
2607 .flags = IORESOURCE_MEM,
2608 },
2609 [1] = {
2610 .start = 0xffc40000,
2611 .end = 0xffc46fff,
2612 .flags = IORESOURCE_MEM,
2613 }
2614};
2615
2616static struct pinmux_info r8a7779_pinmux_info = {
2617 .name = "r8a7779_pfc",
2618
2619 .resource = r8a7779_pfc_resources,
2620 .num_resources = ARRAY_SIZE(r8a7779_pfc_resources),
2621
2622 .unlock_reg = 0xfffc0000, /* PMMR */
2623
2624 .reserved_id = PINMUX_RESERVED,
2625 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
2626 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
2627 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
2628 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
2629 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
2630
2631 .first_gpio = GPIO_GP_0_0,
2632 .last_gpio = GPIO_FN_SCK4_B,
2633
2634 .gpios = pinmux_gpios,
2635 .cfg_regs = pinmux_config_regs,
2636 .data_regs = pinmux_data_regs,
2637
2638 .gpio_data = pinmux_data,
2639 .gpio_data_size = ARRAY_SIZE(pinmux_data),
2640};
2641
2642void r8a7779_pinmux_init(void)
2643{
2644 register_pinmux(&r8a7779_pinmux_info);
2645}
diff --git a/arch/arm/mach-shmobile/pfc-sh7372.c b/arch/arm/mach-shmobile/pfc-sh7372.c
deleted file mode 100644
index 7a1525fd6ada..000000000000
--- a/arch/arm/mach-shmobile/pfc-sh7372.c
+++ /dev/null
@@ -1,1663 +0,0 @@
1/*
2 * sh7372 processor support - PFC hardware block
3 *
4 * Copyright (C) 2010 Kuninori Morimoto <morimoto.kuninori@renesas.com>
5 *
6 * Based on
7 * sh7367 processor support - PFC hardware block
8 * Copyright (C) 2010 Magnus Damm
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; version 2 of the License.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23#include <linux/init.h>
24#include <linux/kernel.h>
25#include <linux/sh_pfc.h>
26#include <mach/irqs.h>
27#include <mach/sh7372.h>
28
29#define CPU_ALL_PORT(fn, pfx, sfx) \
30 PORT_10(fn, pfx, sfx), PORT_90(fn, pfx, sfx), \
31 PORT_10(fn, pfx##10, sfx), PORT_10(fn, pfx##11, sfx), \
32 PORT_10(fn, pfx##12, sfx), PORT_10(fn, pfx##13, sfx), \
33 PORT_10(fn, pfx##14, sfx), PORT_10(fn, pfx##15, sfx), \
34 PORT_10(fn, pfx##16, sfx), PORT_10(fn, pfx##17, sfx), \
35 PORT_10(fn, pfx##18, sfx), PORT_1(fn, pfx##190, sfx)
36
37enum {
38 PINMUX_RESERVED = 0,
39
40 /* PORT0_DATA -> PORT190_DATA */
41 PINMUX_DATA_BEGIN,
42 PORT_ALL(DATA),
43 PINMUX_DATA_END,
44
45 /* PORT0_IN -> PORT190_IN */
46 PINMUX_INPUT_BEGIN,
47 PORT_ALL(IN),
48 PINMUX_INPUT_END,
49
50 /* PORT0_IN_PU -> PORT190_IN_PU */
51 PINMUX_INPUT_PULLUP_BEGIN,
52 PORT_ALL(IN_PU),
53 PINMUX_INPUT_PULLUP_END,
54
55 /* PORT0_IN_PD -> PORT190_IN_PD */
56 PINMUX_INPUT_PULLDOWN_BEGIN,
57 PORT_ALL(IN_PD),
58 PINMUX_INPUT_PULLDOWN_END,
59
60 /* PORT0_OUT -> PORT190_OUT */
61 PINMUX_OUTPUT_BEGIN,
62 PORT_ALL(OUT),
63 PINMUX_OUTPUT_END,
64
65 PINMUX_FUNCTION_BEGIN,
66 PORT_ALL(FN_IN), /* PORT0_FN_IN -> PORT190_FN_IN */
67 PORT_ALL(FN_OUT), /* PORT0_FN_OUT -> PORT190_FN_OUT */
68 PORT_ALL(FN0), /* PORT0_FN0 -> PORT190_FN0 */
69 PORT_ALL(FN1), /* PORT0_FN1 -> PORT190_FN1 */
70 PORT_ALL(FN2), /* PORT0_FN2 -> PORT190_FN2 */
71 PORT_ALL(FN3), /* PORT0_FN3 -> PORT190_FN3 */
72 PORT_ALL(FN4), /* PORT0_FN4 -> PORT190_FN4 */
73 PORT_ALL(FN5), /* PORT0_FN5 -> PORT190_FN5 */
74 PORT_ALL(FN6), /* PORT0_FN6 -> PORT190_FN6 */
75 PORT_ALL(FN7), /* PORT0_FN7 -> PORT190_FN7 */
76
77 MSEL1CR_31_0, MSEL1CR_31_1,
78 MSEL1CR_30_0, MSEL1CR_30_1,
79 MSEL1CR_29_0, MSEL1CR_29_1,
80 MSEL1CR_28_0, MSEL1CR_28_1,
81 MSEL1CR_27_0, MSEL1CR_27_1,
82 MSEL1CR_26_0, MSEL1CR_26_1,
83 MSEL1CR_16_0, MSEL1CR_16_1,
84 MSEL1CR_15_0, MSEL1CR_15_1,
85 MSEL1CR_14_0, MSEL1CR_14_1,
86 MSEL1CR_13_0, MSEL1CR_13_1,
87 MSEL1CR_12_0, MSEL1CR_12_1,
88 MSEL1CR_9_0, MSEL1CR_9_1,
89 MSEL1CR_8_0, MSEL1CR_8_1,
90 MSEL1CR_7_0, MSEL1CR_7_1,
91 MSEL1CR_6_0, MSEL1CR_6_1,
92 MSEL1CR_4_0, MSEL1CR_4_1,
93 MSEL1CR_3_0, MSEL1CR_3_1,
94 MSEL1CR_2_0, MSEL1CR_2_1,
95 MSEL1CR_0_0, MSEL1CR_0_1,
96
97 MSEL3CR_27_0, MSEL3CR_27_1,
98 MSEL3CR_26_0, MSEL3CR_26_1,
99 MSEL3CR_21_0, MSEL3CR_21_1,
100 MSEL3CR_20_0, MSEL3CR_20_1,
101 MSEL3CR_15_0, MSEL3CR_15_1,
102 MSEL3CR_9_0, MSEL3CR_9_1,
103 MSEL3CR_6_0, MSEL3CR_6_1,
104
105 MSEL4CR_19_0, MSEL4CR_19_1,
106 MSEL4CR_18_0, MSEL4CR_18_1,
107 MSEL4CR_17_0, MSEL4CR_17_1,
108 MSEL4CR_16_0, MSEL4CR_16_1,
109 MSEL4CR_15_0, MSEL4CR_15_1,
110 MSEL4CR_14_0, MSEL4CR_14_1,
111 MSEL4CR_10_0, MSEL4CR_10_1,
112 MSEL4CR_6_0, MSEL4CR_6_1,
113 MSEL4CR_4_0, MSEL4CR_4_1,
114 MSEL4CR_1_0, MSEL4CR_1_1,
115 PINMUX_FUNCTION_END,
116
117 PINMUX_MARK_BEGIN,
118
119 /* IRQ */
120 IRQ0_6_MARK, IRQ0_162_MARK, IRQ1_MARK, IRQ2_4_MARK,
121 IRQ2_5_MARK, IRQ3_8_MARK, IRQ3_16_MARK, IRQ4_17_MARK,
122 IRQ4_163_MARK, IRQ5_MARK, IRQ6_39_MARK, IRQ6_164_MARK,
123 IRQ7_40_MARK, IRQ7_167_MARK, IRQ8_41_MARK, IRQ8_168_MARK,
124 IRQ9_42_MARK, IRQ9_169_MARK, IRQ10_MARK, IRQ11_MARK,
125 IRQ12_80_MARK, IRQ12_137_MARK, IRQ13_81_MARK, IRQ13_145_MARK,
126 IRQ14_82_MARK, IRQ14_146_MARK, IRQ15_83_MARK, IRQ15_147_MARK,
127 IRQ16_84_MARK, IRQ16_170_MARK, IRQ17_MARK, IRQ18_MARK,
128 IRQ19_MARK, IRQ20_MARK, IRQ21_MARK, IRQ22_MARK,
129 IRQ23_MARK, IRQ24_MARK, IRQ25_MARK, IRQ26_121_MARK,
130 IRQ26_172_MARK, IRQ27_122_MARK, IRQ27_180_MARK, IRQ28_123_MARK,
131 IRQ28_181_MARK, IRQ29_129_MARK, IRQ29_182_MARK, IRQ30_130_MARK,
132 IRQ30_183_MARK, IRQ31_138_MARK, IRQ31_184_MARK,
133
134 /* MSIOF0 */
135 MSIOF0_TSYNC_MARK, MSIOF0_TSCK_MARK, MSIOF0_RXD_MARK,
136 MSIOF0_RSCK_MARK, MSIOF0_RSYNC_MARK, MSIOF0_MCK0_MARK,
137 MSIOF0_MCK1_MARK, MSIOF0_SS1_MARK, MSIOF0_SS2_MARK,
138 MSIOF0_TXD_MARK,
139
140 /* MSIOF1 */
141 MSIOF1_TSCK_39_MARK, MSIOF1_TSYNC_40_MARK,
142 MSIOF1_TSCK_88_MARK, MSIOF1_TSYNC_89_MARK,
143 MSIOF1_TXD_41_MARK, MSIOF1_RXD_42_MARK,
144 MSIOF1_TXD_90_MARK, MSIOF1_RXD_91_MARK,
145 MSIOF1_SS1_43_MARK, MSIOF1_SS2_44_MARK,
146 MSIOF1_SS1_92_MARK, MSIOF1_SS2_93_MARK,
147 MSIOF1_RSCK_MARK, MSIOF1_RSYNC_MARK,
148 MSIOF1_MCK0_MARK, MSIOF1_MCK1_MARK,
149
150 /* MSIOF2 */
151 MSIOF2_RSCK_MARK, MSIOF2_RSYNC_MARK, MSIOF2_MCK0_MARK,
152 MSIOF2_MCK1_MARK, MSIOF2_SS1_MARK, MSIOF2_SS2_MARK,
153 MSIOF2_TSYNC_MARK, MSIOF2_TSCK_MARK, MSIOF2_RXD_MARK,
154 MSIOF2_TXD_MARK,
155
156 /* BBIF1 */
157 BBIF1_RXD_MARK, BBIF1_TSYNC_MARK, BBIF1_TSCK_MARK,
158 BBIF1_TXD_MARK, BBIF1_RSCK_MARK, BBIF1_RSYNC_MARK,
159 BBIF1_FLOW_MARK, BB_RX_FLOW_N_MARK,
160
161 /* BBIF2 */
162 BBIF2_TSCK1_MARK, BBIF2_TSYNC1_MARK,
163 BBIF2_TXD1_MARK, BBIF2_RXD_MARK,
164
165 /* FSI */
166 FSIACK_MARK, FSIBCK_MARK, FSIAILR_MARK, FSIAIBT_MARK,
167 FSIAISLD_MARK, FSIAOMC_MARK, FSIAOLR_MARK, FSIAOBT_MARK,
168 FSIAOSLD_MARK, FSIASPDIF_11_MARK, FSIASPDIF_15_MARK,
169
170 /* FMSI */
171 FMSOCK_MARK, FMSOOLR_MARK, FMSIOLR_MARK, FMSOOBT_MARK,
172 FMSIOBT_MARK, FMSOSLD_MARK, FMSOILR_MARK, FMSIILR_MARK,
173 FMSOIBT_MARK, FMSIIBT_MARK, FMSISLD_MARK, FMSICK_MARK,
174
175 /* SCIFA0 */
176 SCIFA0_TXD_MARK, SCIFA0_RXD_MARK, SCIFA0_SCK_MARK,
177 SCIFA0_RTS_MARK, SCIFA0_CTS_MARK,
178
179 /* SCIFA1 */
180 SCIFA1_TXD_MARK, SCIFA1_RXD_MARK, SCIFA1_SCK_MARK,
181 SCIFA1_RTS_MARK, SCIFA1_CTS_MARK,
182
183 /* SCIFA2 */
184 SCIFA2_CTS1_MARK, SCIFA2_RTS1_MARK, SCIFA2_TXD1_MARK,
185 SCIFA2_RXD1_MARK, SCIFA2_SCK1_MARK,
186
187 /* SCIFA3 */
188 SCIFA3_CTS_43_MARK, SCIFA3_CTS_140_MARK, SCIFA3_RTS_44_MARK,
189 SCIFA3_RTS_141_MARK, SCIFA3_SCK_MARK, SCIFA3_TXD_MARK,
190 SCIFA3_RXD_MARK,
191
192 /* SCIFA4 */
193 SCIFA4_RXD_MARK, SCIFA4_TXD_MARK,
194
195 /* SCIFA5 */
196 SCIFA5_RXD_MARK, SCIFA5_TXD_MARK,
197
198 /* SCIFB */
199 SCIFB_SCK_MARK, SCIFB_RTS_MARK, SCIFB_CTS_MARK,
200 SCIFB_TXD_MARK, SCIFB_RXD_MARK,
201
202 /* CEU */
203 VIO_HD_MARK, VIO_CKO1_MARK, VIO_CKO2_MARK, VIO_VD_MARK,
204 VIO_CLK_MARK, VIO_FIELD_MARK, VIO_CKO_MARK,
205 VIO_D0_MARK, VIO_D1_MARK, VIO_D2_MARK, VIO_D3_MARK,
206 VIO_D4_MARK, VIO_D5_MARK, VIO_D6_MARK, VIO_D7_MARK,
207 VIO_D8_MARK, VIO_D9_MARK, VIO_D10_MARK, VIO_D11_MARK,
208 VIO_D12_MARK, VIO_D13_MARK, VIO_D14_MARK, VIO_D15_MARK,
209
210 /* USB0 */
211 IDIN_0_MARK, EXTLP_0_MARK, OVCN2_0_MARK, PWEN_0_MARK,
212 OVCN_0_MARK, VBUS0_0_MARK,
213
214 /* USB1 */
215 IDIN_1_18_MARK, IDIN_1_113_MARK,
216 PWEN_1_115_MARK, PWEN_1_138_MARK,
217 OVCN_1_114_MARK, OVCN_1_162_MARK,
218 EXTLP_1_MARK, OVCN2_1_MARK,
219 VBUS0_1_MARK,
220
221 /* GPIO */
222 GPI0_MARK, GPI1_MARK, GPO0_MARK, GPO1_MARK,
223
224 /* BSC */
225 BS_MARK, WE1_MARK,
226 CKO_MARK, WAIT_MARK, RDWR_MARK,
227
228 A0_MARK, A1_MARK, A2_MARK, A3_MARK,
229 A6_MARK, A7_MARK, A8_MARK, A9_MARK,
230 A10_MARK, A11_MARK, A12_MARK, A13_MARK,
231 A14_MARK, A15_MARK, A16_MARK, A17_MARK,
232 A18_MARK, A19_MARK, A20_MARK, A21_MARK,
233 A22_MARK, A23_MARK, A24_MARK, A25_MARK,
234 A26_MARK,
235
236 CS0_MARK, CS2_MARK, CS4_MARK,
237 CS5A_MARK, CS5B_MARK, CS6A_MARK,
238
239 /* BSC/FLCTL */
240 RD_FSC_MARK, WE0_FWE_MARK, A4_FOE_MARK, A5_FCDE_MARK,
241 D0_NAF0_MARK, D1_NAF1_MARK, D2_NAF2_MARK, D3_NAF3_MARK,
242 D4_NAF4_MARK, D5_NAF5_MARK, D6_NAF6_MARK, D7_NAF7_MARK,
243 D8_NAF8_MARK, D9_NAF9_MARK, D10_NAF10_MARK, D11_NAF11_MARK,
244 D12_NAF12_MARK, D13_NAF13_MARK, D14_NAF14_MARK, D15_NAF15_MARK,
245
246 /* MMCIF(1) */
247 MMCD0_0_MARK, MMCD0_1_MARK, MMCD0_2_MARK, MMCD0_3_MARK,
248 MMCD0_4_MARK, MMCD0_5_MARK, MMCD0_6_MARK, MMCD0_7_MARK,
249 MMCCMD0_MARK, MMCCLK0_MARK,
250
251 /* MMCIF(2) */
252 MMCD1_0_MARK, MMCD1_1_MARK, MMCD1_2_MARK, MMCD1_3_MARK,
253 MMCD1_4_MARK, MMCD1_5_MARK, MMCD1_6_MARK, MMCD1_7_MARK,
254 MMCCLK1_MARK, MMCCMD1_MARK,
255
256 /* SPU2 */
257 VINT_I_MARK,
258
259 /* FLCTL */
260 FCE1_MARK, FCE0_MARK, FRB_MARK,
261
262 /* HSI */
263 GP_RX_FLAG_MARK, GP_RX_DATA_MARK, GP_TX_READY_MARK,
264 GP_RX_WAKE_MARK, MP_TX_FLAG_MARK, MP_TX_DATA_MARK,
265 MP_RX_READY_MARK, MP_TX_WAKE_MARK,
266
267 /* MFI */
268 MFIv6_MARK,
269 MFIv4_MARK,
270
271 MEMC_CS0_MARK, MEMC_BUSCLK_MEMC_A0_MARK,
272 MEMC_CS1_MEMC_A1_MARK, MEMC_ADV_MEMC_DREQ0_MARK,
273 MEMC_WAIT_MEMC_DREQ1_MARK, MEMC_NOE_MARK,
274 MEMC_NWE_MARK, MEMC_INT_MARK,
275
276 MEMC_AD0_MARK, MEMC_AD1_MARK, MEMC_AD2_MARK,
277 MEMC_AD3_MARK, MEMC_AD4_MARK, MEMC_AD5_MARK,
278 MEMC_AD6_MARK, MEMC_AD7_MARK, MEMC_AD8_MARK,
279 MEMC_AD9_MARK, MEMC_AD10_MARK, MEMC_AD11_MARK,
280 MEMC_AD12_MARK, MEMC_AD13_MARK, MEMC_AD14_MARK,
281 MEMC_AD15_MARK,
282
283 /* SIM */
284 SIM_RST_MARK, SIM_CLK_MARK, SIM_D_MARK,
285
286 /* TPU */
287 TPU0TO0_MARK, TPU0TO1_MARK,
288 TPU0TO2_93_MARK, TPU0TO2_99_MARK,
289 TPU0TO3_MARK,
290
291 /* I2C2 */
292 I2C_SCL2_MARK, I2C_SDA2_MARK,
293
294 /* I2C3(1) */
295 I2C_SCL3_MARK, I2C_SDA3_MARK,
296
297 /* I2C3(2) */
298 I2C_SCL3S_MARK, I2C_SDA3S_MARK,
299
300 /* I2C4(2) */
301 I2C_SCL4_MARK, I2C_SDA4_MARK,
302
303 /* I2C4(2) */
304 I2C_SCL4S_MARK, I2C_SDA4S_MARK,
305
306 /* KEYSC */
307 KEYOUT0_MARK, KEYIN0_121_MARK, KEYIN0_136_MARK,
308 KEYOUT1_MARK, KEYIN1_122_MARK, KEYIN1_135_MARK,
309 KEYOUT2_MARK, KEYIN2_123_MARK, KEYIN2_134_MARK,
310 KEYOUT3_MARK, KEYIN3_124_MARK, KEYIN3_133_MARK,
311 KEYOUT4_MARK, KEYIN4_MARK,
312 KEYOUT5_MARK, KEYIN5_MARK,
313 KEYOUT6_MARK, KEYIN6_MARK,
314 KEYOUT7_MARK, KEYIN7_MARK,
315
316 /* LCDC */
317 LCDC0_SELECT_MARK,
318 LCDC1_SELECT_MARK,
319 LCDHSYN_MARK, LCDCS_MARK, LCDVSYN_MARK, LCDDCK_MARK,
320 LCDWR_MARK, LCDRD_MARK, LCDDISP_MARK, LCDRS_MARK,
321 LCDLCLK_MARK, LCDDON_MARK,
322
323 LCDD0_MARK, LCDD1_MARK, LCDD2_MARK, LCDD3_MARK,
324 LCDD4_MARK, LCDD5_MARK, LCDD6_MARK, LCDD7_MARK,
325 LCDD8_MARK, LCDD9_MARK, LCDD10_MARK, LCDD11_MARK,
326 LCDD12_MARK, LCDD13_MARK, LCDD14_MARK, LCDD15_MARK,
327 LCDD16_MARK, LCDD17_MARK, LCDD18_MARK, LCDD19_MARK,
328 LCDD20_MARK, LCDD21_MARK, LCDD22_MARK, LCDD23_MARK,
329
330 /* IRDA */
331 IRDA_OUT_MARK, IRDA_IN_MARK, IRDA_FIRSEL_MARK,
332 IROUT_139_MARK, IROUT_140_MARK,
333
334 /* TSIF1 */
335 TS0_1SELECT_MARK,
336 TS0_2SELECT_MARK,
337 TS1_1SELECT_MARK,
338 TS1_2SELECT_MARK,
339
340 TS_SPSYNC1_MARK, TS_SDAT1_MARK,
341 TS_SDEN1_MARK, TS_SCK1_MARK,
342
343 /* TSIF2 */
344 TS_SPSYNC2_MARK, TS_SDAT2_MARK,
345 TS_SDEN2_MARK, TS_SCK2_MARK,
346
347 /* HDMI */
348 HDMI_HPD_MARK, HDMI_CEC_MARK,
349
350 /* SDHI0 */
351 SDHICLK0_MARK, SDHICD0_MARK,
352 SDHICMD0_MARK, SDHIWP0_MARK,
353 SDHID0_0_MARK, SDHID0_1_MARK,
354 SDHID0_2_MARK, SDHID0_3_MARK,
355
356 /* SDHI1 */
357 SDHICLK1_MARK, SDHICMD1_MARK, SDHID1_0_MARK,
358 SDHID1_1_MARK, SDHID1_2_MARK, SDHID1_3_MARK,
359
360 /* SDHI2 */
361 SDHICLK2_MARK, SDHICMD2_MARK, SDHID2_0_MARK,
362 SDHID2_1_MARK, SDHID2_2_MARK, SDHID2_3_MARK,
363
364 /* SDENC */
365 SDENC_CPG_MARK,
366 SDENC_DV_CLKI_MARK,
367
368 PINMUX_MARK_END,
369};
370
371static pinmux_enum_t pinmux_data[] = {
372
373 /* specify valid pin states for each pin in GPIO mode */
374 PORT_DATA_IO_PD(0), PORT_DATA_IO_PD(1),
375 PORT_DATA_O(2), PORT_DATA_I_PD(3),
376 PORT_DATA_I_PD(4), PORT_DATA_I_PD(5),
377 PORT_DATA_IO_PU_PD(6), PORT_DATA_I_PD(7),
378 PORT_DATA_IO_PD(8), PORT_DATA_O(9),
379
380 PORT_DATA_O(10), PORT_DATA_O(11),
381 PORT_DATA_IO_PU_PD(12), PORT_DATA_IO_PD(13),
382 PORT_DATA_IO_PD(14), PORT_DATA_O(15),
383 PORT_DATA_IO_PD(16), PORT_DATA_IO_PD(17),
384 PORT_DATA_I_PD(18), PORT_DATA_IO(19),
385
386 PORT_DATA_IO(20), PORT_DATA_IO(21),
387 PORT_DATA_IO(22), PORT_DATA_IO(23),
388 PORT_DATA_IO(24), PORT_DATA_IO(25),
389 PORT_DATA_IO(26), PORT_DATA_IO(27),
390 PORT_DATA_IO(28), PORT_DATA_IO(29),
391
392 PORT_DATA_IO(30), PORT_DATA_IO(31),
393 PORT_DATA_IO(32), PORT_DATA_IO(33),
394 PORT_DATA_IO(34), PORT_DATA_IO(35),
395 PORT_DATA_IO(36), PORT_DATA_IO(37),
396 PORT_DATA_IO(38), PORT_DATA_IO(39),
397
398 PORT_DATA_IO(40), PORT_DATA_IO(41),
399 PORT_DATA_IO(42), PORT_DATA_IO(43),
400 PORT_DATA_IO(44), PORT_DATA_IO(45),
401 PORT_DATA_IO_PU(46), PORT_DATA_IO_PU(47),
402 PORT_DATA_IO_PU(48), PORT_DATA_IO_PU(49),
403
404 PORT_DATA_IO_PU(50), PORT_DATA_IO_PU(51),
405 PORT_DATA_IO_PU(52), PORT_DATA_IO_PU(53),
406 PORT_DATA_IO_PU(54), PORT_DATA_IO_PU(55),
407 PORT_DATA_IO_PU(56), PORT_DATA_IO_PU(57),
408 PORT_DATA_IO_PU(58), PORT_DATA_IO_PU(59),
409
410 PORT_DATA_IO_PU(60), PORT_DATA_IO_PU(61),
411 PORT_DATA_IO(62), PORT_DATA_O(63),
412 PORT_DATA_O(64), PORT_DATA_IO_PU(65),
413 PORT_DATA_O(66), PORT_DATA_IO_PU(67), /*66?*/
414 PORT_DATA_O(68), PORT_DATA_IO(69),
415
416 PORT_DATA_IO(70), PORT_DATA_IO(71),
417 PORT_DATA_O(72), PORT_DATA_I_PU(73),
418 PORT_DATA_I_PU_PD(74), PORT_DATA_IO_PU_PD(75),
419 PORT_DATA_IO_PU_PD(76), PORT_DATA_IO_PU_PD(77),
420 PORT_DATA_IO_PU_PD(78), PORT_DATA_IO_PU_PD(79),
421
422 PORT_DATA_IO_PU_PD(80), PORT_DATA_IO_PU_PD(81),
423 PORT_DATA_IO_PU_PD(82), PORT_DATA_IO_PU_PD(83),
424 PORT_DATA_IO_PU_PD(84), PORT_DATA_IO_PU_PD(85),
425 PORT_DATA_IO_PU_PD(86), PORT_DATA_IO_PU_PD(87),
426 PORT_DATA_IO_PU_PD(88), PORT_DATA_IO_PU_PD(89),
427
428 PORT_DATA_IO_PU_PD(90), PORT_DATA_IO_PU_PD(91),
429 PORT_DATA_IO_PU_PD(92), PORT_DATA_IO_PU_PD(93),
430 PORT_DATA_IO_PU_PD(94), PORT_DATA_IO_PU_PD(95),
431 PORT_DATA_IO_PU(96), PORT_DATA_IO_PU_PD(97),
432 PORT_DATA_IO_PU_PD(98), PORT_DATA_O(99), /*99?*/
433
434 PORT_DATA_IO_PD(100), PORT_DATA_IO_PD(101),
435 PORT_DATA_IO_PD(102), PORT_DATA_IO_PD(103),
436 PORT_DATA_IO_PD(104), PORT_DATA_IO_PD(105),
437 PORT_DATA_IO_PU(106), PORT_DATA_IO_PU(107),
438 PORT_DATA_IO_PU(108), PORT_DATA_IO_PU(109),
439
440 PORT_DATA_IO_PU(110), PORT_DATA_IO_PU(111),
441 PORT_DATA_IO_PD(112), PORT_DATA_IO_PD(113),
442 PORT_DATA_IO_PU(114), PORT_DATA_IO_PU(115),
443 PORT_DATA_IO_PU(116), PORT_DATA_IO_PU(117),
444 PORT_DATA_IO_PU(118), PORT_DATA_IO_PU(119),
445
446 PORT_DATA_IO_PU(120), PORT_DATA_IO_PD(121),
447 PORT_DATA_IO_PD(122), PORT_DATA_IO_PD(123),
448 PORT_DATA_IO_PD(124), PORT_DATA_IO_PD(125),
449 PORT_DATA_IO_PD(126), PORT_DATA_IO_PD(127),
450 PORT_DATA_IO_PD(128), PORT_DATA_IO_PU_PD(129),
451
452 PORT_DATA_IO_PU_PD(130), PORT_DATA_IO_PU_PD(131),
453 PORT_DATA_IO_PU_PD(132), PORT_DATA_IO_PU_PD(133),
454 PORT_DATA_IO_PU_PD(134), PORT_DATA_IO_PU_PD(135),
455 PORT_DATA_IO_PD(136), PORT_DATA_IO_PD(137),
456 PORT_DATA_IO_PD(138), PORT_DATA_IO_PD(139),
457
458 PORT_DATA_IO_PD(140), PORT_DATA_IO_PD(141),
459 PORT_DATA_IO_PD(142), PORT_DATA_IO_PU_PD(143),
460 PORT_DATA_IO_PD(144), PORT_DATA_IO_PD(145),
461 PORT_DATA_IO_PD(146), PORT_DATA_IO_PD(147),
462 PORT_DATA_IO_PD(148), PORT_DATA_IO_PD(149),
463
464 PORT_DATA_IO_PD(150), PORT_DATA_IO_PD(151),
465 PORT_DATA_IO_PU_PD(152), PORT_DATA_I_PD(153),
466 PORT_DATA_IO_PU_PD(154), PORT_DATA_I_PD(155),
467 PORT_DATA_IO_PD(156), PORT_DATA_IO_PD(157),
468 PORT_DATA_I_PD(158), PORT_DATA_IO_PD(159),
469
470 PORT_DATA_O(160), PORT_DATA_IO_PD(161),
471 PORT_DATA_IO_PD(162), PORT_DATA_IO_PD(163),
472 PORT_DATA_I_PD(164), PORT_DATA_IO_PD(165),
473 PORT_DATA_I_PD(166), PORT_DATA_I_PD(167),
474 PORT_DATA_I_PD(168), PORT_DATA_I_PD(169),
475
476 PORT_DATA_I_PD(170), PORT_DATA_O(171),
477 PORT_DATA_IO_PU_PD(172), PORT_DATA_IO_PU_PD(173),
478 PORT_DATA_IO_PU_PD(174), PORT_DATA_IO_PU_PD(175),
479 PORT_DATA_IO_PU_PD(176), PORT_DATA_IO_PU_PD(177),
480 PORT_DATA_IO_PU_PD(178), PORT_DATA_O(179),
481
482 PORT_DATA_IO_PU_PD(180), PORT_DATA_IO_PU_PD(181),
483 PORT_DATA_IO_PU_PD(182), PORT_DATA_IO_PU_PD(183),
484 PORT_DATA_IO_PU_PD(184), PORT_DATA_O(185),
485 PORT_DATA_IO_PU_PD(186), PORT_DATA_IO_PU_PD(187),
486 PORT_DATA_IO_PU_PD(188), PORT_DATA_IO_PU_PD(189),
487
488 PORT_DATA_IO_PU_PD(190),
489
490 /* IRQ */
491 PINMUX_DATA(IRQ0_6_MARK, PORT6_FN0, MSEL1CR_0_0),
492 PINMUX_DATA(IRQ0_162_MARK, PORT162_FN0, MSEL1CR_0_1),
493 PINMUX_DATA(IRQ1_MARK, PORT12_FN0),
494 PINMUX_DATA(IRQ2_4_MARK, PORT4_FN0, MSEL1CR_2_0),
495 PINMUX_DATA(IRQ2_5_MARK, PORT5_FN0, MSEL1CR_2_1),
496 PINMUX_DATA(IRQ3_8_MARK, PORT8_FN0, MSEL1CR_3_0),
497 PINMUX_DATA(IRQ3_16_MARK, PORT16_FN0, MSEL1CR_3_1),
498 PINMUX_DATA(IRQ4_17_MARK, PORT17_FN0, MSEL1CR_4_0),
499 PINMUX_DATA(IRQ4_163_MARK, PORT163_FN0, MSEL1CR_4_1),
500 PINMUX_DATA(IRQ5_MARK, PORT18_FN0),
501 PINMUX_DATA(IRQ6_39_MARK, PORT39_FN0, MSEL1CR_6_0),
502 PINMUX_DATA(IRQ6_164_MARK, PORT164_FN0, MSEL1CR_6_1),
503 PINMUX_DATA(IRQ7_40_MARK, PORT40_FN0, MSEL1CR_7_1),
504 PINMUX_DATA(IRQ7_167_MARK, PORT167_FN0, MSEL1CR_7_0),
505 PINMUX_DATA(IRQ8_41_MARK, PORT41_FN0, MSEL1CR_8_1),
506 PINMUX_DATA(IRQ8_168_MARK, PORT168_FN0, MSEL1CR_8_0),
507 PINMUX_DATA(IRQ9_42_MARK, PORT42_FN0, MSEL1CR_9_0),
508 PINMUX_DATA(IRQ9_169_MARK, PORT169_FN0, MSEL1CR_9_1),
509 PINMUX_DATA(IRQ10_MARK, PORT65_FN0, MSEL1CR_9_1),
510 PINMUX_DATA(IRQ11_MARK, PORT67_FN0),
511 PINMUX_DATA(IRQ12_80_MARK, PORT80_FN0, MSEL1CR_12_0),
512 PINMUX_DATA(IRQ12_137_MARK, PORT137_FN0, MSEL1CR_12_1),
513 PINMUX_DATA(IRQ13_81_MARK, PORT81_FN0, MSEL1CR_13_0),
514 PINMUX_DATA(IRQ13_145_MARK, PORT145_FN0, MSEL1CR_13_1),
515 PINMUX_DATA(IRQ14_82_MARK, PORT82_FN0, MSEL1CR_14_0),
516 PINMUX_DATA(IRQ14_146_MARK, PORT146_FN0, MSEL1CR_14_1),
517 PINMUX_DATA(IRQ15_83_MARK, PORT83_FN0, MSEL1CR_15_0),
518 PINMUX_DATA(IRQ15_147_MARK, PORT147_FN0, MSEL1CR_15_1),
519 PINMUX_DATA(IRQ16_84_MARK, PORT84_FN0, MSEL1CR_16_0),
520 PINMUX_DATA(IRQ16_170_MARK, PORT170_FN0, MSEL1CR_16_1),
521 PINMUX_DATA(IRQ17_MARK, PORT85_FN0),
522 PINMUX_DATA(IRQ18_MARK, PORT86_FN0),
523 PINMUX_DATA(IRQ19_MARK, PORT87_FN0),
524 PINMUX_DATA(IRQ20_MARK, PORT92_FN0),
525 PINMUX_DATA(IRQ21_MARK, PORT93_FN0),
526 PINMUX_DATA(IRQ22_MARK, PORT94_FN0),
527 PINMUX_DATA(IRQ23_MARK, PORT95_FN0),
528 PINMUX_DATA(IRQ24_MARK, PORT112_FN0),
529 PINMUX_DATA(IRQ25_MARK, PORT119_FN0),
530 PINMUX_DATA(IRQ26_121_MARK, PORT121_FN0, MSEL1CR_26_1),
531 PINMUX_DATA(IRQ26_172_MARK, PORT172_FN0, MSEL1CR_26_0),
532 PINMUX_DATA(IRQ27_122_MARK, PORT122_FN0, MSEL1CR_27_1),
533 PINMUX_DATA(IRQ27_180_MARK, PORT180_FN0, MSEL1CR_27_0),
534 PINMUX_DATA(IRQ28_123_MARK, PORT123_FN0, MSEL1CR_28_1),
535 PINMUX_DATA(IRQ28_181_MARK, PORT181_FN0, MSEL1CR_28_0),
536 PINMUX_DATA(IRQ29_129_MARK, PORT129_FN0, MSEL1CR_29_1),
537 PINMUX_DATA(IRQ29_182_MARK, PORT182_FN0, MSEL1CR_29_0),
538 PINMUX_DATA(IRQ30_130_MARK, PORT130_FN0, MSEL1CR_30_1),
539 PINMUX_DATA(IRQ30_183_MARK, PORT183_FN0, MSEL1CR_30_0),
540 PINMUX_DATA(IRQ31_138_MARK, PORT138_FN0, MSEL1CR_31_1),
541 PINMUX_DATA(IRQ31_184_MARK, PORT184_FN0, MSEL1CR_31_0),
542
543 /* Function 1 */
544 PINMUX_DATA(BBIF2_TSCK1_MARK, PORT0_FN1),
545 PINMUX_DATA(BBIF2_TSYNC1_MARK, PORT1_FN1),
546 PINMUX_DATA(BBIF2_TXD1_MARK, PORT2_FN1),
547 PINMUX_DATA(BBIF2_RXD_MARK, PORT3_FN1),
548 PINMUX_DATA(FSIACK_MARK, PORT4_FN1),
549 PINMUX_DATA(FSIAILR_MARK, PORT5_FN1),
550 PINMUX_DATA(FSIAIBT_MARK, PORT6_FN1),
551 PINMUX_DATA(FSIAISLD_MARK, PORT7_FN1),
552 PINMUX_DATA(FSIAOMC_MARK, PORT8_FN1),
553 PINMUX_DATA(FSIAOLR_MARK, PORT9_FN1),
554 PINMUX_DATA(FSIAOBT_MARK, PORT10_FN1),
555 PINMUX_DATA(FSIAOSLD_MARK, PORT11_FN1),
556 PINMUX_DATA(FMSOCK_MARK, PORT12_FN1),
557 PINMUX_DATA(FMSOOLR_MARK, PORT13_FN1),
558 PINMUX_DATA(FMSOOBT_MARK, PORT14_FN1),
559 PINMUX_DATA(FMSOSLD_MARK, PORT15_FN1),
560 PINMUX_DATA(FMSOILR_MARK, PORT16_FN1),
561 PINMUX_DATA(FMSOIBT_MARK, PORT17_FN1),
562 PINMUX_DATA(FMSISLD_MARK, PORT18_FN1),
563 PINMUX_DATA(A0_MARK, PORT19_FN1),
564 PINMUX_DATA(A1_MARK, PORT20_FN1),
565 PINMUX_DATA(A2_MARK, PORT21_FN1),
566 PINMUX_DATA(A3_MARK, PORT22_FN1),
567 PINMUX_DATA(A4_FOE_MARK, PORT23_FN1),
568 PINMUX_DATA(A5_FCDE_MARK, PORT24_FN1),
569 PINMUX_DATA(A6_MARK, PORT25_FN1),
570 PINMUX_DATA(A7_MARK, PORT26_FN1),
571 PINMUX_DATA(A8_MARK, PORT27_FN1),
572 PINMUX_DATA(A9_MARK, PORT28_FN1),
573 PINMUX_DATA(A10_MARK, PORT29_FN1),
574 PINMUX_DATA(A11_MARK, PORT30_FN1),
575 PINMUX_DATA(A12_MARK, PORT31_FN1),
576 PINMUX_DATA(A13_MARK, PORT32_FN1),
577 PINMUX_DATA(A14_MARK, PORT33_FN1),
578 PINMUX_DATA(A15_MARK, PORT34_FN1),
579 PINMUX_DATA(A16_MARK, PORT35_FN1),
580 PINMUX_DATA(A17_MARK, PORT36_FN1),
581 PINMUX_DATA(A18_MARK, PORT37_FN1),
582 PINMUX_DATA(A19_MARK, PORT38_FN1),
583 PINMUX_DATA(A20_MARK, PORT39_FN1),
584 PINMUX_DATA(A21_MARK, PORT40_FN1),
585 PINMUX_DATA(A22_MARK, PORT41_FN1),
586 PINMUX_DATA(A23_MARK, PORT42_FN1),
587 PINMUX_DATA(A24_MARK, PORT43_FN1),
588 PINMUX_DATA(A25_MARK, PORT44_FN1),
589 PINMUX_DATA(A26_MARK, PORT45_FN1),
590 PINMUX_DATA(D0_NAF0_MARK, PORT46_FN1),
591 PINMUX_DATA(D1_NAF1_MARK, PORT47_FN1),
592 PINMUX_DATA(D2_NAF2_MARK, PORT48_FN1),
593 PINMUX_DATA(D3_NAF3_MARK, PORT49_FN1),
594 PINMUX_DATA(D4_NAF4_MARK, PORT50_FN1),
595 PINMUX_DATA(D5_NAF5_MARK, PORT51_FN1),
596 PINMUX_DATA(D6_NAF6_MARK, PORT52_FN1),
597 PINMUX_DATA(D7_NAF7_MARK, PORT53_FN1),
598 PINMUX_DATA(D8_NAF8_MARK, PORT54_FN1),
599 PINMUX_DATA(D9_NAF9_MARK, PORT55_FN1),
600 PINMUX_DATA(D10_NAF10_MARK, PORT56_FN1),
601 PINMUX_DATA(D11_NAF11_MARK, PORT57_FN1),
602 PINMUX_DATA(D12_NAF12_MARK, PORT58_FN1),
603 PINMUX_DATA(D13_NAF13_MARK, PORT59_FN1),
604 PINMUX_DATA(D14_NAF14_MARK, PORT60_FN1),
605 PINMUX_DATA(D15_NAF15_MARK, PORT61_FN1),
606 PINMUX_DATA(CS0_MARK, PORT62_FN1),
607 PINMUX_DATA(CS2_MARK, PORT63_FN1),
608 PINMUX_DATA(CS4_MARK, PORT64_FN1),
609 PINMUX_DATA(CS5A_MARK, PORT65_FN1),
610 PINMUX_DATA(CS5B_MARK, PORT66_FN1),
611 PINMUX_DATA(CS6A_MARK, PORT67_FN1),
612 PINMUX_DATA(FCE0_MARK, PORT68_FN1),
613 PINMUX_DATA(RD_FSC_MARK, PORT69_FN1),
614 PINMUX_DATA(WE0_FWE_MARK, PORT70_FN1),
615 PINMUX_DATA(WE1_MARK, PORT71_FN1),
616 PINMUX_DATA(CKO_MARK, PORT72_FN1),
617 PINMUX_DATA(FRB_MARK, PORT73_FN1),
618 PINMUX_DATA(WAIT_MARK, PORT74_FN1),
619 PINMUX_DATA(RDWR_MARK, PORT75_FN1),
620 PINMUX_DATA(MEMC_AD0_MARK, PORT76_FN1),
621 PINMUX_DATA(MEMC_AD1_MARK, PORT77_FN1),
622 PINMUX_DATA(MEMC_AD2_MARK, PORT78_FN1),
623 PINMUX_DATA(MEMC_AD3_MARK, PORT79_FN1),
624 PINMUX_DATA(MEMC_AD4_MARK, PORT80_FN1),
625 PINMUX_DATA(MEMC_AD5_MARK, PORT81_FN1),
626 PINMUX_DATA(MEMC_AD6_MARK, PORT82_FN1),
627 PINMUX_DATA(MEMC_AD7_MARK, PORT83_FN1),
628 PINMUX_DATA(MEMC_AD8_MARK, PORT84_FN1),
629 PINMUX_DATA(MEMC_AD9_MARK, PORT85_FN1),
630 PINMUX_DATA(MEMC_AD10_MARK, PORT86_FN1),
631 PINMUX_DATA(MEMC_AD11_MARK, PORT87_FN1),
632 PINMUX_DATA(MEMC_AD12_MARK, PORT88_FN1),
633 PINMUX_DATA(MEMC_AD13_MARK, PORT89_FN1),
634 PINMUX_DATA(MEMC_AD14_MARK, PORT90_FN1),
635 PINMUX_DATA(MEMC_AD15_MARK, PORT91_FN1),
636 PINMUX_DATA(MEMC_CS0_MARK, PORT92_FN1),
637 PINMUX_DATA(MEMC_BUSCLK_MEMC_A0_MARK, PORT93_FN1),
638 PINMUX_DATA(MEMC_CS1_MEMC_A1_MARK, PORT94_FN1),
639 PINMUX_DATA(MEMC_ADV_MEMC_DREQ0_MARK, PORT95_FN1),
640 PINMUX_DATA(MEMC_WAIT_MEMC_DREQ1_MARK, PORT96_FN1),
641 PINMUX_DATA(MEMC_NOE_MARK, PORT97_FN1),
642 PINMUX_DATA(MEMC_NWE_MARK, PORT98_FN1),
643 PINMUX_DATA(MEMC_INT_MARK, PORT99_FN1),
644 PINMUX_DATA(VIO_VD_MARK, PORT100_FN1),
645 PINMUX_DATA(VIO_HD_MARK, PORT101_FN1),
646 PINMUX_DATA(VIO_D0_MARK, PORT102_FN1),
647 PINMUX_DATA(VIO_D1_MARK, PORT103_FN1),
648 PINMUX_DATA(VIO_D2_MARK, PORT104_FN1),
649 PINMUX_DATA(VIO_D3_MARK, PORT105_FN1),
650 PINMUX_DATA(VIO_D4_MARK, PORT106_FN1),
651 PINMUX_DATA(VIO_D5_MARK, PORT107_FN1),
652 PINMUX_DATA(VIO_D6_MARK, PORT108_FN1),
653 PINMUX_DATA(VIO_D7_MARK, PORT109_FN1),
654 PINMUX_DATA(VIO_D8_MARK, PORT110_FN1),
655 PINMUX_DATA(VIO_D9_MARK, PORT111_FN1),
656 PINMUX_DATA(VIO_D10_MARK, PORT112_FN1),
657 PINMUX_DATA(VIO_D11_MARK, PORT113_FN1),
658 PINMUX_DATA(VIO_D12_MARK, PORT114_FN1),
659 PINMUX_DATA(VIO_D13_MARK, PORT115_FN1),
660 PINMUX_DATA(VIO_D14_MARK, PORT116_FN1),
661 PINMUX_DATA(VIO_D15_MARK, PORT117_FN1),
662 PINMUX_DATA(VIO_CLK_MARK, PORT118_FN1),
663 PINMUX_DATA(VIO_FIELD_MARK, PORT119_FN1),
664 PINMUX_DATA(VIO_CKO_MARK, PORT120_FN1),
665 PINMUX_DATA(LCDD0_MARK, PORT121_FN1),
666 PINMUX_DATA(LCDD1_MARK, PORT122_FN1),
667 PINMUX_DATA(LCDD2_MARK, PORT123_FN1),
668 PINMUX_DATA(LCDD3_MARK, PORT124_FN1),
669 PINMUX_DATA(LCDD4_MARK, PORT125_FN1),
670 PINMUX_DATA(LCDD5_MARK, PORT126_FN1),
671 PINMUX_DATA(LCDD6_MARK, PORT127_FN1),
672 PINMUX_DATA(LCDD7_MARK, PORT128_FN1),
673 PINMUX_DATA(LCDD8_MARK, PORT129_FN1),
674 PINMUX_DATA(LCDD9_MARK, PORT130_FN1),
675 PINMUX_DATA(LCDD10_MARK, PORT131_FN1),
676 PINMUX_DATA(LCDD11_MARK, PORT132_FN1),
677 PINMUX_DATA(LCDD12_MARK, PORT133_FN1),
678 PINMUX_DATA(LCDD13_MARK, PORT134_FN1),
679 PINMUX_DATA(LCDD14_MARK, PORT135_FN1),
680 PINMUX_DATA(LCDD15_MARK, PORT136_FN1),
681 PINMUX_DATA(LCDD16_MARK, PORT137_FN1),
682 PINMUX_DATA(LCDD17_MARK, PORT138_FN1),
683 PINMUX_DATA(LCDD18_MARK, PORT139_FN1),
684 PINMUX_DATA(LCDD19_MARK, PORT140_FN1),
685 PINMUX_DATA(LCDD20_MARK, PORT141_FN1),
686 PINMUX_DATA(LCDD21_MARK, PORT142_FN1),
687 PINMUX_DATA(LCDD22_MARK, PORT143_FN1),
688 PINMUX_DATA(LCDD23_MARK, PORT144_FN1),
689 PINMUX_DATA(LCDHSYN_MARK, PORT145_FN1),
690 PINMUX_DATA(LCDVSYN_MARK, PORT146_FN1),
691 PINMUX_DATA(LCDDCK_MARK, PORT147_FN1),
692 PINMUX_DATA(LCDRD_MARK, PORT148_FN1),
693 PINMUX_DATA(LCDDISP_MARK, PORT149_FN1),
694 PINMUX_DATA(LCDLCLK_MARK, PORT150_FN1),
695 PINMUX_DATA(LCDDON_MARK, PORT151_FN1),
696 PINMUX_DATA(SCIFA0_TXD_MARK, PORT152_FN1),
697 PINMUX_DATA(SCIFA0_RXD_MARK, PORT153_FN1),
698 PINMUX_DATA(SCIFA1_TXD_MARK, PORT154_FN1),
699 PINMUX_DATA(SCIFA1_RXD_MARK, PORT155_FN1),
700 PINMUX_DATA(TS_SPSYNC1_MARK, PORT156_FN1),
701 PINMUX_DATA(TS_SDAT1_MARK, PORT157_FN1),
702 PINMUX_DATA(TS_SDEN1_MARK, PORT158_FN1),
703 PINMUX_DATA(TS_SCK1_MARK, PORT159_FN1),
704 PINMUX_DATA(TPU0TO0_MARK, PORT160_FN1),
705 PINMUX_DATA(TPU0TO1_MARK, PORT161_FN1),
706 PINMUX_DATA(SCIFB_SCK_MARK, PORT162_FN1),
707 PINMUX_DATA(SCIFB_RTS_MARK, PORT163_FN1),
708 PINMUX_DATA(SCIFB_CTS_MARK, PORT164_FN1),
709 PINMUX_DATA(SCIFB_TXD_MARK, PORT165_FN1),
710 PINMUX_DATA(SCIFB_RXD_MARK, PORT166_FN1),
711 PINMUX_DATA(VBUS0_0_MARK, PORT167_FN1),
712 PINMUX_DATA(VBUS0_1_MARK, PORT168_FN1),
713 PINMUX_DATA(HDMI_HPD_MARK, PORT169_FN1),
714 PINMUX_DATA(HDMI_CEC_MARK, PORT170_FN1),
715 PINMUX_DATA(SDHICLK0_MARK, PORT171_FN1),
716 PINMUX_DATA(SDHICD0_MARK, PORT172_FN1),
717 PINMUX_DATA(SDHID0_0_MARK, PORT173_FN1),
718 PINMUX_DATA(SDHID0_1_MARK, PORT174_FN1),
719 PINMUX_DATA(SDHID0_2_MARK, PORT175_FN1),
720 PINMUX_DATA(SDHID0_3_MARK, PORT176_FN1),
721 PINMUX_DATA(SDHICMD0_MARK, PORT177_FN1),
722 PINMUX_DATA(SDHIWP0_MARK, PORT178_FN1),
723 PINMUX_DATA(SDHICLK1_MARK, PORT179_FN1),
724 PINMUX_DATA(SDHID1_0_MARK, PORT180_FN1),
725 PINMUX_DATA(SDHID1_1_MARK, PORT181_FN1),
726 PINMUX_DATA(SDHID1_2_MARK, PORT182_FN1),
727 PINMUX_DATA(SDHID1_3_MARK, PORT183_FN1),
728 PINMUX_DATA(SDHICMD1_MARK, PORT184_FN1),
729 PINMUX_DATA(SDHICLK2_MARK, PORT185_FN1),
730 PINMUX_DATA(SDHID2_0_MARK, PORT186_FN1),
731 PINMUX_DATA(SDHID2_1_MARK, PORT187_FN1),
732 PINMUX_DATA(SDHID2_2_MARK, PORT188_FN1),
733 PINMUX_DATA(SDHID2_3_MARK, PORT189_FN1),
734 PINMUX_DATA(SDHICMD2_MARK, PORT190_FN1),
735
736 /* Function 2 */
737 PINMUX_DATA(FSIBCK_MARK, PORT4_FN2),
738 PINMUX_DATA(SCIFA4_RXD_MARK, PORT5_FN2),
739 PINMUX_DATA(SCIFA4_TXD_MARK, PORT6_FN2),
740 PINMUX_DATA(SCIFA5_RXD_MARK, PORT8_FN2),
741 PINMUX_DATA(FSIASPDIF_11_MARK, PORT11_FN2),
742 PINMUX_DATA(SCIFA5_TXD_MARK, PORT12_FN2),
743 PINMUX_DATA(FMSIOLR_MARK, PORT13_FN2),
744 PINMUX_DATA(FMSIOBT_MARK, PORT14_FN2),
745 PINMUX_DATA(FSIASPDIF_15_MARK, PORT15_FN2),
746 PINMUX_DATA(FMSIILR_MARK, PORT16_FN2),
747 PINMUX_DATA(FMSIIBT_MARK, PORT17_FN2),
748 PINMUX_DATA(BS_MARK, PORT19_FN2),
749 PINMUX_DATA(MSIOF0_TSYNC_MARK, PORT36_FN2),
750 PINMUX_DATA(MSIOF0_TSCK_MARK, PORT37_FN2),
751 PINMUX_DATA(MSIOF0_RXD_MARK, PORT38_FN2),
752 PINMUX_DATA(MSIOF0_RSCK_MARK, PORT39_FN2),
753 PINMUX_DATA(MSIOF0_RSYNC_MARK, PORT40_FN2),
754 PINMUX_DATA(MSIOF0_MCK0_MARK, PORT41_FN2),
755 PINMUX_DATA(MSIOF0_MCK1_MARK, PORT42_FN2),
756 PINMUX_DATA(MSIOF0_SS1_MARK, PORT43_FN2),
757 PINMUX_DATA(MSIOF0_SS2_MARK, PORT44_FN2),
758 PINMUX_DATA(MSIOF0_TXD_MARK, PORT45_FN2),
759 PINMUX_DATA(FMSICK_MARK, PORT65_FN2),
760 PINMUX_DATA(FCE1_MARK, PORT66_FN2),
761 PINMUX_DATA(BBIF1_RXD_MARK, PORT76_FN2),
762 PINMUX_DATA(BBIF1_TSYNC_MARK, PORT77_FN2),
763 PINMUX_DATA(BBIF1_TSCK_MARK, PORT78_FN2),
764 PINMUX_DATA(BBIF1_TXD_MARK, PORT79_FN2),
765 PINMUX_DATA(BBIF1_RSCK_MARK, PORT80_FN2),
766 PINMUX_DATA(BBIF1_RSYNC_MARK, PORT81_FN2),
767 PINMUX_DATA(BBIF1_FLOW_MARK, PORT82_FN2),
768 PINMUX_DATA(BB_RX_FLOW_N_MARK, PORT83_FN2),
769 PINMUX_DATA(MSIOF1_RSCK_MARK, PORT84_FN2),
770 PINMUX_DATA(MSIOF1_RSYNC_MARK, PORT85_FN2),
771 PINMUX_DATA(MSIOF1_MCK0_MARK, PORT86_FN2),
772 PINMUX_DATA(MSIOF1_MCK1_MARK, PORT87_FN2),
773 PINMUX_DATA(MSIOF1_TSCK_88_MARK, PORT88_FN2, MSEL4CR_10_1),
774 PINMUX_DATA(MSIOF1_TSYNC_89_MARK, PORT89_FN2, MSEL4CR_10_1),
775 PINMUX_DATA(MSIOF1_TXD_90_MARK, PORT90_FN2, MSEL4CR_10_1),
776 PINMUX_DATA(MSIOF1_RXD_91_MARK, PORT91_FN2, MSEL4CR_10_1),
777 PINMUX_DATA(MSIOF1_SS1_92_MARK, PORT92_FN2, MSEL4CR_10_1),
778 PINMUX_DATA(MSIOF1_SS2_93_MARK, PORT93_FN2, MSEL4CR_10_1),
779 PINMUX_DATA(SCIFA2_CTS1_MARK, PORT94_FN2),
780 PINMUX_DATA(SCIFA2_RTS1_MARK, PORT95_FN2),
781 PINMUX_DATA(SCIFA2_TXD1_MARK, PORT96_FN2),
782 PINMUX_DATA(SCIFA2_RXD1_MARK, PORT97_FN2),
783 PINMUX_DATA(SCIFA2_SCK1_MARK, PORT98_FN2),
784 PINMUX_DATA(I2C_SCL2_MARK, PORT110_FN2),
785 PINMUX_DATA(I2C_SDA2_MARK, PORT111_FN2),
786 PINMUX_DATA(I2C_SCL3_MARK, PORT114_FN2, MSEL4CR_16_1),
787 PINMUX_DATA(I2C_SDA3_MARK, PORT115_FN2, MSEL4CR_16_1),
788 PINMUX_DATA(I2C_SCL4_MARK, PORT116_FN2, MSEL4CR_17_1),
789 PINMUX_DATA(I2C_SDA4_MARK, PORT117_FN2, MSEL4CR_17_1),
790 PINMUX_DATA(MSIOF2_RSCK_MARK, PORT134_FN2),
791 PINMUX_DATA(MSIOF2_RSYNC_MARK, PORT135_FN2),
792 PINMUX_DATA(MSIOF2_MCK0_MARK, PORT136_FN2),
793 PINMUX_DATA(MSIOF2_MCK1_MARK, PORT137_FN2),
794 PINMUX_DATA(MSIOF2_SS1_MARK, PORT138_FN2),
795 PINMUX_DATA(MSIOF2_SS2_MARK, PORT139_FN2),
796 PINMUX_DATA(SCIFA3_CTS_140_MARK, PORT140_FN2, MSEL3CR_9_1),
797 PINMUX_DATA(SCIFA3_RTS_141_MARK, PORT141_FN2),
798 PINMUX_DATA(SCIFA3_SCK_MARK, PORT142_FN2),
799 PINMUX_DATA(SCIFA3_TXD_MARK, PORT143_FN2),
800 PINMUX_DATA(SCIFA3_RXD_MARK, PORT144_FN2),
801 PINMUX_DATA(MSIOF2_TSYNC_MARK, PORT148_FN2),
802 PINMUX_DATA(MSIOF2_TSCK_MARK, PORT149_FN2),
803 PINMUX_DATA(MSIOF2_RXD_MARK, PORT150_FN2),
804 PINMUX_DATA(MSIOF2_TXD_MARK, PORT151_FN2),
805 PINMUX_DATA(SCIFA0_SCK_MARK, PORT156_FN2),
806 PINMUX_DATA(SCIFA0_RTS_MARK, PORT157_FN2),
807 PINMUX_DATA(SCIFA0_CTS_MARK, PORT158_FN2),
808 PINMUX_DATA(SCIFA1_SCK_MARK, PORT159_FN2),
809 PINMUX_DATA(SCIFA1_RTS_MARK, PORT160_FN2),
810 PINMUX_DATA(SCIFA1_CTS_MARK, PORT161_FN2),
811
812 /* Function 3 */
813 PINMUX_DATA(VIO_CKO1_MARK, PORT16_FN3),
814 PINMUX_DATA(VIO_CKO2_MARK, PORT17_FN3),
815 PINMUX_DATA(IDIN_1_18_MARK, PORT18_FN3, MSEL4CR_14_1),
816 PINMUX_DATA(MSIOF1_TSCK_39_MARK, PORT39_FN3, MSEL4CR_10_0),
817 PINMUX_DATA(MSIOF1_TSYNC_40_MARK, PORT40_FN3, MSEL4CR_10_0),
818 PINMUX_DATA(MSIOF1_TXD_41_MARK, PORT41_FN3, MSEL4CR_10_0),
819 PINMUX_DATA(MSIOF1_RXD_42_MARK, PORT42_FN3, MSEL4CR_10_0),
820 PINMUX_DATA(MSIOF1_SS1_43_MARK, PORT43_FN3, MSEL4CR_10_0),
821 PINMUX_DATA(MSIOF1_SS2_44_MARK, PORT44_FN3, MSEL4CR_10_0),
822 PINMUX_DATA(MMCD1_0_MARK, PORT54_FN3, MSEL4CR_15_1),
823 PINMUX_DATA(MMCD1_1_MARK, PORT55_FN3, MSEL4CR_15_1),
824 PINMUX_DATA(MMCD1_2_MARK, PORT56_FN3, MSEL4CR_15_1),
825 PINMUX_DATA(MMCD1_3_MARK, PORT57_FN3, MSEL4CR_15_1),
826 PINMUX_DATA(MMCD1_4_MARK, PORT58_FN3, MSEL4CR_15_1),
827 PINMUX_DATA(MMCD1_5_MARK, PORT59_FN3, MSEL4CR_15_1),
828 PINMUX_DATA(MMCD1_6_MARK, PORT60_FN3, MSEL4CR_15_1),
829 PINMUX_DATA(MMCD1_7_MARK, PORT61_FN3, MSEL4CR_15_1),
830 PINMUX_DATA(VINT_I_MARK, PORT65_FN3),
831 PINMUX_DATA(MMCCLK1_MARK, PORT66_FN3, MSEL4CR_15_1),
832 PINMUX_DATA(MMCCMD1_MARK, PORT67_FN3, MSEL4CR_15_1),
833 PINMUX_DATA(TPU0TO2_93_MARK, PORT93_FN3),
834 PINMUX_DATA(TPU0TO2_99_MARK, PORT99_FN3),
835 PINMUX_DATA(TPU0TO3_MARK, PORT112_FN3),
836 PINMUX_DATA(IDIN_0_MARK, PORT113_FN3),
837 PINMUX_DATA(EXTLP_0_MARK, PORT114_FN3),
838 PINMUX_DATA(OVCN2_0_MARK, PORT115_FN3),
839 PINMUX_DATA(PWEN_0_MARK, PORT116_FN3),
840 PINMUX_DATA(OVCN_0_MARK, PORT117_FN3),
841 PINMUX_DATA(KEYOUT7_MARK, PORT121_FN3),
842 PINMUX_DATA(KEYOUT6_MARK, PORT122_FN3),
843 PINMUX_DATA(KEYOUT5_MARK, PORT123_FN3),
844 PINMUX_DATA(KEYOUT4_MARK, PORT124_FN3),
845 PINMUX_DATA(KEYOUT3_MARK, PORT125_FN3),
846 PINMUX_DATA(KEYOUT2_MARK, PORT126_FN3),
847 PINMUX_DATA(KEYOUT1_MARK, PORT127_FN3),
848 PINMUX_DATA(KEYOUT0_MARK, PORT128_FN3),
849 PINMUX_DATA(KEYIN7_MARK, PORT129_FN3),
850 PINMUX_DATA(KEYIN6_MARK, PORT130_FN3),
851 PINMUX_DATA(KEYIN5_MARK, PORT131_FN3),
852 PINMUX_DATA(KEYIN4_MARK, PORT132_FN3),
853 PINMUX_DATA(KEYIN3_133_MARK, PORT133_FN3, MSEL4CR_18_0),
854 PINMUX_DATA(KEYIN2_134_MARK, PORT134_FN3, MSEL4CR_18_0),
855 PINMUX_DATA(KEYIN1_135_MARK, PORT135_FN3, MSEL4CR_18_0),
856 PINMUX_DATA(KEYIN0_136_MARK, PORT136_FN3, MSEL4CR_18_0),
857 PINMUX_DATA(TS_SPSYNC2_MARK, PORT137_FN3),
858 PINMUX_DATA(IROUT_139_MARK, PORT139_FN3),
859 PINMUX_DATA(IRDA_OUT_MARK, PORT140_FN3),
860 PINMUX_DATA(IRDA_IN_MARK, PORT141_FN3),
861 PINMUX_DATA(IRDA_FIRSEL_MARK, PORT142_FN3),
862 PINMUX_DATA(TS_SDAT2_MARK, PORT145_FN3),
863 PINMUX_DATA(TS_SDEN2_MARK, PORT146_FN3),
864 PINMUX_DATA(TS_SCK2_MARK, PORT147_FN3),
865
866 /* Function 4 */
867 PINMUX_DATA(SCIFA3_CTS_43_MARK, PORT43_FN4, MSEL3CR_9_0),
868 PINMUX_DATA(SCIFA3_RTS_44_MARK, PORT44_FN4),
869 PINMUX_DATA(GP_RX_FLAG_MARK, PORT76_FN4),
870 PINMUX_DATA(GP_RX_DATA_MARK, PORT77_FN4),
871 PINMUX_DATA(GP_TX_READY_MARK, PORT78_FN4),
872 PINMUX_DATA(GP_RX_WAKE_MARK, PORT79_FN4),
873 PINMUX_DATA(MP_TX_FLAG_MARK, PORT80_FN4),
874 PINMUX_DATA(MP_TX_DATA_MARK, PORT81_FN4),
875 PINMUX_DATA(MP_RX_READY_MARK, PORT82_FN4),
876 PINMUX_DATA(MP_TX_WAKE_MARK, PORT83_FN4),
877 PINMUX_DATA(MMCD0_0_MARK, PORT84_FN4, MSEL4CR_15_0),
878 PINMUX_DATA(MMCD0_1_MARK, PORT85_FN4, MSEL4CR_15_0),
879 PINMUX_DATA(MMCD0_2_MARK, PORT86_FN4, MSEL4CR_15_0),
880 PINMUX_DATA(MMCD0_3_MARK, PORT87_FN4, MSEL4CR_15_0),
881 PINMUX_DATA(MMCD0_4_MARK, PORT88_FN4, MSEL4CR_15_0),
882 PINMUX_DATA(MMCD0_5_MARK, PORT89_FN4, MSEL4CR_15_0),
883 PINMUX_DATA(MMCD0_6_MARK, PORT90_FN4, MSEL4CR_15_0),
884 PINMUX_DATA(MMCD0_7_MARK, PORT91_FN4, MSEL4CR_15_0),
885 PINMUX_DATA(MMCCMD0_MARK, PORT92_FN4, MSEL4CR_15_0),
886 PINMUX_DATA(SIM_RST_MARK, PORT94_FN4),
887 PINMUX_DATA(SIM_CLK_MARK, PORT95_FN4),
888 PINMUX_DATA(SIM_D_MARK, PORT98_FN4),
889 PINMUX_DATA(MMCCLK0_MARK, PORT99_FN4, MSEL4CR_15_0),
890 PINMUX_DATA(IDIN_1_113_MARK, PORT113_FN4, MSEL4CR_14_0),
891 PINMUX_DATA(OVCN_1_114_MARK, PORT114_FN4, MSEL4CR_14_0),
892 PINMUX_DATA(PWEN_1_115_MARK, PORT115_FN4),
893 PINMUX_DATA(EXTLP_1_MARK, PORT116_FN4),
894 PINMUX_DATA(OVCN2_1_MARK, PORT117_FN4),
895 PINMUX_DATA(KEYIN0_121_MARK, PORT121_FN4, MSEL4CR_18_1),
896 PINMUX_DATA(KEYIN1_122_MARK, PORT122_FN4, MSEL4CR_18_1),
897 PINMUX_DATA(KEYIN2_123_MARK, PORT123_FN4, MSEL4CR_18_1),
898 PINMUX_DATA(KEYIN3_124_MARK, PORT124_FN4, MSEL4CR_18_1),
899 PINMUX_DATA(PWEN_1_138_MARK, PORT138_FN4),
900 PINMUX_DATA(IROUT_140_MARK, PORT140_FN4),
901 PINMUX_DATA(LCDCS_MARK, PORT145_FN4),
902 PINMUX_DATA(LCDWR_MARK, PORT147_FN4),
903 PINMUX_DATA(LCDRS_MARK, PORT149_FN4),
904 PINMUX_DATA(OVCN_1_162_MARK, PORT162_FN4, MSEL4CR_14_1),
905
906 /* Function 5 */
907 PINMUX_DATA(GPI0_MARK, PORT41_FN5),
908 PINMUX_DATA(GPI1_MARK, PORT42_FN5),
909 PINMUX_DATA(GPO0_MARK, PORT43_FN5),
910 PINMUX_DATA(GPO1_MARK, PORT44_FN5),
911 PINMUX_DATA(I2C_SCL3S_MARK, PORT137_FN5, MSEL4CR_16_0),
912 PINMUX_DATA(I2C_SDA3S_MARK, PORT145_FN5, MSEL4CR_16_0),
913 PINMUX_DATA(I2C_SCL4S_MARK, PORT146_FN5, MSEL4CR_17_0),
914 PINMUX_DATA(I2C_SDA4S_MARK, PORT147_FN5, MSEL4CR_17_0),
915
916 /* Function select */
917 PINMUX_DATA(LCDC0_SELECT_MARK, MSEL3CR_6_0),
918 PINMUX_DATA(LCDC1_SELECT_MARK, MSEL3CR_6_1),
919
920 PINMUX_DATA(TS0_1SELECT_MARK, MSEL3CR_21_0, MSEL3CR_20_0),
921 PINMUX_DATA(TS0_2SELECT_MARK, MSEL3CR_21_0, MSEL3CR_20_1),
922 PINMUX_DATA(TS1_1SELECT_MARK, MSEL3CR_27_0, MSEL3CR_26_0),
923 PINMUX_DATA(TS1_2SELECT_MARK, MSEL3CR_27_0, MSEL3CR_26_1),
924
925 PINMUX_DATA(SDENC_CPG_MARK, MSEL4CR_19_0),
926 PINMUX_DATA(SDENC_DV_CLKI_MARK, MSEL4CR_19_1),
927
928 PINMUX_DATA(MFIv6_MARK, MSEL4CR_6_0),
929 PINMUX_DATA(MFIv4_MARK, MSEL4CR_6_1),
930};
931
932static struct pinmux_gpio pinmux_gpios[] = {
933
934 /* PORT */
935 GPIO_PORT_ALL(),
936
937 /* IRQ */
938 GPIO_FN(IRQ0_6), GPIO_FN(IRQ0_162), GPIO_FN(IRQ1),
939 GPIO_FN(IRQ2_4), GPIO_FN(IRQ2_5), GPIO_FN(IRQ3_8),
940 GPIO_FN(IRQ3_16), GPIO_FN(IRQ4_17), GPIO_FN(IRQ4_163),
941 GPIO_FN(IRQ5), GPIO_FN(IRQ6_39), GPIO_FN(IRQ6_164),
942 GPIO_FN(IRQ7_40), GPIO_FN(IRQ7_167), GPIO_FN(IRQ8_41),
943 GPIO_FN(IRQ8_168), GPIO_FN(IRQ9_42), GPIO_FN(IRQ9_169),
944 GPIO_FN(IRQ10), GPIO_FN(IRQ11), GPIO_FN(IRQ12_80),
945 GPIO_FN(IRQ12_137), GPIO_FN(IRQ13_81), GPIO_FN(IRQ13_145),
946 GPIO_FN(IRQ14_82), GPIO_FN(IRQ14_146), GPIO_FN(IRQ15_83),
947 GPIO_FN(IRQ15_147), GPIO_FN(IRQ16_84), GPIO_FN(IRQ16_170),
948 GPIO_FN(IRQ17), GPIO_FN(IRQ18), GPIO_FN(IRQ19),
949 GPIO_FN(IRQ20), GPIO_FN(IRQ21), GPIO_FN(IRQ22),
950 GPIO_FN(IRQ23), GPIO_FN(IRQ24), GPIO_FN(IRQ25),
951 GPIO_FN(IRQ26_121), GPIO_FN(IRQ26_172), GPIO_FN(IRQ27_122),
952 GPIO_FN(IRQ27_180), GPIO_FN(IRQ28_123), GPIO_FN(IRQ28_181),
953 GPIO_FN(IRQ29_129), GPIO_FN(IRQ29_182), GPIO_FN(IRQ30_130),
954 GPIO_FN(IRQ30_183), GPIO_FN(IRQ31_138), GPIO_FN(IRQ31_184),
955
956 /* MSIOF0 */
957 GPIO_FN(MSIOF0_TSYNC), GPIO_FN(MSIOF0_TSCK), GPIO_FN(MSIOF0_RXD),
958 GPIO_FN(MSIOF0_RSCK), GPIO_FN(MSIOF0_RSYNC), GPIO_FN(MSIOF0_MCK0),
959 GPIO_FN(MSIOF0_MCK1), GPIO_FN(MSIOF0_SS1), GPIO_FN(MSIOF0_SS2),
960 GPIO_FN(MSIOF0_TXD),
961
962 /* MSIOF1 */
963 GPIO_FN(MSIOF1_TSCK_39), GPIO_FN(MSIOF1_TSCK_88),
964 GPIO_FN(MSIOF1_TSYNC_40), GPIO_FN(MSIOF1_TSYNC_89),
965 GPIO_FN(MSIOF1_TXD_41), GPIO_FN(MSIOF1_TXD_90),
966 GPIO_FN(MSIOF1_RXD_42), GPIO_FN(MSIOF1_RXD_91),
967 GPIO_FN(MSIOF1_SS1_43), GPIO_FN(MSIOF1_SS1_92),
968 GPIO_FN(MSIOF1_SS2_44), GPIO_FN(MSIOF1_SS2_93),
969 GPIO_FN(MSIOF1_RSCK), GPIO_FN(MSIOF1_RSYNC),
970 GPIO_FN(MSIOF1_MCK0), GPIO_FN(MSIOF1_MCK1),
971
972 /* MSIOF2 */
973 GPIO_FN(MSIOF2_RSCK), GPIO_FN(MSIOF2_RSYNC), GPIO_FN(MSIOF2_MCK0),
974 GPIO_FN(MSIOF2_MCK1), GPIO_FN(MSIOF2_SS1), GPIO_FN(MSIOF2_SS2),
975 GPIO_FN(MSIOF2_TSYNC), GPIO_FN(MSIOF2_TSCK), GPIO_FN(MSIOF2_RXD),
976 GPIO_FN(MSIOF2_TXD),
977
978 /* BBIF1 */
979 GPIO_FN(BBIF1_RXD), GPIO_FN(BBIF1_TSYNC), GPIO_FN(BBIF1_TSCK),
980 GPIO_FN(BBIF1_TXD), GPIO_FN(BBIF1_RSCK), GPIO_FN(BBIF1_RSYNC),
981 GPIO_FN(BBIF1_FLOW), GPIO_FN(BB_RX_FLOW_N),
982
983 /* BBIF2 */
984 GPIO_FN(BBIF2_TSCK1), GPIO_FN(BBIF2_TSYNC1),
985 GPIO_FN(BBIF2_TXD1), GPIO_FN(BBIF2_RXD),
986
987 /* FSI */
988 GPIO_FN(FSIACK), GPIO_FN(FSIBCK), GPIO_FN(FSIAILR),
989 GPIO_FN(FSIAIBT), GPIO_FN(FSIAISLD), GPIO_FN(FSIAOMC),
990 GPIO_FN(FSIAOLR), GPIO_FN(FSIAOBT), GPIO_FN(FSIAOSLD),
991 GPIO_FN(FSIASPDIF_11), GPIO_FN(FSIASPDIF_15),
992
993 /* FMSI */
994 GPIO_FN(FMSOCK), GPIO_FN(FMSOOLR), GPIO_FN(FMSIOLR),
995 GPIO_FN(FMSOOBT), GPIO_FN(FMSIOBT), GPIO_FN(FMSOSLD),
996 GPIO_FN(FMSOILR), GPIO_FN(FMSIILR), GPIO_FN(FMSOIBT),
997 GPIO_FN(FMSIIBT), GPIO_FN(FMSISLD), GPIO_FN(FMSICK),
998
999 /* SCIFA0 */
1000 GPIO_FN(SCIFA0_TXD), GPIO_FN(SCIFA0_RXD), GPIO_FN(SCIFA0_SCK),
1001 GPIO_FN(SCIFA0_RTS), GPIO_FN(SCIFA0_CTS),
1002
1003 /* SCIFA1 */
1004 GPIO_FN(SCIFA1_TXD), GPIO_FN(SCIFA1_RXD), GPIO_FN(SCIFA1_SCK),
1005 GPIO_FN(SCIFA1_RTS), GPIO_FN(SCIFA1_CTS),
1006
1007 /* SCIFA2 */
1008 GPIO_FN(SCIFA2_CTS1), GPIO_FN(SCIFA2_RTS1), GPIO_FN(SCIFA2_TXD1),
1009 GPIO_FN(SCIFA2_RXD1), GPIO_FN(SCIFA2_SCK1),
1010
1011 /* SCIFA3 */
1012 GPIO_FN(SCIFA3_CTS_43), GPIO_FN(SCIFA3_CTS_140),
1013 GPIO_FN(SCIFA3_RTS_44), GPIO_FN(SCIFA3_RTS_141),
1014 GPIO_FN(SCIFA3_SCK), GPIO_FN(SCIFA3_TXD),
1015 GPIO_FN(SCIFA3_RXD),
1016
1017 /* SCIFA4 */
1018 GPIO_FN(SCIFA4_RXD), GPIO_FN(SCIFA4_TXD),
1019
1020 /* SCIFA5 */
1021 GPIO_FN(SCIFA5_RXD), GPIO_FN(SCIFA5_TXD),
1022
1023 /* SCIFB */
1024 GPIO_FN(SCIFB_SCK), GPIO_FN(SCIFB_RTS), GPIO_FN(SCIFB_CTS),
1025 GPIO_FN(SCIFB_TXD), GPIO_FN(SCIFB_RXD),
1026
1027 /* CEU */
1028 GPIO_FN(VIO_HD), GPIO_FN(VIO_CKO1), GPIO_FN(VIO_CKO2),
1029 GPIO_FN(VIO_VD), GPIO_FN(VIO_CLK), GPIO_FN(VIO_FIELD),
1030 GPIO_FN(VIO_CKO), GPIO_FN(VIO_D0), GPIO_FN(VIO_D1),
1031 GPIO_FN(VIO_D2), GPIO_FN(VIO_D3), GPIO_FN(VIO_D4),
1032 GPIO_FN(VIO_D5), GPIO_FN(VIO_D6), GPIO_FN(VIO_D7),
1033 GPIO_FN(VIO_D8), GPIO_FN(VIO_D9), GPIO_FN(VIO_D10),
1034 GPIO_FN(VIO_D11), GPIO_FN(VIO_D12), GPIO_FN(VIO_D13),
1035 GPIO_FN(VIO_D14), GPIO_FN(VIO_D15),
1036
1037 /* USB0 */
1038 GPIO_FN(IDIN_0), GPIO_FN(EXTLP_0), GPIO_FN(OVCN2_0),
1039 GPIO_FN(PWEN_0), GPIO_FN(OVCN_0), GPIO_FN(VBUS0_0),
1040
1041 /* USB1 */
1042 GPIO_FN(IDIN_1_18), GPIO_FN(IDIN_1_113),
1043 GPIO_FN(OVCN_1_114), GPIO_FN(OVCN_1_162),
1044 GPIO_FN(PWEN_1_115), GPIO_FN(PWEN_1_138),
1045 GPIO_FN(EXTLP_1), GPIO_FN(OVCN2_1),
1046 GPIO_FN(VBUS0_1),
1047
1048 /* GPIO */
1049 GPIO_FN(GPI0), GPIO_FN(GPI1), GPIO_FN(GPO0), GPIO_FN(GPO1),
1050
1051 /* BSC */
1052 GPIO_FN(BS), GPIO_FN(WE1), GPIO_FN(CKO),
1053 GPIO_FN(WAIT), GPIO_FN(RDWR),
1054
1055 GPIO_FN(A0), GPIO_FN(A1), GPIO_FN(A2),
1056 GPIO_FN(A3), GPIO_FN(A6), GPIO_FN(A7),
1057 GPIO_FN(A8), GPIO_FN(A9), GPIO_FN(A10),
1058 GPIO_FN(A11), GPIO_FN(A12), GPIO_FN(A13),
1059 GPIO_FN(A14), GPIO_FN(A15), GPIO_FN(A16),
1060 GPIO_FN(A17), GPIO_FN(A18), GPIO_FN(A19),
1061 GPIO_FN(A20), GPIO_FN(A21), GPIO_FN(A22),
1062 GPIO_FN(A23), GPIO_FN(A24), GPIO_FN(A25),
1063 GPIO_FN(A26),
1064
1065 GPIO_FN(CS0), GPIO_FN(CS2), GPIO_FN(CS4),
1066 GPIO_FN(CS5A), GPIO_FN(CS5B), GPIO_FN(CS6A),
1067
1068 /* BSC/FLCTL */
1069 GPIO_FN(RD_FSC), GPIO_FN(WE0_FWE), GPIO_FN(A4_FOE),
1070 GPIO_FN(A5_FCDE), GPIO_FN(D0_NAF0), GPIO_FN(D1_NAF1),
1071 GPIO_FN(D2_NAF2), GPIO_FN(D3_NAF3), GPIO_FN(D4_NAF4),
1072 GPIO_FN(D5_NAF5), GPIO_FN(D6_NAF6), GPIO_FN(D7_NAF7),
1073 GPIO_FN(D8_NAF8), GPIO_FN(D9_NAF9), GPIO_FN(D10_NAF10),
1074 GPIO_FN(D11_NAF11), GPIO_FN(D12_NAF12), GPIO_FN(D13_NAF13),
1075 GPIO_FN(D14_NAF14), GPIO_FN(D15_NAF15),
1076
1077 /* MMCIF(1) */
1078 GPIO_FN(MMCD0_0), GPIO_FN(MMCD0_1), GPIO_FN(MMCD0_2),
1079 GPIO_FN(MMCD0_3), GPIO_FN(MMCD0_4), GPIO_FN(MMCD0_5),
1080 GPIO_FN(MMCD0_6), GPIO_FN(MMCD0_7), GPIO_FN(MMCCMD0),
1081 GPIO_FN(MMCCLK0),
1082
1083 /* MMCIF(2) */
1084 GPIO_FN(MMCD1_0), GPIO_FN(MMCD1_1), GPIO_FN(MMCD1_2),
1085 GPIO_FN(MMCD1_3), GPIO_FN(MMCD1_4), GPIO_FN(MMCD1_5),
1086 GPIO_FN(MMCD1_6), GPIO_FN(MMCD1_7), GPIO_FN(MMCCLK1),
1087 GPIO_FN(MMCCMD1),
1088
1089 /* SPU2 */
1090 GPIO_FN(VINT_I),
1091
1092 /* FLCTL */
1093 GPIO_FN(FCE1), GPIO_FN(FCE0), GPIO_FN(FRB),
1094
1095 /* HSI */
1096 GPIO_FN(GP_RX_FLAG), GPIO_FN(GP_RX_DATA), GPIO_FN(GP_TX_READY),
1097 GPIO_FN(GP_RX_WAKE), GPIO_FN(MP_TX_FLAG), GPIO_FN(MP_TX_DATA),
1098 GPIO_FN(MP_RX_READY), GPIO_FN(MP_TX_WAKE),
1099
1100 /* MFI */
1101 GPIO_FN(MFIv6),
1102 GPIO_FN(MFIv4),
1103
1104 GPIO_FN(MEMC_BUSCLK_MEMC_A0), GPIO_FN(MEMC_ADV_MEMC_DREQ0),
1105 GPIO_FN(MEMC_WAIT_MEMC_DREQ1), GPIO_FN(MEMC_CS1_MEMC_A1),
1106 GPIO_FN(MEMC_CS0), GPIO_FN(MEMC_NOE),
1107 GPIO_FN(MEMC_NWE), GPIO_FN(MEMC_INT),
1108
1109 GPIO_FN(MEMC_AD0), GPIO_FN(MEMC_AD1), GPIO_FN(MEMC_AD2),
1110 GPIO_FN(MEMC_AD3), GPIO_FN(MEMC_AD4), GPIO_FN(MEMC_AD5),
1111 GPIO_FN(MEMC_AD6), GPIO_FN(MEMC_AD7), GPIO_FN(MEMC_AD8),
1112 GPIO_FN(MEMC_AD9), GPIO_FN(MEMC_AD10), GPIO_FN(MEMC_AD11),
1113 GPIO_FN(MEMC_AD12), GPIO_FN(MEMC_AD13), GPIO_FN(MEMC_AD14),
1114 GPIO_FN(MEMC_AD15),
1115
1116 /* SIM */
1117 GPIO_FN(SIM_RST), GPIO_FN(SIM_CLK), GPIO_FN(SIM_D),
1118
1119 /* TPU */
1120 GPIO_FN(TPU0TO0), GPIO_FN(TPU0TO1), GPIO_FN(TPU0TO2_93),
1121 GPIO_FN(TPU0TO2_99), GPIO_FN(TPU0TO3),
1122
1123 /* I2C2 */
1124 GPIO_FN(I2C_SCL2), GPIO_FN(I2C_SDA2),
1125
1126 /* I2C3(1) */
1127 GPIO_FN(I2C_SCL3), GPIO_FN(I2C_SDA3),
1128
1129 /* I2C3(2) */
1130 GPIO_FN(I2C_SCL3S), GPIO_FN(I2C_SDA3S),
1131
1132 /* I2C4(2) */
1133 GPIO_FN(I2C_SCL4), GPIO_FN(I2C_SDA4),
1134
1135 /* I2C4(2) */
1136 GPIO_FN(I2C_SCL4S), GPIO_FN(I2C_SDA4S),
1137
1138 /* KEYSC */
1139 GPIO_FN(KEYOUT0), GPIO_FN(KEYIN0_121), GPIO_FN(KEYIN0_136),
1140 GPIO_FN(KEYOUT1), GPIO_FN(KEYIN1_122), GPIO_FN(KEYIN1_135),
1141 GPIO_FN(KEYOUT2), GPIO_FN(KEYIN2_123), GPIO_FN(KEYIN2_134),
1142 GPIO_FN(KEYOUT3), GPIO_FN(KEYIN3_124), GPIO_FN(KEYIN3_133),
1143 GPIO_FN(KEYOUT4), GPIO_FN(KEYIN4), GPIO_FN(KEYOUT5),
1144 GPIO_FN(KEYIN5), GPIO_FN(KEYOUT6), GPIO_FN(KEYIN6),
1145 GPIO_FN(KEYOUT7), GPIO_FN(KEYIN7),
1146
1147 /* LCDC */
1148 GPIO_FN(LCDHSYN), GPIO_FN(LCDCS), GPIO_FN(LCDVSYN),
1149 GPIO_FN(LCDDCK), GPIO_FN(LCDWR), GPIO_FN(LCDRD),
1150 GPIO_FN(LCDDISP), GPIO_FN(LCDRS), GPIO_FN(LCDLCLK),
1151 GPIO_FN(LCDDON),
1152
1153 GPIO_FN(LCDD0), GPIO_FN(LCDD1), GPIO_FN(LCDD2),
1154 GPIO_FN(LCDD3), GPIO_FN(LCDD4), GPIO_FN(LCDD5),
1155 GPIO_FN(LCDD6), GPIO_FN(LCDD7), GPIO_FN(LCDD8),
1156 GPIO_FN(LCDD9), GPIO_FN(LCDD10), GPIO_FN(LCDD11),
1157 GPIO_FN(LCDD12), GPIO_FN(LCDD13), GPIO_FN(LCDD14),
1158 GPIO_FN(LCDD15), GPIO_FN(LCDD16), GPIO_FN(LCDD17),
1159 GPIO_FN(LCDD18), GPIO_FN(LCDD19), GPIO_FN(LCDD20),
1160 GPIO_FN(LCDD21), GPIO_FN(LCDD22), GPIO_FN(LCDD23),
1161
1162 GPIO_FN(LCDC0_SELECT),
1163 GPIO_FN(LCDC1_SELECT),
1164
1165 /* IRDA */
1166 GPIO_FN(IRDA_OUT), GPIO_FN(IRDA_IN), GPIO_FN(IRDA_FIRSEL),
1167 GPIO_FN(IROUT_139), GPIO_FN(IROUT_140),
1168
1169 /* TSIF1 */
1170 GPIO_FN(TS0_1SELECT),
1171 GPIO_FN(TS0_2SELECT),
1172 GPIO_FN(TS1_1SELECT),
1173 GPIO_FN(TS1_2SELECT),
1174
1175 GPIO_FN(TS_SPSYNC1), GPIO_FN(TS_SDAT1),
1176 GPIO_FN(TS_SDEN1), GPIO_FN(TS_SCK1),
1177
1178 /* TSIF2 */
1179 GPIO_FN(TS_SPSYNC2), GPIO_FN(TS_SDAT2),
1180 GPIO_FN(TS_SDEN2), GPIO_FN(TS_SCK2),
1181
1182 /* HDMI */
1183 GPIO_FN(HDMI_HPD), GPIO_FN(HDMI_CEC),
1184
1185 /* SDHI0 */
1186 GPIO_FN(SDHICLK0), GPIO_FN(SDHICD0), GPIO_FN(SDHICMD0),
1187 GPIO_FN(SDHIWP0), GPIO_FN(SDHID0_0), GPIO_FN(SDHID0_1),
1188 GPIO_FN(SDHID0_2), GPIO_FN(SDHID0_3),
1189
1190 /* SDHI1 */
1191 GPIO_FN(SDHICLK1), GPIO_FN(SDHICMD1), GPIO_FN(SDHID1_0),
1192 GPIO_FN(SDHID1_1), GPIO_FN(SDHID1_2), GPIO_FN(SDHID1_3),
1193
1194 /* SDHI2 */
1195 GPIO_FN(SDHICLK2), GPIO_FN(SDHICMD2), GPIO_FN(SDHID2_0),
1196 GPIO_FN(SDHID2_1), GPIO_FN(SDHID2_2), GPIO_FN(SDHID2_3),
1197
1198 /* SDENC */
1199 GPIO_FN(SDENC_CPG),
1200 GPIO_FN(SDENC_DV_CLKI),
1201};
1202
1203static struct pinmux_cfg_reg pinmux_config_regs[] = {
1204 PORTCR(0, 0xE6051000), /* PORT0CR */
1205 PORTCR(1, 0xE6051001), /* PORT1CR */
1206 PORTCR(2, 0xE6051002), /* PORT2CR */
1207 PORTCR(3, 0xE6051003), /* PORT3CR */
1208 PORTCR(4, 0xE6051004), /* PORT4CR */
1209 PORTCR(5, 0xE6051005), /* PORT5CR */
1210 PORTCR(6, 0xE6051006), /* PORT6CR */
1211 PORTCR(7, 0xE6051007), /* PORT7CR */
1212 PORTCR(8, 0xE6051008), /* PORT8CR */
1213 PORTCR(9, 0xE6051009), /* PORT9CR */
1214 PORTCR(10, 0xE605100A), /* PORT10CR */
1215 PORTCR(11, 0xE605100B), /* PORT11CR */
1216 PORTCR(12, 0xE605100C), /* PORT12CR */
1217 PORTCR(13, 0xE605100D), /* PORT13CR */
1218 PORTCR(14, 0xE605100E), /* PORT14CR */
1219 PORTCR(15, 0xE605100F), /* PORT15CR */
1220 PORTCR(16, 0xE6051010), /* PORT16CR */
1221 PORTCR(17, 0xE6051011), /* PORT17CR */
1222 PORTCR(18, 0xE6051012), /* PORT18CR */
1223 PORTCR(19, 0xE6051013), /* PORT19CR */
1224 PORTCR(20, 0xE6051014), /* PORT20CR */
1225 PORTCR(21, 0xE6051015), /* PORT21CR */
1226 PORTCR(22, 0xE6051016), /* PORT22CR */
1227 PORTCR(23, 0xE6051017), /* PORT23CR */
1228 PORTCR(24, 0xE6051018), /* PORT24CR */
1229 PORTCR(25, 0xE6051019), /* PORT25CR */
1230 PORTCR(26, 0xE605101A), /* PORT26CR */
1231 PORTCR(27, 0xE605101B), /* PORT27CR */
1232 PORTCR(28, 0xE605101C), /* PORT28CR */
1233 PORTCR(29, 0xE605101D), /* PORT29CR */
1234 PORTCR(30, 0xE605101E), /* PORT30CR */
1235 PORTCR(31, 0xE605101F), /* PORT31CR */
1236 PORTCR(32, 0xE6051020), /* PORT32CR */
1237 PORTCR(33, 0xE6051021), /* PORT33CR */
1238 PORTCR(34, 0xE6051022), /* PORT34CR */
1239 PORTCR(35, 0xE6051023), /* PORT35CR */
1240 PORTCR(36, 0xE6051024), /* PORT36CR */
1241 PORTCR(37, 0xE6051025), /* PORT37CR */
1242 PORTCR(38, 0xE6051026), /* PORT38CR */
1243 PORTCR(39, 0xE6051027), /* PORT39CR */
1244 PORTCR(40, 0xE6051028), /* PORT40CR */
1245 PORTCR(41, 0xE6051029), /* PORT41CR */
1246 PORTCR(42, 0xE605102A), /* PORT42CR */
1247 PORTCR(43, 0xE605102B), /* PORT43CR */
1248 PORTCR(44, 0xE605102C), /* PORT44CR */
1249 PORTCR(45, 0xE605102D), /* PORT45CR */
1250 PORTCR(46, 0xE605202E), /* PORT46CR */
1251 PORTCR(47, 0xE605202F), /* PORT47CR */
1252 PORTCR(48, 0xE6052030), /* PORT48CR */
1253 PORTCR(49, 0xE6052031), /* PORT49CR */
1254 PORTCR(50, 0xE6052032), /* PORT50CR */
1255 PORTCR(51, 0xE6052033), /* PORT51CR */
1256 PORTCR(52, 0xE6052034), /* PORT52CR */
1257 PORTCR(53, 0xE6052035), /* PORT53CR */
1258 PORTCR(54, 0xE6052036), /* PORT54CR */
1259 PORTCR(55, 0xE6052037), /* PORT55CR */
1260 PORTCR(56, 0xE6052038), /* PORT56CR */
1261 PORTCR(57, 0xE6052039), /* PORT57CR */
1262 PORTCR(58, 0xE605203A), /* PORT58CR */
1263 PORTCR(59, 0xE605203B), /* PORT59CR */
1264 PORTCR(60, 0xE605203C), /* PORT60CR */
1265 PORTCR(61, 0xE605203D), /* PORT61CR */
1266 PORTCR(62, 0xE605203E), /* PORT62CR */
1267 PORTCR(63, 0xE605203F), /* PORT63CR */
1268 PORTCR(64, 0xE6052040), /* PORT64CR */
1269 PORTCR(65, 0xE6052041), /* PORT65CR */
1270 PORTCR(66, 0xE6052042), /* PORT66CR */
1271 PORTCR(67, 0xE6052043), /* PORT67CR */
1272 PORTCR(68, 0xE6052044), /* PORT68CR */
1273 PORTCR(69, 0xE6052045), /* PORT69CR */
1274 PORTCR(70, 0xE6052046), /* PORT70CR */
1275 PORTCR(71, 0xE6052047), /* PORT71CR */
1276 PORTCR(72, 0xE6052048), /* PORT72CR */
1277 PORTCR(73, 0xE6052049), /* PORT73CR */
1278 PORTCR(74, 0xE605204A), /* PORT74CR */
1279 PORTCR(75, 0xE605204B), /* PORT75CR */
1280 PORTCR(76, 0xE605004C), /* PORT76CR */
1281 PORTCR(77, 0xE605004D), /* PORT77CR */
1282 PORTCR(78, 0xE605004E), /* PORT78CR */
1283 PORTCR(79, 0xE605004F), /* PORT79CR */
1284 PORTCR(80, 0xE6050050), /* PORT80CR */
1285 PORTCR(81, 0xE6050051), /* PORT81CR */
1286 PORTCR(82, 0xE6050052), /* PORT82CR */
1287 PORTCR(83, 0xE6050053), /* PORT83CR */
1288 PORTCR(84, 0xE6050054), /* PORT84CR */
1289 PORTCR(85, 0xE6050055), /* PORT85CR */
1290 PORTCR(86, 0xE6050056), /* PORT86CR */
1291 PORTCR(87, 0xE6050057), /* PORT87CR */
1292 PORTCR(88, 0xE6050058), /* PORT88CR */
1293 PORTCR(89, 0xE6050059), /* PORT89CR */
1294 PORTCR(90, 0xE605005A), /* PORT90CR */
1295 PORTCR(91, 0xE605005B), /* PORT91CR */
1296 PORTCR(92, 0xE605005C), /* PORT92CR */
1297 PORTCR(93, 0xE605005D), /* PORT93CR */
1298 PORTCR(94, 0xE605005E), /* PORT94CR */
1299 PORTCR(95, 0xE605005F), /* PORT95CR */
1300 PORTCR(96, 0xE6050060), /* PORT96CR */
1301 PORTCR(97, 0xE6050061), /* PORT97CR */
1302 PORTCR(98, 0xE6050062), /* PORT98CR */
1303 PORTCR(99, 0xE6050063), /* PORT99CR */
1304 PORTCR(100, 0xE6053064), /* PORT100CR */
1305 PORTCR(101, 0xE6053065), /* PORT101CR */
1306 PORTCR(102, 0xE6053066), /* PORT102CR */
1307 PORTCR(103, 0xE6053067), /* PORT103CR */
1308 PORTCR(104, 0xE6053068), /* PORT104CR */
1309 PORTCR(105, 0xE6053069), /* PORT105CR */
1310 PORTCR(106, 0xE605306A), /* PORT106CR */
1311 PORTCR(107, 0xE605306B), /* PORT107CR */
1312 PORTCR(108, 0xE605306C), /* PORT108CR */
1313 PORTCR(109, 0xE605306D), /* PORT109CR */
1314 PORTCR(110, 0xE605306E), /* PORT110CR */
1315 PORTCR(111, 0xE605306F), /* PORT111CR */
1316 PORTCR(112, 0xE6053070), /* PORT112CR */
1317 PORTCR(113, 0xE6053071), /* PORT113CR */
1318 PORTCR(114, 0xE6053072), /* PORT114CR */
1319 PORTCR(115, 0xE6053073), /* PORT115CR */
1320 PORTCR(116, 0xE6053074), /* PORT116CR */
1321 PORTCR(117, 0xE6053075), /* PORT117CR */
1322 PORTCR(118, 0xE6053076), /* PORT118CR */
1323 PORTCR(119, 0xE6053077), /* PORT119CR */
1324 PORTCR(120, 0xE6053078), /* PORT120CR */
1325 PORTCR(121, 0xE6050079), /* PORT121CR */
1326 PORTCR(122, 0xE605007A), /* PORT122CR */
1327 PORTCR(123, 0xE605007B), /* PORT123CR */
1328 PORTCR(124, 0xE605007C), /* PORT124CR */
1329 PORTCR(125, 0xE605007D), /* PORT125CR */
1330 PORTCR(126, 0xE605007E), /* PORT126CR */
1331 PORTCR(127, 0xE605007F), /* PORT127CR */
1332 PORTCR(128, 0xE6050080), /* PORT128CR */
1333 PORTCR(129, 0xE6050081), /* PORT129CR */
1334 PORTCR(130, 0xE6050082), /* PORT130CR */
1335 PORTCR(131, 0xE6050083), /* PORT131CR */
1336 PORTCR(132, 0xE6050084), /* PORT132CR */
1337 PORTCR(133, 0xE6050085), /* PORT133CR */
1338 PORTCR(134, 0xE6050086), /* PORT134CR */
1339 PORTCR(135, 0xE6050087), /* PORT135CR */
1340 PORTCR(136, 0xE6050088), /* PORT136CR */
1341 PORTCR(137, 0xE6050089), /* PORT137CR */
1342 PORTCR(138, 0xE605008A), /* PORT138CR */
1343 PORTCR(139, 0xE605008B), /* PORT139CR */
1344 PORTCR(140, 0xE605008C), /* PORT140CR */
1345 PORTCR(141, 0xE605008D), /* PORT141CR */
1346 PORTCR(142, 0xE605008E), /* PORT142CR */
1347 PORTCR(143, 0xE605008F), /* PORT143CR */
1348 PORTCR(144, 0xE6050090), /* PORT144CR */
1349 PORTCR(145, 0xE6050091), /* PORT145CR */
1350 PORTCR(146, 0xE6050092), /* PORT146CR */
1351 PORTCR(147, 0xE6050093), /* PORT147CR */
1352 PORTCR(148, 0xE6050094), /* PORT148CR */
1353 PORTCR(149, 0xE6050095), /* PORT149CR */
1354 PORTCR(150, 0xE6050096), /* PORT150CR */
1355 PORTCR(151, 0xE6050097), /* PORT151CR */
1356 PORTCR(152, 0xE6053098), /* PORT152CR */
1357 PORTCR(153, 0xE6053099), /* PORT153CR */
1358 PORTCR(154, 0xE605309A), /* PORT154CR */
1359 PORTCR(155, 0xE605309B), /* PORT155CR */
1360 PORTCR(156, 0xE605009C), /* PORT156CR */
1361 PORTCR(157, 0xE605009D), /* PORT157CR */
1362 PORTCR(158, 0xE605009E), /* PORT158CR */
1363 PORTCR(159, 0xE605009F), /* PORT159CR */
1364 PORTCR(160, 0xE60500A0), /* PORT160CR */
1365 PORTCR(161, 0xE60500A1), /* PORT161CR */
1366 PORTCR(162, 0xE60500A2), /* PORT162CR */
1367 PORTCR(163, 0xE60500A3), /* PORT163CR */
1368 PORTCR(164, 0xE60500A4), /* PORT164CR */
1369 PORTCR(165, 0xE60500A5), /* PORT165CR */
1370 PORTCR(166, 0xE60500A6), /* PORT166CR */
1371 PORTCR(167, 0xE60520A7), /* PORT167CR */
1372 PORTCR(168, 0xE60520A8), /* PORT168CR */
1373 PORTCR(169, 0xE60520A9), /* PORT169CR */
1374 PORTCR(170, 0xE60520AA), /* PORT170CR */
1375 PORTCR(171, 0xE60520AB), /* PORT171CR */
1376 PORTCR(172, 0xE60520AC), /* PORT172CR */
1377 PORTCR(173, 0xE60520AD), /* PORT173CR */
1378 PORTCR(174, 0xE60520AE), /* PORT174CR */
1379 PORTCR(175, 0xE60520AF), /* PORT175CR */
1380 PORTCR(176, 0xE60520B0), /* PORT176CR */
1381 PORTCR(177, 0xE60520B1), /* PORT177CR */
1382 PORTCR(178, 0xE60520B2), /* PORT178CR */
1383 PORTCR(179, 0xE60520B3), /* PORT179CR */
1384 PORTCR(180, 0xE60520B4), /* PORT180CR */
1385 PORTCR(181, 0xE60520B5), /* PORT181CR */
1386 PORTCR(182, 0xE60520B6), /* PORT182CR */
1387 PORTCR(183, 0xE60520B7), /* PORT183CR */
1388 PORTCR(184, 0xE60520B8), /* PORT184CR */
1389 PORTCR(185, 0xE60520B9), /* PORT185CR */
1390 PORTCR(186, 0xE60520BA), /* PORT186CR */
1391 PORTCR(187, 0xE60520BB), /* PORT187CR */
1392 PORTCR(188, 0xE60520BC), /* PORT188CR */
1393 PORTCR(189, 0xE60520BD), /* PORT189CR */
1394 PORTCR(190, 0xE60520BE), /* PORT190CR */
1395
1396 { PINMUX_CFG_REG("MSEL1CR", 0xE605800C, 32, 1) {
1397 MSEL1CR_31_0, MSEL1CR_31_1,
1398 MSEL1CR_30_0, MSEL1CR_30_1,
1399 MSEL1CR_29_0, MSEL1CR_29_1,
1400 MSEL1CR_28_0, MSEL1CR_28_1,
1401 MSEL1CR_27_0, MSEL1CR_27_1,
1402 MSEL1CR_26_0, MSEL1CR_26_1,
1403 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1404 0, 0, 0, 0, 0, 0, 0, 0,
1405 MSEL1CR_16_0, MSEL1CR_16_1,
1406 MSEL1CR_15_0, MSEL1CR_15_1,
1407 MSEL1CR_14_0, MSEL1CR_14_1,
1408 MSEL1CR_13_0, MSEL1CR_13_1,
1409 MSEL1CR_12_0, MSEL1CR_12_1,
1410 0, 0, 0, 0,
1411 MSEL1CR_9_0, MSEL1CR_9_1,
1412 MSEL1CR_8_0, MSEL1CR_8_1,
1413 MSEL1CR_7_0, MSEL1CR_7_1,
1414 MSEL1CR_6_0, MSEL1CR_6_1,
1415 0, 0,
1416 MSEL1CR_4_0, MSEL1CR_4_1,
1417 MSEL1CR_3_0, MSEL1CR_3_1,
1418 MSEL1CR_2_0, MSEL1CR_2_1,
1419 0, 0,
1420 MSEL1CR_0_0, MSEL1CR_0_1,
1421 }
1422 },
1423 { PINMUX_CFG_REG("MSEL3CR", 0xE6058020, 32, 1) {
1424 0, 0, 0, 0,
1425 0, 0, 0, 0,
1426 MSEL3CR_27_0, MSEL3CR_27_1,
1427 MSEL3CR_26_0, MSEL3CR_26_1,
1428 0, 0, 0, 0,
1429 0, 0, 0, 0,
1430 MSEL3CR_21_0, MSEL3CR_21_1,
1431 MSEL3CR_20_0, MSEL3CR_20_1,
1432 0, 0, 0, 0,
1433 0, 0, 0, 0,
1434 MSEL3CR_15_0, MSEL3CR_15_1,
1435 0, 0, 0, 0,
1436 0, 0, 0, 0,
1437 0, 0,
1438 MSEL3CR_9_0, MSEL3CR_9_1,
1439 0, 0, 0, 0,
1440 MSEL3CR_6_0, MSEL3CR_6_1,
1441 0, 0, 0, 0,
1442 0, 0, 0, 0,
1443 0, 0, 0, 0,
1444 }
1445 },
1446 { PINMUX_CFG_REG("MSEL4CR", 0xE6058024, 32, 1) {
1447 0, 0, 0, 0,
1448 0, 0, 0, 0,
1449 0, 0, 0, 0,
1450 0, 0, 0, 0,
1451 0, 0, 0, 0,
1452 0, 0, 0, 0,
1453 MSEL4CR_19_0, MSEL4CR_19_1,
1454 MSEL4CR_18_0, MSEL4CR_18_1,
1455 MSEL4CR_17_0, MSEL4CR_17_1,
1456 MSEL4CR_16_0, MSEL4CR_16_1,
1457 MSEL4CR_15_0, MSEL4CR_15_1,
1458 MSEL4CR_14_0, MSEL4CR_14_1,
1459 0, 0, 0, 0,
1460 0, 0,
1461 MSEL4CR_10_0, MSEL4CR_10_1,
1462 0, 0, 0, 0,
1463 0, 0,
1464 MSEL4CR_6_0, MSEL4CR_6_1,
1465 0, 0,
1466 MSEL4CR_4_0, MSEL4CR_4_1,
1467 0, 0, 0, 0,
1468 MSEL4CR_1_0, MSEL4CR_1_1,
1469 0, 0,
1470 }
1471 },
1472 { },
1473};
1474
1475static struct pinmux_data_reg pinmux_data_regs[] = {
1476 { PINMUX_DATA_REG("PORTL095_064DR", 0xE6054008, 32) {
1477 PORT95_DATA, PORT94_DATA, PORT93_DATA, PORT92_DATA,
1478 PORT91_DATA, PORT90_DATA, PORT89_DATA, PORT88_DATA,
1479 PORT87_DATA, PORT86_DATA, PORT85_DATA, PORT84_DATA,
1480 PORT83_DATA, PORT82_DATA, PORT81_DATA, PORT80_DATA,
1481 PORT79_DATA, PORT78_DATA, PORT77_DATA, PORT76_DATA,
1482 0, 0, 0, 0,
1483 0, 0, 0, 0,
1484 0, 0, 0, 0,
1485 }
1486 },
1487 { PINMUX_DATA_REG("PORTL127_096DR", 0xE605400C, 32) {
1488 PORT127_DATA, PORT126_DATA, PORT125_DATA, PORT124_DATA,
1489 PORT123_DATA, PORT122_DATA, PORT121_DATA, 0,
1490 0, 0, 0, 0,
1491 0, 0, 0, 0,
1492 0, 0, 0, 0,
1493 0, 0, 0, 0,
1494 0, 0, 0, 0,
1495 PORT99_DATA, PORT98_DATA, PORT97_DATA, PORT96_DATA,
1496 }
1497 },
1498 { PINMUX_DATA_REG("PORTL159_128DR", 0xE6054010, 32) {
1499 PORT159_DATA, PORT158_DATA, PORT157_DATA, PORT156_DATA,
1500 0, 0, 0, 0,
1501 PORT151_DATA, PORT150_DATA, PORT149_DATA, PORT148_DATA,
1502 PORT147_DATA, PORT146_DATA, PORT145_DATA, PORT144_DATA,
1503 PORT143_DATA, PORT142_DATA, PORT141_DATA, PORT140_DATA,
1504 PORT139_DATA, PORT138_DATA, PORT137_DATA, PORT136_DATA,
1505 PORT135_DATA, PORT134_DATA, PORT133_DATA, PORT132_DATA,
1506 PORT131_DATA, PORT130_DATA, PORT129_DATA, PORT128_DATA,
1507 }
1508 },
1509 { PINMUX_DATA_REG("PORTL191_160DR", 0xE6054014, 32) {
1510 0, 0, 0, 0,
1511 0, 0, 0, 0,
1512 0, 0, 0, 0,
1513 0, 0, 0, 0,
1514 0, 0, 0, 0,
1515 0, 0, 0, 0,
1516 0, PORT166_DATA, PORT165_DATA, PORT164_DATA,
1517 PORT163_DATA, PORT162_DATA, PORT161_DATA, PORT160_DATA,
1518 }
1519 },
1520 { PINMUX_DATA_REG("PORTD031_000DR", 0xE6055000, 32) {
1521 PORT31_DATA, PORT30_DATA, PORT29_DATA, PORT28_DATA,
1522 PORT27_DATA, PORT26_DATA, PORT25_DATA, PORT24_DATA,
1523 PORT23_DATA, PORT22_DATA, PORT21_DATA, PORT20_DATA,
1524 PORT19_DATA, PORT18_DATA, PORT17_DATA, PORT16_DATA,
1525 PORT15_DATA, PORT14_DATA, PORT13_DATA, PORT12_DATA,
1526 PORT11_DATA, PORT10_DATA, PORT9_DATA, PORT8_DATA,
1527 PORT7_DATA, PORT6_DATA, PORT5_DATA, PORT4_DATA,
1528 PORT3_DATA, PORT2_DATA, PORT1_DATA, PORT0_DATA,
1529 }
1530 },
1531 { PINMUX_DATA_REG("PORTD063_032DR", 0xE6055004, 32) {
1532 0, 0, 0, 0, 0, 0, 0, 0,
1533 0, 0, 0, 0, 0, 0, 0, 0,
1534 0, 0, PORT45_DATA, PORT44_DATA,
1535 PORT43_DATA, PORT42_DATA, PORT41_DATA, PORT40_DATA,
1536 PORT39_DATA, PORT38_DATA, PORT37_DATA, PORT36_DATA,
1537 PORT35_DATA, PORT34_DATA, PORT33_DATA, PORT32_DATA,
1538 }
1539 },
1540 { PINMUX_DATA_REG("PORTR063_032DR", 0xE6056004, 32) {
1541 PORT63_DATA, PORT62_DATA, PORT61_DATA, PORT60_DATA,
1542 PORT59_DATA, PORT58_DATA, PORT57_DATA, PORT56_DATA,
1543 PORT55_DATA, PORT54_DATA, PORT53_DATA, PORT52_DATA,
1544 PORT51_DATA, PORT50_DATA, PORT49_DATA, PORT48_DATA,
1545 PORT47_DATA, PORT46_DATA, 0, 0,
1546 0, 0, 0, 0,
1547 0, 0, 0, 0,
1548 0, 0, 0, 0,
1549 }
1550 },
1551 { PINMUX_DATA_REG("PORTR095_064DR", 0xE6056008, 32) {
1552 0, 0, 0, 0,
1553 0, 0, 0, 0,
1554 0, 0, 0, 0,
1555 0, 0, 0, 0,
1556 0, 0, 0, 0,
1557 PORT75_DATA, PORT74_DATA, PORT73_DATA, PORT72_DATA,
1558 PORT71_DATA, PORT70_DATA, PORT69_DATA, PORT68_DATA,
1559 PORT67_DATA, PORT66_DATA, PORT65_DATA, PORT64_DATA,
1560 }
1561 },
1562 { PINMUX_DATA_REG("PORTR191_160DR", 0xE6056014, 32) {
1563 0, PORT190_DATA, PORT189_DATA, PORT188_DATA,
1564 PORT187_DATA, PORT186_DATA, PORT185_DATA, PORT184_DATA,
1565 PORT183_DATA, PORT182_DATA, PORT181_DATA, PORT180_DATA,
1566 PORT179_DATA, PORT178_DATA, PORT177_DATA, PORT176_DATA,
1567 PORT175_DATA, PORT174_DATA, PORT173_DATA, PORT172_DATA,
1568 PORT171_DATA, PORT170_DATA, PORT169_DATA, PORT168_DATA,
1569 PORT167_DATA, 0, 0, 0,
1570 0, 0, 0, 0,
1571 }
1572 },
1573 { PINMUX_DATA_REG("PORTU127_096DR", 0xE605700C, 32) {
1574 0, 0, 0, 0,
1575 0, 0, 0, PORT120_DATA,
1576 PORT119_DATA, PORT118_DATA, PORT117_DATA, PORT116_DATA,
1577 PORT115_DATA, PORT114_DATA, PORT113_DATA, PORT112_DATA,
1578 PORT111_DATA, PORT110_DATA, PORT109_DATA, PORT108_DATA,
1579 PORT107_DATA, PORT106_DATA, PORT105_DATA, PORT104_DATA,
1580 PORT103_DATA, PORT102_DATA, PORT101_DATA, PORT100_DATA,
1581 0, 0, 0, 0,
1582 }
1583 },
1584 { PINMUX_DATA_REG("PORTU159_128DR", 0xE6057010, 32) {
1585 0, 0, 0, 0,
1586 PORT155_DATA, PORT154_DATA, PORT153_DATA, PORT152_DATA,
1587 0, 0, 0, 0,
1588 0, 0, 0, 0,
1589 0, 0, 0, 0,
1590 0, 0, 0, 0,
1591 0, 0, 0, 0,
1592 0, 0, 0, 0,
1593 }
1594 },
1595 { },
1596};
1597
1598#define EXT_IRQ16L(n) evt2irq(0x200 + ((n) << 5))
1599#define EXT_IRQ16H(n) evt2irq(0x3200 + (((n) - 16) << 5))
1600static struct pinmux_irq pinmux_irqs[] = {
1601 PINMUX_IRQ(EXT_IRQ16L(0), PORT6_FN0, PORT162_FN0),
1602 PINMUX_IRQ(EXT_IRQ16L(1), PORT12_FN0),
1603 PINMUX_IRQ(EXT_IRQ16L(2), PORT4_FN0, PORT5_FN0),
1604 PINMUX_IRQ(EXT_IRQ16L(3), PORT8_FN0, PORT16_FN0),
1605 PINMUX_IRQ(EXT_IRQ16L(4), PORT17_FN0, PORT163_FN0),
1606 PINMUX_IRQ(EXT_IRQ16L(5), PORT18_FN0),
1607 PINMUX_IRQ(EXT_IRQ16L(6), PORT39_FN0, PORT164_FN0),
1608 PINMUX_IRQ(EXT_IRQ16L(7), PORT40_FN0, PORT167_FN0),
1609 PINMUX_IRQ(EXT_IRQ16L(8), PORT41_FN0, PORT168_FN0),
1610 PINMUX_IRQ(EXT_IRQ16L(9), PORT42_FN0, PORT169_FN0),
1611 PINMUX_IRQ(EXT_IRQ16L(10), PORT65_FN0),
1612 PINMUX_IRQ(EXT_IRQ16L(11), PORT67_FN0),
1613 PINMUX_IRQ(EXT_IRQ16L(12), PORT80_FN0, PORT137_FN0),
1614 PINMUX_IRQ(EXT_IRQ16L(13), PORT81_FN0, PORT145_FN0),
1615 PINMUX_IRQ(EXT_IRQ16L(14), PORT82_FN0, PORT146_FN0),
1616 PINMUX_IRQ(EXT_IRQ16L(15), PORT83_FN0, PORT147_FN0),
1617 PINMUX_IRQ(EXT_IRQ16H(16), PORT84_FN0, PORT170_FN0),
1618 PINMUX_IRQ(EXT_IRQ16H(17), PORT85_FN0),
1619 PINMUX_IRQ(EXT_IRQ16H(18), PORT86_FN0),
1620 PINMUX_IRQ(EXT_IRQ16H(19), PORT87_FN0),
1621 PINMUX_IRQ(EXT_IRQ16H(20), PORT92_FN0),
1622 PINMUX_IRQ(EXT_IRQ16H(21), PORT93_FN0),
1623 PINMUX_IRQ(EXT_IRQ16H(22), PORT94_FN0),
1624 PINMUX_IRQ(EXT_IRQ16H(23), PORT95_FN0),
1625 PINMUX_IRQ(EXT_IRQ16H(24), PORT112_FN0),
1626 PINMUX_IRQ(EXT_IRQ16H(25), PORT119_FN0),
1627 PINMUX_IRQ(EXT_IRQ16H(26), PORT121_FN0, PORT172_FN0),
1628 PINMUX_IRQ(EXT_IRQ16H(27), PORT122_FN0, PORT180_FN0),
1629 PINMUX_IRQ(EXT_IRQ16H(28), PORT123_FN0, PORT181_FN0),
1630 PINMUX_IRQ(EXT_IRQ16H(29), PORT129_FN0, PORT182_FN0),
1631 PINMUX_IRQ(EXT_IRQ16H(30), PORT130_FN0, PORT183_FN0),
1632 PINMUX_IRQ(EXT_IRQ16H(31), PORT138_FN0, PORT184_FN0),
1633};
1634
1635static struct pinmux_info sh7372_pinmux_info = {
1636 .name = "sh7372_pfc",
1637 .reserved_id = PINMUX_RESERVED,
1638 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
1639 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
1640 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END },
1641 .input_pd = { PINMUX_INPUT_PULLDOWN_BEGIN, PINMUX_INPUT_PULLDOWN_END },
1642 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
1643 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
1644 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
1645
1646 .first_gpio = GPIO_PORT0,
1647 .last_gpio = GPIO_FN_SDENC_DV_CLKI,
1648
1649 .gpios = pinmux_gpios,
1650 .cfg_regs = pinmux_config_regs,
1651 .data_regs = pinmux_data_regs,
1652
1653 .gpio_data = pinmux_data,
1654 .gpio_data_size = ARRAY_SIZE(pinmux_data),
1655
1656 .gpio_irq = pinmux_irqs,
1657 .gpio_irq_size = ARRAY_SIZE(pinmux_irqs),
1658};
1659
1660void sh7372_pinmux_init(void)
1661{
1662 register_pinmux(&sh7372_pinmux_info);
1663}
diff --git a/arch/arm/mach-shmobile/pfc-sh73a0.c b/arch/arm/mach-shmobile/pfc-sh73a0.c
deleted file mode 100644
index b442f9d8c716..000000000000
--- a/arch/arm/mach-shmobile/pfc-sh73a0.c
+++ /dev/null
@@ -1,2803 +0,0 @@
1/*
2 * sh73a0 processor support - PFC hardware block
3 *
4 * Copyright (C) 2010 Renesas Solutions Corp.
5 * Copyright (C) 2010 NISHIMOTO Hiroki
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 as
9 * published by the Free Software Foundation; version 2 of the
10 * License.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21#include <linux/init.h>
22#include <linux/kernel.h>
23#include <linux/sh_pfc.h>
24#include <mach/sh73a0.h>
25#include <mach/irqs.h>
26
27#define CPU_ALL_PORT(fn, pfx, sfx) \
28 PORT_10(fn, pfx, sfx), PORT_10(fn, pfx##1, sfx), \
29 PORT_10(fn, pfx##2, sfx), PORT_10(fn, pfx##3, sfx), \
30 PORT_10(fn, pfx##4, sfx), PORT_10(fn, pfx##5, sfx), \
31 PORT_10(fn, pfx##6, sfx), PORT_10(fn, pfx##7, sfx), \
32 PORT_10(fn, pfx##8, sfx), PORT_10(fn, pfx##9, sfx), \
33 PORT_10(fn, pfx##10, sfx), \
34 PORT_1(fn, pfx##110, sfx), PORT_1(fn, pfx##111, sfx), \
35 PORT_1(fn, pfx##112, sfx), PORT_1(fn, pfx##113, sfx), \
36 PORT_1(fn, pfx##114, sfx), PORT_1(fn, pfx##115, sfx), \
37 PORT_1(fn, pfx##116, sfx), PORT_1(fn, pfx##117, sfx), \
38 PORT_1(fn, pfx##118, sfx), \
39 PORT_1(fn, pfx##128, sfx), PORT_1(fn, pfx##129, sfx), \
40 PORT_10(fn, pfx##13, sfx), PORT_10(fn, pfx##14, sfx), \
41 PORT_10(fn, pfx##15, sfx), \
42 PORT_1(fn, pfx##160, sfx), PORT_1(fn, pfx##161, sfx), \
43 PORT_1(fn, pfx##162, sfx), PORT_1(fn, pfx##163, sfx), \
44 PORT_1(fn, pfx##164, sfx), \
45 PORT_1(fn, pfx##192, sfx), PORT_1(fn, pfx##193, sfx), \
46 PORT_1(fn, pfx##194, sfx), PORT_1(fn, pfx##195, sfx), \
47 PORT_1(fn, pfx##196, sfx), PORT_1(fn, pfx##197, sfx), \
48 PORT_1(fn, pfx##198, sfx), PORT_1(fn, pfx##199, sfx), \
49 PORT_10(fn, pfx##20, sfx), PORT_10(fn, pfx##21, sfx), \
50 PORT_10(fn, pfx##22, sfx), PORT_10(fn, pfx##23, sfx), \
51 PORT_10(fn, pfx##24, sfx), PORT_10(fn, pfx##25, sfx), \
52 PORT_10(fn, pfx##26, sfx), PORT_10(fn, pfx##27, sfx), \
53 PORT_1(fn, pfx##280, sfx), PORT_1(fn, pfx##281, sfx), \
54 PORT_1(fn, pfx##282, sfx), \
55 PORT_1(fn, pfx##288, sfx), PORT_1(fn, pfx##289, sfx), \
56 PORT_10(fn, pfx##29, sfx), PORT_10(fn, pfx##30, sfx)
57
58enum {
59 PINMUX_RESERVED = 0,
60
61 PINMUX_DATA_BEGIN,
62 PORT_ALL(DATA), /* PORT0_DATA -> PORT309_DATA */
63 PINMUX_DATA_END,
64
65 PINMUX_INPUT_BEGIN,
66 PORT_ALL(IN), /* PORT0_IN -> PORT309_IN */
67 PINMUX_INPUT_END,
68
69 PINMUX_INPUT_PULLUP_BEGIN,
70 PORT_ALL(IN_PU), /* PORT0_IN_PU -> PORT309_IN_PU */
71 PINMUX_INPUT_PULLUP_END,
72
73 PINMUX_INPUT_PULLDOWN_BEGIN,
74 PORT_ALL(IN_PD), /* PORT0_IN_PD -> PORT309_IN_PD */
75 PINMUX_INPUT_PULLDOWN_END,
76
77 PINMUX_OUTPUT_BEGIN,
78 PORT_ALL(OUT), /* PORT0_OUT -> PORT309_OUT */
79 PINMUX_OUTPUT_END,
80
81 PINMUX_FUNCTION_BEGIN,
82 PORT_ALL(FN_IN), /* PORT0_FN_IN -> PORT309_FN_IN */
83 PORT_ALL(FN_OUT), /* PORT0_FN_OUT -> PORT309_FN_OUT */
84 PORT_ALL(FN0), /* PORT0_FN0 -> PORT309_FN0 */
85 PORT_ALL(FN1), /* PORT0_FN1 -> PORT309_FN1 */
86 PORT_ALL(FN2), /* PORT0_FN2 -> PORT309_FN2 */
87 PORT_ALL(FN3), /* PORT0_FN3 -> PORT309_FN3 */
88 PORT_ALL(FN4), /* PORT0_FN4 -> PORT309_FN4 */
89 PORT_ALL(FN5), /* PORT0_FN5 -> PORT309_FN5 */
90 PORT_ALL(FN6), /* PORT0_FN6 -> PORT309_FN6 */
91 PORT_ALL(FN7), /* PORT0_FN7 -> PORT309_FN7 */
92
93 MSEL2CR_MSEL19_0, MSEL2CR_MSEL19_1,
94 MSEL2CR_MSEL18_0, MSEL2CR_MSEL18_1,
95 MSEL2CR_MSEL17_0, MSEL2CR_MSEL17_1,
96 MSEL2CR_MSEL16_0, MSEL2CR_MSEL16_1,
97 MSEL2CR_MSEL14_0, MSEL2CR_MSEL14_1,
98 MSEL2CR_MSEL13_0, MSEL2CR_MSEL13_1,
99 MSEL2CR_MSEL12_0, MSEL2CR_MSEL12_1,
100 MSEL2CR_MSEL11_0, MSEL2CR_MSEL11_1,
101 MSEL2CR_MSEL10_0, MSEL2CR_MSEL10_1,
102 MSEL2CR_MSEL9_0, MSEL2CR_MSEL9_1,
103 MSEL2CR_MSEL8_0, MSEL2CR_MSEL8_1,
104 MSEL2CR_MSEL7_0, MSEL2CR_MSEL7_1,
105 MSEL2CR_MSEL6_0, MSEL2CR_MSEL6_1,
106 MSEL2CR_MSEL4_0, MSEL2CR_MSEL4_1,
107 MSEL2CR_MSEL5_0, MSEL2CR_MSEL5_1,
108 MSEL2CR_MSEL3_0, MSEL2CR_MSEL3_1,
109 MSEL2CR_MSEL2_0, MSEL2CR_MSEL2_1,
110 MSEL2CR_MSEL1_0, MSEL2CR_MSEL1_1,
111 MSEL2CR_MSEL0_0, MSEL2CR_MSEL0_1,
112 MSEL3CR_MSEL28_0, MSEL3CR_MSEL28_1,
113 MSEL3CR_MSEL15_0, MSEL3CR_MSEL15_1,
114 MSEL3CR_MSEL11_0, MSEL3CR_MSEL11_1,
115 MSEL3CR_MSEL9_0, MSEL3CR_MSEL9_1,
116 MSEL3CR_MSEL6_0, MSEL3CR_MSEL6_1,
117 MSEL3CR_MSEL2_0, MSEL3CR_MSEL2_1,
118 MSEL4CR_MSEL29_0, MSEL4CR_MSEL29_1,
119 MSEL4CR_MSEL27_0, MSEL4CR_MSEL27_1,
120 MSEL4CR_MSEL26_0, MSEL4CR_MSEL26_1,
121 MSEL4CR_MSEL22_0, MSEL4CR_MSEL22_1,
122 MSEL4CR_MSEL21_0, MSEL4CR_MSEL21_1,
123 MSEL4CR_MSEL20_0, MSEL4CR_MSEL20_1,
124 MSEL4CR_MSEL19_0, MSEL4CR_MSEL19_1,
125 MSEL4CR_MSEL15_0, MSEL4CR_MSEL15_1,
126 MSEL4CR_MSEL13_0, MSEL4CR_MSEL13_1,
127 MSEL4CR_MSEL12_0, MSEL4CR_MSEL12_1,
128 MSEL4CR_MSEL11_0, MSEL4CR_MSEL11_1,
129 MSEL4CR_MSEL10_0, MSEL4CR_MSEL10_1,
130 MSEL4CR_MSEL9_0, MSEL4CR_MSEL9_1,
131 MSEL4CR_MSEL8_0, MSEL4CR_MSEL8_1,
132 MSEL4CR_MSEL7_0, MSEL4CR_MSEL7_1,
133 MSEL4CR_MSEL4_0, MSEL4CR_MSEL4_1,
134 MSEL4CR_MSEL1_0, MSEL4CR_MSEL1_1,
135 PINMUX_FUNCTION_END,
136
137 PINMUX_MARK_BEGIN,
138 /* Hardware manual Table 25-1 (Function 0-7) */
139 VBUS_0_MARK,
140 GPI0_MARK,
141 GPI1_MARK,
142 GPI2_MARK,
143 GPI3_MARK,
144 GPI4_MARK,
145 GPI5_MARK,
146 GPI6_MARK,
147 GPI7_MARK,
148 SCIFA7_RXD_MARK,
149 SCIFA7_CTS__MARK,
150 GPO7_MARK, MFG0_OUT2_MARK,
151 GPO6_MARK, MFG1_OUT2_MARK,
152 GPO5_MARK, SCIFA0_SCK_MARK, FSICOSLDT3_MARK, PORT16_VIO_CKOR_MARK,
153 SCIFA0_TXD_MARK,
154 SCIFA7_TXD_MARK,
155 SCIFA7_RTS__MARK, PORT19_VIO_CKO2_MARK,
156 GPO0_MARK,
157 GPO1_MARK,
158 GPO2_MARK, STATUS0_MARK,
159 GPO3_MARK, STATUS1_MARK,
160 GPO4_MARK, STATUS2_MARK,
161 VINT_MARK,
162 TCKON_MARK,
163 XDVFS1_MARK, PORT27_I2C_SCL2_MARK, PORT27_I2C_SCL3_MARK, \
164 MFG0_OUT1_MARK, PORT27_IROUT_MARK,
165 XDVFS2_MARK, PORT28_I2C_SDA2_MARK, PORT28_I2C_SDA3_MARK, \
166 PORT28_TPU1TO1_MARK,
167 SIM_RST_MARK, PORT29_TPU1TO1_MARK,
168 SIM_CLK_MARK, PORT30_VIO_CKOR_MARK,
169 SIM_D_MARK, PORT31_IROUT_MARK,
170 SCIFA4_TXD_MARK,
171 SCIFA4_RXD_MARK, XWUP_MARK,
172 SCIFA4_RTS__MARK,
173 SCIFA4_CTS__MARK,
174 FSIBOBT_MARK, FSIBIBT_MARK,
175 FSIBOLR_MARK, FSIBILR_MARK,
176 FSIBOSLD_MARK,
177 FSIBISLD_MARK,
178 VACK_MARK,
179 XTAL1L_MARK,
180 SCIFA0_RTS__MARK, FSICOSLDT2_MARK,
181 SCIFA0_RXD_MARK,
182 SCIFA0_CTS__MARK, FSICOSLDT1_MARK,
183 FSICOBT_MARK, FSICIBT_MARK, FSIDOBT_MARK, FSIDIBT_MARK,
184 FSICOLR_MARK, FSICILR_MARK, FSIDOLR_MARK, FSIDILR_MARK,
185 FSICOSLD_MARK, PORT47_FSICSPDIF_MARK,
186 FSICISLD_MARK, FSIDISLD_MARK,
187 FSIACK_MARK, PORT49_IRDA_OUT_MARK, PORT49_IROUT_MARK, FSIAOMC_MARK,
188 FSIAOLR_MARK, BBIF2_TSYNC2_MARK, TPU2TO2_MARK, FSIAILR_MARK,
189
190 FSIAOBT_MARK, BBIF2_TSCK2_MARK, TPU2TO3_MARK, FSIAIBT_MARK,
191 FSIAOSLD_MARK, BBIF2_TXD2_MARK,
192 FSIASPDIF_MARK, PORT53_IRDA_IN_MARK, TPU3TO3_MARK, FSIBSPDIF_MARK, \
193 PORT53_FSICSPDIF_MARK,
194 FSIBCK_MARK, PORT54_IRDA_FIRSEL_MARK, TPU3TO2_MARK, FSIBOMC_MARK, \
195 FSICCK_MARK, FSICOMC_MARK,
196 FSIAISLD_MARK, TPU0TO0_MARK,
197 A0_MARK, BS__MARK,
198 A12_MARK, PORT58_KEYOUT7_MARK, TPU4TO2_MARK,
199 A13_MARK, PORT59_KEYOUT6_MARK, TPU0TO1_MARK,
200 A14_MARK, KEYOUT5_MARK,
201 A15_MARK, KEYOUT4_MARK,
202 A16_MARK, KEYOUT3_MARK, MSIOF0_SS1_MARK,
203 A17_MARK, KEYOUT2_MARK, MSIOF0_TSYNC_MARK,
204 A18_MARK, KEYOUT1_MARK, MSIOF0_TSCK_MARK,
205 A19_MARK, KEYOUT0_MARK, MSIOF0_TXD_MARK,
206 A20_MARK, KEYIN0_MARK, MSIOF0_RSCK_MARK,
207 A21_MARK, KEYIN1_MARK, MSIOF0_RSYNC_MARK,
208 A22_MARK, KEYIN2_MARK, MSIOF0_MCK0_MARK,
209 A23_MARK, KEYIN3_MARK, MSIOF0_MCK1_MARK,
210 A24_MARK, KEYIN4_MARK, MSIOF0_RXD_MARK,
211 A25_MARK, KEYIN5_MARK, MSIOF0_SS2_MARK,
212 A26_MARK, KEYIN6_MARK,
213 KEYIN7_MARK,
214 D0_NAF0_MARK,
215 D1_NAF1_MARK,
216 D2_NAF2_MARK,
217 D3_NAF3_MARK,
218 D4_NAF4_MARK,
219 D5_NAF5_MARK,
220 D6_NAF6_MARK,
221 D7_NAF7_MARK,
222 D8_NAF8_MARK,
223 D9_NAF9_MARK,
224 D10_NAF10_MARK,
225 D11_NAF11_MARK,
226 D12_NAF12_MARK,
227 D13_NAF13_MARK,
228 D14_NAF14_MARK,
229 D15_NAF15_MARK,
230 CS4__MARK,
231 CS5A__MARK, PORT91_RDWR_MARK,
232 CS5B__MARK, FCE1__MARK,
233 CS6B__MARK, DACK0_MARK,
234 FCE0__MARK, CS6A__MARK,
235 WAIT__MARK, DREQ0_MARK,
236 RD__FSC_MARK,
237 WE0__FWE_MARK, RDWR_FWE_MARK,
238 WE1__MARK,
239 FRB_MARK,
240 CKO_MARK,
241 NBRSTOUT__MARK,
242 NBRST__MARK,
243 BBIF2_TXD_MARK,
244 BBIF2_RXD_MARK,
245 BBIF2_SYNC_MARK,
246 BBIF2_SCK_MARK,
247 SCIFA3_CTS__MARK, MFG3_IN2_MARK,
248 SCIFA3_RXD_MARK, MFG3_IN1_MARK,
249 BBIF1_SS2_MARK, SCIFA3_RTS__MARK, MFG3_OUT1_MARK,
250 SCIFA3_TXD_MARK,
251 HSI_RX_DATA_MARK, BBIF1_RXD_MARK,
252 HSI_TX_WAKE_MARK, BBIF1_TSCK_MARK,
253 HSI_TX_DATA_MARK, BBIF1_TSYNC_MARK,
254 HSI_TX_READY_MARK, BBIF1_TXD_MARK,
255 HSI_RX_READY_MARK, BBIF1_RSCK_MARK, PORT115_I2C_SCL2_MARK, \
256 PORT115_I2C_SCL3_MARK,
257 HSI_RX_WAKE_MARK, BBIF1_RSYNC_MARK, PORT116_I2C_SDA2_MARK, \
258 PORT116_I2C_SDA3_MARK,
259 HSI_RX_FLAG_MARK, BBIF1_SS1_MARK, BBIF1_FLOW_MARK,
260 HSI_TX_FLAG_MARK,
261 VIO_VD_MARK, PORT128_LCD2VSYN_MARK, VIO2_VD_MARK, LCD2D0_MARK,
262
263 VIO_HD_MARK, PORT129_LCD2HSYN_MARK, PORT129_LCD2CS__MARK, \
264 VIO2_HD_MARK, LCD2D1_MARK,
265 VIO_D0_MARK, PORT130_MSIOF2_RXD_MARK, LCD2D10_MARK,
266 VIO_D1_MARK, PORT131_KEYOUT6_MARK, PORT131_MSIOF2_SS1_MARK, \
267 PORT131_KEYOUT11_MARK, LCD2D11_MARK,
268 VIO_D2_MARK, PORT132_KEYOUT7_MARK, PORT132_MSIOF2_SS2_MARK, \
269 PORT132_KEYOUT10_MARK, LCD2D12_MARK,
270 VIO_D3_MARK, MSIOF2_TSYNC_MARK, LCD2D13_MARK,
271 VIO_D4_MARK, MSIOF2_TXD_MARK, LCD2D14_MARK,
272 VIO_D5_MARK, MSIOF2_TSCK_MARK, LCD2D15_MARK,
273 VIO_D6_MARK, PORT136_KEYOUT8_MARK, LCD2D16_MARK,
274 VIO_D7_MARK, PORT137_KEYOUT9_MARK, LCD2D17_MARK,
275 VIO_D8_MARK, PORT138_KEYOUT8_MARK, VIO2_D0_MARK, LCD2D6_MARK,
276 VIO_D9_MARK, PORT139_KEYOUT9_MARK, VIO2_D1_MARK, LCD2D7_MARK,
277 VIO_D10_MARK, TPU0TO2_MARK, VIO2_D2_MARK, LCD2D8_MARK,
278 VIO_D11_MARK, TPU0TO3_MARK, VIO2_D3_MARK, LCD2D9_MARK,
279 VIO_D12_MARK, PORT142_KEYOUT10_MARK, VIO2_D4_MARK, LCD2D2_MARK,
280 VIO_D13_MARK, PORT143_KEYOUT11_MARK, PORT143_KEYOUT6_MARK, \
281 VIO2_D5_MARK, LCD2D3_MARK,
282 VIO_D14_MARK, PORT144_KEYOUT7_MARK, VIO2_D6_MARK, LCD2D4_MARK,
283 VIO_D15_MARK, TPU1TO3_MARK, PORT145_LCD2DISP_MARK, \
284 PORT145_LCD2RS_MARK, VIO2_D7_MARK, LCD2D5_MARK,
285 VIO_CLK_MARK, LCD2DCK_MARK, PORT146_LCD2WR__MARK, VIO2_CLK_MARK, \
286 LCD2D18_MARK,
287 VIO_FIELD_MARK, LCD2RD__MARK, VIO2_FIELD_MARK, LCD2D19_MARK,
288 VIO_CKO_MARK,
289 A27_MARK, PORT149_RDWR_MARK, MFG0_IN1_MARK, PORT149_KEYOUT9_MARK,
290 MFG0_IN2_MARK,
291 TS_SPSYNC3_MARK, MSIOF2_RSCK_MARK,
292 TS_SDAT3_MARK, MSIOF2_RSYNC_MARK,
293 TPU1TO2_MARK, TS_SDEN3_MARK, PORT153_MSIOF2_SS1_MARK,
294 SCIFA2_TXD1_MARK, MSIOF2_MCK0_MARK,
295 SCIFA2_RXD1_MARK, MSIOF2_MCK1_MARK,
296 SCIFA2_RTS1__MARK, PORT156_MSIOF2_SS2_MARK,
297 SCIFA2_CTS1__MARK, PORT157_MSIOF2_RXD_MARK,
298 DINT__MARK, SCIFA2_SCK1_MARK, TS_SCK3_MARK,
299 PORT159_SCIFB_SCK_MARK, PORT159_SCIFA5_SCK_MARK, NMI_MARK,
300 PORT160_SCIFB_TXD_MARK, PORT160_SCIFA5_TXD_MARK,
301 PORT161_SCIFB_CTS__MARK, PORT161_SCIFA5_CTS__MARK,
302 PORT162_SCIFB_RXD_MARK, PORT162_SCIFA5_RXD_MARK,
303 PORT163_SCIFB_RTS__MARK, PORT163_SCIFA5_RTS__MARK, TPU3TO0_MARK,
304 LCDD0_MARK,
305 LCDD1_MARK, PORT193_SCIFA5_CTS__MARK, BBIF2_TSYNC1_MARK,
306 LCDD2_MARK, PORT194_SCIFA5_RTS__MARK, BBIF2_TSCK1_MARK,
307 LCDD3_MARK, PORT195_SCIFA5_RXD_MARK, BBIF2_TXD1_MARK,
308 LCDD4_MARK, PORT196_SCIFA5_TXD_MARK,
309 LCDD5_MARK, PORT197_SCIFA5_SCK_MARK, MFG2_OUT2_MARK, TPU2TO1_MARK,
310 LCDD6_MARK,
311 LCDD7_MARK, TPU4TO1_MARK, MFG4_OUT2_MARK,
312 LCDD8_MARK, D16_MARK,
313 LCDD9_MARK, D17_MARK,
314 LCDD10_MARK, D18_MARK,
315 LCDD11_MARK, D19_MARK,
316 LCDD12_MARK, D20_MARK,
317 LCDD13_MARK, D21_MARK,
318 LCDD14_MARK, D22_MARK,
319 LCDD15_MARK, PORT207_MSIOF0L_SS1_MARK, D23_MARK,
320 LCDD16_MARK, PORT208_MSIOF0L_SS2_MARK, D24_MARK,
321 LCDD17_MARK, D25_MARK,
322 LCDD18_MARK, DREQ2_MARK, PORT210_MSIOF0L_SS1_MARK, D26_MARK,
323 LCDD19_MARK, PORT211_MSIOF0L_SS2_MARK, D27_MARK,
324 LCDD20_MARK, TS_SPSYNC1_MARK, MSIOF0L_MCK0_MARK, D28_MARK,
325 LCDD21_MARK, TS_SDAT1_MARK, MSIOF0L_MCK1_MARK, D29_MARK,
326 LCDD22_MARK, TS_SDEN1_MARK, MSIOF0L_RSCK_MARK, D30_MARK,
327 LCDD23_MARK, TS_SCK1_MARK, MSIOF0L_RSYNC_MARK, D31_MARK,
328 LCDDCK_MARK, LCDWR__MARK,
329 LCDRD__MARK, DACK2_MARK, PORT217_LCD2RS_MARK, MSIOF0L_TSYNC_MARK, \
330 VIO2_FIELD3_MARK, PORT217_LCD2DISP_MARK,
331 LCDHSYN_MARK, LCDCS__MARK, LCDCS2__MARK, DACK3_MARK, \
332 PORT218_VIO_CKOR_MARK,
333 LCDDISP_MARK, LCDRS_MARK, PORT219_LCD2WR__MARK, DREQ3_MARK, \
334 MSIOF0L_TSCK_MARK, VIO2_CLK3_MARK, LCD2DCK_2_MARK,
335 LCDVSYN_MARK, LCDVSYN2_MARK,
336 LCDLCLK_MARK, DREQ1_MARK, PORT221_LCD2CS__MARK, PWEN_MARK, \
337 MSIOF0L_RXD_MARK, VIO2_HD3_MARK, PORT221_LCD2HSYN_MARK,
338 LCDDON_MARK, LCDDON2_MARK, DACK1_MARK, OVCN_MARK, MSIOF0L_TXD_MARK, \
339 VIO2_VD3_MARK, PORT222_LCD2VSYN_MARK,
340
341 SCIFA1_TXD_MARK, OVCN2_MARK,
342 EXTLP_MARK, SCIFA1_SCK_MARK, PORT226_VIO_CKO2_MARK,
343 SCIFA1_RTS__MARK, IDIN_MARK,
344 SCIFA1_RXD_MARK,
345 SCIFA1_CTS__MARK, MFG1_IN1_MARK,
346 MSIOF1_TXD_MARK, SCIFA2_TXD2_MARK,
347 MSIOF1_TSYNC_MARK, SCIFA2_CTS2__MARK,
348 MSIOF1_TSCK_MARK, SCIFA2_SCK2_MARK,
349 MSIOF1_RXD_MARK, SCIFA2_RXD2_MARK,
350 MSIOF1_RSCK_MARK, SCIFA2_RTS2__MARK, VIO2_CLK2_MARK, LCD2D20_MARK,
351 MSIOF1_RSYNC_MARK, MFG1_IN2_MARK, VIO2_VD2_MARK, LCD2D21_MARK,
352 MSIOF1_MCK0_MARK, PORT236_I2C_SDA2_MARK,
353 MSIOF1_MCK1_MARK, PORT237_I2C_SCL2_MARK,
354 MSIOF1_SS1_MARK, VIO2_FIELD2_MARK, LCD2D22_MARK,
355 MSIOF1_SS2_MARK, VIO2_HD2_MARK, LCD2D23_MARK,
356 SCIFA6_TXD_MARK,
357 PORT241_IRDA_OUT_MARK, PORT241_IROUT_MARK, MFG4_OUT1_MARK, TPU4TO0_MARK,
358 PORT242_IRDA_IN_MARK, MFG4_IN2_MARK,
359 PORT243_IRDA_FIRSEL_MARK, PORT243_VIO_CKO2_MARK,
360 PORT244_SCIFA5_CTS__MARK, MFG2_IN1_MARK, PORT244_SCIFB_CTS__MARK, \
361 MSIOF2R_RXD_MARK,
362 PORT245_SCIFA5_RTS__MARK, MFG2_IN2_MARK, PORT245_SCIFB_RTS__MARK, \
363 MSIOF2R_TXD_MARK,
364 PORT246_SCIFA5_RXD_MARK, MFG1_OUT1_MARK, PORT246_SCIFB_RXD_MARK, \
365 TPU1TO0_MARK,
366 PORT247_SCIFA5_TXD_MARK, MFG3_OUT2_MARK, PORT247_SCIFB_TXD_MARK, \
367 TPU3TO1_MARK,
368 PORT248_SCIFA5_SCK_MARK, MFG2_OUT1_MARK, PORT248_SCIFB_SCK_MARK, \
369 TPU2TO0_MARK, PORT248_I2C_SCL3_MARK, MSIOF2R_TSCK_MARK,
370 PORT249_IROUT_MARK, MFG4_IN1_MARK, PORT249_I2C_SDA3_MARK, \
371 MSIOF2R_TSYNC_MARK,
372 SDHICLK0_MARK,
373 SDHICD0_MARK,
374 SDHID0_0_MARK,
375 SDHID0_1_MARK,
376 SDHID0_2_MARK,
377 SDHID0_3_MARK,
378 SDHICMD0_MARK,
379 SDHIWP0_MARK,
380 SDHICLK1_MARK,
381 SDHID1_0_MARK, TS_SPSYNC2_MARK,
382 SDHID1_1_MARK, TS_SDAT2_MARK,
383 SDHID1_2_MARK, TS_SDEN2_MARK,
384 SDHID1_3_MARK, TS_SCK2_MARK,
385 SDHICMD1_MARK,
386 SDHICLK2_MARK,
387 SDHID2_0_MARK, TS_SPSYNC4_MARK,
388 SDHID2_1_MARK, TS_SDAT4_MARK,
389 SDHID2_2_MARK, TS_SDEN4_MARK,
390 SDHID2_3_MARK, TS_SCK4_MARK,
391 SDHICMD2_MARK,
392 MMCCLK0_MARK,
393 MMCD0_0_MARK,
394 MMCD0_1_MARK,
395 MMCD0_2_MARK,
396 MMCD0_3_MARK,
397 MMCD0_4_MARK, TS_SPSYNC5_MARK,
398 MMCD0_5_MARK, TS_SDAT5_MARK,
399 MMCD0_6_MARK, TS_SDEN5_MARK,
400 MMCD0_7_MARK, TS_SCK5_MARK,
401 MMCCMD0_MARK,
402 RESETOUTS__MARK, EXTAL2OUT_MARK,
403 MCP_WAIT__MCP_FRB_MARK,
404 MCP_CKO_MARK, MMCCLK1_MARK,
405 MCP_D15_MCP_NAF15_MARK,
406 MCP_D14_MCP_NAF14_MARK,
407 MCP_D13_MCP_NAF13_MARK,
408 MCP_D12_MCP_NAF12_MARK,
409 MCP_D11_MCP_NAF11_MARK,
410 MCP_D10_MCP_NAF10_MARK,
411 MCP_D9_MCP_NAF9_MARK,
412 MCP_D8_MCP_NAF8_MARK, MMCCMD1_MARK,
413 MCP_D7_MCP_NAF7_MARK, MMCD1_7_MARK,
414
415 MCP_D6_MCP_NAF6_MARK, MMCD1_6_MARK,
416 MCP_D5_MCP_NAF5_MARK, MMCD1_5_MARK,
417 MCP_D4_MCP_NAF4_MARK, MMCD1_4_MARK,
418 MCP_D3_MCP_NAF3_MARK, MMCD1_3_MARK,
419 MCP_D2_MCP_NAF2_MARK, MMCD1_2_MARK,
420 MCP_D1_MCP_NAF1_MARK, MMCD1_1_MARK,
421 MCP_D0_MCP_NAF0_MARK, MMCD1_0_MARK,
422 MCP_NBRSTOUT__MARK,
423 MCP_WE0__MCP_FWE_MARK, MCP_RDWR_MCP_FWE_MARK,
424
425 /* MSEL2 special cases */
426 TSIF2_TS_XX1_MARK,
427 TSIF2_TS_XX2_MARK,
428 TSIF2_TS_XX3_MARK,
429 TSIF2_TS_XX4_MARK,
430 TSIF2_TS_XX5_MARK,
431 TSIF1_TS_XX1_MARK,
432 TSIF1_TS_XX2_MARK,
433 TSIF1_TS_XX3_MARK,
434 TSIF1_TS_XX4_MARK,
435 TSIF1_TS_XX5_MARK,
436 TSIF0_TS_XX1_MARK,
437 TSIF0_TS_XX2_MARK,
438 TSIF0_TS_XX3_MARK,
439 TSIF0_TS_XX4_MARK,
440 TSIF0_TS_XX5_MARK,
441 MST1_TS_XX1_MARK,
442 MST1_TS_XX2_MARK,
443 MST1_TS_XX3_MARK,
444 MST1_TS_XX4_MARK,
445 MST1_TS_XX5_MARK,
446 MST0_TS_XX1_MARK,
447 MST0_TS_XX2_MARK,
448 MST0_TS_XX3_MARK,
449 MST0_TS_XX4_MARK,
450 MST0_TS_XX5_MARK,
451
452 /* MSEL3 special cases */
453 SDHI0_VCCQ_MC0_ON_MARK,
454 SDHI0_VCCQ_MC0_OFF_MARK,
455 DEBUG_MON_VIO_MARK,
456 DEBUG_MON_LCDD_MARK,
457 LCDC_LCDC0_MARK,
458 LCDC_LCDC1_MARK,
459
460 /* MSEL4 special cases */
461 IRQ9_MEM_INT_MARK,
462 IRQ9_MCP_INT_MARK,
463 A11_MARK,
464 KEYOUT8_MARK,
465 TPU4TO3_MARK,
466 RESETA_N_PU_ON_MARK,
467 RESETA_N_PU_OFF_MARK,
468 EDBGREQ_PD_MARK,
469 EDBGREQ_PU_MARK,
470
471 /* Functions with pull-ups */
472 KEYIN0_PU_MARK,
473 KEYIN1_PU_MARK,
474 KEYIN2_PU_MARK,
475 KEYIN3_PU_MARK,
476 KEYIN4_PU_MARK,
477 KEYIN5_PU_MARK,
478 KEYIN6_PU_MARK,
479 KEYIN7_PU_MARK,
480 SDHICD0_PU_MARK,
481 SDHID0_0_PU_MARK,
482 SDHID0_1_PU_MARK,
483 SDHID0_2_PU_MARK,
484 SDHID0_3_PU_MARK,
485 SDHICMD0_PU_MARK,
486 SDHIWP0_PU_MARK,
487 SDHID1_0_PU_MARK,
488 SDHID1_1_PU_MARK,
489 SDHID1_2_PU_MARK,
490 SDHID1_3_PU_MARK,
491 SDHICMD1_PU_MARK,
492 SDHID2_0_PU_MARK,
493 SDHID2_1_PU_MARK,
494 SDHID2_2_PU_MARK,
495 SDHID2_3_PU_MARK,
496 SDHICMD2_PU_MARK,
497 MMCCMD0_PU_MARK,
498 MMCCMD1_PU_MARK,
499 MMCD0_0_PU_MARK,
500 MMCD0_1_PU_MARK,
501 MMCD0_2_PU_MARK,
502 MMCD0_3_PU_MARK,
503 MMCD0_4_PU_MARK,
504 MMCD0_5_PU_MARK,
505 MMCD0_6_PU_MARK,
506 MMCD0_7_PU_MARK,
507 FSIBISLD_PU_MARK,
508 FSIACK_PU_MARK,
509 FSIAILR_PU_MARK,
510 FSIAIBT_PU_MARK,
511 FSIAISLD_PU_MARK,
512
513 PINMUX_MARK_END,
514};
515
516static pinmux_enum_t pinmux_data[] = {
517 /* specify valid pin states for each pin in GPIO mode */
518
519 /* Table 25-1 (I/O and Pull U/D) */
520 PORT_DATA_I_PD(0),
521 PORT_DATA_I_PU(1),
522 PORT_DATA_I_PU(2),
523 PORT_DATA_I_PU(3),
524 PORT_DATA_I_PU(4),
525 PORT_DATA_I_PU(5),
526 PORT_DATA_I_PU(6),
527 PORT_DATA_I_PU(7),
528 PORT_DATA_I_PU(8),
529 PORT_DATA_I_PD(9),
530 PORT_DATA_I_PD(10),
531 PORT_DATA_I_PU_PD(11),
532 PORT_DATA_IO_PU_PD(12),
533 PORT_DATA_IO_PU_PD(13),
534 PORT_DATA_IO_PU_PD(14),
535 PORT_DATA_IO_PU_PD(15),
536 PORT_DATA_IO_PD(16),
537 PORT_DATA_IO_PD(17),
538 PORT_DATA_IO_PU(18),
539 PORT_DATA_IO_PU(19),
540 PORT_DATA_O(20),
541 PORT_DATA_O(21),
542 PORT_DATA_O(22),
543 PORT_DATA_O(23),
544 PORT_DATA_O(24),
545 PORT_DATA_I_PD(25),
546 PORT_DATA_I_PD(26),
547 PORT_DATA_IO_PU(27),
548 PORT_DATA_IO_PU(28),
549 PORT_DATA_IO_PD(29),
550 PORT_DATA_IO_PD(30),
551 PORT_DATA_IO_PU(31),
552 PORT_DATA_IO_PD(32),
553 PORT_DATA_I_PU_PD(33),
554 PORT_DATA_IO_PD(34),
555 PORT_DATA_I_PU_PD(35),
556 PORT_DATA_IO_PD(36),
557 PORT_DATA_IO(37),
558 PORT_DATA_O(38),
559 PORT_DATA_I_PU(39),
560 PORT_DATA_I_PU_PD(40),
561 PORT_DATA_O(41),
562 PORT_DATA_IO_PD(42),
563 PORT_DATA_IO_PU_PD(43),
564 PORT_DATA_IO_PU_PD(44),
565 PORT_DATA_IO_PD(45),
566 PORT_DATA_IO_PD(46),
567 PORT_DATA_IO_PD(47),
568 PORT_DATA_I_PD(48),
569 PORT_DATA_IO_PU_PD(49),
570 PORT_DATA_IO_PD(50),
571
572 PORT_DATA_IO_PD(51),
573 PORT_DATA_O(52),
574 PORT_DATA_IO_PU_PD(53),
575 PORT_DATA_IO_PU_PD(54),
576 PORT_DATA_IO_PD(55),
577 PORT_DATA_I_PU_PD(56),
578 PORT_DATA_IO(57),
579 PORT_DATA_IO(58),
580 PORT_DATA_IO(59),
581 PORT_DATA_IO(60),
582 PORT_DATA_IO(61),
583 PORT_DATA_IO_PD(62),
584 PORT_DATA_IO_PD(63),
585 PORT_DATA_IO_PU_PD(64),
586 PORT_DATA_IO_PD(65),
587 PORT_DATA_IO_PU_PD(66),
588 PORT_DATA_IO_PU_PD(67),
589 PORT_DATA_IO_PU_PD(68),
590 PORT_DATA_IO_PU_PD(69),
591 PORT_DATA_IO_PU_PD(70),
592 PORT_DATA_IO_PU_PD(71),
593 PORT_DATA_IO_PU_PD(72),
594 PORT_DATA_I_PU_PD(73),
595 PORT_DATA_IO_PU(74),
596 PORT_DATA_IO_PU(75),
597 PORT_DATA_IO_PU(76),
598 PORT_DATA_IO_PU(77),
599 PORT_DATA_IO_PU(78),
600 PORT_DATA_IO_PU(79),
601 PORT_DATA_IO_PU(80),
602 PORT_DATA_IO_PU(81),
603 PORT_DATA_IO_PU(82),
604 PORT_DATA_IO_PU(83),
605 PORT_DATA_IO_PU(84),
606 PORT_DATA_IO_PU(85),
607 PORT_DATA_IO_PU(86),
608 PORT_DATA_IO_PU(87),
609 PORT_DATA_IO_PU(88),
610 PORT_DATA_IO_PU(89),
611 PORT_DATA_O(90),
612 PORT_DATA_IO_PU(91),
613 PORT_DATA_O(92),
614 PORT_DATA_IO_PU(93),
615 PORT_DATA_O(94),
616 PORT_DATA_I_PU_PD(95),
617 PORT_DATA_IO(96),
618 PORT_DATA_IO(97),
619 PORT_DATA_IO(98),
620 PORT_DATA_I_PU(99),
621 PORT_DATA_O(100),
622 PORT_DATA_O(101),
623 PORT_DATA_I_PU(102),
624 PORT_DATA_IO_PD(103),
625 PORT_DATA_I_PU_PD(104),
626 PORT_DATA_I_PD(105),
627 PORT_DATA_I_PD(106),
628 PORT_DATA_I_PU_PD(107),
629 PORT_DATA_I_PU_PD(108),
630 PORT_DATA_IO_PD(109),
631 PORT_DATA_IO_PD(110),
632 PORT_DATA_IO_PU_PD(111),
633 PORT_DATA_IO_PU_PD(112),
634 PORT_DATA_IO_PU_PD(113),
635 PORT_DATA_IO_PD(114),
636 PORT_DATA_IO_PU(115),
637 PORT_DATA_IO_PU(116),
638 PORT_DATA_IO_PU_PD(117),
639 PORT_DATA_IO_PU_PD(118),
640 PORT_DATA_IO_PD(128),
641
642 PORT_DATA_IO_PD(129),
643 PORT_DATA_IO_PU_PD(130),
644 PORT_DATA_IO_PD(131),
645 PORT_DATA_IO_PD(132),
646 PORT_DATA_IO_PD(133),
647 PORT_DATA_IO_PU_PD(134),
648 PORT_DATA_IO_PU_PD(135),
649 PORT_DATA_IO_PU_PD(136),
650 PORT_DATA_IO_PU_PD(137),
651 PORT_DATA_IO_PD(138),
652 PORT_DATA_IO_PD(139),
653 PORT_DATA_IO_PD(140),
654 PORT_DATA_IO_PD(141),
655 PORT_DATA_IO_PD(142),
656 PORT_DATA_IO_PD(143),
657 PORT_DATA_IO_PU_PD(144),
658 PORT_DATA_IO_PD(145),
659 PORT_DATA_IO_PU_PD(146),
660 PORT_DATA_IO_PU_PD(147),
661 PORT_DATA_IO_PU_PD(148),
662 PORT_DATA_IO_PU_PD(149),
663 PORT_DATA_I_PU_PD(150),
664 PORT_DATA_IO_PU_PD(151),
665 PORT_DATA_IO_PU_PD(152),
666 PORT_DATA_IO_PD(153),
667 PORT_DATA_IO_PD(154),
668 PORT_DATA_I_PU_PD(155),
669 PORT_DATA_IO_PU_PD(156),
670 PORT_DATA_I_PD(157),
671 PORT_DATA_IO_PD(158),
672 PORT_DATA_IO_PU_PD(159),
673 PORT_DATA_IO_PU_PD(160),
674 PORT_DATA_I_PU_PD(161),
675 PORT_DATA_I_PU_PD(162),
676 PORT_DATA_IO_PU_PD(163),
677 PORT_DATA_I_PU_PD(164),
678 PORT_DATA_IO_PD(192),
679 PORT_DATA_IO_PU_PD(193),
680 PORT_DATA_IO_PD(194),
681 PORT_DATA_IO_PU_PD(195),
682 PORT_DATA_IO_PD(196),
683 PORT_DATA_IO_PD(197),
684 PORT_DATA_IO_PD(198),
685 PORT_DATA_IO_PD(199),
686 PORT_DATA_IO_PU_PD(200),
687 PORT_DATA_IO_PU_PD(201),
688 PORT_DATA_IO_PU_PD(202),
689 PORT_DATA_IO_PU_PD(203),
690 PORT_DATA_IO_PU_PD(204),
691 PORT_DATA_IO_PU_PD(205),
692 PORT_DATA_IO_PU_PD(206),
693 PORT_DATA_IO_PD(207),
694 PORT_DATA_IO_PD(208),
695 PORT_DATA_IO_PD(209),
696 PORT_DATA_IO_PD(210),
697 PORT_DATA_IO_PD(211),
698 PORT_DATA_IO_PD(212),
699 PORT_DATA_IO_PD(213),
700 PORT_DATA_IO_PU_PD(214),
701 PORT_DATA_IO_PU_PD(215),
702 PORT_DATA_IO_PD(216),
703 PORT_DATA_IO_PD(217),
704 PORT_DATA_O(218),
705 PORT_DATA_IO_PD(219),
706 PORT_DATA_IO_PD(220),
707 PORT_DATA_IO_PU_PD(221),
708 PORT_DATA_IO_PU_PD(222),
709 PORT_DATA_I_PU_PD(223),
710 PORT_DATA_I_PU_PD(224),
711
712 PORT_DATA_IO_PU_PD(225),
713 PORT_DATA_O(226),
714 PORT_DATA_IO_PU_PD(227),
715 PORT_DATA_I_PU_PD(228),
716 PORT_DATA_I_PD(229),
717 PORT_DATA_IO(230),
718 PORT_DATA_IO_PU_PD(231),
719 PORT_DATA_IO_PU_PD(232),
720 PORT_DATA_I_PU_PD(233),
721 PORT_DATA_IO_PU_PD(234),
722 PORT_DATA_IO_PU_PD(235),
723 PORT_DATA_IO_PU_PD(236),
724 PORT_DATA_IO_PD(237),
725 PORT_DATA_IO_PU_PD(238),
726 PORT_DATA_IO_PU_PD(239),
727 PORT_DATA_IO_PU_PD(240),
728 PORT_DATA_O(241),
729 PORT_DATA_I_PD(242),
730 PORT_DATA_IO_PU_PD(243),
731 PORT_DATA_IO_PU_PD(244),
732 PORT_DATA_IO_PU_PD(245),
733 PORT_DATA_IO_PU_PD(246),
734 PORT_DATA_IO_PU_PD(247),
735 PORT_DATA_IO_PU_PD(248),
736 PORT_DATA_IO_PU_PD(249),
737 PORT_DATA_IO_PU_PD(250),
738 PORT_DATA_IO_PU_PD(251),
739 PORT_DATA_IO_PU_PD(252),
740 PORT_DATA_IO_PU_PD(253),
741 PORT_DATA_IO_PU_PD(254),
742 PORT_DATA_IO_PU_PD(255),
743 PORT_DATA_IO_PU_PD(256),
744 PORT_DATA_IO_PU_PD(257),
745 PORT_DATA_IO_PU_PD(258),
746 PORT_DATA_IO_PU_PD(259),
747 PORT_DATA_IO_PU_PD(260),
748 PORT_DATA_IO_PU_PD(261),
749 PORT_DATA_IO_PU_PD(262),
750 PORT_DATA_IO_PU_PD(263),
751 PORT_DATA_IO_PU_PD(264),
752 PORT_DATA_IO_PU_PD(265),
753 PORT_DATA_IO_PU_PD(266),
754 PORT_DATA_IO_PU_PD(267),
755 PORT_DATA_IO_PU_PD(268),
756 PORT_DATA_IO_PU_PD(269),
757 PORT_DATA_IO_PU_PD(270),
758 PORT_DATA_IO_PU_PD(271),
759 PORT_DATA_IO_PU_PD(272),
760 PORT_DATA_IO_PU_PD(273),
761 PORT_DATA_IO_PU_PD(274),
762 PORT_DATA_IO_PU_PD(275),
763 PORT_DATA_IO_PU_PD(276),
764 PORT_DATA_IO_PU_PD(277),
765 PORT_DATA_IO_PU_PD(278),
766 PORT_DATA_IO_PU_PD(279),
767 PORT_DATA_IO_PU_PD(280),
768 PORT_DATA_O(281),
769 PORT_DATA_O(282),
770 PORT_DATA_I_PU(288),
771 PORT_DATA_IO_PU_PD(289),
772 PORT_DATA_IO_PU_PD(290),
773 PORT_DATA_IO_PU_PD(291),
774 PORT_DATA_IO_PU_PD(292),
775 PORT_DATA_IO_PU_PD(293),
776 PORT_DATA_IO_PU_PD(294),
777 PORT_DATA_IO_PU_PD(295),
778 PORT_DATA_IO_PU_PD(296),
779 PORT_DATA_IO_PU_PD(297),
780 PORT_DATA_IO_PU_PD(298),
781
782 PORT_DATA_IO_PU_PD(299),
783 PORT_DATA_IO_PU_PD(300),
784 PORT_DATA_IO_PU_PD(301),
785 PORT_DATA_IO_PU_PD(302),
786 PORT_DATA_IO_PU_PD(303),
787 PORT_DATA_IO_PU_PD(304),
788 PORT_DATA_IO_PU_PD(305),
789 PORT_DATA_O(306),
790 PORT_DATA_O(307),
791 PORT_DATA_I_PU(308),
792 PORT_DATA_O(309),
793
794 /* Table 25-1 (Function 0-7) */
795 PINMUX_DATA(VBUS_0_MARK, PORT0_FN1),
796 PINMUX_DATA(GPI0_MARK, PORT1_FN1),
797 PINMUX_DATA(GPI1_MARK, PORT2_FN1),
798 PINMUX_DATA(GPI2_MARK, PORT3_FN1),
799 PINMUX_DATA(GPI3_MARK, PORT4_FN1),
800 PINMUX_DATA(GPI4_MARK, PORT5_FN1),
801 PINMUX_DATA(GPI5_MARK, PORT6_FN1),
802 PINMUX_DATA(GPI6_MARK, PORT7_FN1),
803 PINMUX_DATA(GPI7_MARK, PORT8_FN1),
804 PINMUX_DATA(SCIFA7_RXD_MARK, PORT12_FN2),
805 PINMUX_DATA(SCIFA7_CTS__MARK, PORT13_FN2),
806 PINMUX_DATA(GPO7_MARK, PORT14_FN1), \
807 PINMUX_DATA(MFG0_OUT2_MARK, PORT14_FN4),
808 PINMUX_DATA(GPO6_MARK, PORT15_FN1), \
809 PINMUX_DATA(MFG1_OUT2_MARK, PORT15_FN4),
810 PINMUX_DATA(GPO5_MARK, PORT16_FN1), \
811 PINMUX_DATA(SCIFA0_SCK_MARK, PORT16_FN2), \
812 PINMUX_DATA(FSICOSLDT3_MARK, PORT16_FN3), \
813 PINMUX_DATA(PORT16_VIO_CKOR_MARK, PORT16_FN4),
814 PINMUX_DATA(SCIFA0_TXD_MARK, PORT17_FN2),
815 PINMUX_DATA(SCIFA7_TXD_MARK, PORT18_FN2),
816 PINMUX_DATA(SCIFA7_RTS__MARK, PORT19_FN2), \
817 PINMUX_DATA(PORT19_VIO_CKO2_MARK, PORT19_FN3),
818 PINMUX_DATA(GPO0_MARK, PORT20_FN1),
819 PINMUX_DATA(GPO1_MARK, PORT21_FN1),
820 PINMUX_DATA(GPO2_MARK, PORT22_FN1), \
821 PINMUX_DATA(STATUS0_MARK, PORT22_FN2),
822 PINMUX_DATA(GPO3_MARK, PORT23_FN1), \
823 PINMUX_DATA(STATUS1_MARK, PORT23_FN2),
824 PINMUX_DATA(GPO4_MARK, PORT24_FN1), \
825 PINMUX_DATA(STATUS2_MARK, PORT24_FN2),
826 PINMUX_DATA(VINT_MARK, PORT25_FN1),
827 PINMUX_DATA(TCKON_MARK, PORT26_FN1),
828 PINMUX_DATA(XDVFS1_MARK, PORT27_FN1), \
829 PINMUX_DATA(PORT27_I2C_SCL2_MARK, PORT27_FN2, MSEL2CR_MSEL17_0,
830 MSEL2CR_MSEL16_1), \
831 PINMUX_DATA(PORT27_I2C_SCL3_MARK, PORT27_FN3, MSEL2CR_MSEL19_0,
832 MSEL2CR_MSEL18_1), \
833 PINMUX_DATA(MFG0_OUT1_MARK, PORT27_FN4), \
834 PINMUX_DATA(PORT27_IROUT_MARK, PORT27_FN7),
835 PINMUX_DATA(XDVFS2_MARK, PORT28_FN1), \
836 PINMUX_DATA(PORT28_I2C_SDA2_MARK, PORT28_FN2, MSEL2CR_MSEL17_0,
837 MSEL2CR_MSEL16_1), \
838 PINMUX_DATA(PORT28_I2C_SDA3_MARK, PORT28_FN3, MSEL2CR_MSEL19_0,
839 MSEL2CR_MSEL18_1), \
840 PINMUX_DATA(PORT28_TPU1TO1_MARK, PORT28_FN7),
841 PINMUX_DATA(SIM_RST_MARK, PORT29_FN1), \
842 PINMUX_DATA(PORT29_TPU1TO1_MARK, PORT29_FN4),
843 PINMUX_DATA(SIM_CLK_MARK, PORT30_FN1), \
844 PINMUX_DATA(PORT30_VIO_CKOR_MARK, PORT30_FN4),
845 PINMUX_DATA(SIM_D_MARK, PORT31_FN1), \
846 PINMUX_DATA(PORT31_IROUT_MARK, PORT31_FN4),
847 PINMUX_DATA(SCIFA4_TXD_MARK, PORT32_FN2),
848 PINMUX_DATA(SCIFA4_RXD_MARK, PORT33_FN2), \
849 PINMUX_DATA(XWUP_MARK, PORT33_FN3),
850 PINMUX_DATA(SCIFA4_RTS__MARK, PORT34_FN2),
851 PINMUX_DATA(SCIFA4_CTS__MARK, PORT35_FN2),
852 PINMUX_DATA(FSIBOBT_MARK, PORT36_FN1), \
853 PINMUX_DATA(FSIBIBT_MARK, PORT36_FN2),
854 PINMUX_DATA(FSIBOLR_MARK, PORT37_FN1), \
855 PINMUX_DATA(FSIBILR_MARK, PORT37_FN2),
856 PINMUX_DATA(FSIBOSLD_MARK, PORT38_FN1),
857 PINMUX_DATA(FSIBISLD_MARK, PORT39_FN1),
858 PINMUX_DATA(VACK_MARK, PORT40_FN1),
859 PINMUX_DATA(XTAL1L_MARK, PORT41_FN1),
860 PINMUX_DATA(SCIFA0_RTS__MARK, PORT42_FN2), \
861 PINMUX_DATA(FSICOSLDT2_MARK, PORT42_FN3),
862 PINMUX_DATA(SCIFA0_RXD_MARK, PORT43_FN2),
863 PINMUX_DATA(SCIFA0_CTS__MARK, PORT44_FN2), \
864 PINMUX_DATA(FSICOSLDT1_MARK, PORT44_FN3),
865 PINMUX_DATA(FSICOBT_MARK, PORT45_FN1), \
866 PINMUX_DATA(FSICIBT_MARK, PORT45_FN2), \
867 PINMUX_DATA(FSIDOBT_MARK, PORT45_FN3), \
868 PINMUX_DATA(FSIDIBT_MARK, PORT45_FN4),
869 PINMUX_DATA(FSICOLR_MARK, PORT46_FN1), \
870 PINMUX_DATA(FSICILR_MARK, PORT46_FN2), \
871 PINMUX_DATA(FSIDOLR_MARK, PORT46_FN3), \
872 PINMUX_DATA(FSIDILR_MARK, PORT46_FN4),
873 PINMUX_DATA(FSICOSLD_MARK, PORT47_FN1), \
874 PINMUX_DATA(PORT47_FSICSPDIF_MARK, PORT47_FN2),
875 PINMUX_DATA(FSICISLD_MARK, PORT48_FN1), \
876 PINMUX_DATA(FSIDISLD_MARK, PORT48_FN3),
877 PINMUX_DATA(FSIACK_MARK, PORT49_FN1), \
878 PINMUX_DATA(PORT49_IRDA_OUT_MARK, PORT49_FN2, MSEL4CR_MSEL19_1), \
879 PINMUX_DATA(PORT49_IROUT_MARK, PORT49_FN4), \
880 PINMUX_DATA(FSIAOMC_MARK, PORT49_FN5),
881 PINMUX_DATA(FSIAOLR_MARK, PORT50_FN1), \
882 PINMUX_DATA(BBIF2_TSYNC2_MARK, PORT50_FN2), \
883 PINMUX_DATA(TPU2TO2_MARK, PORT50_FN3), \
884 PINMUX_DATA(FSIAILR_MARK, PORT50_FN5),
885
886 PINMUX_DATA(FSIAOBT_MARK, PORT51_FN1), \
887 PINMUX_DATA(BBIF2_TSCK2_MARK, PORT51_FN2), \
888 PINMUX_DATA(TPU2TO3_MARK, PORT51_FN3), \
889 PINMUX_DATA(FSIAIBT_MARK, PORT51_FN5),
890 PINMUX_DATA(FSIAOSLD_MARK, PORT52_FN1), \
891 PINMUX_DATA(BBIF2_TXD2_MARK, PORT52_FN2),
892 PINMUX_DATA(FSIASPDIF_MARK, PORT53_FN1), \
893 PINMUX_DATA(PORT53_IRDA_IN_MARK, PORT53_FN2, MSEL4CR_MSEL19_1), \
894 PINMUX_DATA(TPU3TO3_MARK, PORT53_FN3), \
895 PINMUX_DATA(FSIBSPDIF_MARK, PORT53_FN5), \
896 PINMUX_DATA(PORT53_FSICSPDIF_MARK, PORT53_FN6),
897 PINMUX_DATA(FSIBCK_MARK, PORT54_FN1), \
898 PINMUX_DATA(PORT54_IRDA_FIRSEL_MARK, PORT54_FN2, MSEL4CR_MSEL19_1), \
899 PINMUX_DATA(TPU3TO2_MARK, PORT54_FN3), \
900 PINMUX_DATA(FSIBOMC_MARK, PORT54_FN5), \
901 PINMUX_DATA(FSICCK_MARK, PORT54_FN6), \
902 PINMUX_DATA(FSICOMC_MARK, PORT54_FN7),
903 PINMUX_DATA(FSIAISLD_MARK, PORT55_FN1), \
904 PINMUX_DATA(TPU0TO0_MARK, PORT55_FN3),
905 PINMUX_DATA(A0_MARK, PORT57_FN1), \
906 PINMUX_DATA(BS__MARK, PORT57_FN2),
907 PINMUX_DATA(A12_MARK, PORT58_FN1), \
908 PINMUX_DATA(PORT58_KEYOUT7_MARK, PORT58_FN2), \
909 PINMUX_DATA(TPU4TO2_MARK, PORT58_FN4),
910 PINMUX_DATA(A13_MARK, PORT59_FN1), \
911 PINMUX_DATA(PORT59_KEYOUT6_MARK, PORT59_FN2), \
912 PINMUX_DATA(TPU0TO1_MARK, PORT59_FN4),
913 PINMUX_DATA(A14_MARK, PORT60_FN1), \
914 PINMUX_DATA(KEYOUT5_MARK, PORT60_FN2),
915 PINMUX_DATA(A15_MARK, PORT61_FN1), \
916 PINMUX_DATA(KEYOUT4_MARK, PORT61_FN2),
917 PINMUX_DATA(A16_MARK, PORT62_FN1), \
918 PINMUX_DATA(KEYOUT3_MARK, PORT62_FN2), \
919 PINMUX_DATA(MSIOF0_SS1_MARK, PORT62_FN4, MSEL3CR_MSEL11_0),
920 PINMUX_DATA(A17_MARK, PORT63_FN1), \
921 PINMUX_DATA(KEYOUT2_MARK, PORT63_FN2), \
922 PINMUX_DATA(MSIOF0_TSYNC_MARK, PORT63_FN4, MSEL3CR_MSEL11_0),
923 PINMUX_DATA(A18_MARK, PORT64_FN1), \
924 PINMUX_DATA(KEYOUT1_MARK, PORT64_FN2), \
925 PINMUX_DATA(MSIOF0_TSCK_MARK, PORT64_FN4, MSEL3CR_MSEL11_0),
926 PINMUX_DATA(A19_MARK, PORT65_FN1), \
927 PINMUX_DATA(KEYOUT0_MARK, PORT65_FN2), \
928 PINMUX_DATA(MSIOF0_TXD_MARK, PORT65_FN4, MSEL3CR_MSEL11_0),
929 PINMUX_DATA(A20_MARK, PORT66_FN1), \
930 PINMUX_DATA(KEYIN0_MARK, PORT66_FN2), \
931 PINMUX_DATA(MSIOF0_RSCK_MARK, PORT66_FN4, MSEL3CR_MSEL11_0),
932 PINMUX_DATA(A21_MARK, PORT67_FN1), \
933 PINMUX_DATA(KEYIN1_MARK, PORT67_FN2), \
934 PINMUX_DATA(MSIOF0_RSYNC_MARK, PORT67_FN4, MSEL3CR_MSEL11_0),
935 PINMUX_DATA(A22_MARK, PORT68_FN1), \
936 PINMUX_DATA(KEYIN2_MARK, PORT68_FN2), \
937 PINMUX_DATA(MSIOF0_MCK0_MARK, PORT68_FN4, MSEL3CR_MSEL11_0),
938 PINMUX_DATA(A23_MARK, PORT69_FN1), \
939 PINMUX_DATA(KEYIN3_MARK, PORT69_FN2), \
940 PINMUX_DATA(MSIOF0_MCK1_MARK, PORT69_FN4, MSEL3CR_MSEL11_0),
941 PINMUX_DATA(A24_MARK, PORT70_FN1), \
942 PINMUX_DATA(KEYIN4_MARK, PORT70_FN2), \
943 PINMUX_DATA(MSIOF0_RXD_MARK, PORT70_FN4, MSEL3CR_MSEL11_0),
944 PINMUX_DATA(A25_MARK, PORT71_FN1), \
945 PINMUX_DATA(KEYIN5_MARK, PORT71_FN2), \
946 PINMUX_DATA(MSIOF0_SS2_MARK, PORT71_FN4, MSEL3CR_MSEL11_0),
947 PINMUX_DATA(A26_MARK, PORT72_FN1), \
948 PINMUX_DATA(KEYIN6_MARK, PORT72_FN2),
949 PINMUX_DATA(KEYIN7_MARK, PORT73_FN2),
950 PINMUX_DATA(D0_NAF0_MARK, PORT74_FN1),
951 PINMUX_DATA(D1_NAF1_MARK, PORT75_FN1),
952 PINMUX_DATA(D2_NAF2_MARK, PORT76_FN1),
953 PINMUX_DATA(D3_NAF3_MARK, PORT77_FN1),
954 PINMUX_DATA(D4_NAF4_MARK, PORT78_FN1),
955 PINMUX_DATA(D5_NAF5_MARK, PORT79_FN1),
956 PINMUX_DATA(D6_NAF6_MARK, PORT80_FN1),
957 PINMUX_DATA(D7_NAF7_MARK, PORT81_FN1),
958 PINMUX_DATA(D8_NAF8_MARK, PORT82_FN1),
959 PINMUX_DATA(D9_NAF9_MARK, PORT83_FN1),
960 PINMUX_DATA(D10_NAF10_MARK, PORT84_FN1),
961 PINMUX_DATA(D11_NAF11_MARK, PORT85_FN1),
962 PINMUX_DATA(D12_NAF12_MARK, PORT86_FN1),
963 PINMUX_DATA(D13_NAF13_MARK, PORT87_FN1),
964 PINMUX_DATA(D14_NAF14_MARK, PORT88_FN1),
965 PINMUX_DATA(D15_NAF15_MARK, PORT89_FN1),
966 PINMUX_DATA(CS4__MARK, PORT90_FN1),
967 PINMUX_DATA(CS5A__MARK, PORT91_FN1), \
968 PINMUX_DATA(PORT91_RDWR_MARK, PORT91_FN2),
969 PINMUX_DATA(CS5B__MARK, PORT92_FN1), \
970 PINMUX_DATA(FCE1__MARK, PORT92_FN2),
971 PINMUX_DATA(CS6B__MARK, PORT93_FN1), \
972 PINMUX_DATA(DACK0_MARK, PORT93_FN4),
973 PINMUX_DATA(FCE0__MARK, PORT94_FN1), \
974 PINMUX_DATA(CS6A__MARK, PORT94_FN2),
975 PINMUX_DATA(WAIT__MARK, PORT95_FN1), \
976 PINMUX_DATA(DREQ0_MARK, PORT95_FN2),
977 PINMUX_DATA(RD__FSC_MARK, PORT96_FN1),
978 PINMUX_DATA(WE0__FWE_MARK, PORT97_FN1), \
979 PINMUX_DATA(RDWR_FWE_MARK, PORT97_FN2),
980 PINMUX_DATA(WE1__MARK, PORT98_FN1),
981 PINMUX_DATA(FRB_MARK, PORT99_FN1),
982 PINMUX_DATA(CKO_MARK, PORT100_FN1),
983 PINMUX_DATA(NBRSTOUT__MARK, PORT101_FN1),
984 PINMUX_DATA(NBRST__MARK, PORT102_FN1),
985 PINMUX_DATA(BBIF2_TXD_MARK, PORT103_FN3),
986 PINMUX_DATA(BBIF2_RXD_MARK, PORT104_FN3),
987 PINMUX_DATA(BBIF2_SYNC_MARK, PORT105_FN3),
988 PINMUX_DATA(BBIF2_SCK_MARK, PORT106_FN3),
989 PINMUX_DATA(SCIFA3_CTS__MARK, PORT107_FN3), \
990 PINMUX_DATA(MFG3_IN2_MARK, PORT107_FN4),
991 PINMUX_DATA(SCIFA3_RXD_MARK, PORT108_FN3), \
992 PINMUX_DATA(MFG3_IN1_MARK, PORT108_FN4),
993 PINMUX_DATA(BBIF1_SS2_MARK, PORT109_FN2), \
994 PINMUX_DATA(SCIFA3_RTS__MARK, PORT109_FN3), \
995 PINMUX_DATA(MFG3_OUT1_MARK, PORT109_FN4),
996 PINMUX_DATA(SCIFA3_TXD_MARK, PORT110_FN3),
997 PINMUX_DATA(HSI_RX_DATA_MARK, PORT111_FN1), \
998 PINMUX_DATA(BBIF1_RXD_MARK, PORT111_FN3),
999 PINMUX_DATA(HSI_TX_WAKE_MARK, PORT112_FN1), \
1000 PINMUX_DATA(BBIF1_TSCK_MARK, PORT112_FN3),
1001 PINMUX_DATA(HSI_TX_DATA_MARK, PORT113_FN1), \
1002 PINMUX_DATA(BBIF1_TSYNC_MARK, PORT113_FN3),
1003 PINMUX_DATA(HSI_TX_READY_MARK, PORT114_FN1), \
1004 PINMUX_DATA(BBIF1_TXD_MARK, PORT114_FN3),
1005 PINMUX_DATA(HSI_RX_READY_MARK, PORT115_FN1), \
1006 PINMUX_DATA(BBIF1_RSCK_MARK, PORT115_FN3), \
1007 PINMUX_DATA(PORT115_I2C_SCL2_MARK, PORT115_FN5, MSEL2CR_MSEL17_1), \
1008 PINMUX_DATA(PORT115_I2C_SCL3_MARK, PORT115_FN6, MSEL2CR_MSEL19_1),
1009 PINMUX_DATA(HSI_RX_WAKE_MARK, PORT116_FN1), \
1010 PINMUX_DATA(BBIF1_RSYNC_MARK, PORT116_FN3), \
1011 PINMUX_DATA(PORT116_I2C_SDA2_MARK, PORT116_FN5, MSEL2CR_MSEL17_1), \
1012 PINMUX_DATA(PORT116_I2C_SDA3_MARK, PORT116_FN6, MSEL2CR_MSEL19_1),
1013 PINMUX_DATA(HSI_RX_FLAG_MARK, PORT117_FN1), \
1014 PINMUX_DATA(BBIF1_SS1_MARK, PORT117_FN2), \
1015 PINMUX_DATA(BBIF1_FLOW_MARK, PORT117_FN3),
1016 PINMUX_DATA(HSI_TX_FLAG_MARK, PORT118_FN1),
1017 PINMUX_DATA(VIO_VD_MARK, PORT128_FN1), \
1018 PINMUX_DATA(PORT128_LCD2VSYN_MARK, PORT128_FN4, MSEL3CR_MSEL2_0), \
1019 PINMUX_DATA(VIO2_VD_MARK, PORT128_FN6, MSEL4CR_MSEL27_0), \
1020 PINMUX_DATA(LCD2D0_MARK, PORT128_FN7),
1021
1022 PINMUX_DATA(VIO_HD_MARK, PORT129_FN1), \
1023 PINMUX_DATA(PORT129_LCD2HSYN_MARK, PORT129_FN4), \
1024 PINMUX_DATA(PORT129_LCD2CS__MARK, PORT129_FN5), \
1025 PINMUX_DATA(VIO2_HD_MARK, PORT129_FN6, MSEL4CR_MSEL27_0), \
1026 PINMUX_DATA(LCD2D1_MARK, PORT129_FN7),
1027 PINMUX_DATA(VIO_D0_MARK, PORT130_FN1), \
1028 PINMUX_DATA(PORT130_MSIOF2_RXD_MARK, PORT130_FN3, MSEL4CR_MSEL11_0,
1029 MSEL4CR_MSEL10_1), \
1030 PINMUX_DATA(LCD2D10_MARK, PORT130_FN7),
1031 PINMUX_DATA(VIO_D1_MARK, PORT131_FN1), \
1032 PINMUX_DATA(PORT131_KEYOUT6_MARK, PORT131_FN2), \
1033 PINMUX_DATA(PORT131_MSIOF2_SS1_MARK, PORT131_FN3), \
1034 PINMUX_DATA(PORT131_KEYOUT11_MARK, PORT131_FN4), \
1035 PINMUX_DATA(LCD2D11_MARK, PORT131_FN7),
1036 PINMUX_DATA(VIO_D2_MARK, PORT132_FN1), \
1037 PINMUX_DATA(PORT132_KEYOUT7_MARK, PORT132_FN2), \
1038 PINMUX_DATA(PORT132_MSIOF2_SS2_MARK, PORT132_FN3), \
1039 PINMUX_DATA(PORT132_KEYOUT10_MARK, PORT132_FN4), \
1040 PINMUX_DATA(LCD2D12_MARK, PORT132_FN7),
1041 PINMUX_DATA(VIO_D3_MARK, PORT133_FN1), \
1042 PINMUX_DATA(MSIOF2_TSYNC_MARK, PORT133_FN3, MSEL4CR_MSEL11_0), \
1043 PINMUX_DATA(LCD2D13_MARK, PORT133_FN7),
1044 PINMUX_DATA(VIO_D4_MARK, PORT134_FN1), \
1045 PINMUX_DATA(MSIOF2_TXD_MARK, PORT134_FN3, MSEL4CR_MSEL11_0), \
1046 PINMUX_DATA(LCD2D14_MARK, PORT134_FN7),
1047 PINMUX_DATA(VIO_D5_MARK, PORT135_FN1), \
1048 PINMUX_DATA(MSIOF2_TSCK_MARK, PORT135_FN3, MSEL4CR_MSEL11_0), \
1049 PINMUX_DATA(LCD2D15_MARK, PORT135_FN7),
1050 PINMUX_DATA(VIO_D6_MARK, PORT136_FN1), \
1051 PINMUX_DATA(PORT136_KEYOUT8_MARK, PORT136_FN2), \
1052 PINMUX_DATA(LCD2D16_MARK, PORT136_FN7),
1053 PINMUX_DATA(VIO_D7_MARK, PORT137_FN1), \
1054 PINMUX_DATA(PORT137_KEYOUT9_MARK, PORT137_FN2), \
1055 PINMUX_DATA(LCD2D17_MARK, PORT137_FN7),
1056 PINMUX_DATA(VIO_D8_MARK, PORT138_FN1), \
1057 PINMUX_DATA(PORT138_KEYOUT8_MARK, PORT138_FN2), \
1058 PINMUX_DATA(VIO2_D0_MARK, PORT138_FN6), \
1059 PINMUX_DATA(LCD2D6_MARK, PORT138_FN7),
1060 PINMUX_DATA(VIO_D9_MARK, PORT139_FN1), \
1061 PINMUX_DATA(PORT139_KEYOUT9_MARK, PORT139_FN2), \
1062 PINMUX_DATA(VIO2_D1_MARK, PORT139_FN6), \
1063 PINMUX_DATA(LCD2D7_MARK, PORT139_FN7),
1064 PINMUX_DATA(VIO_D10_MARK, PORT140_FN1), \
1065 PINMUX_DATA(TPU0TO2_MARK, PORT140_FN4), \
1066 PINMUX_DATA(VIO2_D2_MARK, PORT140_FN6), \
1067 PINMUX_DATA(LCD2D8_MARK, PORT140_FN7),
1068 PINMUX_DATA(VIO_D11_MARK, PORT141_FN1), \
1069 PINMUX_DATA(TPU0TO3_MARK, PORT141_FN4), \
1070 PINMUX_DATA(VIO2_D3_MARK, PORT141_FN6), \
1071 PINMUX_DATA(LCD2D9_MARK, PORT141_FN7),
1072 PINMUX_DATA(VIO_D12_MARK, PORT142_FN1), \
1073 PINMUX_DATA(PORT142_KEYOUT10_MARK, PORT142_FN2), \
1074 PINMUX_DATA(VIO2_D4_MARK, PORT142_FN6), \
1075 PINMUX_DATA(LCD2D2_MARK, PORT142_FN7),
1076 PINMUX_DATA(VIO_D13_MARK, PORT143_FN1), \
1077 PINMUX_DATA(PORT143_KEYOUT11_MARK, PORT143_FN2), \
1078 PINMUX_DATA(PORT143_KEYOUT6_MARK, PORT143_FN3), \
1079 PINMUX_DATA(VIO2_D5_MARK, PORT143_FN6), \
1080 PINMUX_DATA(LCD2D3_MARK, PORT143_FN7),
1081 PINMUX_DATA(VIO_D14_MARK, PORT144_FN1), \
1082 PINMUX_DATA(PORT144_KEYOUT7_MARK, PORT144_FN2), \
1083 PINMUX_DATA(VIO2_D6_MARK, PORT144_FN6), \
1084 PINMUX_DATA(LCD2D4_MARK, PORT144_FN7),
1085 PINMUX_DATA(VIO_D15_MARK, PORT145_FN1), \
1086 PINMUX_DATA(TPU1TO3_MARK, PORT145_FN3), \
1087 PINMUX_DATA(PORT145_LCD2DISP_MARK, PORT145_FN4), \
1088 PINMUX_DATA(PORT145_LCD2RS_MARK, PORT145_FN5), \
1089 PINMUX_DATA(VIO2_D7_MARK, PORT145_FN6), \
1090 PINMUX_DATA(LCD2D5_MARK, PORT145_FN7),
1091 PINMUX_DATA(VIO_CLK_MARK, PORT146_FN1), \
1092 PINMUX_DATA(LCD2DCK_MARK, PORT146_FN4), \
1093 PINMUX_DATA(PORT146_LCD2WR__MARK, PORT146_FN5), \
1094 PINMUX_DATA(VIO2_CLK_MARK, PORT146_FN6, MSEL4CR_MSEL27_0), \
1095 PINMUX_DATA(LCD2D18_MARK, PORT146_FN7),
1096 PINMUX_DATA(VIO_FIELD_MARK, PORT147_FN1), \
1097 PINMUX_DATA(LCD2RD__MARK, PORT147_FN4), \
1098 PINMUX_DATA(VIO2_FIELD_MARK, PORT147_FN6, MSEL4CR_MSEL27_0), \
1099 PINMUX_DATA(LCD2D19_MARK, PORT147_FN7),
1100 PINMUX_DATA(VIO_CKO_MARK, PORT148_FN1),
1101 PINMUX_DATA(A27_MARK, PORT149_FN1), \
1102 PINMUX_DATA(PORT149_RDWR_MARK, PORT149_FN2), \
1103 PINMUX_DATA(MFG0_IN1_MARK, PORT149_FN3), \
1104 PINMUX_DATA(PORT149_KEYOUT9_MARK, PORT149_FN4),
1105 PINMUX_DATA(MFG0_IN2_MARK, PORT150_FN3),
1106 PINMUX_DATA(TS_SPSYNC3_MARK, PORT151_FN4), \
1107 PINMUX_DATA(MSIOF2_RSCK_MARK, PORT151_FN5),
1108 PINMUX_DATA(TS_SDAT3_MARK, PORT152_FN4), \
1109 PINMUX_DATA(MSIOF2_RSYNC_MARK, PORT152_FN5),
1110 PINMUX_DATA(TPU1TO2_MARK, PORT153_FN3), \
1111 PINMUX_DATA(TS_SDEN3_MARK, PORT153_FN4), \
1112 PINMUX_DATA(PORT153_MSIOF2_SS1_MARK, PORT153_FN5),
1113 PINMUX_DATA(SCIFA2_TXD1_MARK, PORT154_FN2, MSEL3CR_MSEL9_0), \
1114 PINMUX_DATA(MSIOF2_MCK0_MARK, PORT154_FN5),
1115 PINMUX_DATA(SCIFA2_RXD1_MARK, PORT155_FN2, MSEL3CR_MSEL9_0), \
1116 PINMUX_DATA(MSIOF2_MCK1_MARK, PORT155_FN5),
1117 PINMUX_DATA(SCIFA2_RTS1__MARK, PORT156_FN2, MSEL3CR_MSEL9_0), \
1118 PINMUX_DATA(PORT156_MSIOF2_SS2_MARK, PORT156_FN5),
1119 PINMUX_DATA(SCIFA2_CTS1__MARK, PORT157_FN2, MSEL3CR_MSEL9_0), \
1120 PINMUX_DATA(PORT157_MSIOF2_RXD_MARK, PORT157_FN5, MSEL4CR_MSEL11_0,
1121 MSEL4CR_MSEL10_0),
1122 PINMUX_DATA(DINT__MARK, PORT158_FN1), \
1123 PINMUX_DATA(SCIFA2_SCK1_MARK, PORT158_FN2, MSEL3CR_MSEL9_0), \
1124 PINMUX_DATA(TS_SCK3_MARK, PORT158_FN4),
1125 PINMUX_DATA(PORT159_SCIFB_SCK_MARK, PORT159_FN1, MSEL4CR_MSEL22_0), \
1126 PINMUX_DATA(PORT159_SCIFA5_SCK_MARK, PORT159_FN2, MSEL4CR_MSEL21_1), \
1127 PINMUX_DATA(NMI_MARK, PORT159_FN3),
1128 PINMUX_DATA(PORT160_SCIFB_TXD_MARK, PORT160_FN1, MSEL4CR_MSEL22_0), \
1129 PINMUX_DATA(PORT160_SCIFA5_TXD_MARK, PORT160_FN2, MSEL4CR_MSEL21_1),
1130 PINMUX_DATA(PORT161_SCIFB_CTS__MARK, PORT161_FN1, MSEL4CR_MSEL22_0), \
1131 PINMUX_DATA(PORT161_SCIFA5_CTS__MARK, PORT161_FN2, MSEL4CR_MSEL21_1),
1132 PINMUX_DATA(PORT162_SCIFB_RXD_MARK, PORT162_FN1, MSEL4CR_MSEL22_0), \
1133 PINMUX_DATA(PORT162_SCIFA5_RXD_MARK, PORT162_FN2, MSEL4CR_MSEL21_1),
1134 PINMUX_DATA(PORT163_SCIFB_RTS__MARK, PORT163_FN1, MSEL4CR_MSEL22_0), \
1135 PINMUX_DATA(PORT163_SCIFA5_RTS__MARK, PORT163_FN2, MSEL4CR_MSEL21_1), \
1136 PINMUX_DATA(TPU3TO0_MARK, PORT163_FN5),
1137 PINMUX_DATA(LCDD0_MARK, PORT192_FN1),
1138 PINMUX_DATA(LCDD1_MARK, PORT193_FN1), \
1139 PINMUX_DATA(PORT193_SCIFA5_CTS__MARK, PORT193_FN3, MSEL4CR_MSEL21_0,
1140 MSEL4CR_MSEL20_1), \
1141 PINMUX_DATA(BBIF2_TSYNC1_MARK, PORT193_FN5),
1142 PINMUX_DATA(LCDD2_MARK, PORT194_FN1), \
1143 PINMUX_DATA(PORT194_SCIFA5_RTS__MARK, PORT194_FN3, MSEL4CR_MSEL21_0,
1144 MSEL4CR_MSEL20_1), \
1145 PINMUX_DATA(BBIF2_TSCK1_MARK, PORT194_FN5),
1146 PINMUX_DATA(LCDD3_MARK, PORT195_FN1), \
1147 PINMUX_DATA(PORT195_SCIFA5_RXD_MARK, PORT195_FN3, MSEL4CR_MSEL21_0,
1148 MSEL4CR_MSEL20_1), \
1149 PINMUX_DATA(BBIF2_TXD1_MARK, PORT195_FN5),
1150 PINMUX_DATA(LCDD4_MARK, PORT196_FN1), \
1151 PINMUX_DATA(PORT196_SCIFA5_TXD_MARK, PORT196_FN3, MSEL4CR_MSEL21_0,
1152 MSEL4CR_MSEL20_1),
1153 PINMUX_DATA(LCDD5_MARK, PORT197_FN1), \
1154 PINMUX_DATA(PORT197_SCIFA5_SCK_MARK, PORT197_FN3, MSEL4CR_MSEL21_0,
1155 MSEL4CR_MSEL20_1), \
1156 PINMUX_DATA(MFG2_OUT2_MARK, PORT197_FN5), \
1157 PINMUX_DATA(TPU2TO1_MARK, PORT197_FN7),
1158 PINMUX_DATA(LCDD6_MARK, PORT198_FN1),
1159 PINMUX_DATA(LCDD7_MARK, PORT199_FN1), \
1160 PINMUX_DATA(TPU4TO1_MARK, PORT199_FN2), \
1161 PINMUX_DATA(MFG4_OUT2_MARK, PORT199_FN5),
1162 PINMUX_DATA(LCDD8_MARK, PORT200_FN1), \
1163 PINMUX_DATA(D16_MARK, PORT200_FN6),
1164 PINMUX_DATA(LCDD9_MARK, PORT201_FN1), \
1165 PINMUX_DATA(D17_MARK, PORT201_FN6),
1166 PINMUX_DATA(LCDD10_MARK, PORT202_FN1), \
1167 PINMUX_DATA(D18_MARK, PORT202_FN6),
1168 PINMUX_DATA(LCDD11_MARK, PORT203_FN1), \
1169 PINMUX_DATA(D19_MARK, PORT203_FN6),
1170 PINMUX_DATA(LCDD12_MARK, PORT204_FN1), \
1171 PINMUX_DATA(D20_MARK, PORT204_FN6),
1172 PINMUX_DATA(LCDD13_MARK, PORT205_FN1), \
1173 PINMUX_DATA(D21_MARK, PORT205_FN6),
1174 PINMUX_DATA(LCDD14_MARK, PORT206_FN1), \
1175 PINMUX_DATA(D22_MARK, PORT206_FN6),
1176 PINMUX_DATA(LCDD15_MARK, PORT207_FN1), \
1177 PINMUX_DATA(PORT207_MSIOF0L_SS1_MARK, PORT207_FN2, MSEL3CR_MSEL11_1), \
1178 PINMUX_DATA(D23_MARK, PORT207_FN6),
1179 PINMUX_DATA(LCDD16_MARK, PORT208_FN1), \
1180 PINMUX_DATA(PORT208_MSIOF0L_SS2_MARK, PORT208_FN2, MSEL3CR_MSEL11_1), \
1181 PINMUX_DATA(D24_MARK, PORT208_FN6),
1182 PINMUX_DATA(LCDD17_MARK, PORT209_FN1), \
1183 PINMUX_DATA(D25_MARK, PORT209_FN6),
1184 PINMUX_DATA(LCDD18_MARK, PORT210_FN1), \
1185 PINMUX_DATA(DREQ2_MARK, PORT210_FN2), \
1186 PINMUX_DATA(PORT210_MSIOF0L_SS1_MARK, PORT210_FN5, MSEL3CR_MSEL11_1), \
1187 PINMUX_DATA(D26_MARK, PORT210_FN6),
1188 PINMUX_DATA(LCDD19_MARK, PORT211_FN1), \
1189 PINMUX_DATA(PORT211_MSIOF0L_SS2_MARK, PORT211_FN5, MSEL3CR_MSEL11_1), \
1190 PINMUX_DATA(D27_MARK, PORT211_FN6),
1191 PINMUX_DATA(LCDD20_MARK, PORT212_FN1), \
1192 PINMUX_DATA(TS_SPSYNC1_MARK, PORT212_FN2), \
1193 PINMUX_DATA(MSIOF0L_MCK0_MARK, PORT212_FN5, MSEL3CR_MSEL11_1), \
1194 PINMUX_DATA(D28_MARK, PORT212_FN6),
1195 PINMUX_DATA(LCDD21_MARK, PORT213_FN1), \
1196 PINMUX_DATA(TS_SDAT1_MARK, PORT213_FN2), \
1197 PINMUX_DATA(MSIOF0L_MCK1_MARK, PORT213_FN5, MSEL3CR_MSEL11_1), \
1198 PINMUX_DATA(D29_MARK, PORT213_FN6),
1199 PINMUX_DATA(LCDD22_MARK, PORT214_FN1), \
1200 PINMUX_DATA(TS_SDEN1_MARK, PORT214_FN2), \
1201 PINMUX_DATA(MSIOF0L_RSCK_MARK, PORT214_FN5, MSEL3CR_MSEL11_1), \
1202 PINMUX_DATA(D30_MARK, PORT214_FN6),
1203 PINMUX_DATA(LCDD23_MARK, PORT215_FN1), \
1204 PINMUX_DATA(TS_SCK1_MARK, PORT215_FN2), \
1205 PINMUX_DATA(MSIOF0L_RSYNC_MARK, PORT215_FN5, MSEL3CR_MSEL11_1), \
1206 PINMUX_DATA(D31_MARK, PORT215_FN6),
1207 PINMUX_DATA(LCDDCK_MARK, PORT216_FN1), \
1208 PINMUX_DATA(LCDWR__MARK, PORT216_FN2),
1209 PINMUX_DATA(LCDRD__MARK, PORT217_FN1), \
1210 PINMUX_DATA(DACK2_MARK, PORT217_FN2), \
1211 PINMUX_DATA(PORT217_LCD2RS_MARK, PORT217_FN3), \
1212 PINMUX_DATA(MSIOF0L_TSYNC_MARK, PORT217_FN5, MSEL3CR_MSEL11_1), \
1213 PINMUX_DATA(VIO2_FIELD3_MARK, PORT217_FN6, MSEL4CR_MSEL27_1,
1214 MSEL4CR_MSEL26_1), \
1215 PINMUX_DATA(PORT217_LCD2DISP_MARK, PORT217_FN7),
1216 PINMUX_DATA(LCDHSYN_MARK, PORT218_FN1), \
1217 PINMUX_DATA(LCDCS__MARK, PORT218_FN2), \
1218 PINMUX_DATA(LCDCS2__MARK, PORT218_FN3), \
1219 PINMUX_DATA(DACK3_MARK, PORT218_FN4), \
1220 PINMUX_DATA(PORT218_VIO_CKOR_MARK, PORT218_FN5),
1221 PINMUX_DATA(LCDDISP_MARK, PORT219_FN1), \
1222 PINMUX_DATA(LCDRS_MARK, PORT219_FN2), \
1223 PINMUX_DATA(PORT219_LCD2WR__MARK, PORT219_FN3), \
1224 PINMUX_DATA(DREQ3_MARK, PORT219_FN4), \
1225 PINMUX_DATA(MSIOF0L_TSCK_MARK, PORT219_FN5, MSEL3CR_MSEL11_1), \
1226 PINMUX_DATA(VIO2_CLK3_MARK, PORT219_FN6, MSEL4CR_MSEL27_1,
1227 MSEL4CR_MSEL26_1), \
1228 PINMUX_DATA(LCD2DCK_2_MARK, PORT219_FN7),
1229 PINMUX_DATA(LCDVSYN_MARK, PORT220_FN1), \
1230 PINMUX_DATA(LCDVSYN2_MARK, PORT220_FN2),
1231 PINMUX_DATA(LCDLCLK_MARK, PORT221_FN1), \
1232 PINMUX_DATA(DREQ1_MARK, PORT221_FN2), \
1233 PINMUX_DATA(PORT221_LCD2CS__MARK, PORT221_FN3), \
1234 PINMUX_DATA(PWEN_MARK, PORT221_FN4), \
1235 PINMUX_DATA(MSIOF0L_RXD_MARK, PORT221_FN5, MSEL3CR_MSEL11_1), \
1236 PINMUX_DATA(VIO2_HD3_MARK, PORT221_FN6, MSEL4CR_MSEL27_1,
1237 MSEL4CR_MSEL26_1), \
1238 PINMUX_DATA(PORT221_LCD2HSYN_MARK, PORT221_FN7),
1239 PINMUX_DATA(LCDDON_MARK, PORT222_FN1), \
1240 PINMUX_DATA(LCDDON2_MARK, PORT222_FN2), \
1241 PINMUX_DATA(DACK1_MARK, PORT222_FN3), \
1242 PINMUX_DATA(OVCN_MARK, PORT222_FN4), \
1243 PINMUX_DATA(MSIOF0L_TXD_MARK, PORT222_FN5, MSEL3CR_MSEL11_1), \
1244 PINMUX_DATA(VIO2_VD3_MARK, PORT222_FN6, MSEL4CR_MSEL27_1,
1245 MSEL4CR_MSEL26_1), \
1246 PINMUX_DATA(PORT222_LCD2VSYN_MARK, PORT222_FN7, MSEL3CR_MSEL2_1),
1247
1248 PINMUX_DATA(SCIFA1_TXD_MARK, PORT225_FN2), \
1249 PINMUX_DATA(OVCN2_MARK, PORT225_FN4),
1250 PINMUX_DATA(EXTLP_MARK, PORT226_FN1), \
1251 PINMUX_DATA(SCIFA1_SCK_MARK, PORT226_FN2), \
1252 PINMUX_DATA(PORT226_VIO_CKO2_MARK, PORT226_FN5),
1253 PINMUX_DATA(SCIFA1_RTS__MARK, PORT227_FN2), \
1254 PINMUX_DATA(IDIN_MARK, PORT227_FN4),
1255 PINMUX_DATA(SCIFA1_RXD_MARK, PORT228_FN2),
1256 PINMUX_DATA(SCIFA1_CTS__MARK, PORT229_FN2), \
1257 PINMUX_DATA(MFG1_IN1_MARK, PORT229_FN3),
1258 PINMUX_DATA(MSIOF1_TXD_MARK, PORT230_FN1), \
1259 PINMUX_DATA(SCIFA2_TXD2_MARK, PORT230_FN2, MSEL3CR_MSEL9_1),
1260 PINMUX_DATA(MSIOF1_TSYNC_MARK, PORT231_FN1), \
1261 PINMUX_DATA(SCIFA2_CTS2__MARK, PORT231_FN2, MSEL3CR_MSEL9_1),
1262 PINMUX_DATA(MSIOF1_TSCK_MARK, PORT232_FN1), \
1263 PINMUX_DATA(SCIFA2_SCK2_MARK, PORT232_FN2, MSEL3CR_MSEL9_1),
1264 PINMUX_DATA(MSIOF1_RXD_MARK, PORT233_FN1), \
1265 PINMUX_DATA(SCIFA2_RXD2_MARK, PORT233_FN2, MSEL3CR_MSEL9_1),
1266 PINMUX_DATA(MSIOF1_RSCK_MARK, PORT234_FN1), \
1267 PINMUX_DATA(SCIFA2_RTS2__MARK, PORT234_FN2, MSEL3CR_MSEL9_1), \
1268 PINMUX_DATA(VIO2_CLK2_MARK, PORT234_FN6, MSEL4CR_MSEL27_1,
1269 MSEL4CR_MSEL26_0), \
1270 PINMUX_DATA(LCD2D20_MARK, PORT234_FN7),
1271 PINMUX_DATA(MSIOF1_RSYNC_MARK, PORT235_FN1), \
1272 PINMUX_DATA(MFG1_IN2_MARK, PORT235_FN3), \
1273 PINMUX_DATA(VIO2_VD2_MARK, PORT235_FN6, MSEL4CR_MSEL27_1,
1274 MSEL4CR_MSEL26_0), \
1275 PINMUX_DATA(LCD2D21_MARK, PORT235_FN7),
1276 PINMUX_DATA(MSIOF1_MCK0_MARK, PORT236_FN1), \
1277 PINMUX_DATA(PORT236_I2C_SDA2_MARK, PORT236_FN2, MSEL2CR_MSEL17_0,
1278 MSEL2CR_MSEL16_0),
1279 PINMUX_DATA(MSIOF1_MCK1_MARK, PORT237_FN1), \
1280 PINMUX_DATA(PORT237_I2C_SCL2_MARK, PORT237_FN2, MSEL2CR_MSEL17_0,
1281 MSEL2CR_MSEL16_0),
1282 PINMUX_DATA(MSIOF1_SS1_MARK, PORT238_FN1), \
1283 PINMUX_DATA(VIO2_FIELD2_MARK, PORT238_FN6, MSEL4CR_MSEL27_1,
1284 MSEL4CR_MSEL26_0), \
1285 PINMUX_DATA(LCD2D22_MARK, PORT238_FN7),
1286 PINMUX_DATA(MSIOF1_SS2_MARK, PORT239_FN1), \
1287 PINMUX_DATA(VIO2_HD2_MARK, PORT239_FN6, MSEL4CR_MSEL27_1,
1288 MSEL4CR_MSEL26_0), \
1289 PINMUX_DATA(LCD2D23_MARK, PORT239_FN7),
1290 PINMUX_DATA(SCIFA6_TXD_MARK, PORT240_FN1),
1291 PINMUX_DATA(PORT241_IRDA_OUT_MARK, PORT241_FN1, MSEL4CR_MSEL19_0), \
1292 PINMUX_DATA(PORT241_IROUT_MARK, PORT241_FN2), \
1293 PINMUX_DATA(MFG4_OUT1_MARK, PORT241_FN3), \
1294 PINMUX_DATA(TPU4TO0_MARK, PORT241_FN4),
1295 PINMUX_DATA(PORT242_IRDA_IN_MARK, PORT242_FN1, MSEL4CR_MSEL19_0), \
1296 PINMUX_DATA(MFG4_IN2_MARK, PORT242_FN3),
1297 PINMUX_DATA(PORT243_IRDA_FIRSEL_MARK, PORT243_FN1, MSEL4CR_MSEL19_0), \
1298 PINMUX_DATA(PORT243_VIO_CKO2_MARK, PORT243_FN2),
1299 PINMUX_DATA(PORT244_SCIFA5_CTS__MARK, PORT244_FN1, MSEL4CR_MSEL21_0,
1300 MSEL4CR_MSEL20_0), \
1301 PINMUX_DATA(MFG2_IN1_MARK, PORT244_FN2), \
1302 PINMUX_DATA(PORT244_SCIFB_CTS__MARK, PORT244_FN3, MSEL4CR_MSEL22_1), \
1303 PINMUX_DATA(MSIOF2R_RXD_MARK, PORT244_FN7, MSEL4CR_MSEL11_1),
1304 PINMUX_DATA(PORT245_SCIFA5_RTS__MARK, PORT245_FN1, MSEL4CR_MSEL21_0,
1305 MSEL4CR_MSEL20_0), \
1306 PINMUX_DATA(MFG2_IN2_MARK, PORT245_FN2), \
1307 PINMUX_DATA(PORT245_SCIFB_RTS__MARK, PORT245_FN3, MSEL4CR_MSEL22_1), \
1308 PINMUX_DATA(MSIOF2R_TXD_MARK, PORT245_FN7, MSEL4CR_MSEL11_1),
1309 PINMUX_DATA(PORT246_SCIFA5_RXD_MARK, PORT246_FN1, MSEL4CR_MSEL21_0,
1310 MSEL4CR_MSEL20_0), \
1311 PINMUX_DATA(MFG1_OUT1_MARK, PORT246_FN2), \
1312 PINMUX_DATA(PORT246_SCIFB_RXD_MARK, PORT246_FN3, MSEL4CR_MSEL22_1), \
1313 PINMUX_DATA(TPU1TO0_MARK, PORT246_FN4),
1314 PINMUX_DATA(PORT247_SCIFA5_TXD_MARK, PORT247_FN1, MSEL4CR_MSEL21_0,
1315 MSEL4CR_MSEL20_0), \
1316 PINMUX_DATA(MFG3_OUT2_MARK, PORT247_FN2), \
1317 PINMUX_DATA(PORT247_SCIFB_TXD_MARK, PORT247_FN3, MSEL4CR_MSEL22_1), \
1318 PINMUX_DATA(TPU3TO1_MARK, PORT247_FN4),
1319 PINMUX_DATA(PORT248_SCIFA5_SCK_MARK, PORT248_FN1, MSEL4CR_MSEL21_0,
1320 MSEL4CR_MSEL20_0), \
1321 PINMUX_DATA(MFG2_OUT1_MARK, PORT248_FN2), \
1322 PINMUX_DATA(PORT248_SCIFB_SCK_MARK, PORT248_FN3, MSEL4CR_MSEL22_1), \
1323 PINMUX_DATA(TPU2TO0_MARK, PORT248_FN4), \
1324 PINMUX_DATA(PORT248_I2C_SCL3_MARK, PORT248_FN5, MSEL2CR_MSEL19_0,
1325 MSEL2CR_MSEL18_0), \
1326 PINMUX_DATA(MSIOF2R_TSCK_MARK, PORT248_FN7, MSEL4CR_MSEL11_1),
1327 PINMUX_DATA(PORT249_IROUT_MARK, PORT249_FN1), \
1328 PINMUX_DATA(MFG4_IN1_MARK, PORT249_FN2), \
1329 PINMUX_DATA(PORT249_I2C_SDA3_MARK, PORT249_FN5, MSEL2CR_MSEL19_0,
1330 MSEL2CR_MSEL18_0), \
1331 PINMUX_DATA(MSIOF2R_TSYNC_MARK, PORT249_FN7, MSEL4CR_MSEL11_1),
1332 PINMUX_DATA(SDHICLK0_MARK, PORT250_FN1),
1333 PINMUX_DATA(SDHICD0_MARK, PORT251_FN1),
1334 PINMUX_DATA(SDHID0_0_MARK, PORT252_FN1),
1335 PINMUX_DATA(SDHID0_1_MARK, PORT253_FN1),
1336 PINMUX_DATA(SDHID0_2_MARK, PORT254_FN1),
1337 PINMUX_DATA(SDHID0_3_MARK, PORT255_FN1),
1338 PINMUX_DATA(SDHICMD0_MARK, PORT256_FN1),
1339 PINMUX_DATA(SDHIWP0_MARK, PORT257_FN1),
1340 PINMUX_DATA(SDHICLK1_MARK, PORT258_FN1),
1341 PINMUX_DATA(SDHID1_0_MARK, PORT259_FN1), \
1342 PINMUX_DATA(TS_SPSYNC2_MARK, PORT259_FN3),
1343 PINMUX_DATA(SDHID1_1_MARK, PORT260_FN1), \
1344 PINMUX_DATA(TS_SDAT2_MARK, PORT260_FN3),
1345 PINMUX_DATA(SDHID1_2_MARK, PORT261_FN1), \
1346 PINMUX_DATA(TS_SDEN2_MARK, PORT261_FN3),
1347 PINMUX_DATA(SDHID1_3_MARK, PORT262_FN1), \
1348 PINMUX_DATA(TS_SCK2_MARK, PORT262_FN3),
1349 PINMUX_DATA(SDHICMD1_MARK, PORT263_FN1),
1350 PINMUX_DATA(SDHICLK2_MARK, PORT264_FN1),
1351 PINMUX_DATA(SDHID2_0_MARK, PORT265_FN1), \
1352 PINMUX_DATA(TS_SPSYNC4_MARK, PORT265_FN3),
1353 PINMUX_DATA(SDHID2_1_MARK, PORT266_FN1), \
1354 PINMUX_DATA(TS_SDAT4_MARK, PORT266_FN3),
1355 PINMUX_DATA(SDHID2_2_MARK, PORT267_FN1), \
1356 PINMUX_DATA(TS_SDEN4_MARK, PORT267_FN3),
1357 PINMUX_DATA(SDHID2_3_MARK, PORT268_FN1), \
1358 PINMUX_DATA(TS_SCK4_MARK, PORT268_FN3),
1359 PINMUX_DATA(SDHICMD2_MARK, PORT269_FN1),
1360 PINMUX_DATA(MMCCLK0_MARK, PORT270_FN1, MSEL4CR_MSEL15_0),
1361 PINMUX_DATA(MMCD0_0_MARK, PORT271_FN1, PORT271_IN_PU,
1362 MSEL4CR_MSEL15_0),
1363 PINMUX_DATA(MMCD0_1_MARK, PORT272_FN1, PORT272_IN_PU,
1364 MSEL4CR_MSEL15_0),
1365 PINMUX_DATA(MMCD0_2_MARK, PORT273_FN1, PORT273_IN_PU,
1366 MSEL4CR_MSEL15_0),
1367 PINMUX_DATA(MMCD0_3_MARK, PORT274_FN1, PORT274_IN_PU,
1368 MSEL4CR_MSEL15_0),
1369 PINMUX_DATA(MMCD0_4_MARK, PORT275_FN1, PORT275_IN_PU,
1370 MSEL4CR_MSEL15_0), \
1371 PINMUX_DATA(TS_SPSYNC5_MARK, PORT275_FN3),
1372 PINMUX_DATA(MMCD0_5_MARK, PORT276_FN1, PORT276_IN_PU,
1373 MSEL4CR_MSEL15_0), \
1374 PINMUX_DATA(TS_SDAT5_MARK, PORT276_FN3),
1375 PINMUX_DATA(MMCD0_6_MARK, PORT277_FN1, PORT277_IN_PU,
1376 MSEL4CR_MSEL15_0), \
1377 PINMUX_DATA(TS_SDEN5_MARK, PORT277_FN3),
1378 PINMUX_DATA(MMCD0_7_MARK, PORT278_FN1, PORT278_IN_PU,
1379 MSEL4CR_MSEL15_0), \
1380 PINMUX_DATA(TS_SCK5_MARK, PORT278_FN3),
1381 PINMUX_DATA(MMCCMD0_MARK, PORT279_FN1, PORT279_IN_PU,
1382 MSEL4CR_MSEL15_0),
1383 PINMUX_DATA(RESETOUTS__MARK, PORT281_FN1), \
1384 PINMUX_DATA(EXTAL2OUT_MARK, PORT281_FN2),
1385 PINMUX_DATA(MCP_WAIT__MCP_FRB_MARK, PORT288_FN1),
1386 PINMUX_DATA(MCP_CKO_MARK, PORT289_FN1), \
1387 PINMUX_DATA(MMCCLK1_MARK, PORT289_FN2, MSEL4CR_MSEL15_1),
1388 PINMUX_DATA(MCP_D15_MCP_NAF15_MARK, PORT290_FN1),
1389 PINMUX_DATA(MCP_D14_MCP_NAF14_MARK, PORT291_FN1),
1390 PINMUX_DATA(MCP_D13_MCP_NAF13_MARK, PORT292_FN1),
1391 PINMUX_DATA(MCP_D12_MCP_NAF12_MARK, PORT293_FN1),
1392 PINMUX_DATA(MCP_D11_MCP_NAF11_MARK, PORT294_FN1),
1393 PINMUX_DATA(MCP_D10_MCP_NAF10_MARK, PORT295_FN1),
1394 PINMUX_DATA(MCP_D9_MCP_NAF9_MARK, PORT296_FN1),
1395 PINMUX_DATA(MCP_D8_MCP_NAF8_MARK, PORT297_FN1), \
1396 PINMUX_DATA(MMCCMD1_MARK, PORT297_FN2, MSEL4CR_MSEL15_1),
1397 PINMUX_DATA(MCP_D7_MCP_NAF7_MARK, PORT298_FN1), \
1398 PINMUX_DATA(MMCD1_7_MARK, PORT298_FN2, MSEL4CR_MSEL15_1),
1399
1400 PINMUX_DATA(MCP_D6_MCP_NAF6_MARK, PORT299_FN1), \
1401 PINMUX_DATA(MMCD1_6_MARK, PORT299_FN2, MSEL4CR_MSEL15_1),
1402 PINMUX_DATA(MCP_D5_MCP_NAF5_MARK, PORT300_FN1), \
1403 PINMUX_DATA(MMCD1_5_MARK, PORT300_FN2, MSEL4CR_MSEL15_1),
1404 PINMUX_DATA(MCP_D4_MCP_NAF4_MARK, PORT301_FN1), \
1405 PINMUX_DATA(MMCD1_4_MARK, PORT301_FN2, MSEL4CR_MSEL15_1),
1406 PINMUX_DATA(MCP_D3_MCP_NAF3_MARK, PORT302_FN1), \
1407 PINMUX_DATA(MMCD1_3_MARK, PORT302_FN2, MSEL4CR_MSEL15_1),
1408 PINMUX_DATA(MCP_D2_MCP_NAF2_MARK, PORT303_FN1), \
1409 PINMUX_DATA(MMCD1_2_MARK, PORT303_FN2, MSEL4CR_MSEL15_1),
1410 PINMUX_DATA(MCP_D1_MCP_NAF1_MARK, PORT304_FN1), \
1411 PINMUX_DATA(MMCD1_1_MARK, PORT304_FN2, MSEL4CR_MSEL15_1),
1412 PINMUX_DATA(MCP_D0_MCP_NAF0_MARK, PORT305_FN1), \
1413 PINMUX_DATA(MMCD1_0_MARK, PORT305_FN2, MSEL4CR_MSEL15_1),
1414 PINMUX_DATA(MCP_NBRSTOUT__MARK, PORT306_FN1),
1415 PINMUX_DATA(MCP_WE0__MCP_FWE_MARK, PORT309_FN1), \
1416 PINMUX_DATA(MCP_RDWR_MCP_FWE_MARK, PORT309_FN2),
1417
1418 /* MSEL2 special cases */
1419 PINMUX_DATA(TSIF2_TS_XX1_MARK, MSEL2CR_MSEL14_0, MSEL2CR_MSEL13_0,
1420 MSEL2CR_MSEL12_0),
1421 PINMUX_DATA(TSIF2_TS_XX2_MARK, MSEL2CR_MSEL14_0, MSEL2CR_MSEL13_0,
1422 MSEL2CR_MSEL12_1),
1423 PINMUX_DATA(TSIF2_TS_XX3_MARK, MSEL2CR_MSEL14_0, MSEL2CR_MSEL13_1,
1424 MSEL2CR_MSEL12_0),
1425 PINMUX_DATA(TSIF2_TS_XX4_MARK, MSEL2CR_MSEL14_0, MSEL2CR_MSEL13_1,
1426 MSEL2CR_MSEL12_1),
1427 PINMUX_DATA(TSIF2_TS_XX5_MARK, MSEL2CR_MSEL14_1, MSEL2CR_MSEL13_0,
1428 MSEL2CR_MSEL12_0),
1429 PINMUX_DATA(TSIF1_TS_XX1_MARK, MSEL2CR_MSEL11_0, MSEL2CR_MSEL10_0,
1430 MSEL2CR_MSEL9_0),
1431 PINMUX_DATA(TSIF1_TS_XX2_MARK, MSEL2CR_MSEL11_0, MSEL2CR_MSEL10_0,
1432 MSEL2CR_MSEL9_1),
1433 PINMUX_DATA(TSIF1_TS_XX3_MARK, MSEL2CR_MSEL11_0, MSEL2CR_MSEL10_1,
1434 MSEL2CR_MSEL9_0),
1435 PINMUX_DATA(TSIF1_TS_XX4_MARK, MSEL2CR_MSEL11_0, MSEL2CR_MSEL10_1,
1436 MSEL2CR_MSEL9_1),
1437 PINMUX_DATA(TSIF1_TS_XX5_MARK, MSEL2CR_MSEL11_1, MSEL2CR_MSEL10_0,
1438 MSEL2CR_MSEL9_0),
1439 PINMUX_DATA(TSIF0_TS_XX1_MARK, MSEL2CR_MSEL8_0, MSEL2CR_MSEL7_0,
1440 MSEL2CR_MSEL6_0),
1441 PINMUX_DATA(TSIF0_TS_XX2_MARK, MSEL2CR_MSEL8_0, MSEL2CR_MSEL7_0,
1442 MSEL2CR_MSEL6_1),
1443 PINMUX_DATA(TSIF0_TS_XX3_MARK, MSEL2CR_MSEL8_0, MSEL2CR_MSEL7_1,
1444 MSEL2CR_MSEL6_0),
1445 PINMUX_DATA(TSIF0_TS_XX4_MARK, MSEL2CR_MSEL8_0, MSEL2CR_MSEL7_1,
1446 MSEL2CR_MSEL6_1),
1447 PINMUX_DATA(TSIF0_TS_XX5_MARK, MSEL2CR_MSEL8_1, MSEL2CR_MSEL7_0,
1448 MSEL2CR_MSEL6_0),
1449 PINMUX_DATA(MST1_TS_XX1_MARK, MSEL2CR_MSEL5_0, MSEL2CR_MSEL4_0,
1450 MSEL2CR_MSEL3_0),
1451 PINMUX_DATA(MST1_TS_XX2_MARK, MSEL2CR_MSEL5_0, MSEL2CR_MSEL4_0,
1452 MSEL2CR_MSEL3_1),
1453 PINMUX_DATA(MST1_TS_XX3_MARK, MSEL2CR_MSEL5_0, MSEL2CR_MSEL4_1,
1454 MSEL2CR_MSEL3_0),
1455 PINMUX_DATA(MST1_TS_XX4_MARK, MSEL2CR_MSEL5_0, MSEL2CR_MSEL4_1,
1456 MSEL2CR_MSEL3_1),
1457 PINMUX_DATA(MST1_TS_XX5_MARK, MSEL2CR_MSEL5_1, MSEL2CR_MSEL4_0,
1458 MSEL2CR_MSEL3_0),
1459 PINMUX_DATA(MST0_TS_XX1_MARK, MSEL2CR_MSEL2_0, MSEL2CR_MSEL1_0,
1460 MSEL2CR_MSEL0_0),
1461 PINMUX_DATA(MST0_TS_XX2_MARK, MSEL2CR_MSEL2_0, MSEL2CR_MSEL1_0,
1462 MSEL2CR_MSEL0_1),
1463 PINMUX_DATA(MST0_TS_XX3_MARK, MSEL2CR_MSEL2_0, MSEL2CR_MSEL1_1,
1464 MSEL2CR_MSEL0_0),
1465 PINMUX_DATA(MST0_TS_XX4_MARK, MSEL2CR_MSEL2_0, MSEL2CR_MSEL1_1,
1466 MSEL2CR_MSEL0_1),
1467 PINMUX_DATA(MST0_TS_XX5_MARK, MSEL2CR_MSEL2_1, MSEL2CR_MSEL1_0,
1468 MSEL2CR_MSEL0_0),
1469
1470 /* MSEL3 special cases */
1471 PINMUX_DATA(SDHI0_VCCQ_MC0_ON_MARK, MSEL3CR_MSEL28_1),
1472 PINMUX_DATA(SDHI0_VCCQ_MC0_OFF_MARK, MSEL3CR_MSEL28_0),
1473 PINMUX_DATA(DEBUG_MON_VIO_MARK, MSEL3CR_MSEL15_0),
1474 PINMUX_DATA(DEBUG_MON_LCDD_MARK, MSEL3CR_MSEL15_1),
1475 PINMUX_DATA(LCDC_LCDC0_MARK, MSEL3CR_MSEL6_0),
1476 PINMUX_DATA(LCDC_LCDC1_MARK, MSEL3CR_MSEL6_1),
1477
1478 /* MSEL4 special cases */
1479 PINMUX_DATA(IRQ9_MEM_INT_MARK, MSEL4CR_MSEL29_0),
1480 PINMUX_DATA(IRQ9_MCP_INT_MARK, MSEL4CR_MSEL29_1),
1481 PINMUX_DATA(A11_MARK, MSEL4CR_MSEL13_0, MSEL4CR_MSEL12_0),
1482 PINMUX_DATA(KEYOUT8_MARK, MSEL4CR_MSEL13_0, MSEL4CR_MSEL12_1),
1483 PINMUX_DATA(TPU4TO3_MARK, MSEL4CR_MSEL13_1, MSEL4CR_MSEL12_0),
1484 PINMUX_DATA(RESETA_N_PU_ON_MARK, MSEL4CR_MSEL4_0),
1485 PINMUX_DATA(RESETA_N_PU_OFF_MARK, MSEL4CR_MSEL4_1),
1486 PINMUX_DATA(EDBGREQ_PD_MARK, MSEL4CR_MSEL1_0),
1487 PINMUX_DATA(EDBGREQ_PU_MARK, MSEL4CR_MSEL1_1),
1488
1489 /* Functions with pull-ups */
1490 PINMUX_DATA(KEYIN0_PU_MARK, PORT66_FN2, PORT66_IN_PU),
1491 PINMUX_DATA(KEYIN1_PU_MARK, PORT67_FN2, PORT67_IN_PU),
1492 PINMUX_DATA(KEYIN2_PU_MARK, PORT68_FN2, PORT68_IN_PU),
1493 PINMUX_DATA(KEYIN3_PU_MARK, PORT69_FN2, PORT69_IN_PU),
1494 PINMUX_DATA(KEYIN4_PU_MARK, PORT70_FN2, PORT70_IN_PU),
1495 PINMUX_DATA(KEYIN5_PU_MARK, PORT71_FN2, PORT71_IN_PU),
1496 PINMUX_DATA(KEYIN6_PU_MARK, PORT72_FN2, PORT72_IN_PU),
1497 PINMUX_DATA(KEYIN7_PU_MARK, PORT73_FN2, PORT73_IN_PU),
1498
1499 PINMUX_DATA(SDHICD0_PU_MARK, PORT251_FN1, PORT251_IN_PU),
1500 PINMUX_DATA(SDHID0_0_PU_MARK, PORT252_FN1, PORT252_IN_PU),
1501 PINMUX_DATA(SDHID0_1_PU_MARK, PORT253_FN1, PORT253_IN_PU),
1502 PINMUX_DATA(SDHID0_2_PU_MARK, PORT254_FN1, PORT254_IN_PU),
1503 PINMUX_DATA(SDHID0_3_PU_MARK, PORT255_FN1, PORT255_IN_PU),
1504 PINMUX_DATA(SDHICMD0_PU_MARK, PORT256_FN1, PORT256_IN_PU),
1505 PINMUX_DATA(SDHIWP0_PU_MARK, PORT257_FN1, PORT256_IN_PU),
1506 PINMUX_DATA(SDHID1_0_PU_MARK, PORT259_FN1, PORT259_IN_PU),
1507 PINMUX_DATA(SDHID1_1_PU_MARK, PORT260_FN1, PORT260_IN_PU),
1508 PINMUX_DATA(SDHID1_2_PU_MARK, PORT261_FN1, PORT261_IN_PU),
1509 PINMUX_DATA(SDHID1_3_PU_MARK, PORT262_FN1, PORT262_IN_PU),
1510 PINMUX_DATA(SDHICMD1_PU_MARK, PORT263_FN1, PORT263_IN_PU),
1511 PINMUX_DATA(SDHID2_0_PU_MARK, PORT265_FN1, PORT265_IN_PU),
1512 PINMUX_DATA(SDHID2_1_PU_MARK, PORT266_FN1, PORT266_IN_PU),
1513 PINMUX_DATA(SDHID2_2_PU_MARK, PORT267_FN1, PORT267_IN_PU),
1514 PINMUX_DATA(SDHID2_3_PU_MARK, PORT268_FN1, PORT268_IN_PU),
1515 PINMUX_DATA(SDHICMD2_PU_MARK, PORT269_FN1, PORT269_IN_PU),
1516
1517 PINMUX_DATA(MMCCMD0_PU_MARK, PORT279_FN1, PORT279_IN_PU,
1518 MSEL4CR_MSEL15_0),
1519 PINMUX_DATA(MMCCMD1_PU_MARK, PORT297_FN2, PORT297_IN_PU,
1520 MSEL4CR_MSEL15_1),
1521
1522 PINMUX_DATA(MMCD0_0_PU_MARK,
1523 PORT271_FN1, PORT271_IN_PU, MSEL4CR_MSEL15_0),
1524 PINMUX_DATA(MMCD0_1_PU_MARK,
1525 PORT272_FN1, PORT272_IN_PU, MSEL4CR_MSEL15_0),
1526 PINMUX_DATA(MMCD0_2_PU_MARK,
1527 PORT273_FN1, PORT273_IN_PU, MSEL4CR_MSEL15_0),
1528 PINMUX_DATA(MMCD0_3_PU_MARK,
1529 PORT274_FN1, PORT274_IN_PU, MSEL4CR_MSEL15_0),
1530 PINMUX_DATA(MMCD0_4_PU_MARK,
1531 PORT275_FN1, PORT275_IN_PU, MSEL4CR_MSEL15_0),
1532 PINMUX_DATA(MMCD0_5_PU_MARK,
1533 PORT276_FN1, PORT276_IN_PU, MSEL4CR_MSEL15_0),
1534 PINMUX_DATA(MMCD0_6_PU_MARK,
1535 PORT277_FN1, PORT277_IN_PU, MSEL4CR_MSEL15_0),
1536 PINMUX_DATA(MMCD0_7_PU_MARK,
1537 PORT278_FN1, PORT278_IN_PU, MSEL4CR_MSEL15_0),
1538
1539 PINMUX_DATA(FSIBISLD_PU_MARK, PORT39_FN1, PORT39_IN_PU),
1540 PINMUX_DATA(FSIACK_PU_MARK, PORT49_FN1, PORT49_IN_PU),
1541 PINMUX_DATA(FSIAILR_PU_MARK, PORT50_FN5, PORT50_IN_PU),
1542 PINMUX_DATA(FSIAIBT_PU_MARK, PORT51_FN5, PORT51_IN_PU),
1543 PINMUX_DATA(FSIAISLD_PU_MARK, PORT55_FN1, PORT55_IN_PU),
1544};
1545
1546static struct pinmux_gpio pinmux_gpios[] = {
1547 GPIO_PORT_ALL(),
1548
1549 /* Table 25-1 (Functions 0-7) */
1550 GPIO_FN(VBUS_0),
1551 GPIO_FN(GPI0),
1552 GPIO_FN(GPI1),
1553 GPIO_FN(GPI2),
1554 GPIO_FN(GPI3),
1555 GPIO_FN(GPI4),
1556 GPIO_FN(GPI5),
1557 GPIO_FN(GPI6),
1558 GPIO_FN(GPI7),
1559 GPIO_FN(SCIFA7_RXD),
1560 GPIO_FN(SCIFA7_CTS_),
1561 GPIO_FN(GPO7), \
1562 GPIO_FN(MFG0_OUT2),
1563 GPIO_FN(GPO6), \
1564 GPIO_FN(MFG1_OUT2),
1565 GPIO_FN(GPO5), \
1566 GPIO_FN(SCIFA0_SCK), \
1567 GPIO_FN(FSICOSLDT3), \
1568 GPIO_FN(PORT16_VIO_CKOR),
1569 GPIO_FN(SCIFA0_TXD),
1570 GPIO_FN(SCIFA7_TXD),
1571 GPIO_FN(SCIFA7_RTS_), \
1572 GPIO_FN(PORT19_VIO_CKO2),
1573 GPIO_FN(GPO0),
1574 GPIO_FN(GPO1),
1575 GPIO_FN(GPO2), \
1576 GPIO_FN(STATUS0),
1577 GPIO_FN(GPO3), \
1578 GPIO_FN(STATUS1),
1579 GPIO_FN(GPO4), \
1580 GPIO_FN(STATUS2),
1581 GPIO_FN(VINT),
1582 GPIO_FN(TCKON),
1583 GPIO_FN(XDVFS1), \
1584 GPIO_FN(PORT27_I2C_SCL2), \
1585 GPIO_FN(PORT27_I2C_SCL3), \
1586 GPIO_FN(MFG0_OUT1), \
1587 GPIO_FN(PORT27_IROUT),
1588 GPIO_FN(XDVFS2), \
1589 GPIO_FN(PORT28_I2C_SDA2), \
1590 GPIO_FN(PORT28_I2C_SDA3), \
1591 GPIO_FN(PORT28_TPU1TO1),
1592 GPIO_FN(SIM_RST), \
1593 GPIO_FN(PORT29_TPU1TO1),
1594 GPIO_FN(SIM_CLK), \
1595 GPIO_FN(PORT30_VIO_CKOR),
1596 GPIO_FN(SIM_D), \
1597 GPIO_FN(PORT31_IROUT),
1598 GPIO_FN(SCIFA4_TXD),
1599 GPIO_FN(SCIFA4_RXD), \
1600 GPIO_FN(XWUP),
1601 GPIO_FN(SCIFA4_RTS_),
1602 GPIO_FN(SCIFA4_CTS_),
1603 GPIO_FN(FSIBOBT), \
1604 GPIO_FN(FSIBIBT),
1605 GPIO_FN(FSIBOLR), \
1606 GPIO_FN(FSIBILR),
1607 GPIO_FN(FSIBOSLD),
1608 GPIO_FN(FSIBISLD),
1609 GPIO_FN(VACK),
1610 GPIO_FN(XTAL1L),
1611 GPIO_FN(SCIFA0_RTS_), \
1612 GPIO_FN(FSICOSLDT2),
1613 GPIO_FN(SCIFA0_RXD),
1614 GPIO_FN(SCIFA0_CTS_), \
1615 GPIO_FN(FSICOSLDT1),
1616 GPIO_FN(FSICOBT), \
1617 GPIO_FN(FSICIBT), \
1618 GPIO_FN(FSIDOBT), \
1619 GPIO_FN(FSIDIBT),
1620 GPIO_FN(FSICOLR), \
1621 GPIO_FN(FSICILR), \
1622 GPIO_FN(FSIDOLR), \
1623 GPIO_FN(FSIDILR),
1624 GPIO_FN(FSICOSLD), \
1625 GPIO_FN(PORT47_FSICSPDIF),
1626 GPIO_FN(FSICISLD), \
1627 GPIO_FN(FSIDISLD),
1628 GPIO_FN(FSIACK), \
1629 GPIO_FN(PORT49_IRDA_OUT), \
1630 GPIO_FN(PORT49_IROUT), \
1631 GPIO_FN(FSIAOMC),
1632 GPIO_FN(FSIAOLR), \
1633 GPIO_FN(BBIF2_TSYNC2), \
1634 GPIO_FN(TPU2TO2), \
1635 GPIO_FN(FSIAILR),
1636
1637 GPIO_FN(FSIAOBT), \
1638 GPIO_FN(BBIF2_TSCK2), \
1639 GPIO_FN(TPU2TO3), \
1640 GPIO_FN(FSIAIBT),
1641 GPIO_FN(FSIAOSLD), \
1642 GPIO_FN(BBIF2_TXD2),
1643 GPIO_FN(FSIASPDIF), \
1644 GPIO_FN(PORT53_IRDA_IN), \
1645 GPIO_FN(TPU3TO3), \
1646 GPIO_FN(FSIBSPDIF), \
1647 GPIO_FN(PORT53_FSICSPDIF),
1648 GPIO_FN(FSIBCK), \
1649 GPIO_FN(PORT54_IRDA_FIRSEL), \
1650 GPIO_FN(TPU3TO2), \
1651 GPIO_FN(FSIBOMC), \
1652 GPIO_FN(FSICCK), \
1653 GPIO_FN(FSICOMC),
1654 GPIO_FN(FSIAISLD), \
1655 GPIO_FN(TPU0TO0),
1656 GPIO_FN(A0), \
1657 GPIO_FN(BS_),
1658 GPIO_FN(A12), \
1659 GPIO_FN(PORT58_KEYOUT7), \
1660 GPIO_FN(TPU4TO2),
1661 GPIO_FN(A13), \
1662 GPIO_FN(PORT59_KEYOUT6), \
1663 GPIO_FN(TPU0TO1),
1664 GPIO_FN(A14), \
1665 GPIO_FN(KEYOUT5),
1666 GPIO_FN(A15), \
1667 GPIO_FN(KEYOUT4),
1668 GPIO_FN(A16), \
1669 GPIO_FN(KEYOUT3), \
1670 GPIO_FN(MSIOF0_SS1),
1671 GPIO_FN(A17), \
1672 GPIO_FN(KEYOUT2), \
1673 GPIO_FN(MSIOF0_TSYNC),
1674 GPIO_FN(A18), \
1675 GPIO_FN(KEYOUT1), \
1676 GPIO_FN(MSIOF0_TSCK),
1677 GPIO_FN(A19), \
1678 GPIO_FN(KEYOUT0), \
1679 GPIO_FN(MSIOF0_TXD),
1680 GPIO_FN(A20), \
1681 GPIO_FN(KEYIN0), \
1682 GPIO_FN(MSIOF0_RSCK),
1683 GPIO_FN(A21), \
1684 GPIO_FN(KEYIN1), \
1685 GPIO_FN(MSIOF0_RSYNC),
1686 GPIO_FN(A22), \
1687 GPIO_FN(KEYIN2), \
1688 GPIO_FN(MSIOF0_MCK0),
1689 GPIO_FN(A23), \
1690 GPIO_FN(KEYIN3), \
1691 GPIO_FN(MSIOF0_MCK1),
1692 GPIO_FN(A24), \
1693 GPIO_FN(KEYIN4), \
1694 GPIO_FN(MSIOF0_RXD),
1695 GPIO_FN(A25), \
1696 GPIO_FN(KEYIN5), \
1697 GPIO_FN(MSIOF0_SS2),
1698 GPIO_FN(A26), \
1699 GPIO_FN(KEYIN6),
1700 GPIO_FN(KEYIN7),
1701 GPIO_FN(D0_NAF0),
1702 GPIO_FN(D1_NAF1),
1703 GPIO_FN(D2_NAF2),
1704 GPIO_FN(D3_NAF3),
1705 GPIO_FN(D4_NAF4),
1706 GPIO_FN(D5_NAF5),
1707 GPIO_FN(D6_NAF6),
1708 GPIO_FN(D7_NAF7),
1709 GPIO_FN(D8_NAF8),
1710 GPIO_FN(D9_NAF9),
1711 GPIO_FN(D10_NAF10),
1712 GPIO_FN(D11_NAF11),
1713 GPIO_FN(D12_NAF12),
1714 GPIO_FN(D13_NAF13),
1715 GPIO_FN(D14_NAF14),
1716 GPIO_FN(D15_NAF15),
1717 GPIO_FN(CS4_),
1718 GPIO_FN(CS5A_), \
1719 GPIO_FN(PORT91_RDWR),
1720 GPIO_FN(CS5B_), \
1721 GPIO_FN(FCE1_),
1722 GPIO_FN(CS6B_), \
1723 GPIO_FN(DACK0),
1724 GPIO_FN(FCE0_), \
1725 GPIO_FN(CS6A_),
1726 GPIO_FN(WAIT_), \
1727 GPIO_FN(DREQ0),
1728 GPIO_FN(RD__FSC),
1729 GPIO_FN(WE0__FWE), \
1730 GPIO_FN(RDWR_FWE),
1731 GPIO_FN(WE1_),
1732 GPIO_FN(FRB),
1733 GPIO_FN(CKO),
1734 GPIO_FN(NBRSTOUT_),
1735 GPIO_FN(NBRST_),
1736 GPIO_FN(BBIF2_TXD),
1737 GPIO_FN(BBIF2_RXD),
1738 GPIO_FN(BBIF2_SYNC),
1739 GPIO_FN(BBIF2_SCK),
1740 GPIO_FN(SCIFA3_CTS_), \
1741 GPIO_FN(MFG3_IN2),
1742 GPIO_FN(SCIFA3_RXD), \
1743 GPIO_FN(MFG3_IN1),
1744 GPIO_FN(BBIF1_SS2), \
1745 GPIO_FN(SCIFA3_RTS_), \
1746 GPIO_FN(MFG3_OUT1),
1747 GPIO_FN(SCIFA3_TXD),
1748 GPIO_FN(HSI_RX_DATA), \
1749 GPIO_FN(BBIF1_RXD),
1750 GPIO_FN(HSI_TX_WAKE), \
1751 GPIO_FN(BBIF1_TSCK),
1752 GPIO_FN(HSI_TX_DATA), \
1753 GPIO_FN(BBIF1_TSYNC),
1754 GPIO_FN(HSI_TX_READY), \
1755 GPIO_FN(BBIF1_TXD),
1756 GPIO_FN(HSI_RX_READY), \
1757 GPIO_FN(BBIF1_RSCK), \
1758 GPIO_FN(PORT115_I2C_SCL2), \
1759 GPIO_FN(PORT115_I2C_SCL3),
1760 GPIO_FN(HSI_RX_WAKE), \
1761 GPIO_FN(BBIF1_RSYNC), \
1762 GPIO_FN(PORT116_I2C_SDA2), \
1763 GPIO_FN(PORT116_I2C_SDA3),
1764 GPIO_FN(HSI_RX_FLAG), \
1765 GPIO_FN(BBIF1_SS1), \
1766 GPIO_FN(BBIF1_FLOW),
1767 GPIO_FN(HSI_TX_FLAG),
1768 GPIO_FN(VIO_VD), \
1769 GPIO_FN(PORT128_LCD2VSYN), \
1770 GPIO_FN(VIO2_VD), \
1771 GPIO_FN(LCD2D0),
1772
1773 GPIO_FN(VIO_HD), \
1774 GPIO_FN(PORT129_LCD2HSYN), \
1775 GPIO_FN(PORT129_LCD2CS_), \
1776 GPIO_FN(VIO2_HD), \
1777 GPIO_FN(LCD2D1),
1778 GPIO_FN(VIO_D0), \
1779 GPIO_FN(PORT130_MSIOF2_RXD), \
1780 GPIO_FN(LCD2D10),
1781 GPIO_FN(VIO_D1), \
1782 GPIO_FN(PORT131_KEYOUT6), \
1783 GPIO_FN(PORT131_MSIOF2_SS1), \
1784 GPIO_FN(PORT131_KEYOUT11), \
1785 GPIO_FN(LCD2D11),
1786 GPIO_FN(VIO_D2), \
1787 GPIO_FN(PORT132_KEYOUT7), \
1788 GPIO_FN(PORT132_MSIOF2_SS2), \
1789 GPIO_FN(PORT132_KEYOUT10), \
1790 GPIO_FN(LCD2D12),
1791 GPIO_FN(VIO_D3), \
1792 GPIO_FN(MSIOF2_TSYNC), \
1793 GPIO_FN(LCD2D13),
1794 GPIO_FN(VIO_D4), \
1795 GPIO_FN(MSIOF2_TXD), \
1796 GPIO_FN(LCD2D14),
1797 GPIO_FN(VIO_D5), \
1798 GPIO_FN(MSIOF2_TSCK), \
1799 GPIO_FN(LCD2D15),
1800 GPIO_FN(VIO_D6), \
1801 GPIO_FN(PORT136_KEYOUT8), \
1802 GPIO_FN(LCD2D16),
1803 GPIO_FN(VIO_D7), \
1804 GPIO_FN(PORT137_KEYOUT9), \
1805 GPIO_FN(LCD2D17),
1806 GPIO_FN(VIO_D8), \
1807 GPIO_FN(PORT138_KEYOUT8), \
1808 GPIO_FN(VIO2_D0), \
1809 GPIO_FN(LCD2D6),
1810 GPIO_FN(VIO_D9), \
1811 GPIO_FN(PORT139_KEYOUT9), \
1812 GPIO_FN(VIO2_D1), \
1813 GPIO_FN(LCD2D7),
1814 GPIO_FN(VIO_D10), \
1815 GPIO_FN(TPU0TO2), \
1816 GPIO_FN(VIO2_D2), \
1817 GPIO_FN(LCD2D8),
1818 GPIO_FN(VIO_D11), \
1819 GPIO_FN(TPU0TO3), \
1820 GPIO_FN(VIO2_D3), \
1821 GPIO_FN(LCD2D9),
1822 GPIO_FN(VIO_D12), \
1823 GPIO_FN(PORT142_KEYOUT10), \
1824 GPIO_FN(VIO2_D4), \
1825 GPIO_FN(LCD2D2),
1826 GPIO_FN(VIO_D13), \
1827 GPIO_FN(PORT143_KEYOUT11), \
1828 GPIO_FN(PORT143_KEYOUT6), \
1829 GPIO_FN(VIO2_D5), \
1830 GPIO_FN(LCD2D3),
1831 GPIO_FN(VIO_D14), \
1832 GPIO_FN(PORT144_KEYOUT7), \
1833 GPIO_FN(VIO2_D6), \
1834 GPIO_FN(LCD2D4),
1835 GPIO_FN(VIO_D15), \
1836 GPIO_FN(TPU1TO3), \
1837 GPIO_FN(PORT145_LCD2DISP), \
1838 GPIO_FN(PORT145_LCD2RS), \
1839 GPIO_FN(VIO2_D7), \
1840 GPIO_FN(LCD2D5),
1841 GPIO_FN(VIO_CLK), \
1842 GPIO_FN(LCD2DCK), \
1843 GPIO_FN(PORT146_LCD2WR_), \
1844 GPIO_FN(VIO2_CLK), \
1845 GPIO_FN(LCD2D18),
1846 GPIO_FN(VIO_FIELD), \
1847 GPIO_FN(LCD2RD_), \
1848 GPIO_FN(VIO2_FIELD), \
1849 GPIO_FN(LCD2D19),
1850 GPIO_FN(VIO_CKO),
1851 GPIO_FN(A27), \
1852 GPIO_FN(PORT149_RDWR), \
1853 GPIO_FN(MFG0_IN1), \
1854 GPIO_FN(PORT149_KEYOUT9),
1855 GPIO_FN(MFG0_IN2),
1856 GPIO_FN(TS_SPSYNC3), \
1857 GPIO_FN(MSIOF2_RSCK),
1858 GPIO_FN(TS_SDAT3), \
1859 GPIO_FN(MSIOF2_RSYNC),
1860 GPIO_FN(TPU1TO2), \
1861 GPIO_FN(TS_SDEN3), \
1862 GPIO_FN(PORT153_MSIOF2_SS1),
1863 GPIO_FN(SCIFA2_TXD1), \
1864 GPIO_FN(MSIOF2_MCK0),
1865 GPIO_FN(SCIFA2_RXD1), \
1866 GPIO_FN(MSIOF2_MCK1),
1867 GPIO_FN(SCIFA2_RTS1_), \
1868 GPIO_FN(PORT156_MSIOF2_SS2),
1869 GPIO_FN(SCIFA2_CTS1_), \
1870 GPIO_FN(PORT157_MSIOF2_RXD),
1871 GPIO_FN(DINT_), \
1872 GPIO_FN(SCIFA2_SCK1), \
1873 GPIO_FN(TS_SCK3),
1874 GPIO_FN(PORT159_SCIFB_SCK), \
1875 GPIO_FN(PORT159_SCIFA5_SCK), \
1876 GPIO_FN(NMI),
1877 GPIO_FN(PORT160_SCIFB_TXD), \
1878 GPIO_FN(PORT160_SCIFA5_TXD),
1879 GPIO_FN(PORT161_SCIFB_CTS_), \
1880 GPIO_FN(PORT161_SCIFA5_CTS_),
1881 GPIO_FN(PORT162_SCIFB_RXD), \
1882 GPIO_FN(PORT162_SCIFA5_RXD),
1883 GPIO_FN(PORT163_SCIFB_RTS_), \
1884 GPIO_FN(PORT163_SCIFA5_RTS_), \
1885 GPIO_FN(TPU3TO0),
1886 GPIO_FN(LCDD0),
1887 GPIO_FN(LCDD1), \
1888 GPIO_FN(PORT193_SCIFA5_CTS_), \
1889 GPIO_FN(BBIF2_TSYNC1),
1890 GPIO_FN(LCDD2), \
1891 GPIO_FN(PORT194_SCIFA5_RTS_), \
1892 GPIO_FN(BBIF2_TSCK1),
1893 GPIO_FN(LCDD3), \
1894 GPIO_FN(PORT195_SCIFA5_RXD), \
1895 GPIO_FN(BBIF2_TXD1),
1896 GPIO_FN(LCDD4), \
1897 GPIO_FN(PORT196_SCIFA5_TXD),
1898 GPIO_FN(LCDD5), \
1899 GPIO_FN(PORT197_SCIFA5_SCK), \
1900 GPIO_FN(MFG2_OUT2), \
1901 GPIO_FN(TPU2TO1),
1902 GPIO_FN(LCDD6),
1903 GPIO_FN(LCDD7), \
1904 GPIO_FN(TPU4TO1), \
1905 GPIO_FN(MFG4_OUT2),
1906 GPIO_FN(LCDD8), \
1907 GPIO_FN(D16),
1908 GPIO_FN(LCDD9), \
1909 GPIO_FN(D17),
1910 GPIO_FN(LCDD10), \
1911 GPIO_FN(D18),
1912 GPIO_FN(LCDD11), \
1913 GPIO_FN(D19),
1914 GPIO_FN(LCDD12), \
1915 GPIO_FN(D20),
1916 GPIO_FN(LCDD13), \
1917 GPIO_FN(D21),
1918 GPIO_FN(LCDD14), \
1919 GPIO_FN(D22),
1920 GPIO_FN(LCDD15), \
1921 GPIO_FN(PORT207_MSIOF0L_SS1), \
1922 GPIO_FN(D23),
1923 GPIO_FN(LCDD16), \
1924 GPIO_FN(PORT208_MSIOF0L_SS2), \
1925 GPIO_FN(D24),
1926 GPIO_FN(LCDD17), \
1927 GPIO_FN(D25),
1928 GPIO_FN(LCDD18), \
1929 GPIO_FN(DREQ2), \
1930 GPIO_FN(PORT210_MSIOF0L_SS1), \
1931 GPIO_FN(D26),
1932 GPIO_FN(LCDD19), \
1933 GPIO_FN(PORT211_MSIOF0L_SS2), \
1934 GPIO_FN(D27),
1935 GPIO_FN(LCDD20), \
1936 GPIO_FN(TS_SPSYNC1), \
1937 GPIO_FN(MSIOF0L_MCK0), \
1938 GPIO_FN(D28),
1939 GPIO_FN(LCDD21), \
1940 GPIO_FN(TS_SDAT1), \
1941 GPIO_FN(MSIOF0L_MCK1), \
1942 GPIO_FN(D29),
1943 GPIO_FN(LCDD22), \
1944 GPIO_FN(TS_SDEN1), \
1945 GPIO_FN(MSIOF0L_RSCK), \
1946 GPIO_FN(D30),
1947 GPIO_FN(LCDD23), \
1948 GPIO_FN(TS_SCK1), \
1949 GPIO_FN(MSIOF0L_RSYNC), \
1950 GPIO_FN(D31),
1951 GPIO_FN(LCDDCK), \
1952 GPIO_FN(LCDWR_),
1953 GPIO_FN(LCDRD_), \
1954 GPIO_FN(DACK2), \
1955 GPIO_FN(PORT217_LCD2RS), \
1956 GPIO_FN(MSIOF0L_TSYNC), \
1957 GPIO_FN(VIO2_FIELD3), \
1958 GPIO_FN(PORT217_LCD2DISP),
1959 GPIO_FN(LCDHSYN), \
1960 GPIO_FN(LCDCS_), \
1961 GPIO_FN(LCDCS2_), \
1962 GPIO_FN(DACK3), \
1963 GPIO_FN(PORT218_VIO_CKOR),
1964 GPIO_FN(LCDDISP), \
1965 GPIO_FN(LCDRS), \
1966 GPIO_FN(PORT219_LCD2WR_), \
1967 GPIO_FN(DREQ3), \
1968 GPIO_FN(MSIOF0L_TSCK), \
1969 GPIO_FN(VIO2_CLK3), \
1970 GPIO_FN(LCD2DCK_2),
1971 GPIO_FN(LCDVSYN), \
1972 GPIO_FN(LCDVSYN2),
1973 GPIO_FN(LCDLCLK), \
1974 GPIO_FN(DREQ1), \
1975 GPIO_FN(PORT221_LCD2CS_), \
1976 GPIO_FN(PWEN), \
1977 GPIO_FN(MSIOF0L_RXD), \
1978 GPIO_FN(VIO2_HD3), \
1979 GPIO_FN(PORT221_LCD2HSYN),
1980 GPIO_FN(LCDDON), \
1981 GPIO_FN(LCDDON2), \
1982 GPIO_FN(DACK1), \
1983 GPIO_FN(OVCN), \
1984 GPIO_FN(MSIOF0L_TXD), \
1985 GPIO_FN(VIO2_VD3), \
1986 GPIO_FN(PORT222_LCD2VSYN),
1987
1988 GPIO_FN(SCIFA1_TXD), \
1989 GPIO_FN(OVCN2),
1990 GPIO_FN(EXTLP), \
1991 GPIO_FN(SCIFA1_SCK), \
1992 GPIO_FN(PORT226_VIO_CKO2),
1993 GPIO_FN(SCIFA1_RTS_), \
1994 GPIO_FN(IDIN),
1995 GPIO_FN(SCIFA1_RXD),
1996 GPIO_FN(SCIFA1_CTS_), \
1997 GPIO_FN(MFG1_IN1),
1998 GPIO_FN(MSIOF1_TXD), \
1999 GPIO_FN(SCIFA2_TXD2),
2000 GPIO_FN(MSIOF1_TSYNC), \
2001 GPIO_FN(SCIFA2_CTS2_),
2002 GPIO_FN(MSIOF1_TSCK), \
2003 GPIO_FN(SCIFA2_SCK2),
2004 GPIO_FN(MSIOF1_RXD), \
2005 GPIO_FN(SCIFA2_RXD2),
2006 GPIO_FN(MSIOF1_RSCK), \
2007 GPIO_FN(SCIFA2_RTS2_), \
2008 GPIO_FN(VIO2_CLK2), \
2009 GPIO_FN(LCD2D20),
2010 GPIO_FN(MSIOF1_RSYNC), \
2011 GPIO_FN(MFG1_IN2), \
2012 GPIO_FN(VIO2_VD2), \
2013 GPIO_FN(LCD2D21),
2014 GPIO_FN(MSIOF1_MCK0), \
2015 GPIO_FN(PORT236_I2C_SDA2),
2016 GPIO_FN(MSIOF1_MCK1), \
2017 GPIO_FN(PORT237_I2C_SCL2),
2018 GPIO_FN(MSIOF1_SS1), \
2019 GPIO_FN(VIO2_FIELD2), \
2020 GPIO_FN(LCD2D22),
2021 GPIO_FN(MSIOF1_SS2), \
2022 GPIO_FN(VIO2_HD2), \
2023 GPIO_FN(LCD2D23),
2024 GPIO_FN(SCIFA6_TXD),
2025 GPIO_FN(PORT241_IRDA_OUT), \
2026 GPIO_FN(PORT241_IROUT), \
2027 GPIO_FN(MFG4_OUT1), \
2028 GPIO_FN(TPU4TO0),
2029 GPIO_FN(PORT242_IRDA_IN), \
2030 GPIO_FN(MFG4_IN2),
2031 GPIO_FN(PORT243_IRDA_FIRSEL), \
2032 GPIO_FN(PORT243_VIO_CKO2),
2033 GPIO_FN(PORT244_SCIFA5_CTS_), \
2034 GPIO_FN(MFG2_IN1), \
2035 GPIO_FN(PORT244_SCIFB_CTS_), \
2036 GPIO_FN(MSIOF2R_RXD),
2037 GPIO_FN(PORT245_SCIFA5_RTS_), \
2038 GPIO_FN(MFG2_IN2), \
2039 GPIO_FN(PORT245_SCIFB_RTS_), \
2040 GPIO_FN(MSIOF2R_TXD),
2041 GPIO_FN(PORT246_SCIFA5_RXD), \
2042 GPIO_FN(MFG1_OUT1), \
2043 GPIO_FN(PORT246_SCIFB_RXD), \
2044 GPIO_FN(TPU1TO0),
2045 GPIO_FN(PORT247_SCIFA5_TXD), \
2046 GPIO_FN(MFG3_OUT2), \
2047 GPIO_FN(PORT247_SCIFB_TXD), \
2048 GPIO_FN(TPU3TO1),
2049 GPIO_FN(PORT248_SCIFA5_SCK), \
2050 GPIO_FN(MFG2_OUT1), \
2051 GPIO_FN(PORT248_SCIFB_SCK), \
2052 GPIO_FN(TPU2TO0), \
2053 GPIO_FN(PORT248_I2C_SCL3), \
2054 GPIO_FN(MSIOF2R_TSCK),
2055 GPIO_FN(PORT249_IROUT), \
2056 GPIO_FN(MFG4_IN1), \
2057 GPIO_FN(PORT249_I2C_SDA3), \
2058 GPIO_FN(MSIOF2R_TSYNC),
2059 GPIO_FN(SDHICLK0),
2060 GPIO_FN(SDHICD0),
2061 GPIO_FN(SDHID0_0),
2062 GPIO_FN(SDHID0_1),
2063 GPIO_FN(SDHID0_2),
2064 GPIO_FN(SDHID0_3),
2065 GPIO_FN(SDHICMD0),
2066 GPIO_FN(SDHIWP0),
2067 GPIO_FN(SDHICLK1),
2068 GPIO_FN(SDHID1_0), \
2069 GPIO_FN(TS_SPSYNC2),
2070 GPIO_FN(SDHID1_1), \
2071 GPIO_FN(TS_SDAT2),
2072 GPIO_FN(SDHID1_2), \
2073 GPIO_FN(TS_SDEN2),
2074 GPIO_FN(SDHID1_3), \
2075 GPIO_FN(TS_SCK2),
2076 GPIO_FN(SDHICMD1),
2077 GPIO_FN(SDHICLK2),
2078 GPIO_FN(SDHID2_0), \
2079 GPIO_FN(TS_SPSYNC4),
2080 GPIO_FN(SDHID2_1), \
2081 GPIO_FN(TS_SDAT4),
2082 GPIO_FN(SDHID2_2), \
2083 GPIO_FN(TS_SDEN4),
2084 GPIO_FN(SDHID2_3), \
2085 GPIO_FN(TS_SCK4),
2086 GPIO_FN(SDHICMD2),
2087 GPIO_FN(MMCCLK0),
2088 GPIO_FN(MMCD0_0),
2089 GPIO_FN(MMCD0_1),
2090 GPIO_FN(MMCD0_2),
2091 GPIO_FN(MMCD0_3),
2092 GPIO_FN(MMCD0_4), \
2093 GPIO_FN(TS_SPSYNC5),
2094 GPIO_FN(MMCD0_5), \
2095 GPIO_FN(TS_SDAT5),
2096 GPIO_FN(MMCD0_6), \
2097 GPIO_FN(TS_SDEN5),
2098 GPIO_FN(MMCD0_7), \
2099 GPIO_FN(TS_SCK5),
2100 GPIO_FN(MMCCMD0),
2101 GPIO_FN(RESETOUTS_), \
2102 GPIO_FN(EXTAL2OUT),
2103 GPIO_FN(MCP_WAIT__MCP_FRB),
2104 GPIO_FN(MCP_CKO), \
2105 GPIO_FN(MMCCLK1),
2106 GPIO_FN(MCP_D15_MCP_NAF15),
2107 GPIO_FN(MCP_D14_MCP_NAF14),
2108 GPIO_FN(MCP_D13_MCP_NAF13),
2109 GPIO_FN(MCP_D12_MCP_NAF12),
2110 GPIO_FN(MCP_D11_MCP_NAF11),
2111 GPIO_FN(MCP_D10_MCP_NAF10),
2112 GPIO_FN(MCP_D9_MCP_NAF9),
2113 GPIO_FN(MCP_D8_MCP_NAF8), \
2114 GPIO_FN(MMCCMD1),
2115 GPIO_FN(MCP_D7_MCP_NAF7), \
2116 GPIO_FN(MMCD1_7),
2117
2118 GPIO_FN(MCP_D6_MCP_NAF6), \
2119 GPIO_FN(MMCD1_6),
2120 GPIO_FN(MCP_D5_MCP_NAF5), \
2121 GPIO_FN(MMCD1_5),
2122 GPIO_FN(MCP_D4_MCP_NAF4), \
2123 GPIO_FN(MMCD1_4),
2124 GPIO_FN(MCP_D3_MCP_NAF3), \
2125 GPIO_FN(MMCD1_3),
2126 GPIO_FN(MCP_D2_MCP_NAF2), \
2127 GPIO_FN(MMCD1_2),
2128 GPIO_FN(MCP_D1_MCP_NAF1), \
2129 GPIO_FN(MMCD1_1),
2130 GPIO_FN(MCP_D0_MCP_NAF0), \
2131 GPIO_FN(MMCD1_0),
2132 GPIO_FN(MCP_NBRSTOUT_),
2133 GPIO_FN(MCP_WE0__MCP_FWE), \
2134 GPIO_FN(MCP_RDWR_MCP_FWE),
2135
2136 /* MSEL2 special cases */
2137 GPIO_FN(TSIF2_TS_XX1),
2138 GPIO_FN(TSIF2_TS_XX2),
2139 GPIO_FN(TSIF2_TS_XX3),
2140 GPIO_FN(TSIF2_TS_XX4),
2141 GPIO_FN(TSIF2_TS_XX5),
2142 GPIO_FN(TSIF1_TS_XX1),
2143 GPIO_FN(TSIF1_TS_XX2),
2144 GPIO_FN(TSIF1_TS_XX3),
2145 GPIO_FN(TSIF1_TS_XX4),
2146 GPIO_FN(TSIF1_TS_XX5),
2147 GPIO_FN(TSIF0_TS_XX1),
2148 GPIO_FN(TSIF0_TS_XX2),
2149 GPIO_FN(TSIF0_TS_XX3),
2150 GPIO_FN(TSIF0_TS_XX4),
2151 GPIO_FN(TSIF0_TS_XX5),
2152 GPIO_FN(MST1_TS_XX1),
2153 GPIO_FN(MST1_TS_XX2),
2154 GPIO_FN(MST1_TS_XX3),
2155 GPIO_FN(MST1_TS_XX4),
2156 GPIO_FN(MST1_TS_XX5),
2157 GPIO_FN(MST0_TS_XX1),
2158 GPIO_FN(MST0_TS_XX2),
2159 GPIO_FN(MST0_TS_XX3),
2160 GPIO_FN(MST0_TS_XX4),
2161 GPIO_FN(MST0_TS_XX5),
2162
2163 /* MSEL3 special cases */
2164 GPIO_FN(SDHI0_VCCQ_MC0_ON),
2165 GPIO_FN(SDHI0_VCCQ_MC0_OFF),
2166 GPIO_FN(DEBUG_MON_VIO),
2167 GPIO_FN(DEBUG_MON_LCDD),
2168 GPIO_FN(LCDC_LCDC0),
2169 GPIO_FN(LCDC_LCDC1),
2170
2171 /* MSEL4 special cases */
2172 GPIO_FN(IRQ9_MEM_INT),
2173 GPIO_FN(IRQ9_MCP_INT),
2174 GPIO_FN(A11),
2175 GPIO_FN(KEYOUT8),
2176 GPIO_FN(TPU4TO3),
2177 GPIO_FN(RESETA_N_PU_ON),
2178 GPIO_FN(RESETA_N_PU_OFF),
2179 GPIO_FN(EDBGREQ_PD),
2180 GPIO_FN(EDBGREQ_PU),
2181
2182 /* Functions with pull-ups */
2183 GPIO_FN(KEYIN0_PU),
2184 GPIO_FN(KEYIN1_PU),
2185 GPIO_FN(KEYIN2_PU),
2186 GPIO_FN(KEYIN3_PU),
2187 GPIO_FN(KEYIN4_PU),
2188 GPIO_FN(KEYIN5_PU),
2189 GPIO_FN(KEYIN6_PU),
2190 GPIO_FN(KEYIN7_PU),
2191 GPIO_FN(SDHICD0_PU),
2192 GPIO_FN(SDHID0_0_PU),
2193 GPIO_FN(SDHID0_1_PU),
2194 GPIO_FN(SDHID0_2_PU),
2195 GPIO_FN(SDHID0_3_PU),
2196 GPIO_FN(SDHICMD0_PU),
2197 GPIO_FN(SDHIWP0_PU),
2198 GPIO_FN(SDHID1_0_PU),
2199 GPIO_FN(SDHID1_1_PU),
2200 GPIO_FN(SDHID1_2_PU),
2201 GPIO_FN(SDHID1_3_PU),
2202 GPIO_FN(SDHICMD1_PU),
2203 GPIO_FN(SDHID2_0_PU),
2204 GPIO_FN(SDHID2_1_PU),
2205 GPIO_FN(SDHID2_2_PU),
2206 GPIO_FN(SDHID2_3_PU),
2207 GPIO_FN(SDHICMD2_PU),
2208 GPIO_FN(MMCCMD0_PU),
2209 GPIO_FN(MMCCMD1_PU),
2210 GPIO_FN(MMCD0_0_PU),
2211 GPIO_FN(MMCD0_1_PU),
2212 GPIO_FN(MMCD0_2_PU),
2213 GPIO_FN(MMCD0_3_PU),
2214 GPIO_FN(MMCD0_4_PU),
2215 GPIO_FN(MMCD0_5_PU),
2216 GPIO_FN(MMCD0_6_PU),
2217 GPIO_FN(MMCD0_7_PU),
2218 GPIO_FN(FSIACK_PU),
2219 GPIO_FN(FSIAILR_PU),
2220 GPIO_FN(FSIAIBT_PU),
2221 GPIO_FN(FSIAISLD_PU),
2222};
2223
2224static struct pinmux_cfg_reg pinmux_config_regs[] = {
2225 PORTCR(0, 0xe6050000), /* PORT0CR */
2226 PORTCR(1, 0xe6050001), /* PORT1CR */
2227 PORTCR(2, 0xe6050002), /* PORT2CR */
2228 PORTCR(3, 0xe6050003), /* PORT3CR */
2229 PORTCR(4, 0xe6050004), /* PORT4CR */
2230 PORTCR(5, 0xe6050005), /* PORT5CR */
2231 PORTCR(6, 0xe6050006), /* PORT6CR */
2232 PORTCR(7, 0xe6050007), /* PORT7CR */
2233 PORTCR(8, 0xe6050008), /* PORT8CR */
2234 PORTCR(9, 0xe6050009), /* PORT9CR */
2235
2236 PORTCR(10, 0xe605000a), /* PORT10CR */
2237 PORTCR(11, 0xe605000b), /* PORT11CR */
2238 PORTCR(12, 0xe605000c), /* PORT12CR */
2239 PORTCR(13, 0xe605000d), /* PORT13CR */
2240 PORTCR(14, 0xe605000e), /* PORT14CR */
2241 PORTCR(15, 0xe605000f), /* PORT15CR */
2242 PORTCR(16, 0xe6050010), /* PORT16CR */
2243 PORTCR(17, 0xe6050011), /* PORT17CR */
2244 PORTCR(18, 0xe6050012), /* PORT18CR */
2245 PORTCR(19, 0xe6050013), /* PORT19CR */
2246
2247 PORTCR(20, 0xe6050014), /* PORT20CR */
2248 PORTCR(21, 0xe6050015), /* PORT21CR */
2249 PORTCR(22, 0xe6050016), /* PORT22CR */
2250 PORTCR(23, 0xe6050017), /* PORT23CR */
2251 PORTCR(24, 0xe6050018), /* PORT24CR */
2252 PORTCR(25, 0xe6050019), /* PORT25CR */
2253 PORTCR(26, 0xe605001a), /* PORT26CR */
2254 PORTCR(27, 0xe605001b), /* PORT27CR */
2255 PORTCR(28, 0xe605001c), /* PORT28CR */
2256 PORTCR(29, 0xe605001d), /* PORT29CR */
2257
2258 PORTCR(30, 0xe605001e), /* PORT30CR */
2259 PORTCR(31, 0xe605001f), /* PORT31CR */
2260 PORTCR(32, 0xe6051020), /* PORT32CR */
2261 PORTCR(33, 0xe6051021), /* PORT33CR */
2262 PORTCR(34, 0xe6051022), /* PORT34CR */
2263 PORTCR(35, 0xe6051023), /* PORT35CR */
2264 PORTCR(36, 0xe6051024), /* PORT36CR */
2265 PORTCR(37, 0xe6051025), /* PORT37CR */
2266 PORTCR(38, 0xe6051026), /* PORT38CR */
2267 PORTCR(39, 0xe6051027), /* PORT39CR */
2268
2269 PORTCR(40, 0xe6051028), /* PORT40CR */
2270 PORTCR(41, 0xe6051029), /* PORT41CR */
2271 PORTCR(42, 0xe605102a), /* PORT42CR */
2272 PORTCR(43, 0xe605102b), /* PORT43CR */
2273 PORTCR(44, 0xe605102c), /* PORT44CR */
2274 PORTCR(45, 0xe605102d), /* PORT45CR */
2275 PORTCR(46, 0xe605102e), /* PORT46CR */
2276 PORTCR(47, 0xe605102f), /* PORT47CR */
2277 PORTCR(48, 0xe6051030), /* PORT48CR */
2278 PORTCR(49, 0xe6051031), /* PORT49CR */
2279
2280 PORTCR(50, 0xe6051032), /* PORT50CR */
2281 PORTCR(51, 0xe6051033), /* PORT51CR */
2282 PORTCR(52, 0xe6051034), /* PORT52CR */
2283 PORTCR(53, 0xe6051035), /* PORT53CR */
2284 PORTCR(54, 0xe6051036), /* PORT54CR */
2285 PORTCR(55, 0xe6051037), /* PORT55CR */
2286 PORTCR(56, 0xe6051038), /* PORT56CR */
2287 PORTCR(57, 0xe6051039), /* PORT57CR */
2288 PORTCR(58, 0xe605103a), /* PORT58CR */
2289 PORTCR(59, 0xe605103b), /* PORT59CR */
2290
2291 PORTCR(60, 0xe605103c), /* PORT60CR */
2292 PORTCR(61, 0xe605103d), /* PORT61CR */
2293 PORTCR(62, 0xe605103e), /* PORT62CR */
2294 PORTCR(63, 0xe605103f), /* PORT63CR */
2295 PORTCR(64, 0xe6051040), /* PORT64CR */
2296 PORTCR(65, 0xe6051041), /* PORT65CR */
2297 PORTCR(66, 0xe6051042), /* PORT66CR */
2298 PORTCR(67, 0xe6051043), /* PORT67CR */
2299 PORTCR(68, 0xe6051044), /* PORT68CR */
2300 PORTCR(69, 0xe6051045), /* PORT69CR */
2301
2302 PORTCR(70, 0xe6051046), /* PORT70CR */
2303 PORTCR(71, 0xe6051047), /* PORT71CR */
2304 PORTCR(72, 0xe6051048), /* PORT72CR */
2305 PORTCR(73, 0xe6051049), /* PORT73CR */
2306 PORTCR(74, 0xe605104a), /* PORT74CR */
2307 PORTCR(75, 0xe605104b), /* PORT75CR */
2308 PORTCR(76, 0xe605104c), /* PORT76CR */
2309 PORTCR(77, 0xe605104d), /* PORT77CR */
2310 PORTCR(78, 0xe605104e), /* PORT78CR */
2311 PORTCR(79, 0xe605104f), /* PORT79CR */
2312
2313 PORTCR(80, 0xe6051050), /* PORT80CR */
2314 PORTCR(81, 0xe6051051), /* PORT81CR */
2315 PORTCR(82, 0xe6051052), /* PORT82CR */
2316 PORTCR(83, 0xe6051053), /* PORT83CR */
2317 PORTCR(84, 0xe6051054), /* PORT84CR */
2318 PORTCR(85, 0xe6051055), /* PORT85CR */
2319 PORTCR(86, 0xe6051056), /* PORT86CR */
2320 PORTCR(87, 0xe6051057), /* PORT87CR */
2321 PORTCR(88, 0xe6051058), /* PORT88CR */
2322 PORTCR(89, 0xe6051059), /* PORT89CR */
2323
2324 PORTCR(90, 0xe605105a), /* PORT90CR */
2325 PORTCR(91, 0xe605105b), /* PORT91CR */
2326 PORTCR(92, 0xe605105c), /* PORT92CR */
2327 PORTCR(93, 0xe605105d), /* PORT93CR */
2328 PORTCR(94, 0xe605105e), /* PORT94CR */
2329 PORTCR(95, 0xe605105f), /* PORT95CR */
2330 PORTCR(96, 0xe6052060), /* PORT96CR */
2331 PORTCR(97, 0xe6052061), /* PORT97CR */
2332 PORTCR(98, 0xe6052062), /* PORT98CR */
2333 PORTCR(99, 0xe6052063), /* PORT99CR */
2334
2335 PORTCR(100, 0xe6052064), /* PORT100CR */
2336 PORTCR(101, 0xe6052065), /* PORT101CR */
2337 PORTCR(102, 0xe6052066), /* PORT102CR */
2338 PORTCR(103, 0xe6052067), /* PORT103CR */
2339 PORTCR(104, 0xe6052068), /* PORT104CR */
2340 PORTCR(105, 0xe6052069), /* PORT105CR */
2341 PORTCR(106, 0xe605206a), /* PORT106CR */
2342 PORTCR(107, 0xe605206b), /* PORT107CR */
2343 PORTCR(108, 0xe605206c), /* PORT108CR */
2344 PORTCR(109, 0xe605206d), /* PORT109CR */
2345
2346 PORTCR(110, 0xe605206e), /* PORT110CR */
2347 PORTCR(111, 0xe605206f), /* PORT111CR */
2348 PORTCR(112, 0xe6052070), /* PORT112CR */
2349 PORTCR(113, 0xe6052071), /* PORT113CR */
2350 PORTCR(114, 0xe6052072), /* PORT114CR */
2351 PORTCR(115, 0xe6052073), /* PORT115CR */
2352 PORTCR(116, 0xe6052074), /* PORT116CR */
2353 PORTCR(117, 0xe6052075), /* PORT117CR */
2354 PORTCR(118, 0xe6052076), /* PORT118CR */
2355
2356 PORTCR(128, 0xe6052080), /* PORT128CR */
2357 PORTCR(129, 0xe6052081), /* PORT129CR */
2358
2359 PORTCR(130, 0xe6052082), /* PORT130CR */
2360 PORTCR(131, 0xe6052083), /* PORT131CR */
2361 PORTCR(132, 0xe6052084), /* PORT132CR */
2362 PORTCR(133, 0xe6052085), /* PORT133CR */
2363 PORTCR(134, 0xe6052086), /* PORT134CR */
2364 PORTCR(135, 0xe6052087), /* PORT135CR */
2365 PORTCR(136, 0xe6052088), /* PORT136CR */
2366 PORTCR(137, 0xe6052089), /* PORT137CR */
2367 PORTCR(138, 0xe605208a), /* PORT138CR */
2368 PORTCR(139, 0xe605208b), /* PORT139CR */
2369
2370 PORTCR(140, 0xe605208c), /* PORT140CR */
2371 PORTCR(141, 0xe605208d), /* PORT141CR */
2372 PORTCR(142, 0xe605208e), /* PORT142CR */
2373 PORTCR(143, 0xe605208f), /* PORT143CR */
2374 PORTCR(144, 0xe6052090), /* PORT144CR */
2375 PORTCR(145, 0xe6052091), /* PORT145CR */
2376 PORTCR(146, 0xe6052092), /* PORT146CR */
2377 PORTCR(147, 0xe6052093), /* PORT147CR */
2378 PORTCR(148, 0xe6052094), /* PORT148CR */
2379 PORTCR(149, 0xe6052095), /* PORT149CR */
2380
2381 PORTCR(150, 0xe6052096), /* PORT150CR */
2382 PORTCR(151, 0xe6052097), /* PORT151CR */
2383 PORTCR(152, 0xe6052098), /* PORT152CR */
2384 PORTCR(153, 0xe6052099), /* PORT153CR */
2385 PORTCR(154, 0xe605209a), /* PORT154CR */
2386 PORTCR(155, 0xe605209b), /* PORT155CR */
2387 PORTCR(156, 0xe605209c), /* PORT156CR */
2388 PORTCR(157, 0xe605209d), /* PORT157CR */
2389 PORTCR(158, 0xe605209e), /* PORT158CR */
2390 PORTCR(159, 0xe605209f), /* PORT159CR */
2391
2392 PORTCR(160, 0xe60520a0), /* PORT160CR */
2393 PORTCR(161, 0xe60520a1), /* PORT161CR */
2394 PORTCR(162, 0xe60520a2), /* PORT162CR */
2395 PORTCR(163, 0xe60520a3), /* PORT163CR */
2396 PORTCR(164, 0xe60520a4), /* PORT164CR */
2397
2398 PORTCR(192, 0xe60520c0), /* PORT192CR */
2399 PORTCR(193, 0xe60520c1), /* PORT193CR */
2400 PORTCR(194, 0xe60520c2), /* PORT194CR */
2401 PORTCR(195, 0xe60520c3), /* PORT195CR */
2402 PORTCR(196, 0xe60520c4), /* PORT196CR */
2403 PORTCR(197, 0xe60520c5), /* PORT197CR */
2404 PORTCR(198, 0xe60520c6), /* PORT198CR */
2405 PORTCR(199, 0xe60520c7), /* PORT199CR */
2406
2407 PORTCR(200, 0xe60520c8), /* PORT200CR */
2408 PORTCR(201, 0xe60520c9), /* PORT201CR */
2409 PORTCR(202, 0xe60520ca), /* PORT202CR */
2410 PORTCR(203, 0xe60520cb), /* PORT203CR */
2411 PORTCR(204, 0xe60520cc), /* PORT204CR */
2412 PORTCR(205, 0xe60520cd), /* PORT205CR */
2413 PORTCR(206, 0xe60520ce), /* PORT206CR */
2414 PORTCR(207, 0xe60520cf), /* PORT207CR */
2415 PORTCR(208, 0xe60520d0), /* PORT208CR */
2416 PORTCR(209, 0xe60520d1), /* PORT209CR */
2417
2418 PORTCR(210, 0xe60520d2), /* PORT210CR */
2419 PORTCR(211, 0xe60520d3), /* PORT211CR */
2420 PORTCR(212, 0xe60520d4), /* PORT212CR */
2421 PORTCR(213, 0xe60520d5), /* PORT213CR */
2422 PORTCR(214, 0xe60520d6), /* PORT214CR */
2423 PORTCR(215, 0xe60520d7), /* PORT215CR */
2424 PORTCR(216, 0xe60520d8), /* PORT216CR */
2425 PORTCR(217, 0xe60520d9), /* PORT217CR */
2426 PORTCR(218, 0xe60520da), /* PORT218CR */
2427 PORTCR(219, 0xe60520db), /* PORT219CR */
2428
2429 PORTCR(220, 0xe60520dc), /* PORT220CR */
2430 PORTCR(221, 0xe60520dd), /* PORT221CR */
2431 PORTCR(222, 0xe60520de), /* PORT222CR */
2432 PORTCR(223, 0xe60520df), /* PORT223CR */
2433 PORTCR(224, 0xe60530e0), /* PORT224CR */
2434 PORTCR(225, 0xe60530e1), /* PORT225CR */
2435 PORTCR(226, 0xe60530e2), /* PORT226CR */
2436 PORTCR(227, 0xe60530e3), /* PORT227CR */
2437 PORTCR(228, 0xe60530e4), /* PORT228CR */
2438 PORTCR(229, 0xe60530e5), /* PORT229CR */
2439
2440 PORTCR(230, 0xe60530e6), /* PORT230CR */
2441 PORTCR(231, 0xe60530e7), /* PORT231CR */
2442 PORTCR(232, 0xe60530e8), /* PORT232CR */
2443 PORTCR(233, 0xe60530e9), /* PORT233CR */
2444 PORTCR(234, 0xe60530ea), /* PORT234CR */
2445 PORTCR(235, 0xe60530eb), /* PORT235CR */
2446 PORTCR(236, 0xe60530ec), /* PORT236CR */
2447 PORTCR(237, 0xe60530ed), /* PORT237CR */
2448 PORTCR(238, 0xe60530ee), /* PORT238CR */
2449 PORTCR(239, 0xe60530ef), /* PORT239CR */
2450
2451 PORTCR(240, 0xe60530f0), /* PORT240CR */
2452 PORTCR(241, 0xe60530f1), /* PORT241CR */
2453 PORTCR(242, 0xe60530f2), /* PORT242CR */
2454 PORTCR(243, 0xe60530f3), /* PORT243CR */
2455 PORTCR(244, 0xe60530f4), /* PORT244CR */
2456 PORTCR(245, 0xe60530f5), /* PORT245CR */
2457 PORTCR(246, 0xe60530f6), /* PORT246CR */
2458 PORTCR(247, 0xe60530f7), /* PORT247CR */
2459 PORTCR(248, 0xe60530f8), /* PORT248CR */
2460 PORTCR(249, 0xe60530f9), /* PORT249CR */
2461
2462 PORTCR(250, 0xe60530fa), /* PORT250CR */
2463 PORTCR(251, 0xe60530fb), /* PORT251CR */
2464 PORTCR(252, 0xe60530fc), /* PORT252CR */
2465 PORTCR(253, 0xe60530fd), /* PORT253CR */
2466 PORTCR(254, 0xe60530fe), /* PORT254CR */
2467 PORTCR(255, 0xe60530ff), /* PORT255CR */
2468 PORTCR(256, 0xe6053100), /* PORT256CR */
2469 PORTCR(257, 0xe6053101), /* PORT257CR */
2470 PORTCR(258, 0xe6053102), /* PORT258CR */
2471 PORTCR(259, 0xe6053103), /* PORT259CR */
2472
2473 PORTCR(260, 0xe6053104), /* PORT260CR */
2474 PORTCR(261, 0xe6053105), /* PORT261CR */
2475 PORTCR(262, 0xe6053106), /* PORT262CR */
2476 PORTCR(263, 0xe6053107), /* PORT263CR */
2477 PORTCR(264, 0xe6053108), /* PORT264CR */
2478 PORTCR(265, 0xe6053109), /* PORT265CR */
2479 PORTCR(266, 0xe605310a), /* PORT266CR */
2480 PORTCR(267, 0xe605310b), /* PORT267CR */
2481 PORTCR(268, 0xe605310c), /* PORT268CR */
2482 PORTCR(269, 0xe605310d), /* PORT269CR */
2483
2484 PORTCR(270, 0xe605310e), /* PORT270CR */
2485 PORTCR(271, 0xe605310f), /* PORT271CR */
2486 PORTCR(272, 0xe6053110), /* PORT272CR */
2487 PORTCR(273, 0xe6053111), /* PORT273CR */
2488 PORTCR(274, 0xe6053112), /* PORT274CR */
2489 PORTCR(275, 0xe6053113), /* PORT275CR */
2490 PORTCR(276, 0xe6053114), /* PORT276CR */
2491 PORTCR(277, 0xe6053115), /* PORT277CR */
2492 PORTCR(278, 0xe6053116), /* PORT278CR */
2493 PORTCR(279, 0xe6053117), /* PORT279CR */
2494
2495 PORTCR(280, 0xe6053118), /* PORT280CR */
2496 PORTCR(281, 0xe6053119), /* PORT281CR */
2497 PORTCR(282, 0xe605311a), /* PORT282CR */
2498
2499 PORTCR(288, 0xe6052120), /* PORT288CR */
2500 PORTCR(289, 0xe6052121), /* PORT289CR */
2501
2502 PORTCR(290, 0xe6052122), /* PORT290CR */
2503 PORTCR(291, 0xe6052123), /* PORT291CR */
2504 PORTCR(292, 0xe6052124), /* PORT292CR */
2505 PORTCR(293, 0xe6052125), /* PORT293CR */
2506 PORTCR(294, 0xe6052126), /* PORT294CR */
2507 PORTCR(295, 0xe6052127), /* PORT295CR */
2508 PORTCR(296, 0xe6052128), /* PORT296CR */
2509 PORTCR(297, 0xe6052129), /* PORT297CR */
2510 PORTCR(298, 0xe605212a), /* PORT298CR */
2511 PORTCR(299, 0xe605212b), /* PORT299CR */
2512
2513 PORTCR(300, 0xe605212c), /* PORT300CR */
2514 PORTCR(301, 0xe605212d), /* PORT301CR */
2515 PORTCR(302, 0xe605212e), /* PORT302CR */
2516 PORTCR(303, 0xe605212f), /* PORT303CR */
2517 PORTCR(304, 0xe6052130), /* PORT304CR */
2518 PORTCR(305, 0xe6052131), /* PORT305CR */
2519 PORTCR(306, 0xe6052132), /* PORT306CR */
2520 PORTCR(307, 0xe6052133), /* PORT307CR */
2521 PORTCR(308, 0xe6052134), /* PORT308CR */
2522 PORTCR(309, 0xe6052135), /* PORT309CR */
2523
2524 { PINMUX_CFG_REG("MSEL2CR", 0xe605801c, 32, 1) {
2525 0, 0,
2526 0, 0,
2527 0, 0,
2528 0, 0,
2529 0, 0,
2530 0, 0,
2531 0, 0,
2532 0, 0,
2533 0, 0,
2534 0, 0,
2535 0, 0,
2536 0, 0,
2537 MSEL2CR_MSEL19_0, MSEL2CR_MSEL19_1,
2538 MSEL2CR_MSEL18_0, MSEL2CR_MSEL18_1,
2539 MSEL2CR_MSEL17_0, MSEL2CR_MSEL17_1,
2540 MSEL2CR_MSEL16_0, MSEL2CR_MSEL16_1,
2541 0, 0,
2542 MSEL2CR_MSEL14_0, MSEL2CR_MSEL14_1,
2543 MSEL2CR_MSEL13_0, MSEL2CR_MSEL13_1,
2544 MSEL2CR_MSEL12_0, MSEL2CR_MSEL12_1,
2545 MSEL2CR_MSEL11_0, MSEL2CR_MSEL11_1,
2546 MSEL2CR_MSEL10_0, MSEL2CR_MSEL10_1,
2547 MSEL2CR_MSEL9_0, MSEL2CR_MSEL9_1,
2548 MSEL2CR_MSEL8_0, MSEL2CR_MSEL8_1,
2549 MSEL2CR_MSEL7_0, MSEL2CR_MSEL7_1,
2550 MSEL2CR_MSEL6_0, MSEL2CR_MSEL6_1,
2551 MSEL2CR_MSEL5_0, MSEL2CR_MSEL5_1,
2552 MSEL2CR_MSEL4_0, MSEL2CR_MSEL4_1,
2553 MSEL2CR_MSEL3_0, MSEL2CR_MSEL3_1,
2554 MSEL2CR_MSEL2_0, MSEL2CR_MSEL2_1,
2555 MSEL2CR_MSEL1_0, MSEL2CR_MSEL1_1,
2556 MSEL2CR_MSEL0_0, MSEL2CR_MSEL0_1,
2557 }
2558 },
2559 { PINMUX_CFG_REG("MSEL3CR", 0xe6058020, 32, 1) {
2560 0, 0,
2561 0, 0,
2562 0, 0,
2563 MSEL3CR_MSEL28_0, MSEL3CR_MSEL28_1,
2564 0, 0,
2565 0, 0,
2566 0, 0,
2567 0, 0,
2568 0, 0,
2569 0, 0,
2570 0, 0,
2571 0, 0,
2572 0, 0,
2573 0, 0,
2574 0, 0,
2575 0, 0,
2576 MSEL3CR_MSEL15_0, MSEL3CR_MSEL15_1,
2577 0, 0,
2578 0, 0,
2579 0, 0,
2580 MSEL3CR_MSEL11_0, MSEL3CR_MSEL11_1,
2581 0, 0,
2582 MSEL3CR_MSEL9_0, MSEL3CR_MSEL9_1,
2583 0, 0,
2584 0, 0,
2585 MSEL3CR_MSEL6_0, MSEL3CR_MSEL6_1,
2586 0, 0,
2587 0, 0,
2588 0, 0,
2589 MSEL3CR_MSEL2_0, MSEL3CR_MSEL2_1,
2590 0, 0,
2591 0, 0,
2592 }
2593 },
2594 { PINMUX_CFG_REG("MSEL4CR", 0xe6058024, 32, 1) {
2595 0, 0,
2596 0, 0,
2597 MSEL4CR_MSEL29_0, MSEL4CR_MSEL29_1,
2598 0, 0,
2599 MSEL4CR_MSEL27_0, MSEL4CR_MSEL27_1,
2600 MSEL4CR_MSEL26_0, MSEL4CR_MSEL26_1,
2601 0, 0,
2602 0, 0,
2603 0, 0,
2604 MSEL4CR_MSEL22_0, MSEL4CR_MSEL22_1,
2605 MSEL4CR_MSEL21_0, MSEL4CR_MSEL21_1,
2606 MSEL4CR_MSEL20_0, MSEL4CR_MSEL20_1,
2607 MSEL4CR_MSEL19_0, MSEL4CR_MSEL19_1,
2608 0, 0,
2609 0, 0,
2610 0, 0,
2611 MSEL4CR_MSEL15_0, MSEL4CR_MSEL15_1,
2612 0, 0,
2613 MSEL4CR_MSEL13_0, MSEL4CR_MSEL13_1,
2614 MSEL4CR_MSEL12_0, MSEL4CR_MSEL12_1,
2615 MSEL4CR_MSEL11_0, MSEL4CR_MSEL11_1,
2616 MSEL4CR_MSEL10_0, MSEL4CR_MSEL10_1,
2617 MSEL4CR_MSEL9_0, MSEL4CR_MSEL9_1,
2618 MSEL4CR_MSEL8_0, MSEL4CR_MSEL8_1,
2619 MSEL4CR_MSEL7_0, MSEL4CR_MSEL7_1,
2620 0, 0,
2621 0, 0,
2622 MSEL4CR_MSEL4_0, MSEL4CR_MSEL4_1,
2623 0, 0,
2624 0, 0,
2625 MSEL4CR_MSEL1_0, MSEL4CR_MSEL1_1,
2626 0, 0,
2627 }
2628 },
2629 { },
2630};
2631
2632static struct pinmux_data_reg pinmux_data_regs[] = {
2633 { PINMUX_DATA_REG("PORTL031_000DR", 0xe6054000, 32) {
2634 PORT31_DATA, PORT30_DATA, PORT29_DATA, PORT28_DATA,
2635 PORT27_DATA, PORT26_DATA, PORT25_DATA, PORT24_DATA,
2636 PORT23_DATA, PORT22_DATA, PORT21_DATA, PORT20_DATA,
2637 PORT19_DATA, PORT18_DATA, PORT17_DATA, PORT16_DATA,
2638 PORT15_DATA, PORT14_DATA, PORT13_DATA, PORT12_DATA,
2639 PORT11_DATA, PORT10_DATA, PORT9_DATA, PORT8_DATA,
2640 PORT7_DATA, PORT6_DATA, PORT5_DATA, PORT4_DATA,
2641 PORT3_DATA, PORT2_DATA, PORT1_DATA, PORT0_DATA }
2642 },
2643 { PINMUX_DATA_REG("PORTD063_032DR", 0xe6055000, 32) {
2644 PORT63_DATA, PORT62_DATA, PORT61_DATA, PORT60_DATA,
2645 PORT59_DATA, PORT58_DATA, PORT57_DATA, PORT56_DATA,
2646 PORT55_DATA, PORT54_DATA, PORT53_DATA, PORT52_DATA,
2647 PORT51_DATA, PORT50_DATA, PORT49_DATA, PORT48_DATA,
2648 PORT47_DATA, PORT46_DATA, PORT45_DATA, PORT44_DATA,
2649 PORT43_DATA, PORT42_DATA, PORT41_DATA, PORT40_DATA,
2650 PORT39_DATA, PORT38_DATA, PORT37_DATA, PORT36_DATA,
2651 PORT35_DATA, PORT34_DATA, PORT33_DATA, PORT32_DATA }
2652 },
2653 { PINMUX_DATA_REG("PORTD095_064DR", 0xe6055004, 32) {
2654 PORT95_DATA, PORT94_DATA, PORT93_DATA, PORT92_DATA,
2655 PORT91_DATA, PORT90_DATA, PORT89_DATA, PORT88_DATA,
2656 PORT87_DATA, PORT86_DATA, PORT85_DATA, PORT84_DATA,
2657 PORT83_DATA, PORT82_DATA, PORT81_DATA, PORT80_DATA,
2658 PORT79_DATA, PORT78_DATA, PORT77_DATA, PORT76_DATA,
2659 PORT75_DATA, PORT74_DATA, PORT73_DATA, PORT72_DATA,
2660 PORT71_DATA, PORT70_DATA, PORT69_DATA, PORT68_DATA,
2661 PORT67_DATA, PORT66_DATA, PORT65_DATA, PORT64_DATA }
2662 },
2663 { PINMUX_DATA_REG("PORTR127_096DR", 0xe6056000, 32) {
2664 0, 0, 0, 0,
2665 0, 0, 0, 0,
2666 0, PORT118_DATA, PORT117_DATA, PORT116_DATA,
2667 PORT115_DATA, PORT114_DATA, PORT113_DATA, PORT112_DATA,
2668 PORT111_DATA, PORT110_DATA, PORT109_DATA, PORT108_DATA,
2669 PORT107_DATA, PORT106_DATA, PORT105_DATA, PORT104_DATA,
2670 PORT103_DATA, PORT102_DATA, PORT101_DATA, PORT100_DATA,
2671 PORT99_DATA, PORT98_DATA, PORT97_DATA, PORT96_DATA }
2672 },
2673 { PINMUX_DATA_REG("PORTR159_128DR", 0xe6056004, 32) {
2674 PORT159_DATA, PORT158_DATA, PORT157_DATA, PORT156_DATA,
2675 PORT155_DATA, PORT154_DATA, PORT153_DATA, PORT152_DATA,
2676 PORT151_DATA, PORT150_DATA, PORT149_DATA, PORT148_DATA,
2677 PORT147_DATA, PORT146_DATA, PORT145_DATA, PORT144_DATA,
2678 PORT143_DATA, PORT142_DATA, PORT141_DATA, PORT140_DATA,
2679 PORT139_DATA, PORT138_DATA, PORT137_DATA, PORT136_DATA,
2680 PORT135_DATA, PORT134_DATA, PORT133_DATA, PORT132_DATA,
2681 PORT131_DATA, PORT130_DATA, PORT129_DATA, PORT128_DATA }
2682 },
2683 { PINMUX_DATA_REG("PORTR191_160DR", 0xe6056008, 32) {
2684 0, 0, 0, 0,
2685 0, 0, 0, 0,
2686 0, 0, 0, 0,
2687 0, 0, 0, 0,
2688 0, 0, 0, 0,
2689 0, 0, 0, 0,
2690 0, 0, 0, PORT164_DATA,
2691 PORT163_DATA, PORT162_DATA, PORT161_DATA, PORT160_DATA }
2692 },
2693 { PINMUX_DATA_REG("PORTR223_192DR", 0xe605600C, 32) {
2694 PORT223_DATA, PORT222_DATA, PORT221_DATA, PORT220_DATA,
2695 PORT219_DATA, PORT218_DATA, PORT217_DATA, PORT216_DATA,
2696 PORT215_DATA, PORT214_DATA, PORT213_DATA, PORT212_DATA,
2697 PORT211_DATA, PORT210_DATA, PORT209_DATA, PORT208_DATA,
2698 PORT207_DATA, PORT206_DATA, PORT205_DATA, PORT204_DATA,
2699 PORT203_DATA, PORT202_DATA, PORT201_DATA, PORT200_DATA,
2700 PORT199_DATA, PORT198_DATA, PORT197_DATA, PORT196_DATA,
2701 PORT195_DATA, PORT194_DATA, PORT193_DATA, PORT192_DATA }
2702 },
2703 { PINMUX_DATA_REG("PORTU255_224DR", 0xe6057000, 32) {
2704 PORT255_DATA, PORT254_DATA, PORT253_DATA, PORT252_DATA,
2705 PORT251_DATA, PORT250_DATA, PORT249_DATA, PORT248_DATA,
2706 PORT247_DATA, PORT246_DATA, PORT245_DATA, PORT244_DATA,
2707 PORT243_DATA, PORT242_DATA, PORT241_DATA, PORT240_DATA,
2708 PORT239_DATA, PORT238_DATA, PORT237_DATA, PORT236_DATA,
2709 PORT235_DATA, PORT234_DATA, PORT233_DATA, PORT232_DATA,
2710 PORT231_DATA, PORT230_DATA, PORT229_DATA, PORT228_DATA,
2711 PORT227_DATA, PORT226_DATA, PORT225_DATA, PORT224_DATA }
2712 },
2713 { PINMUX_DATA_REG("PORTU287_256DR", 0xe6057004, 32) {
2714 0, 0, 0, 0,
2715 0, PORT282_DATA, PORT281_DATA, PORT280_DATA,
2716 PORT279_DATA, PORT278_DATA, PORT277_DATA, PORT276_DATA,
2717 PORT275_DATA, PORT274_DATA, PORT273_DATA, PORT272_DATA,
2718 PORT271_DATA, PORT270_DATA, PORT269_DATA, PORT268_DATA,
2719 PORT267_DATA, PORT266_DATA, PORT265_DATA, PORT264_DATA,
2720 PORT263_DATA, PORT262_DATA, PORT261_DATA, PORT260_DATA,
2721 PORT259_DATA, PORT258_DATA, PORT257_DATA, PORT256_DATA }
2722 },
2723 { PINMUX_DATA_REG("PORTR319_288DR", 0xe6056010, 32) {
2724 0, 0, 0, 0,
2725 0, 0, 0, 0,
2726 0, 0, PORT309_DATA, PORT308_DATA,
2727 PORT307_DATA, PORT306_DATA, PORT305_DATA, PORT304_DATA,
2728 PORT303_DATA, PORT302_DATA, PORT301_DATA, PORT300_DATA,
2729 PORT299_DATA, PORT298_DATA, PORT297_DATA, PORT296_DATA,
2730 PORT295_DATA, PORT294_DATA, PORT293_DATA, PORT292_DATA,
2731 PORT291_DATA, PORT290_DATA, PORT289_DATA, PORT288_DATA }
2732 },
2733 { },
2734};
2735
2736/* IRQ pins through INTCS with IRQ0->15 from 0x200 and IRQ16-31 from 0x3200 */
2737#define EXT_IRQ16L(n) intcs_evt2irq(0x200 + ((n) << 5))
2738#define EXT_IRQ16H(n) intcs_evt2irq(0x3200 + ((n - 16) << 5))
2739
2740static struct pinmux_irq pinmux_irqs[] = {
2741 PINMUX_IRQ(EXT_IRQ16H(19), PORT9_FN0),
2742 PINMUX_IRQ(EXT_IRQ16L(1), PORT10_FN0),
2743 PINMUX_IRQ(EXT_IRQ16L(0), PORT11_FN0),
2744 PINMUX_IRQ(EXT_IRQ16H(18), PORT13_FN0),
2745 PINMUX_IRQ(EXT_IRQ16H(20), PORT14_FN0),
2746 PINMUX_IRQ(EXT_IRQ16H(21), PORT15_FN0),
2747 PINMUX_IRQ(EXT_IRQ16H(31), PORT26_FN0),
2748 PINMUX_IRQ(EXT_IRQ16H(30), PORT27_FN0),
2749 PINMUX_IRQ(EXT_IRQ16H(29), PORT28_FN0),
2750 PINMUX_IRQ(EXT_IRQ16H(22), PORT40_FN0),
2751 PINMUX_IRQ(EXT_IRQ16H(23), PORT53_FN0),
2752 PINMUX_IRQ(EXT_IRQ16L(10), PORT54_FN0),
2753 PINMUX_IRQ(EXT_IRQ16L(9), PORT56_FN0),
2754 PINMUX_IRQ(EXT_IRQ16H(26), PORT115_FN0),
2755 PINMUX_IRQ(EXT_IRQ16H(27), PORT116_FN0),
2756 PINMUX_IRQ(EXT_IRQ16H(28), PORT117_FN0),
2757 PINMUX_IRQ(EXT_IRQ16H(24), PORT118_FN0),
2758 PINMUX_IRQ(EXT_IRQ16L(6), PORT147_FN0),
2759 PINMUX_IRQ(EXT_IRQ16L(2), PORT149_FN0),
2760 PINMUX_IRQ(EXT_IRQ16L(7), PORT150_FN0),
2761 PINMUX_IRQ(EXT_IRQ16L(12), PORT156_FN0),
2762 PINMUX_IRQ(EXT_IRQ16L(4), PORT159_FN0),
2763 PINMUX_IRQ(EXT_IRQ16H(25), PORT164_FN0),
2764 PINMUX_IRQ(EXT_IRQ16L(8), PORT223_FN0),
2765 PINMUX_IRQ(EXT_IRQ16L(3), PORT224_FN0),
2766 PINMUX_IRQ(EXT_IRQ16L(5), PORT227_FN0),
2767 PINMUX_IRQ(EXT_IRQ16H(17), PORT234_FN0),
2768 PINMUX_IRQ(EXT_IRQ16L(11), PORT238_FN0),
2769 PINMUX_IRQ(EXT_IRQ16L(13), PORT239_FN0),
2770 PINMUX_IRQ(EXT_IRQ16H(16), PORT249_FN0),
2771 PINMUX_IRQ(EXT_IRQ16L(14), PORT251_FN0),
2772 PINMUX_IRQ(EXT_IRQ16L(9), PORT308_FN0),
2773};
2774
2775static struct pinmux_info sh73a0_pinmux_info = {
2776 .name = "sh73a0_pfc",
2777 .reserved_id = PINMUX_RESERVED,
2778 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
2779 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
2780 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END },
2781 .input_pd = { PINMUX_INPUT_PULLDOWN_BEGIN, PINMUX_INPUT_PULLDOWN_END },
2782 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
2783 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
2784 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
2785
2786 .first_gpio = GPIO_PORT0,
2787 .last_gpio = GPIO_FN_FSIAISLD_PU,
2788
2789 .gpios = pinmux_gpios,
2790 .cfg_regs = pinmux_config_regs,
2791 .data_regs = pinmux_data_regs,
2792
2793 .gpio_data = pinmux_data,
2794 .gpio_data_size = ARRAY_SIZE(pinmux_data),
2795
2796 .gpio_irq = pinmux_irqs,
2797 .gpio_irq_size = ARRAY_SIZE(pinmux_irqs),
2798};
2799
2800void sh73a0_pinmux_init(void)
2801{
2802 register_pinmux(&sh73a0_pinmux_info);
2803}
diff --git a/arch/arm/mach-shmobile/platsmp.c b/arch/arm/mach-shmobile/platsmp.c
index ed8d2351915e..1f958d7b0bac 100644
--- a/arch/arm/mach-shmobile/platsmp.c
+++ b/arch/arm/mach-shmobile/platsmp.c
@@ -12,7 +12,6 @@
12 */ 12 */
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/smp.h> 14#include <linux/smp.h>
15#include <asm/hardware/gic.h>
16 15
17void __init shmobile_smp_init_cpus(unsigned int ncores) 16void __init shmobile_smp_init_cpus(unsigned int ncores)
18{ 17{
@@ -26,6 +25,4 @@ void __init shmobile_smp_init_cpus(unsigned int ncores)
26 25
27 for (i = 0; i < ncores; i++) 26 for (i = 0; i < ncores; i++)
28 set_cpu_possible(i, true); 27 set_cpu_possible(i, true);
29
30 set_smp_cross_call(gic_raise_softirq);
31} 28}
diff --git a/arch/arm/mach-shmobile/pm-r8a7740.c b/arch/arm/mach-shmobile/pm-r8a7740.c
index 21e5316d2d88..40b87aa1d448 100644
--- a/arch/arm/mach-shmobile/pm-r8a7740.c
+++ b/arch/arm/mach-shmobile/pm-r8a7740.c
@@ -9,7 +9,9 @@
9 * for more details. 9 * for more details.
10 */ 10 */
11#include <linux/console.h> 11#include <linux/console.h>
12#include <linux/suspend.h>
12#include <mach/pm-rmobile.h> 13#include <mach/pm-rmobile.h>
14#include <mach/common.h>
13 15
14#ifdef CONFIG_PM 16#ifdef CONFIG_PM
15static int r8a7740_pd_a4s_suspend(void) 17static int r8a7740_pd_a4s_suspend(void)
@@ -58,3 +60,23 @@ void __init r8a7740_init_pm_domains(void)
58} 60}
59 61
60#endif /* CONFIG_PM */ 62#endif /* CONFIG_PM */
63
64#ifdef CONFIG_SUSPEND
65static int r8a7740_enter_suspend(suspend_state_t suspend_state)
66{
67 cpu_do_idle();
68 return 0;
69}
70
71static void r8a7740_suspend_init(void)
72{
73 shmobile_suspend_ops.enter = r8a7740_enter_suspend;
74}
75#else
76static void r8a7740_suspend_init(void) {}
77#endif
78
79void __init r8a7740_pm_init(void)
80{
81 r8a7740_suspend_init();
82}
diff --git a/arch/arm/mach-shmobile/pm-sh73a0.c b/arch/arm/mach-shmobile/pm-sh73a0.c
new file mode 100644
index 000000000000..99086e98fbbc
--- /dev/null
+++ b/arch/arm/mach-shmobile/pm-sh73a0.c
@@ -0,0 +1,32 @@
1/*
2 * sh73a0 Power management support
3 *
4 * Copyright (C) 2012 Bastian Hecht <hechtb+renesas@gmail.com>
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#include <linux/suspend.h>
12#include <mach/common.h>
13
14#ifdef CONFIG_SUSPEND
15static int sh73a0_enter_suspend(suspend_state_t suspend_state)
16{
17 cpu_do_idle();
18 return 0;
19}
20
21static void sh73a0_suspend_init(void)
22{
23 shmobile_suspend_ops.enter = sh73a0_enter_suspend;
24}
25#else
26static void sh73a0_suspend_init(void) {}
27#endif
28
29void __init sh73a0_pm_init(void)
30{
31 sh73a0_suspend_init();
32}
diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c
index a47beeb18283..47662a581c0a 100644
--- a/arch/arm/mach-shmobile/setup-emev2.c
+++ b/arch/arm/mach-shmobile/setup-emev2.c
@@ -20,13 +20,14 @@
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
22#include <linux/irq.h> 22#include <linux/irq.h>
23#include <linux/irqchip.h>
23#include <linux/platform_device.h> 24#include <linux/platform_device.h>
24#include <linux/platform_data/gpio-em.h> 25#include <linux/platform_data/gpio-em.h>
25#include <linux/of_platform.h> 26#include <linux/of_platform.h>
26#include <linux/delay.h> 27#include <linux/delay.h>
27#include <linux/input.h> 28#include <linux/input.h>
28#include <linux/io.h> 29#include <linux/io.h>
29#include <linux/of_irq.h> 30#include <linux/irqchip/arm-gic.h>
30#include <mach/hardware.h> 31#include <mach/hardware.h>
31#include <mach/common.h> 32#include <mach/common.h>
32#include <mach/emev2.h> 33#include <mach/emev2.h>
@@ -35,7 +36,6 @@
35#include <asm/mach/arch.h> 36#include <asm/mach/arch.h>
36#include <asm/mach/map.h> 37#include <asm/mach/map.h>
37#include <asm/mach/time.h> 38#include <asm/mach/time.h>
38#include <asm/hardware/gic.h>
39 39
40static struct map_desc emev2_io_desc[] __initdata = { 40static struct map_desc emev2_io_desc[] __initdata = {
41#ifdef CONFIG_SMP 41#ifdef CONFIG_SMP
@@ -445,29 +445,18 @@ void __init emev2_add_standard_devices_dt(void)
445 emev2_auxdata_lookup, NULL); 445 emev2_auxdata_lookup, NULL);
446} 446}
447 447
448static const struct of_device_id emev2_dt_irq_match[] = {
449 { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
450 {},
451};
452
453static const char *emev2_boards_compat_dt[] __initdata = { 448static const char *emev2_boards_compat_dt[] __initdata = {
454 "renesas,emev2", 449 "renesas,emev2",
455 NULL, 450 NULL,
456}; 451};
457 452
458void __init emev2_init_irq_dt(void)
459{
460 of_irq_init(emev2_dt_irq_match);
461}
462
463DT_MACHINE_START(EMEV2_DT, "Generic Emma Mobile EV2 (Flattened Device Tree)") 453DT_MACHINE_START(EMEV2_DT, "Generic Emma Mobile EV2 (Flattened Device Tree)")
464 .smp = smp_ops(emev2_smp_ops), 454 .smp = smp_ops(emev2_smp_ops),
465 .init_early = emev2_init_delay, 455 .init_early = emev2_init_delay,
466 .nr_irqs = NR_IRQS_LEGACY, 456 .nr_irqs = NR_IRQS_LEGACY,
467 .init_irq = emev2_init_irq_dt, 457 .init_irq = irqchip_init,
468 .handle_irq = gic_handle_irq,
469 .init_machine = emev2_add_standard_devices_dt, 458 .init_machine = emev2_add_standard_devices_dt,
470 .timer = &shmobile_timer, 459 .init_time = shmobile_timer_init,
471 .dt_compat = emev2_boards_compat_dt, 460 .dt_compat = emev2_boards_compat_dt,
472MACHINE_END 461MACHINE_END
473 462
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
index 095222469d03..8b85d4d8fab6 100644
--- a/arch/arm/mach-shmobile/setup-r8a7740.c
+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
@@ -27,7 +27,7 @@
27#include <linux/serial_sci.h> 27#include <linux/serial_sci.h>
28#include <linux/sh_dma.h> 28#include <linux/sh_dma.h>
29#include <linux/sh_timer.h> 29#include <linux/sh_timer.h>
30#include <linux/dma-mapping.h> 30#include <linux/platform_data/sh_ipmmu.h>
31#include <mach/dma-register.h> 31#include <mach/dma-register.h>
32#include <mach/r8a7740.h> 32#include <mach/r8a7740.h>
33#include <mach/pm-rmobile.h> 33#include <mach/pm-rmobile.h>
@@ -68,6 +68,32 @@ void __init r8a7740_map_io(void)
68 iotable_init(r8a7740_io_desc, ARRAY_SIZE(r8a7740_io_desc)); 68 iotable_init(r8a7740_io_desc, ARRAY_SIZE(r8a7740_io_desc));
69} 69}
70 70
71/* PFC */
72static struct resource r8a7740_pfc_resources[] = {
73 [0] = {
74 .start = 0xe6050000,
75 .end = 0xe6057fff,
76 .flags = IORESOURCE_MEM,
77 },
78 [1] = {
79 .start = 0xe605800c,
80 .end = 0xe605802b,
81 .flags = IORESOURCE_MEM,
82 }
83};
84
85static struct platform_device r8a7740_pfc_device = {
86 .name = "pfc-r8a7740",
87 .id = -1,
88 .resource = r8a7740_pfc_resources,
89 .num_resources = ARRAY_SIZE(r8a7740_pfc_resources),
90};
91
92void __init r8a7740_pinmux_init(void)
93{
94 platform_device_register(&r8a7740_pfc_device);
95}
96
71/* SCIFA0 */ 97/* SCIFA0 */
72static struct plat_sci_port scif0_platform_data = { 98static struct plat_sci_port scif0_platform_data = {
73 .mapbase = 0xe6c40000, 99 .mapbase = 0xe6c40000,
@@ -262,6 +288,128 @@ static struct platform_device cmt10_device = {
262 .num_resources = ARRAY_SIZE(cmt10_resources), 288 .num_resources = ARRAY_SIZE(cmt10_resources),
263}; 289};
264 290
291/* TMU */
292static struct sh_timer_config tmu00_platform_data = {
293 .name = "TMU00",
294 .channel_offset = 0x4,
295 .timer_bit = 0,
296 .clockevent_rating = 200,
297};
298
299static struct resource tmu00_resources[] = {
300 [0] = {
301 .name = "TMU00",
302 .start = 0xfff80008,
303 .end = 0xfff80014 - 1,
304 .flags = IORESOURCE_MEM,
305 },
306 [1] = {
307 .start = intcs_evt2irq(0xe80),
308 .flags = IORESOURCE_IRQ,
309 },
310};
311
312static struct platform_device tmu00_device = {
313 .name = "sh_tmu",
314 .id = 0,
315 .dev = {
316 .platform_data = &tmu00_platform_data,
317 },
318 .resource = tmu00_resources,
319 .num_resources = ARRAY_SIZE(tmu00_resources),
320};
321
322static struct sh_timer_config tmu01_platform_data = {
323 .name = "TMU01",
324 .channel_offset = 0x10,
325 .timer_bit = 1,
326 .clocksource_rating = 200,
327};
328
329static struct resource tmu01_resources[] = {
330 [0] = {
331 .name = "TMU01",
332 .start = 0xfff80014,
333 .end = 0xfff80020 - 1,
334 .flags = IORESOURCE_MEM,
335 },
336 [1] = {
337 .start = intcs_evt2irq(0xea0),
338 .flags = IORESOURCE_IRQ,
339 },
340};
341
342static struct platform_device tmu01_device = {
343 .name = "sh_tmu",
344 .id = 1,
345 .dev = {
346 .platform_data = &tmu01_platform_data,
347 },
348 .resource = tmu01_resources,
349 .num_resources = ARRAY_SIZE(tmu01_resources),
350};
351
352static struct sh_timer_config tmu02_platform_data = {
353 .name = "TMU02",
354 .channel_offset = 0x1C,
355 .timer_bit = 2,
356 .clocksource_rating = 200,
357};
358
359static struct resource tmu02_resources[] = {
360 [0] = {
361 .name = "TMU02",
362 .start = 0xfff80020,
363 .end = 0xfff8002C - 1,
364 .flags = IORESOURCE_MEM,
365 },
366 [1] = {
367 .start = intcs_evt2irq(0xec0),
368 .flags = IORESOURCE_IRQ,
369 },
370};
371
372static struct platform_device tmu02_device = {
373 .name = "sh_tmu",
374 .id = 2,
375 .dev = {
376 .platform_data = &tmu02_platform_data,
377 },
378 .resource = tmu02_resources,
379 .num_resources = ARRAY_SIZE(tmu02_resources),
380};
381
382/* IPMMUI (an IPMMU module for ICB/LMB) */
383static struct resource ipmmu_resources[] = {
384 [0] = {
385 .name = "IPMMUI",
386 .start = 0xfe951000,
387 .end = 0xfe9510ff,
388 .flags = IORESOURCE_MEM,
389 },
390};
391
392static const char * const ipmmu_dev_names[] = {
393 "sh_mobile_lcdc_fb.0",
394 "sh_mobile_lcdc_fb.1",
395 "sh_mobile_ceu.0",
396};
397
398static struct shmobile_ipmmu_platform_data ipmmu_platform_data = {
399 .dev_names = ipmmu_dev_names,
400 .num_dev_names = ARRAY_SIZE(ipmmu_dev_names),
401};
402
403static struct platform_device ipmmu_device = {
404 .name = "ipmmu",
405 .id = -1,
406 .dev = {
407 .platform_data = &ipmmu_platform_data,
408 },
409 .resource = ipmmu_resources,
410 .num_resources = ARRAY_SIZE(ipmmu_resources),
411};
412
265static struct platform_device *r8a7740_early_devices[] __initdata = { 413static struct platform_device *r8a7740_early_devices[] __initdata = {
266 &scif0_device, 414 &scif0_device,
267 &scif1_device, 415 &scif1_device,
@@ -273,6 +421,10 @@ static struct platform_device *r8a7740_early_devices[] __initdata = {
273 &scif7_device, 421 &scif7_device,
274 &scifb_device, 422 &scifb_device,
275 &cmt10_device, 423 &cmt10_device,
424 &tmu00_device,
425 &tmu01_device,
426 &tmu02_device,
427 &ipmmu_device,
276}; 428};
277 429
278/* DMA */ 430/* DMA */
@@ -705,12 +857,6 @@ void __init r8a7740_add_standard_devices(void)
705 rmobile_add_device_to_domain("A3SP", &i2c1_device); 857 rmobile_add_device_to_domain("A3SP", &i2c1_device);
706} 858}
707 859
708static void __init r8a7740_earlytimer_init(void)
709{
710 r8a7740_clock_init(0);
711 shmobile_earlytimer_init();
712}
713
714void __init r8a7740_add_early_devices(void) 860void __init r8a7740_add_early_devices(void)
715{ 861{
716 early_platform_add_devices(r8a7740_early_devices, 862 early_platform_add_devices(r8a7740_early_devices,
@@ -718,9 +864,6 @@ void __init r8a7740_add_early_devices(void)
718 864
719 /* setup early console here as well */ 865 /* setup early console here as well */
720 shmobile_setup_console(); 866 shmobile_setup_console();
721
722 /* override timer setup with soc-specific code */
723 shmobile_timer.init = r8a7740_earlytimer_init;
724} 867}
725 868
726#ifdef CONFIG_USE_OF 869#ifdef CONFIG_USE_OF
@@ -763,7 +906,7 @@ DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)")
763 .init_irq = r8a7740_init_irq, 906 .init_irq = r8a7740_init_irq,
764 .handle_irq = shmobile_handle_irq_intc, 907 .handle_irq = shmobile_handle_irq_intc,
765 .init_machine = r8a7740_add_standard_devices_dt, 908 .init_machine = r8a7740_add_standard_devices_dt,
766 .timer = &shmobile_timer, 909 .init_time = shmobile_timer_init,
767 .dt_compat = r8a7740_boards_compat_dt, 910 .dt_compat = r8a7740_boards_compat_dt,
768MACHINE_END 911MACHINE_END
769 912
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index 7a1ad4f38539..c54ff9b29fe5 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -60,14 +60,38 @@ void __init r8a7779_map_io(void)
60 iotable_init(r8a7779_io_desc, ARRAY_SIZE(r8a7779_io_desc)); 60 iotable_init(r8a7779_io_desc, ARRAY_SIZE(r8a7779_io_desc));
61} 61}
62 62
63static struct resource r8a7779_pfc_resources[] = {
64 [0] = {
65 .start = 0xfffc0000,
66 .end = 0xfffc023b,
67 .flags = IORESOURCE_MEM,
68 },
69 [1] = {
70 .start = 0xffc40000,
71 .end = 0xffc46fff,
72 .flags = IORESOURCE_MEM,
73 }
74};
75
76static struct platform_device r8a7779_pfc_device = {
77 .name = "pfc-r8a7779",
78 .id = -1,
79 .resource = r8a7779_pfc_resources,
80 .num_resources = ARRAY_SIZE(r8a7779_pfc_resources),
81};
82
83void __init r8a7779_pinmux_init(void)
84{
85 platform_device_register(&r8a7779_pfc_device);
86}
87
63static struct plat_sci_port scif0_platform_data = { 88static struct plat_sci_port scif0_platform_data = {
64 .mapbase = 0xffe40000, 89 .mapbase = 0xffe40000,
65 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, 90 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
66 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, 91 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
67 .scbrr_algo_id = SCBRR_ALGO_2, 92 .scbrr_algo_id = SCBRR_ALGO_2,
68 .type = PORT_SCIF, 93 .type = PORT_SCIF,
69 .irqs = { gic_spi(88), gic_spi(88), 94 .irqs = SCIx_IRQ_MUXED(gic_spi(88)),
70 gic_spi(88), gic_spi(88) },
71}; 95};
72 96
73static struct platform_device scif0_device = { 97static struct platform_device scif0_device = {
@@ -84,8 +108,7 @@ static struct plat_sci_port scif1_platform_data = {
84 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, 108 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
85 .scbrr_algo_id = SCBRR_ALGO_2, 109 .scbrr_algo_id = SCBRR_ALGO_2,
86 .type = PORT_SCIF, 110 .type = PORT_SCIF,
87 .irqs = { gic_spi(89), gic_spi(89), 111 .irqs = SCIx_IRQ_MUXED(gic_spi(89)),
88 gic_spi(89), gic_spi(89) },
89}; 112};
90 113
91static struct platform_device scif1_device = { 114static struct platform_device scif1_device = {
@@ -102,8 +125,7 @@ static struct plat_sci_port scif2_platform_data = {
102 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, 125 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
103 .scbrr_algo_id = SCBRR_ALGO_2, 126 .scbrr_algo_id = SCBRR_ALGO_2,
104 .type = PORT_SCIF, 127 .type = PORT_SCIF,
105 .irqs = { gic_spi(90), gic_spi(90), 128 .irqs = SCIx_IRQ_MUXED(gic_spi(90)),
106 gic_spi(90), gic_spi(90) },
107}; 129};
108 130
109static struct platform_device scif2_device = { 131static struct platform_device scif2_device = {
@@ -120,8 +142,7 @@ static struct plat_sci_port scif3_platform_data = {
120 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, 142 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
121 .scbrr_algo_id = SCBRR_ALGO_2, 143 .scbrr_algo_id = SCBRR_ALGO_2,
122 .type = PORT_SCIF, 144 .type = PORT_SCIF,
123 .irqs = { gic_spi(91), gic_spi(91), 145 .irqs = SCIx_IRQ_MUXED(gic_spi(91)),
124 gic_spi(91), gic_spi(91) },
125}; 146};
126 147
127static struct platform_device scif3_device = { 148static struct platform_device scif3_device = {
@@ -138,8 +159,7 @@ static struct plat_sci_port scif4_platform_data = {
138 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, 159 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
139 .scbrr_algo_id = SCBRR_ALGO_2, 160 .scbrr_algo_id = SCBRR_ALGO_2,
140 .type = PORT_SCIF, 161 .type = PORT_SCIF,
141 .irqs = { gic_spi(92), gic_spi(92), 162 .irqs = SCIx_IRQ_MUXED(gic_spi(92)),
142 gic_spi(92), gic_spi(92) },
143}; 163};
144 164
145static struct platform_device scif4_device = { 165static struct platform_device scif4_device = {
@@ -156,8 +176,7 @@ static struct plat_sci_port scif5_platform_data = {
156 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, 176 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
157 .scbrr_algo_id = SCBRR_ALGO_2, 177 .scbrr_algo_id = SCBRR_ALGO_2,
158 .type = PORT_SCIF, 178 .type = PORT_SCIF,
159 .irqs = { gic_spi(93), gic_spi(93), 179 .irqs = SCIx_IRQ_MUXED(gic_spi(93)),
160 gic_spi(93), gic_spi(93) },
161}; 180};
162 181
163static struct platform_device scif5_device = { 182static struct platform_device scif5_device = {
@@ -339,7 +358,7 @@ void __init r8a7779_add_standard_devices(void)
339/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ 358/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */
340void __init __weak r8a7779_register_twd(void) { } 359void __init __weak r8a7779_register_twd(void) { }
341 360
342static void __init r8a7779_earlytimer_init(void) 361void __init r8a7779_earlytimer_init(void)
343{ 362{
344 r8a7779_clock_init(); 363 r8a7779_clock_init();
345 shmobile_earlytimer_init(); 364 shmobile_earlytimer_init();
@@ -366,7 +385,4 @@ void __init r8a7779_add_early_devices(void)
366 * As a final step pass earlyprint=sh-sci.2,115200 on the kernel 385 * As a final step pass earlyprint=sh-sci.2,115200 on the kernel
367 * command line in case of the marzen board. 386 * command line in case of the marzen board.
368 */ 387 */
369
370 /* override timer setup with soc-specific code */
371 shmobile_timer.init = r8a7779_earlytimer_init;
372} 388}
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c
index c917882424a7..59c7146bf66f 100644
--- a/arch/arm/mach-shmobile/setup-sh7372.c
+++ b/arch/arm/mach-shmobile/setup-sh7372.c
@@ -33,6 +33,7 @@
33#include <linux/sh_timer.h> 33#include <linux/sh_timer.h>
34#include <linux/pm_domain.h> 34#include <linux/pm_domain.h>
35#include <linux/dma-mapping.h> 35#include <linux/dma-mapping.h>
36#include <linux/platform_data/sh_ipmmu.h>
36#include <mach/dma-register.h> 37#include <mach/dma-register.h>
37#include <mach/hardware.h> 38#include <mach/hardware.h>
38#include <mach/irqs.h> 39#include <mach/irqs.h>
@@ -60,6 +61,32 @@ void __init sh7372_map_io(void)
60 iotable_init(sh7372_io_desc, ARRAY_SIZE(sh7372_io_desc)); 61 iotable_init(sh7372_io_desc, ARRAY_SIZE(sh7372_io_desc));
61} 62}
62 63
64/* PFC */
65static struct resource sh7372_pfc_resources[] = {
66 [0] = {
67 .start = 0xe6050000,
68 .end = 0xe6057fff,
69 .flags = IORESOURCE_MEM,
70 },
71 [1] = {
72 .start = 0xe605800c,
73 .end = 0xe6058027,
74 .flags = IORESOURCE_MEM,
75 }
76};
77
78static struct platform_device sh7372_pfc_device = {
79 .name = "pfc-sh7372",
80 .id = -1,
81 .resource = sh7372_pfc_resources,
82 .num_resources = ARRAY_SIZE(sh7372_pfc_resources),
83};
84
85void __init sh7372_pinmux_init(void)
86{
87 platform_device_register(&sh7372_pfc_device);
88}
89
63/* SCIFA0 */ 90/* SCIFA0 */
64static struct plat_sci_port scif0_platform_data = { 91static struct plat_sci_port scif0_platform_data = {
65 .mapbase = 0xe6c40000, 92 .mapbase = 0xe6c40000,
@@ -982,6 +1009,43 @@ static struct platform_device spu1_device = {
982 .num_resources = ARRAY_SIZE(spu1_resources), 1009 .num_resources = ARRAY_SIZE(spu1_resources),
983}; 1010};
984 1011
1012/* IPMMUI (an IPMMU module for ICB/LMB) */
1013static struct resource ipmmu_resources[] = {
1014 [0] = {
1015 .name = "IPMMUI",
1016 .start = 0xfe951000,
1017 .end = 0xfe9510ff,
1018 .flags = IORESOURCE_MEM,
1019 },
1020};
1021
1022static const char * const ipmmu_dev_names[] = {
1023 "sh_mobile_lcdc_fb.0",
1024 "sh_mobile_lcdc_fb.1",
1025 "sh_mobile_ceu.0",
1026 "uio_pdrv_genirq.0",
1027 "uio_pdrv_genirq.1",
1028 "uio_pdrv_genirq.2",
1029 "uio_pdrv_genirq.3",
1030 "uio_pdrv_genirq.4",
1031 "uio_pdrv_genirq.5",
1032};
1033
1034static struct shmobile_ipmmu_platform_data ipmmu_platform_data = {
1035 .dev_names = ipmmu_dev_names,
1036 .num_dev_names = ARRAY_SIZE(ipmmu_dev_names),
1037};
1038
1039static struct platform_device ipmmu_device = {
1040 .name = "ipmmu",
1041 .id = -1,
1042 .dev = {
1043 .platform_data = &ipmmu_platform_data,
1044 },
1045 .resource = ipmmu_resources,
1046 .num_resources = ARRAY_SIZE(ipmmu_resources),
1047};
1048
985static struct platform_device *sh7372_early_devices[] __initdata = { 1049static struct platform_device *sh7372_early_devices[] __initdata = {
986 &scif0_device, 1050 &scif0_device,
987 &scif1_device, 1051 &scif1_device,
@@ -993,6 +1057,7 @@ static struct platform_device *sh7372_early_devices[] __initdata = {
993 &cmt2_device, 1057 &cmt2_device,
994 &tmu00_device, 1058 &tmu00_device,
995 &tmu01_device, 1059 &tmu01_device,
1060 &ipmmu_device,
996}; 1061};
997 1062
998static struct platform_device *sh7372_late_devices[] __initdata = { 1063static struct platform_device *sh7372_late_devices[] __initdata = {
@@ -1054,7 +1119,7 @@ void __init sh7372_add_standard_devices(void)
1054 ARRAY_SIZE(domain_devices)); 1119 ARRAY_SIZE(domain_devices));
1055} 1120}
1056 1121
1057static void __init sh7372_earlytimer_init(void) 1122void __init sh7372_earlytimer_init(void)
1058{ 1123{
1059 sh7372_clock_init(); 1124 sh7372_clock_init();
1060 shmobile_earlytimer_init(); 1125 shmobile_earlytimer_init();
@@ -1067,9 +1132,6 @@ void __init sh7372_add_early_devices(void)
1067 1132
1068 /* setup early console here as well */ 1133 /* setup early console here as well */
1069 shmobile_setup_console(); 1134 shmobile_setup_console();
1070
1071 /* override timer setup with soc-specific code */
1072 shmobile_timer.init = sh7372_earlytimer_init;
1073} 1135}
1074 1136
1075#ifdef CONFIG_USE_OF 1137#ifdef CONFIG_USE_OF
@@ -1113,7 +1175,7 @@ DT_MACHINE_START(SH7372_DT, "Generic SH7372 (Flattened Device Tree)")
1113 .init_irq = sh7372_init_irq, 1175 .init_irq = sh7372_init_irq,
1114 .handle_irq = shmobile_handle_irq_intc, 1176 .handle_irq = shmobile_handle_irq_intc,
1115 .init_machine = sh7372_add_standard_devices_dt, 1177 .init_machine = sh7372_add_standard_devices_dt,
1116 .timer = &shmobile_timer, 1178 .init_time = shmobile_timer_init,
1117 .dt_compat = sh7372_boards_compat_dt, 1179 .dt_compat = sh7372_boards_compat_dt,
1118MACHINE_END 1180MACHINE_END
1119 1181
diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
index db99a4ade80c..bdab575f88bc 100644
--- a/arch/arm/mach-shmobile/setup-sh73a0.c
+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
@@ -23,6 +23,7 @@
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/irq.h> 24#include <linux/irq.h>
25#include <linux/platform_device.h> 25#include <linux/platform_device.h>
26#include <linux/of_platform.h>
26#include <linux/delay.h> 27#include <linux/delay.h>
27#include <linux/input.h> 28#include <linux/input.h>
28#include <linux/io.h> 29#include <linux/io.h>
@@ -30,6 +31,7 @@
30#include <linux/sh_dma.h> 31#include <linux/sh_dma.h>
31#include <linux/sh_intc.h> 32#include <linux/sh_intc.h>
32#include <linux/sh_timer.h> 33#include <linux/sh_timer.h>
34#include <linux/platform_data/sh_ipmmu.h>
33#include <mach/dma-register.h> 35#include <mach/dma-register.h>
34#include <mach/hardware.h> 36#include <mach/hardware.h>
35#include <mach/irqs.h> 37#include <mach/irqs.h>
@@ -57,6 +59,31 @@ void __init sh73a0_map_io(void)
57 iotable_init(sh73a0_io_desc, ARRAY_SIZE(sh73a0_io_desc)); 59 iotable_init(sh73a0_io_desc, ARRAY_SIZE(sh73a0_io_desc));
58} 60}
59 61
62static struct resource sh73a0_pfc_resources[] = {
63 [0] = {
64 .start = 0xe6050000,
65 .end = 0xe6057fff,
66 .flags = IORESOURCE_MEM,
67 },
68 [1] = {
69 .start = 0xe605801c,
70 .end = 0xe6058027,
71 .flags = IORESOURCE_MEM,
72 }
73};
74
75static struct platform_device sh73a0_pfc_device = {
76 .name = "pfc-sh73a0",
77 .id = -1,
78 .resource = sh73a0_pfc_resources,
79 .num_resources = ARRAY_SIZE(sh73a0_pfc_resources),
80};
81
82void __init sh73a0_pinmux_init(void)
83{
84 platform_device_register(&sh73a0_pfc_device);
85}
86
60static struct plat_sci_port scif0_platform_data = { 87static struct plat_sci_port scif0_platform_data = {
61 .mapbase = 0xe6c40000, 88 .mapbase = 0xe6c40000,
62 .flags = UPF_BOOT_AUTOCONF, 89 .flags = UPF_BOOT_AUTOCONF,
@@ -754,7 +781,36 @@ static struct platform_device pmu_device = {
754 .resource = pmu_resources, 781 .resource = pmu_resources,
755}; 782};
756 783
757static struct platform_device *sh73a0_early_devices[] __initdata = { 784/* an IPMMU module for ICB */
785static struct resource ipmmu_resources[] = {
786 [0] = {
787 .name = "IPMMU",
788 .start = 0xfe951000,
789 .end = 0xfe9510ff,
790 .flags = IORESOURCE_MEM,
791 },
792};
793
794static const char * const ipmmu_dev_names[] = {
795 "sh_mobile_lcdc_fb.0",
796};
797
798static struct shmobile_ipmmu_platform_data ipmmu_platform_data = {
799 .dev_names = ipmmu_dev_names,
800 .num_dev_names = ARRAY_SIZE(ipmmu_dev_names),
801};
802
803static struct platform_device ipmmu_device = {
804 .name = "ipmmu",
805 .id = -1,
806 .dev = {
807 .platform_data = &ipmmu_platform_data,
808 },
809 .resource = ipmmu_resources,
810 .num_resources = ARRAY_SIZE(ipmmu_resources),
811};
812
813static struct platform_device *sh73a0_early_devices_dt[] __initdata = {
758 &scif0_device, 814 &scif0_device,
759 &scif1_device, 815 &scif1_device,
760 &scif2_device, 816 &scif2_device,
@@ -765,8 +821,12 @@ static struct platform_device *sh73a0_early_devices[] __initdata = {
765 &scif7_device, 821 &scif7_device,
766 &scif8_device, 822 &scif8_device,
767 &cmt10_device, 823 &cmt10_device,
824};
825
826static struct platform_device *sh73a0_early_devices[] __initdata = {
768 &tmu00_device, 827 &tmu00_device,
769 &tmu01_device, 828 &tmu01_device,
829 &ipmmu_device,
770}; 830};
771 831
772static struct platform_device *sh73a0_late_devices[] __initdata = { 832static struct platform_device *sh73a0_late_devices[] __initdata = {
@@ -787,6 +847,8 @@ void __init sh73a0_add_standard_devices(void)
787 /* Clear software reset bit on SY-DMAC module */ 847 /* Clear software reset bit on SY-DMAC module */
788 __raw_writel(__raw_readl(SRCR2) & ~(1 << 18), SRCR2); 848 __raw_writel(__raw_readl(SRCR2) & ~(1 << 18), SRCR2);
789 849
850 platform_add_devices(sh73a0_early_devices_dt,
851 ARRAY_SIZE(sh73a0_early_devices_dt));
790 platform_add_devices(sh73a0_early_devices, 852 platform_add_devices(sh73a0_early_devices,
791 ARRAY_SIZE(sh73a0_early_devices)); 853 ARRAY_SIZE(sh73a0_early_devices));
792 platform_add_devices(sh73a0_late_devices, 854 platform_add_devices(sh73a0_late_devices,
@@ -796,7 +858,7 @@ void __init sh73a0_add_standard_devices(void)
796/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ 858/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */
797void __init __weak sh73a0_register_twd(void) { } 859void __init __weak sh73a0_register_twd(void) { }
798 860
799static void __init sh73a0_earlytimer_init(void) 861void __init sh73a0_earlytimer_init(void)
800{ 862{
801 sh73a0_clock_init(); 863 sh73a0_clock_init();
802 shmobile_earlytimer_init(); 864 shmobile_earlytimer_init();
@@ -805,12 +867,63 @@ static void __init sh73a0_earlytimer_init(void)
805 867
806void __init sh73a0_add_early_devices(void) 868void __init sh73a0_add_early_devices(void)
807{ 869{
870 early_platform_add_devices(sh73a0_early_devices_dt,
871 ARRAY_SIZE(sh73a0_early_devices_dt));
808 early_platform_add_devices(sh73a0_early_devices, 872 early_platform_add_devices(sh73a0_early_devices,
809 ARRAY_SIZE(sh73a0_early_devices)); 873 ARRAY_SIZE(sh73a0_early_devices));
810 874
811 /* setup early console here as well */ 875 /* setup early console here as well */
812 shmobile_setup_console(); 876 shmobile_setup_console();
877}
878
879#ifdef CONFIG_USE_OF
880
881/* Please note that the clock initialisation shcheme used in
882 * sh73a0_add_early_devices_dt() and sh73a0_add_standard_devices_dt()
883 * does not work with SMP as there is a yet to be resolved lock-up in
884 * workqueue initialisation.
885 *
886 * CONFIG_SMP should be disabled when using this code.
887 */
888
889void __init sh73a0_add_early_devices_dt(void)
890{
891 shmobile_setup_delay(1196, 44, 46); /* Cortex-A9 @ 1196MHz */
892
893 early_platform_add_devices(sh73a0_early_devices_dt,
894 ARRAY_SIZE(sh73a0_early_devices_dt));
895
896 /* setup early console here as well */
897 shmobile_setup_console();
898}
813 899
814 /* override timer setup with soc-specific code */ 900static const struct of_dev_auxdata sh73a0_auxdata_lookup[] __initconst = {
815 shmobile_timer.init = sh73a0_earlytimer_init; 901 {},
902};
903
904void __init sh73a0_add_standard_devices_dt(void)
905{
906 /* clocks are setup late during boot in the case of DT */
907 sh73a0_clock_init();
908
909 platform_add_devices(sh73a0_early_devices_dt,
910 ARRAY_SIZE(sh73a0_early_devices_dt));
911 of_platform_populate(NULL, of_default_bus_match_table,
912 sh73a0_auxdata_lookup, NULL);
816} 913}
914
915static const char *sh73a0_boards_compat_dt[] __initdata = {
916 "renesas,sh73a0",
917 NULL,
918};
919
920DT_MACHINE_START(SH73A0_DT, "Generic SH73A0 (Flattened Device Tree)")
921 .map_io = sh73a0_map_io,
922 .init_early = sh73a0_add_early_devices_dt,
923 .nr_irqs = NR_IRQS_LEGACY,
924 .init_irq = sh73a0_init_irq_dt,
925 .init_machine = sh73a0_add_standard_devices_dt,
926 .init_time = shmobile_timer_init,
927 .dt_compat = sh73a0_boards_compat_dt,
928MACHINE_END
929#endif /* CONFIG_USE_OF */
diff --git a/arch/arm/mach-shmobile/sleep-sh7372.S b/arch/arm/mach-shmobile/sleep-sh7372.S
index 1d564674451d..a9df53b69ab8 100644
--- a/arch/arm/mach-shmobile/sleep-sh7372.S
+++ b/arch/arm/mach-shmobile/sleep-sh7372.S
@@ -59,17 +59,19 @@ sh7372_do_idle_sysc:
59 mcr p15, 0, r0, c1, c0, 0 59 mcr p15, 0, r0, c1, c0, 0
60 isb 60 isb
61 61
62 /*
63 * Clean and invalidate data cache again.
64 */
65 ldr r1, kernel_flush
66 blx r1
67
62 /* disable L2 cache in the aux control register */ 68 /* disable L2 cache in the aux control register */
63 mrc p15, 0, r10, c1, c0, 1 69 mrc p15, 0, r10, c1, c0, 1
64 bic r10, r10, #2 70 bic r10, r10, #2
65 mcr p15, 0, r10, c1, c0, 1 71 mcr p15, 0, r10, c1, c0, 1
72 isb
66 73
67 /* 74 /*
68 * Invalidate data cache again.
69 */
70 ldr r1, kernel_flush
71 blx r1
72 /*
73 * The kernel doesn't interwork: v7_flush_dcache_all in particluar will 75 * The kernel doesn't interwork: v7_flush_dcache_all in particluar will
74 * always return in Thumb state when CONFIG_THUMB2_KERNEL is enabled. 76 * always return in Thumb state when CONFIG_THUMB2_KERNEL is enabled.
75 * This sequence switches back to ARM. Note that .align may insert a 77 * This sequence switches back to ARM. Note that .align may insert a
diff --git a/arch/arm/mach-shmobile/smp-emev2.c b/arch/arm/mach-shmobile/smp-emev2.c
index f67456286280..953eb1f9388d 100644
--- a/arch/arm/mach-shmobile/smp-emev2.c
+++ b/arch/arm/mach-shmobile/smp-emev2.c
@@ -23,11 +23,11 @@
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/irqchip/arm-gic.h>
26#include <mach/common.h> 27#include <mach/common.h>
27#include <mach/emev2.h> 28#include <mach/emev2.h>
28#include <asm/smp_plat.h> 29#include <asm/smp_plat.h>
29#include <asm/smp_scu.h> 30#include <asm/smp_scu.h>
30#include <asm/hardware/gic.h>
31#include <asm/cacheflush.h> 31#include <asm/cacheflush.h>
32 32
33#define EMEV2_SCU_BASE 0x1e000000 33#define EMEV2_SCU_BASE 0x1e000000
@@ -100,7 +100,7 @@ static int __cpuinit emev2_boot_secondary(unsigned int cpu, struct task_struct *
100 /* Tell ROM loader about our vector (in headsmp.S) */ 100 /* Tell ROM loader about our vector (in headsmp.S) */
101 emev2_set_boot_vector(__pa(shmobile_secondary_vector)); 101 emev2_set_boot_vector(__pa(shmobile_secondary_vector));
102 102
103 gic_raise_softirq(cpumask_of(cpu), 0); 103 arch_send_wakeup_ipi_mask(cpumask_of(cpu));
104 return 0; 104 return 0;
105} 105}
106 106
diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c
index 2ce6af9a6a37..3a4acf23edcf 100644
--- a/arch/arm/mach-shmobile/smp-r8a7779.c
+++ b/arch/arm/mach-shmobile/smp-r8a7779.c
@@ -23,12 +23,12 @@
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/irqchip/arm-gic.h>
26#include <mach/common.h> 27#include <mach/common.h>
27#include <mach/r8a7779.h> 28#include <mach/r8a7779.h>
28#include <asm/smp_plat.h> 29#include <asm/smp_plat.h>
29#include <asm/smp_scu.h> 30#include <asm/smp_scu.h>
30#include <asm/smp_twd.h> 31#include <asm/smp_twd.h>
31#include <asm/hardware/gic.h>
32 32
33#define AVECR IOMEM(0xfe700040) 33#define AVECR IOMEM(0xfe700040)
34 34
diff --git a/arch/arm/mach-shmobile/smp-sh73a0.c b/arch/arm/mach-shmobile/smp-sh73a0.c
index 624f00f70abf..acb46a94ccdf 100644
--- a/arch/arm/mach-shmobile/smp-sh73a0.c
+++ b/arch/arm/mach-shmobile/smp-sh73a0.c
@@ -23,12 +23,13 @@
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/irqchip/arm-gic.h>
26#include <mach/common.h> 27#include <mach/common.h>
28#include <asm/cacheflush.h>
27#include <asm/smp_plat.h> 29#include <asm/smp_plat.h>
28#include <mach/sh73a0.h> 30#include <mach/sh73a0.h>
29#include <asm/smp_scu.h> 31#include <asm/smp_scu.h>
30#include <asm/smp_twd.h> 32#include <asm/smp_twd.h>
31#include <asm/hardware/gic.h>
32 33
33#define WUPCR IOMEM(0xe6151010) 34#define WUPCR IOMEM(0xe6151010)
34#define SRESCR IOMEM(0xe6151018) 35#define SRESCR IOMEM(0xe6151018)
@@ -36,14 +37,13 @@
36#define SBAR IOMEM(0xe6180020) 37#define SBAR IOMEM(0xe6180020)
37#define APARMBAREA IOMEM(0xe6f10020) 38#define APARMBAREA IOMEM(0xe6f10020)
38 39
40#define PSTR_SHUTDOWN_MODE 3
41
39static void __iomem *scu_base_addr(void) 42static void __iomem *scu_base_addr(void)
40{ 43{
41 return (void __iomem *)0xf0000000; 44 return (void __iomem *)0xf0000000;
42} 45}
43 46
44static DEFINE_SPINLOCK(scu_lock);
45static unsigned long tmp;
46
47#ifdef CONFIG_HAVE_ARM_TWD 47#ifdef CONFIG_HAVE_ARM_TWD
48static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29); 48static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29);
49void __init sh73a0_register_twd(void) 49void __init sh73a0_register_twd(void)
@@ -52,20 +52,6 @@ void __init sh73a0_register_twd(void)
52} 52}
53#endif 53#endif
54 54
55static void modify_scu_cpu_psr(unsigned long set, unsigned long clr)
56{
57 void __iomem *scu_base = scu_base_addr();
58
59 spin_lock(&scu_lock);
60 tmp = __raw_readl(scu_base + 8);
61 tmp &= ~clr;
62 tmp |= set;
63 spin_unlock(&scu_lock);
64
65 /* disable cache coherency after releasing the lock */
66 __raw_writel(tmp, scu_base + 8);
67}
68
69static unsigned int __init sh73a0_get_core_count(void) 55static unsigned int __init sh73a0_get_core_count(void)
70{ 56{
71 void __iomem *scu_base = scu_base_addr(); 57 void __iomem *scu_base = scu_base_addr();
@@ -82,9 +68,6 @@ static int __cpuinit sh73a0_boot_secondary(unsigned int cpu, struct task_struct
82{ 68{
83 cpu = cpu_logical_map(cpu); 69 cpu = cpu_logical_map(cpu);
84 70
85 /* enable cache coherency */
86 modify_scu_cpu_psr(0, 3 << (cpu * 8));
87
88 if (((__raw_readl(PSTR) >> (4 * cpu)) & 3) == 3) 71 if (((__raw_readl(PSTR) >> (4 * cpu)) & 3) == 3)
89 __raw_writel(1 << cpu, WUPCR); /* wake up */ 72 __raw_writel(1 << cpu, WUPCR); /* wake up */
90 else 73 else
@@ -95,16 +78,14 @@ static int __cpuinit sh73a0_boot_secondary(unsigned int cpu, struct task_struct
95 78
96static void __init sh73a0_smp_prepare_cpus(unsigned int max_cpus) 79static void __init sh73a0_smp_prepare_cpus(unsigned int max_cpus)
97{ 80{
98 int cpu = cpu_logical_map(0);
99
100 scu_enable(scu_base_addr()); 81 scu_enable(scu_base_addr());
101 82
102 /* Map the reset vector (in headsmp.S) */ 83 /* Map the reset vector (in headsmp-sh73a0.S) */
103 __raw_writel(0, APARMBAREA); /* 4k */ 84 __raw_writel(0, APARMBAREA); /* 4k */
104 __raw_writel(__pa(shmobile_secondary_vector), SBAR); 85 __raw_writel(__pa(sh73a0_secondary_vector), SBAR);
105 86
106 /* enable cache coherency on CPU0 */ 87 /* enable cache coherency on booting CPU */
107 modify_scu_cpu_psr(0, 3 << (cpu * 8)); 88 scu_power_mode(scu_base_addr(), SCU_PM_NORMAL);
108} 89}
109 90
110static void __init sh73a0_smp_init_cpus(void) 91static void __init sh73a0_smp_init_cpus(void)
@@ -114,16 +95,20 @@ static void __init sh73a0_smp_init_cpus(void)
114 shmobile_smp_init_cpus(ncores); 95 shmobile_smp_init_cpus(ncores);
115} 96}
116 97
117static int __maybe_unused sh73a0_cpu_kill(unsigned int cpu) 98#ifdef CONFIG_HOTPLUG_CPU
99static int sh73a0_cpu_kill(unsigned int cpu)
118{ 100{
101
119 int k; 102 int k;
103 u32 pstr;
120 104
121 /* this function is running on another CPU than the offline target, 105 /*
122 * here we need wait for shutdown code in platform_cpu_die() to 106 * wait until the power status register confirms the shutdown of the
123 * finish before asking SoC-specific code to power off the CPU core. 107 * offline target
124 */ 108 */
125 for (k = 0; k < 1000; k++) { 109 for (k = 0; k < 1000; k++) {
126 if (shmobile_cpu_is_dead(cpu)) 110 pstr = (__raw_readl(PSTR) >> (4 * cpu)) & 3;
111 if (pstr == PSTR_SHUTDOWN_MODE)
127 return 1; 112 return 1;
128 113
129 mdelay(1); 114 mdelay(1);
@@ -132,6 +117,23 @@ static int __maybe_unused sh73a0_cpu_kill(unsigned int cpu)
132 return 0; 117 return 0;
133} 118}
134 119
120static void sh73a0_cpu_die(unsigned int cpu)
121{
122 /*
123 * The ARM MPcore does not issue a cache coherency request for the L1
124 * cache when powering off single CPUs. We must take care of this and
125 * further caches.
126 */
127 dsb();
128 flush_cache_all();
129
130 /* Set power off mode. This takes the CPU out of the MP cluster */
131 scu_power_mode(scu_base_addr(), SCU_PM_POWEROFF);
132
133 /* Enter shutdown mode */
134 cpu_do_idle();
135}
136#endif /* CONFIG_HOTPLUG_CPU */
135 137
136struct smp_operations sh73a0_smp_ops __initdata = { 138struct smp_operations sh73a0_smp_ops __initdata = {
137 .smp_init_cpus = sh73a0_smp_init_cpus, 139 .smp_init_cpus = sh73a0_smp_init_cpus,
@@ -140,7 +142,7 @@ struct smp_operations sh73a0_smp_ops __initdata = {
140 .smp_boot_secondary = sh73a0_boot_secondary, 142 .smp_boot_secondary = sh73a0_boot_secondary,
141#ifdef CONFIG_HOTPLUG_CPU 143#ifdef CONFIG_HOTPLUG_CPU
142 .cpu_kill = sh73a0_cpu_kill, 144 .cpu_kill = sh73a0_cpu_kill,
143 .cpu_die = shmobile_cpu_die, 145 .cpu_die = sh73a0_cpu_die,
144 .cpu_disable = shmobile_cpu_disable, 146 .cpu_disable = shmobile_cpu_disable_any,
145#endif 147#endif
146}; 148};
diff --git a/arch/arm/mach-shmobile/timer.c b/arch/arm/mach-shmobile/timer.c
index a68919727e24..3d16d4dff01b 100644
--- a/arch/arm/mach-shmobile/timer.c
+++ b/arch/arm/mach-shmobile/timer.c
@@ -20,6 +20,7 @@
20 */ 20 */
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/delay.h> 22#include <linux/delay.h>
23#include <asm/arch_timer.h>
23#include <asm/mach/time.h> 24#include <asm/mach/time.h>
24#include <asm/smp_twd.h> 25#include <asm/smp_twd.h>
25 26
@@ -60,10 +61,8 @@ void __init shmobile_earlytimer_init(void)
60 late_time_init = shmobile_late_time_init; 61 late_time_init = shmobile_late_time_init;
61} 62}
62 63
63static void __init shmobile_timer_init(void) 64void __init shmobile_timer_init(void)
64{ 65{
66 arch_timer_of_register();
67 arch_timer_sched_clock_init();
65} 68}
66
67struct sys_timer shmobile_timer = {
68 .init = shmobile_timer_init,
69};
diff --git a/arch/arm/mach-socfpga/core.h b/arch/arm/mach-socfpga/core.h
index 9941caa94931..315edff610f2 100644
--- a/arch/arm/mach-socfpga/core.h
+++ b/arch/arm/mach-socfpga/core.h
@@ -20,7 +20,7 @@
20#ifndef __MACH_CORE_H 20#ifndef __MACH_CORE_H
21#define __MACH_CORE_H 21#define __MACH_CORE_H
22 22
23extern void secondary_startup(void); 23extern void socfpga_secondary_startup(void);
24extern void __iomem *socfpga_scu_base_addr; 24extern void __iomem *socfpga_scu_base_addr;
25 25
26extern void socfpga_init_clocks(void); 26extern void socfpga_init_clocks(void);
@@ -29,6 +29,8 @@ extern void socfpga_sysmgr_init(void);
29extern struct smp_operations socfpga_smp_ops; 29extern struct smp_operations socfpga_smp_ops;
30extern char secondary_trampoline, secondary_trampoline_end; 30extern char secondary_trampoline, secondary_trampoline_end;
31 31
32extern unsigned long cpu1start_addr;
33
32#define SOCFPGA_SCU_VIRT_BASE 0xfffec000 34#define SOCFPGA_SCU_VIRT_BASE 0xfffec000
33 35
34#endif 36#endif
diff --git a/arch/arm/mach-socfpga/headsmp.S b/arch/arm/mach-socfpga/headsmp.S
index f09b1283ffca..9004bfb1756e 100644
--- a/arch/arm/mach-socfpga/headsmp.S
+++ b/arch/arm/mach-socfpga/headsmp.S
@@ -13,13 +13,21 @@
13 __CPUINIT 13 __CPUINIT
14 .arch armv7-a 14 .arch armv7-a
15 15
16#define CPU1_START_ADDR 0xffd08010
17
18ENTRY(secondary_trampoline) 16ENTRY(secondary_trampoline)
19 movw r0, #:lower16:CPU1_START_ADDR 17 movw r2, #:lower16:cpu1start_addr
20 movt r0, #:upper16:CPU1_START_ADDR 18 movt r2, #:upper16:cpu1start_addr
19
20 /* The socfpga VT cannot handle a 0xC0000000 page offset when loading
21 the cpu1start_addr, we bit clear it. Tested on HW and VT. */
22 bic r2, r2, #0x40000000
21 23
24 ldr r0, [r2]
22 ldr r1, [r0] 25 ldr r1, [r0]
23 bx r1 26 bx r1
24 27
25ENTRY(secondary_trampoline_end) 28ENTRY(secondary_trampoline_end)
29
30ENTRY(socfpga_secondary_startup)
31 bl v7_invalidate_l1
32 b secondary_startup
33ENDPROC(socfpga_secondary_startup)
diff --git a/arch/arm/mach-socfpga/platsmp.c b/arch/arm/mach-socfpga/platsmp.c
index 68dd1b69512a..84c60fa8daa0 100644
--- a/arch/arm/mach-socfpga/platsmp.c
+++ b/arch/arm/mach-socfpga/platsmp.c
@@ -22,9 +22,9 @@
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/of.h> 23#include <linux/of.h>
24#include <linux/of_address.h> 24#include <linux/of_address.h>
25#include <linux/irqchip/arm-gic.h>
25 26
26#include <asm/cacheflush.h> 27#include <asm/cacheflush.h>
27#include <asm/hardware/gic.h>
28#include <asm/smp_scu.h> 28#include <asm/smp_scu.h>
29#include <asm/smp_plat.h> 29#include <asm/smp_plat.h>
30 30
@@ -47,16 +47,19 @@ static int __cpuinit socfpga_boot_secondary(unsigned int cpu, struct task_struct
47{ 47{
48 int trampoline_size = &secondary_trampoline_end - &secondary_trampoline; 48 int trampoline_size = &secondary_trampoline_end - &secondary_trampoline;
49 49
50 memcpy(phys_to_virt(0), &secondary_trampoline, trampoline_size); 50 if (cpu1start_addr) {
51 memcpy(phys_to_virt(0), &secondary_trampoline, trampoline_size);
51 52
52 __raw_writel(virt_to_phys(secondary_startup), (sys_manager_base_addr+0x10)); 53 __raw_writel(virt_to_phys(socfpga_secondary_startup),
54 (sys_manager_base_addr + (cpu1start_addr & 0x000000ff)));
53 55
54 flush_cache_all(); 56 flush_cache_all();
55 smp_wmb(); 57 smp_wmb();
56 outer_clean_range(0, trampoline_size); 58 outer_clean_range(0, trampoline_size);
57 59
58 /* This will release CPU #1 out of reset.*/ 60 /* This will release CPU #1 out of reset.*/
59 __raw_writel(0, rst_manager_base_addr + 0x10); 61 __raw_writel(0, rst_manager_base_addr + 0x10);
62 }
60 63
61 return 0; 64 return 0;
62} 65}
@@ -83,8 +86,6 @@ static void __init socfpga_smp_init_cpus(void)
83 86
84 for (i = 0; i < ncores; i++) 87 for (i = 0; i < ncores; i++)
85 set_cpu_possible(i, true); 88 set_cpu_possible(i, true);
86
87 set_smp_cross_call(gic_raise_softirq);
88} 89}
89 90
90static void __init socfpga_smp_prepare_cpus(unsigned int max_cpus) 91static void __init socfpga_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-socfpga/socfpga.c b/arch/arm/mach-socfpga/socfpga.c
index 6732924a5fee..1042c023cf24 100644
--- a/arch/arm/mach-socfpga/socfpga.c
+++ b/arch/arm/mach-socfpga/socfpga.c
@@ -15,12 +15,12 @@
15 * along with this program. If not, see <http://www.gnu.org/licenses/>. 15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17#include <linux/dw_apb_timer.h> 17#include <linux/dw_apb_timer.h>
18#include <linux/irqchip.h>
18#include <linux/of_address.h> 19#include <linux/of_address.h>
19#include <linux/of_irq.h> 20#include <linux/of_irq.h>
20#include <linux/of_platform.h> 21#include <linux/of_platform.h>
21 22
22#include <asm/hardware/cache-l2x0.h> 23#include <asm/hardware/cache-l2x0.h>
23#include <asm/hardware/gic.h>
24#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
25#include <asm/mach/map.h> 25#include <asm/mach/map.h>
26 26
@@ -29,6 +29,7 @@
29void __iomem *socfpga_scu_base_addr = ((void __iomem *)(SOCFPGA_SCU_VIRT_BASE)); 29void __iomem *socfpga_scu_base_addr = ((void __iomem *)(SOCFPGA_SCU_VIRT_BASE));
30void __iomem *sys_manager_base_addr; 30void __iomem *sys_manager_base_addr;
31void __iomem *rst_manager_base_addr; 31void __iomem *rst_manager_base_addr;
32unsigned long cpu1start_addr;
32 33
33static struct map_desc scu_io_desc __initdata = { 34static struct map_desc scu_io_desc __initdata = {
34 .virtual = SOCFPGA_SCU_VIRT_BASE, 35 .virtual = SOCFPGA_SCU_VIRT_BASE,
@@ -62,25 +63,25 @@ static void __init socfpga_map_io(void)
62 early_printk("Early printk initialized\n"); 63 early_printk("Early printk initialized\n");
63} 64}
64 65
65const static struct of_device_id irq_match[] = {
66 { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
67 {}
68};
69
70void __init socfpga_sysmgr_init(void) 66void __init socfpga_sysmgr_init(void)
71{ 67{
72 struct device_node *np; 68 struct device_node *np;
73 69
74 np = of_find_compatible_node(NULL, NULL, "altr,sys-mgr"); 70 np = of_find_compatible_node(NULL, NULL, "altr,sys-mgr");
71
72 if (of_property_read_u32(np, "cpu1-start-addr",
73 (u32 *) &cpu1start_addr))
74 pr_err("SMP: Need cpu1-start-addr in device tree.\n");
75
75 sys_manager_base_addr = of_iomap(np, 0); 76 sys_manager_base_addr = of_iomap(np, 0);
76 77
77 np = of_find_compatible_node(NULL, NULL, "altr,rst-mgr"); 78 np = of_find_compatible_node(NULL, NULL, "altr,rst-mgr");
78 rst_manager_base_addr = of_iomap(np, 0); 79 rst_manager_base_addr = of_iomap(np, 0);
79} 80}
80 81
81static void __init gic_init_irq(void) 82static void __init socfpga_init_irq(void)
82{ 83{
83 of_irq_init(irq_match); 84 irqchip_init();
84 socfpga_sysmgr_init(); 85 socfpga_sysmgr_init();
85} 86}
86 87
@@ -98,16 +99,14 @@ static void __init socfpga_cyclone5_init(void)
98 99
99static const char *altera_dt_match[] = { 100static const char *altera_dt_match[] = {
100 "altr,socfpga", 101 "altr,socfpga",
101 "altr,socfpga-cyclone5",
102 NULL 102 NULL
103}; 103};
104 104
105DT_MACHINE_START(SOCFPGA, "Altera SOCFPGA") 105DT_MACHINE_START(SOCFPGA, "Altera SOCFPGA")
106 .smp = smp_ops(socfpga_smp_ops), 106 .smp = smp_ops(socfpga_smp_ops),
107 .map_io = socfpga_map_io, 107 .map_io = socfpga_map_io,
108 .init_irq = gic_init_irq, 108 .init_irq = socfpga_init_irq,
109 .handle_irq = gic_handle_irq, 109 .init_time = dw_apb_timer_init,
110 .timer = &dw_apb_timer,
111 .init_machine = socfpga_cyclone5_init, 110 .init_machine = socfpga_cyclone5_init,
112 .restart = socfpga_cyclone5_restart, 111 .restart = socfpga_cyclone5_restart,
113 .dt_compat = altera_dt_match, 112 .dt_compat = altera_dt_match,
diff --git a/arch/arm/mach-spear13xx/include/mach/generic.h b/arch/arm/mach-spear13xx/include/mach/generic.h
index c33f4d9361bd..633e678e01a3 100644
--- a/arch/arm/mach-spear13xx/include/mach/generic.h
+++ b/arch/arm/mach-spear13xx/include/mach/generic.h
@@ -18,7 +18,7 @@
18#include <asm/mach/time.h> 18#include <asm/mach/time.h>
19 19
20/* Add spear13xx structure declarations here */ 20/* Add spear13xx structure declarations here */
21extern struct sys_timer spear13xx_timer; 21extern void spear13xx_timer_init(void);
22extern struct pl022_ssp_controller pl022_plat_data; 22extern struct pl022_ssp_controller pl022_plat_data;
23extern struct dw_dma_platform_data dmac_plat_data; 23extern struct dw_dma_platform_data dmac_plat_data;
24extern struct dw_dma_slave cf_dma_priv; 24extern struct dw_dma_slave cf_dma_priv;
@@ -28,7 +28,6 @@ extern struct dw_dma_slave nand_write_dma_priv;
28/* Add spear13xx family function declarations here */ 28/* Add spear13xx family function declarations here */
29void __init spear_setup_of_timer(void); 29void __init spear_setup_of_timer(void);
30void __init spear13xx_map_io(void); 30void __init spear13xx_map_io(void);
31void __init spear13xx_dt_init_irq(void);
32void __init spear13xx_l2x0_init(void); 31void __init spear13xx_l2x0_init(void);
33bool dw_dma_filter(struct dma_chan *chan, void *slave); 32bool dw_dma_filter(struct dma_chan *chan, void *slave);
34void spear_restart(char, const char *); 33void spear_restart(char, const char *);
diff --git a/arch/arm/mach-spear13xx/platsmp.c b/arch/arm/mach-spear13xx/platsmp.c
index 2eaa3fa7b432..af4ade61cd95 100644
--- a/arch/arm/mach-spear13xx/platsmp.c
+++ b/arch/arm/mach-spear13xx/platsmp.c
@@ -15,8 +15,8 @@
15#include <linux/jiffies.h> 15#include <linux/jiffies.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/smp.h> 17#include <linux/smp.h>
18#include <linux/irqchip/arm-gic.h>
18#include <asm/cacheflush.h> 19#include <asm/cacheflush.h>
19#include <asm/hardware/gic.h>
20#include <asm/smp_scu.h> 20#include <asm/smp_scu.h>
21#include <mach/spear.h> 21#include <mach/spear.h>
22#include <mach/generic.h> 22#include <mach/generic.h>
@@ -104,8 +104,6 @@ static void __init spear13xx_smp_init_cpus(void)
104 104
105 for (i = 0; i < ncores; i++) 105 for (i = 0; i < ncores; i++)
106 set_cpu_possible(i, true); 106 set_cpu_possible(i, true);
107
108 set_smp_cross_call(gic_raise_softirq);
109} 107}
110 108
111static void __init spear13xx_smp_prepare_cpus(unsigned int max_cpus) 109static void __init spear13xx_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-spear13xx/spear1310.c b/arch/arm/mach-spear13xx/spear1310.c
index 02f4724bb0d4..56214d1076ef 100644
--- a/arch/arm/mach-spear13xx/spear1310.c
+++ b/arch/arm/mach-spear13xx/spear1310.c
@@ -14,9 +14,9 @@
14#define pr_fmt(fmt) "SPEAr1310: " fmt 14#define pr_fmt(fmt) "SPEAr1310: " fmt
15 15
16#include <linux/amba/pl022.h> 16#include <linux/amba/pl022.h>
17#include <linux/irqchip.h>
17#include <linux/of_platform.h> 18#include <linux/of_platform.h>
18#include <linux/pata_arasan_cf_data.h> 19#include <linux/pata_arasan_cf_data.h>
19#include <asm/hardware/gic.h>
20#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
21#include <asm/mach/map.h> 21#include <asm/mach/map.h>
22#include <mach/generic.h> 22#include <mach/generic.h>
@@ -90,9 +90,8 @@ static void __init spear1310_map_io(void)
90DT_MACHINE_START(SPEAR1310_DT, "ST SPEAr1310 SoC with Flattened Device Tree") 90DT_MACHINE_START(SPEAR1310_DT, "ST SPEAr1310 SoC with Flattened Device Tree")
91 .smp = smp_ops(spear13xx_smp_ops), 91 .smp = smp_ops(spear13xx_smp_ops),
92 .map_io = spear1310_map_io, 92 .map_io = spear1310_map_io,
93 .init_irq = spear13xx_dt_init_irq, 93 .init_irq = irqchip_init,
94 .handle_irq = gic_handle_irq, 94 .init_time = spear13xx_timer_init,
95 .timer = &spear13xx_timer,
96 .init_machine = spear1310_dt_init, 95 .init_machine = spear1310_dt_init,
97 .restart = spear_restart, 96 .restart = spear_restart,
98 .dt_compat = spear1310_dt_board_compat, 97 .dt_compat = spear1310_dt_board_compat,
diff --git a/arch/arm/mach-spear13xx/spear1340.c b/arch/arm/mach-spear13xx/spear1340.c
index 081014fb314a..9a28beb2a113 100644
--- a/arch/arm/mach-spear13xx/spear1340.c
+++ b/arch/arm/mach-spear13xx/spear1340.c
@@ -18,7 +18,7 @@
18#include <linux/delay.h> 18#include <linux/delay.h>
19#include <linux/dw_dmac.h> 19#include <linux/dw_dmac.h>
20#include <linux/of_platform.h> 20#include <linux/of_platform.h>
21#include <asm/hardware/gic.h> 21#include <linux/irqchip.h>
22#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
23#include <mach/dma.h> 23#include <mach/dma.h>
24#include <mach/generic.h> 24#include <mach/generic.h>
@@ -184,9 +184,8 @@ static const char * const spear1340_dt_board_compat[] = {
184DT_MACHINE_START(SPEAR1340_DT, "ST SPEAr1340 SoC with Flattened Device Tree") 184DT_MACHINE_START(SPEAR1340_DT, "ST SPEAr1340 SoC with Flattened Device Tree")
185 .smp = smp_ops(spear13xx_smp_ops), 185 .smp = smp_ops(spear13xx_smp_ops),
186 .map_io = spear13xx_map_io, 186 .map_io = spear13xx_map_io,
187 .init_irq = spear13xx_dt_init_irq, 187 .init_irq = irqchip_init,
188 .handle_irq = gic_handle_irq, 188 .init_time = spear13xx_timer_init,
189 .timer = &spear13xx_timer,
190 .init_machine = spear1340_dt_init, 189 .init_machine = spear1340_dt_init,
191 .restart = spear_restart, 190 .restart = spear_restart,
192 .dt_compat = spear1340_dt_board_compat, 191 .dt_compat = spear1340_dt_board_compat,
diff --git a/arch/arm/mach-spear13xx/spear13xx.c b/arch/arm/mach-spear13xx/spear13xx.c
index c4af775a8451..c7d2b4a8d8cc 100644
--- a/arch/arm/mach-spear13xx/spear13xx.c
+++ b/arch/arm/mach-spear13xx/spear13xx.c
@@ -17,9 +17,8 @@
17#include <linux/clk.h> 17#include <linux/clk.h>
18#include <linux/dw_dmac.h> 18#include <linux/dw_dmac.h>
19#include <linux/err.h> 19#include <linux/err.h>
20#include <linux/of_irq.h> 20#include <linux/of.h>
21#include <asm/hardware/cache-l2x0.h> 21#include <asm/hardware/cache-l2x0.h>
22#include <asm/hardware/gic.h>
23#include <asm/mach/map.h> 22#include <asm/mach/map.h>
24#include <asm/smp_twd.h> 23#include <asm/smp_twd.h>
25#include <mach/dma.h> 24#include <mach/dma.h>
@@ -153,7 +152,7 @@ static void __init spear13xx_clk_init(void)
153 pr_err("%s: Unknown machine\n", __func__); 152 pr_err("%s: Unknown machine\n", __func__);
154} 153}
155 154
156static void __init spear13xx_timer_init(void) 155void __init spear13xx_timer_init(void)
157{ 156{
158 char pclk_name[] = "osc_24m_clk"; 157 char pclk_name[] = "osc_24m_clk";
159 struct clk *gpt_clk, *pclk; 158 struct clk *gpt_clk, *pclk;
@@ -182,17 +181,3 @@ static void __init spear13xx_timer_init(void)
182 spear_setup_of_timer(); 181 spear_setup_of_timer();
183 twd_local_timer_of_register(); 182 twd_local_timer_of_register();
184} 183}
185
186struct sys_timer spear13xx_timer = {
187 .init = spear13xx_timer_init,
188};
189
190static const struct of_device_id gic_of_match[] __initconst = {
191 { .compatible = "arm,cortex-a9-gic", .data = gic_of_init },
192 { /* Sentinel */ }
193};
194
195void __init spear13xx_dt_init_irq(void)
196{
197 of_irq_init(gic_of_match);
198}
diff --git a/arch/arm/mach-spear3xx/include/mach/generic.h b/arch/arm/mach-spear3xx/include/mach/generic.h
index ce19113ca791..df310799e416 100644
--- a/arch/arm/mach-spear3xx/include/mach/generic.h
+++ b/arch/arm/mach-spear3xx/include/mach/generic.h
@@ -22,7 +22,7 @@
22#include <asm/mach/map.h> 22#include <asm/mach/map.h>
23 23
24/* Add spear3xx family device structure declarations here */ 24/* Add spear3xx family device structure declarations here */
25extern struct sys_timer spear3xx_timer; 25extern void spear3xx_timer_init(void);
26extern struct pl022_ssp_controller pl022_plat_data; 26extern struct pl022_ssp_controller pl022_plat_data;
27extern struct pl08x_platform_data pl080_plat_data; 27extern struct pl08x_platform_data pl080_plat_data;
28 28
@@ -30,7 +30,6 @@ extern struct pl08x_platform_data pl080_plat_data;
30void __init spear_setup_of_timer(void); 30void __init spear_setup_of_timer(void);
31void __init spear3xx_clk_init(void); 31void __init spear3xx_clk_init(void);
32void __init spear3xx_map_io(void); 32void __init spear3xx_map_io(void);
33void __init spear3xx_dt_init_irq(void);
34 33
35void spear_restart(char, const char *); 34void spear_restart(char, const char *);
36 35
diff --git a/arch/arm/mach-spear3xx/spear300.c b/arch/arm/mach-spear3xx/spear300.c
index a69cbfdb07ee..bbc9b7e9c62c 100644
--- a/arch/arm/mach-spear3xx/spear300.c
+++ b/arch/arm/mach-spear3xx/spear300.c
@@ -14,8 +14,8 @@
14#define pr_fmt(fmt) "SPEAr300: " fmt 14#define pr_fmt(fmt) "SPEAr300: " fmt
15 15
16#include <linux/amba/pl08x.h> 16#include <linux/amba/pl08x.h>
17#include <linux/irqchip.h>
17#include <linux/of_platform.h> 18#include <linux/of_platform.h>
18#include <asm/hardware/vic.h>
19#include <asm/mach/arch.h> 19#include <asm/mach/arch.h>
20#include <mach/generic.h> 20#include <mach/generic.h>
21#include <mach/spear.h> 21#include <mach/spear.h>
@@ -212,9 +212,8 @@ static void __init spear300_map_io(void)
212 212
213DT_MACHINE_START(SPEAR300_DT, "ST SPEAr300 SoC with Flattened Device Tree") 213DT_MACHINE_START(SPEAR300_DT, "ST SPEAr300 SoC with Flattened Device Tree")
214 .map_io = spear300_map_io, 214 .map_io = spear300_map_io,
215 .init_irq = spear3xx_dt_init_irq, 215 .init_irq = irqchip_init,
216 .handle_irq = vic_handle_irq, 216 .init_time = spear3xx_timer_init,
217 .timer = &spear3xx_timer,
218 .init_machine = spear300_dt_init, 217 .init_machine = spear300_dt_init,
219 .restart = spear_restart, 218 .restart = spear_restart,
220 .dt_compat = spear300_dt_board_compat, 219 .dt_compat = spear300_dt_board_compat,
diff --git a/arch/arm/mach-spear3xx/spear310.c b/arch/arm/mach-spear3xx/spear310.c
index b963ebb10b56..c13a434a8195 100644
--- a/arch/arm/mach-spear3xx/spear310.c
+++ b/arch/arm/mach-spear3xx/spear310.c
@@ -15,8 +15,8 @@
15 15
16#include <linux/amba/pl08x.h> 16#include <linux/amba/pl08x.h>
17#include <linux/amba/serial.h> 17#include <linux/amba/serial.h>
18#include <linux/irqchip.h>
18#include <linux/of_platform.h> 19#include <linux/of_platform.h>
19#include <asm/hardware/vic.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/spear.h>
@@ -254,9 +254,8 @@ static void __init spear310_map_io(void)
254 254
255DT_MACHINE_START(SPEAR310_DT, "ST SPEAr310 SoC with Flattened Device Tree") 255DT_MACHINE_START(SPEAR310_DT, "ST SPEAr310 SoC with Flattened Device Tree")
256 .map_io = spear310_map_io, 256 .map_io = spear310_map_io,
257 .init_irq = spear3xx_dt_init_irq, 257 .init_irq = irqchip_init,
258 .handle_irq = vic_handle_irq, 258 .init_time = spear3xx_timer_init,
259 .timer = &spear3xx_timer,
260 .init_machine = spear310_dt_init, 259 .init_machine = spear310_dt_init,
261 .restart = spear_restart, 260 .restart = spear_restart,
262 .dt_compat = spear310_dt_board_compat, 261 .dt_compat = spear310_dt_board_compat,
diff --git a/arch/arm/mach-spear3xx/spear320.c b/arch/arm/mach-spear3xx/spear320.c
index 66e3a0c33e75..e1c77079a3e5 100644
--- a/arch/arm/mach-spear3xx/spear320.c
+++ b/arch/arm/mach-spear3xx/spear320.c
@@ -16,8 +16,8 @@
16#include <linux/amba/pl022.h> 16#include <linux/amba/pl022.h>
17#include <linux/amba/pl08x.h> 17#include <linux/amba/pl08x.h>
18#include <linux/amba/serial.h> 18#include <linux/amba/serial.h>
19#include <linux/irqchip.h>
19#include <linux/of_platform.h> 20#include <linux/of_platform.h>
20#include <asm/hardware/vic.h>
21#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
22#include <mach/generic.h> 22#include <mach/generic.h>
23#include <mach/spear.h> 23#include <mach/spear.h>
@@ -268,9 +268,8 @@ static void __init spear320_map_io(void)
268 268
269DT_MACHINE_START(SPEAR320_DT, "ST SPEAr320 SoC with Flattened Device Tree") 269DT_MACHINE_START(SPEAR320_DT, "ST SPEAr320 SoC with Flattened Device Tree")
270 .map_io = spear320_map_io, 270 .map_io = spear320_map_io,
271 .init_irq = spear3xx_dt_init_irq, 271 .init_irq = irqchip_init,
272 .handle_irq = vic_handle_irq, 272 .init_time = spear3xx_timer_init,
273 .timer = &spear3xx_timer,
274 .init_machine = spear320_dt_init, 273 .init_machine = spear320_dt_init,
275 .restart = spear_restart, 274 .restart = spear_restart,
276 .dt_compat = spear320_dt_board_compat, 275 .dt_compat = spear320_dt_board_compat,
diff --git a/arch/arm/mach-spear3xx/spear3xx.c b/arch/arm/mach-spear3xx/spear3xx.c
index 38fe95db31a7..f9d754f90c59 100644
--- a/arch/arm/mach-spear3xx/spear3xx.c
+++ b/arch/arm/mach-spear3xx/spear3xx.c
@@ -15,11 +15,7 @@
15 15
16#include <linux/amba/pl022.h> 16#include <linux/amba/pl022.h>
17#include <linux/amba/pl08x.h> 17#include <linux/amba/pl08x.h>
18#include <linux/irqchip/spear-shirq.h>
19#include <linux/of_irq.h>
20#include <linux/io.h> 18#include <linux/io.h>
21#include <asm/hardware/pl080.h>
22#include <asm/hardware/vic.h>
23#include <plat/pl080.h> 19#include <plat/pl080.h>
24#include <mach/generic.h> 20#include <mach/generic.h>
25#include <mach/spear.h> 21#include <mach/spear.h>
@@ -87,7 +83,7 @@ void __init spear3xx_map_io(void)
87 iotable_init(spear3xx_io_desc, ARRAY_SIZE(spear3xx_io_desc)); 83 iotable_init(spear3xx_io_desc, ARRAY_SIZE(spear3xx_io_desc));
88} 84}
89 85
90static void __init spear3xx_timer_init(void) 86void __init spear3xx_timer_init(void)
91{ 87{
92 char pclk_name[] = "pll3_clk"; 88 char pclk_name[] = "pll3_clk";
93 struct clk *gpt_clk, *pclk; 89 struct clk *gpt_clk, *pclk;
@@ -115,20 +111,3 @@ static void __init spear3xx_timer_init(void)
115 111
116 spear_setup_of_timer(); 112 spear_setup_of_timer();
117} 113}
118
119struct sys_timer spear3xx_timer = {
120 .init = spear3xx_timer_init,
121};
122
123static const struct of_device_id vic_of_match[] __initconst = {
124 { .compatible = "arm,pl190-vic", .data = vic_of_init, },
125 { .compatible = "st,spear300-shirq", .data = spear300_shirq_of_init, },
126 { .compatible = "st,spear310-shirq", .data = spear310_shirq_of_init, },
127 { .compatible = "st,spear320-shirq", .data = spear320_shirq_of_init, },
128 { /* Sentinel */ }
129};
130
131void __init spear3xx_dt_init_irq(void)
132{
133 of_irq_init(vic_of_match);
134}
diff --git a/arch/arm/mach-spear6xx/spear6xx.c b/arch/arm/mach-spear6xx/spear6xx.c
index 5a5a52db252b..8904d8a52d84 100644
--- a/arch/arm/mach-spear6xx/spear6xx.c
+++ b/arch/arm/mach-spear6xx/spear6xx.c
@@ -16,12 +16,11 @@
16#include <linux/amba/pl08x.h> 16#include <linux/amba/pl08x.h>
17#include <linux/clk.h> 17#include <linux/clk.h>
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/irqchip.h>
19#include <linux/of.h> 20#include <linux/of.h>
20#include <linux/of_address.h> 21#include <linux/of_address.h>
21#include <linux/of_irq.h>
22#include <linux/of_platform.h> 22#include <linux/of_platform.h>
23#include <asm/hardware/pl080.h> 23#include <linux/amba/pl080.h>
24#include <asm/hardware/vic.h>
25#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
26#include <asm/mach/time.h> 25#include <asm/mach/time.h>
27#include <asm/mach/map.h> 26#include <asm/mach/map.h>
@@ -374,7 +373,7 @@ void __init spear6xx_map_io(void)
374 iotable_init(spear6xx_io_desc, ARRAY_SIZE(spear6xx_io_desc)); 373 iotable_init(spear6xx_io_desc, ARRAY_SIZE(spear6xx_io_desc));
375} 374}
376 375
377static void __init spear6xx_timer_init(void) 376void __init spear6xx_timer_init(void)
378{ 377{
379 char pclk_name[] = "pll3_clk"; 378 char pclk_name[] = "pll3_clk";
380 struct clk *gpt_clk, *pclk; 379 struct clk *gpt_clk, *pclk;
@@ -403,10 +402,6 @@ static void __init spear6xx_timer_init(void)
403 spear_setup_of_timer(); 402 spear_setup_of_timer();
404} 403}
405 404
406struct sys_timer spear6xx_timer = {
407 .init = spear6xx_timer_init,
408};
409
410/* Add auxdata to pass platform data */ 405/* Add auxdata to pass platform data */
411struct of_dev_auxdata spear6xx_auxdata_lookup[] __initdata = { 406struct of_dev_auxdata spear6xx_auxdata_lookup[] __initdata = {
412 OF_DEV_AUXDATA("arm,pl080", SPEAR6XX_ICM3_DMA_BASE, NULL, 407 OF_DEV_AUXDATA("arm,pl080", SPEAR6XX_ICM3_DMA_BASE, NULL,
@@ -425,21 +420,10 @@ static const char *spear600_dt_board_compat[] = {
425 NULL 420 NULL
426}; 421};
427 422
428static const struct of_device_id vic_of_match[] __initconst = {
429 { .compatible = "arm,pl190-vic", .data = vic_of_init, },
430 { /* Sentinel */ }
431};
432
433static void __init spear6xx_dt_init_irq(void)
434{
435 of_irq_init(vic_of_match);
436}
437
438DT_MACHINE_START(SPEAR600_DT, "ST SPEAr600 (Flattened Device Tree)") 423DT_MACHINE_START(SPEAR600_DT, "ST SPEAr600 (Flattened Device Tree)")
439 .map_io = spear6xx_map_io, 424 .map_io = spear6xx_map_io,
440 .init_irq = spear6xx_dt_init_irq, 425 .init_irq = irqchip_init,
441 .handle_irq = vic_handle_irq, 426 .init_time = spear6xx_timer_init,
442 .timer = &spear6xx_timer,
443 .init_machine = spear600_dt_init, 427 .init_machine = spear600_dt_init,
444 .restart = spear_restart, 428 .restart = spear_restart,
445 .dt_compat = spear600_dt_board_compat, 429 .dt_compat = spear600_dt_board_compat,
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index 3fdd0085e306..8709a39bd34c 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -7,3 +7,4 @@ config ARCH_SUNXI
7 select PINCTRL 7 select PINCTRL
8 select SPARSE_IRQ 8 select SPARSE_IRQ
9 select SUNXI_TIMER 9 select SUNXI_TIMER
10 select PINCTRL_SUNXI \ No newline at end of file
diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c
index 1dc8a92e5a5f..23afb732cb40 100644
--- a/arch/arm/mach-sunxi/sunxi.c
+++ b/arch/arm/mach-sunxi/sunxi.c
@@ -21,15 +21,16 @@
21 21
22#include <linux/irqchip/sunxi.h> 22#include <linux/irqchip/sunxi.h>
23 23
24#include <asm/hardware/vic.h>
25
26#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
27#include <asm/mach/map.h> 25#include <asm/mach/map.h>
28 26
29#include "sunxi.h" 27#include "sunxi.h"
30 28
31#define WATCHDOG_CTRL_REG 0x00 29#define WATCHDOG_CTRL_REG 0x00
30#define WATCHDOG_CTRL_RESTART (1 << 0)
32#define WATCHDOG_MODE_REG 0x04 31#define WATCHDOG_MODE_REG 0x04
32#define WATCHDOG_MODE_ENABLE (1 << 0)
33#define WATCHDOG_MODE_RESET_ENABLE (1 << 1)
33 34
34static void __iomem *wdt_base; 35static void __iomem *wdt_base;
35 36
@@ -50,11 +51,19 @@ static void sunxi_restart(char mode, const char *cmd)
50 return; 51 return;
51 52
52 /* Enable timer and set reset bit in the watchdog */ 53 /* Enable timer and set reset bit in the watchdog */
53 writel(3, wdt_base + WATCHDOG_MODE_REG); 54 writel(WATCHDOG_MODE_ENABLE | WATCHDOG_MODE_RESET_ENABLE,
54 writel(0xa57 << 1 | 1, wdt_base + WATCHDOG_CTRL_REG); 55 wdt_base + WATCHDOG_MODE_REG);
55 while(1) { 56
57 /*
58 * Restart the watchdog. The default (and lowest) interval
59 * value for the watchdog is 0.5s.
60 */
61 writel(WATCHDOG_CTRL_RESTART, wdt_base + WATCHDOG_CTRL_REG);
62
63 while (1) {
56 mdelay(5); 64 mdelay(5);
57 writel(3, wdt_base + WATCHDOG_MODE_REG); 65 writel(WATCHDOG_MODE_ENABLE | WATCHDOG_MODE_RESET_ENABLE,
66 wdt_base + WATCHDOG_MODE_REG);
58 } 67 }
59} 68}
60 69
@@ -91,6 +100,6 @@ DT_MACHINE_START(SUNXI_DT, "Allwinner A1X (Device Tree)")
91 .init_irq = sunxi_init_irq, 100 .init_irq = sunxi_init_irq,
92 .handle_irq = sunxi_handle_irq, 101 .handle_irq = sunxi_handle_irq,
93 .restart = sunxi_restart, 102 .restart = sunxi_restart,
94 .timer = &sunxi_timer, 103 .init_time = &sunxi_timer_init,
95 .dt_compat = sunxi_board_dt_compat, 104 .dt_compat = sunxi_board_dt_compat,
96MACHINE_END 105MACHINE_END
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index b442f15fd01a..d1c4893894ce 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -4,11 +4,11 @@ comment "NVIDIA Tegra options"
4 4
5config ARCH_TEGRA_2x_SOC 5config ARCH_TEGRA_2x_SOC
6 bool "Enable support for Tegra20 family" 6 bool "Enable support for Tegra20 family"
7 select ARCH_REQUIRE_GPIOLIB 7 select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP
8 select ARM_ERRATA_720789 8 select ARM_ERRATA_720789
9 select ARM_ERRATA_742230 9 select ARM_ERRATA_742230 if SMP
10 select ARM_ERRATA_751472 10 select ARM_ERRATA_751472
11 select ARM_ERRATA_754327 11 select ARM_ERRATA_754327 if SMP
12 select ARM_ERRATA_764369 if SMP 12 select ARM_ERRATA_764369 if SMP
13 select ARM_GIC 13 select ARM_GIC
14 select CPU_FREQ_TABLE if CPU_FREQ 14 select CPU_FREQ_TABLE if CPU_FREQ
@@ -26,7 +26,6 @@ config ARCH_TEGRA_2x_SOC
26 26
27config ARCH_TEGRA_3x_SOC 27config ARCH_TEGRA_3x_SOC
28 bool "Enable support for Tegra30 family" 28 bool "Enable support for Tegra30 family"
29 select ARCH_REQUIRE_GPIOLIB
30 select ARM_ERRATA_743622 29 select ARM_ERRATA_743622
31 select ARM_ERRATA_751472 30 select ARM_ERRATA_751472
32 select ARM_ERRATA_754322 31 select ARM_ERRATA_754322
@@ -44,6 +43,18 @@ config ARCH_TEGRA_3x_SOC
44 Support for NVIDIA Tegra T30 processor family, based on the 43 Support for NVIDIA Tegra T30 processor family, based on the
45 ARM CortexA9MP CPU and the ARM PL310 L2 cache controller 44 ARM CortexA9MP CPU and the ARM PL310 L2 cache controller
46 45
46config ARCH_TEGRA_114_SOC
47 bool "Enable support for Tegra114 family"
48 select ARM_ARCH_TIMER
49 select ARM_GIC
50 select ARM_L1_CACHE_SHIFT_6
51 select CPU_V7
52 select PINCTRL
53 select PINCTRL_TEGRA114
54 help
55 Support for NVIDIA Tegra T114 processor family, based on the
56 ARM CortexA15MP CPU
57
47config TEGRA_PCI 58config TEGRA_PCI
48 bool "PCI Express support" 59 bool "PCI Express support"
49 depends on ARCH_TEGRA_2x_SOC 60 depends on ARCH_TEGRA_2x_SOC
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index 0979e8bba78a..f6b46ae2b7f8 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -1,39 +1,38 @@
1obj-y += common.o 1obj-y += common.o
2obj-y += io.o 2obj-y += io.o
3obj-y += irq.o 3obj-y += irq.o
4obj-y += clock.o
5obj-y += timer.o
6obj-y += fuse.o 4obj-y += fuse.o
7obj-y += pmc.o 5obj-y += pmc.o
8obj-y += flowctrl.o 6obj-y += flowctrl.o
9obj-y += powergate.o 7obj-y += powergate.o
10obj-y += apbio.o 8obj-y += apbio.o
11obj-y += pm.o 9obj-y += pm.o
10obj-y += reset.o
11obj-y += reset-handler.o
12obj-y += sleep.o
12obj-$(CONFIG_CPU_IDLE) += cpuidle.o 13obj-$(CONFIG_CPU_IDLE) += cpuidle.o
13obj-$(CONFIG_CPU_IDLE) += sleep.o
14obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20_clocks.o
15obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20_clocks_data.o
16obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20_speedo.o 14obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20_speedo.o
17obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_emc.o 15obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_emc.o
18obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += sleep-tegra20.o 16obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += sleep-tegra20.o
19ifeq ($(CONFIG_CPU_IDLE),y) 17ifeq ($(CONFIG_CPU_IDLE),y)
20obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += cpuidle-tegra20.o 18obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += cpuidle-tegra20.o
21endif 19endif
22obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra30_clocks.o
23obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra30_clocks_data.o
24obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra30_speedo.o 20obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra30_speedo.o
25obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += sleep-tegra30.o 21obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += sleep-tegra30.o
26ifeq ($(CONFIG_CPU_IDLE),y) 22ifeq ($(CONFIG_CPU_IDLE),y)
27obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += cpuidle-tegra30.o 23obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += cpuidle-tegra30.o
28endif 24endif
29obj-$(CONFIG_SMP) += platsmp.o headsmp.o 25obj-$(CONFIG_SMP) += platsmp.o headsmp.o
30obj-$(CONFIG_SMP) += reset.o
31obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 26obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
32obj-$(CONFIG_CPU_FREQ) += cpu-tegra.o 27obj-$(CONFIG_CPU_FREQ) += cpu-tegra.o
33obj-$(CONFIG_TEGRA_PCI) += pcie.o 28obj-$(CONFIG_TEGRA_PCI) += pcie.o
34 29
35obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-dt-tegra20.o 30obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-dt-tegra20.o
36obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o 31obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o
32obj-$(CONFIG_ARCH_TEGRA_114_SOC) += board-dt-tegra114.o
33ifeq ($(CONFIG_CPU_IDLE),y)
34obj-$(CONFIG_ARCH_TEGRA_114_SOC) += cpuidle-tegra114.o
35endif
37 36
38obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-harmony-pcie.o 37obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-harmony-pcie.o
39 38
diff --git a/arch/arm/mach-tegra/apbio.c b/arch/arm/mach-tegra/apbio.c
index d091675ba376..d7aa52ea6cfc 100644
--- a/arch/arm/mach-tegra/apbio.c
+++ b/arch/arm/mach-tegra/apbio.c
@@ -38,7 +38,7 @@ static void tegra_apb_writel_direct(u32 value, unsigned long offset);
38static struct dma_chan *tegra_apb_dma_chan; 38static struct dma_chan *tegra_apb_dma_chan;
39static struct dma_slave_config dma_sconfig; 39static struct dma_slave_config dma_sconfig;
40 40
41bool tegra_apb_dma_init(void) 41static bool tegra_apb_dma_init(void)
42{ 42{
43 dma_cap_mask_t mask; 43 dma_cap_mask_t mask;
44 44
diff --git a/arch/arm/mach-tegra/board-dt-tegra114.c b/arch/arm/mach-tegra/board-dt-tegra114.c
new file mode 100644
index 000000000000..085d63637b62
--- /dev/null
+++ b/arch/arm/mach-tegra/board-dt-tegra114.c
@@ -0,0 +1,46 @@
1/*
2 * NVIDIA Tegra114 device tree board support
3 *
4 * Copyright (C) 2013 NVIDIA Corporation
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/of.h>
18#include <linux/of_platform.h>
19#include <linux/clocksource.h>
20
21#include <asm/mach/arch.h>
22
23#include "board.h"
24#include "common.h"
25
26static void __init tegra114_dt_init(void)
27{
28 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
29}
30
31static const char * const tegra114_dt_board_compat[] = {
32 "nvidia,tegra114",
33 NULL,
34};
35
36DT_MACHINE_START(TEGRA114_DT, "NVIDIA Tegra114 (Flattened Device Tree)")
37 .smp = smp_ops(tegra_smp_ops),
38 .map_io = tegra_map_common_io,
39 .init_early = tegra114_init_early,
40 .init_irq = tegra_dt_init_irq,
41 .init_time = clocksource_of_init,
42 .init_machine = tegra114_dt_init,
43 .init_late = tegra_init_late,
44 .restart = tegra_assert_system_reset,
45 .dt_compat = tegra114_dt_board_compat,
46MACHINE_END
diff --git a/arch/arm/mach-tegra/board-dt-tegra20.c b/arch/arm/mach-tegra/board-dt-tegra20.c
index 734d9cc87f2e..a0edf2510280 100644
--- a/arch/arm/mach-tegra/board-dt-tegra20.c
+++ b/arch/arm/mach-tegra/board-dt-tegra20.c
@@ -15,6 +15,7 @@
15 * 15 *
16 */ 16 */
17 17
18#include <linux/clocksource.h>
18#include <linux/kernel.h> 19#include <linux/kernel.h>
19#include <linux/init.h> 20#include <linux/init.h>
20#include <linux/platform_device.h> 21#include <linux/platform_device.h>
@@ -25,7 +26,6 @@
25#include <linux/of.h> 26#include <linux/of.h>
26#include <linux/of_address.h> 27#include <linux/of_address.h>
27#include <linux/of_fdt.h> 28#include <linux/of_fdt.h>
28#include <linux/of_irq.h>
29#include <linux/of_platform.h> 29#include <linux/of_platform.h>
30#include <linux/pda_power.h> 30#include <linux/pda_power.h>
31#include <linux/platform_data/tegra_usb.h> 31#include <linux/platform_data/tegra_usb.h>
@@ -34,106 +34,51 @@
34#include <linux/i2c-tegra.h> 34#include <linux/i2c-tegra.h>
35#include <linux/usb/tegra_usb_phy.h> 35#include <linux/usb/tegra_usb_phy.h>
36 36
37#include <asm/hardware/gic.h>
38#include <asm/mach-types.h> 37#include <asm/mach-types.h>
39#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
40#include <asm/mach/time.h> 39#include <asm/mach/time.h>
41#include <asm/setup.h> 40#include <asm/setup.h>
42 41
43#include "board.h" 42#include "board.h"
44#include "clock.h"
45#include "common.h" 43#include "common.h"
46#include "iomap.h" 44#include "iomap.h"
47 45
48struct tegra_ehci_platform_data tegra_ehci1_pdata = { 46static struct tegra_ehci_platform_data tegra_ehci1_pdata = {
49 .operating_mode = TEGRA_USB_OTG, 47 .operating_mode = TEGRA_USB_OTG,
50 .power_down_on_bus_suspend = 1, 48 .power_down_on_bus_suspend = 1,
51 .vbus_gpio = -1, 49 .vbus_gpio = -1,
52}; 50};
53 51
54struct tegra_ulpi_config tegra_ehci2_ulpi_phy_config = { 52static struct tegra_ulpi_config tegra_ehci2_ulpi_phy_config = {
55 .reset_gpio = -1, 53 .reset_gpio = -1,
56 .clk = "cdev2", 54 .clk = "cdev2",
57}; 55};
58 56
59struct tegra_ehci_platform_data tegra_ehci2_pdata = { 57static struct tegra_ehci_platform_data tegra_ehci2_pdata = {
60 .phy_config = &tegra_ehci2_ulpi_phy_config, 58 .phy_config = &tegra_ehci2_ulpi_phy_config,
61 .operating_mode = TEGRA_USB_HOST, 59 .operating_mode = TEGRA_USB_HOST,
62 .power_down_on_bus_suspend = 1, 60 .power_down_on_bus_suspend = 1,
63 .vbus_gpio = -1, 61 .vbus_gpio = -1,
64}; 62};
65 63
66struct tegra_ehci_platform_data tegra_ehci3_pdata = { 64static struct tegra_ehci_platform_data tegra_ehci3_pdata = {
67 .operating_mode = TEGRA_USB_HOST, 65 .operating_mode = TEGRA_USB_HOST,
68 .power_down_on_bus_suspend = 1, 66 .power_down_on_bus_suspend = 1,
69 .vbus_gpio = -1, 67 .vbus_gpio = -1,
70}; 68};
71 69
72struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = { 70static struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = {
73 OF_DEV_AUXDATA("nvidia,tegra20-sdhci", TEGRA_SDMMC1_BASE, "sdhci-tegra.0", NULL), 71 OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xC5000000, "tegra-ehci.0",
74 OF_DEV_AUXDATA("nvidia,tegra20-sdhci", TEGRA_SDMMC2_BASE, "sdhci-tegra.1", NULL),
75 OF_DEV_AUXDATA("nvidia,tegra20-sdhci", TEGRA_SDMMC3_BASE, "sdhci-tegra.2", NULL),
76 OF_DEV_AUXDATA("nvidia,tegra20-sdhci", TEGRA_SDMMC4_BASE, "sdhci-tegra.3", NULL),
77 OF_DEV_AUXDATA("nvidia,tegra20-i2c", TEGRA_I2C_BASE, "tegra-i2c.0", NULL),
78 OF_DEV_AUXDATA("nvidia,tegra20-i2c", TEGRA_I2C2_BASE, "tegra-i2c.1", NULL),
79 OF_DEV_AUXDATA("nvidia,tegra20-i2c", TEGRA_I2C3_BASE, "tegra-i2c.2", NULL),
80 OF_DEV_AUXDATA("nvidia,tegra20-i2c-dvc", TEGRA_DVC_BASE, "tegra-i2c.3", NULL),
81 OF_DEV_AUXDATA("nvidia,tegra20-i2s", TEGRA_I2S1_BASE, "tegra20-i2s.0", NULL),
82 OF_DEV_AUXDATA("nvidia,tegra20-i2s", TEGRA_I2S2_BASE, "tegra20-i2s.1", NULL),
83 OF_DEV_AUXDATA("nvidia,tegra20-das", TEGRA_APB_MISC_DAS_BASE, "tegra20-das", NULL),
84 OF_DEV_AUXDATA("nvidia,tegra20-ehci", TEGRA_USB_BASE, "tegra-ehci.0",
85 &tegra_ehci1_pdata), 72 &tegra_ehci1_pdata),
86 OF_DEV_AUXDATA("nvidia,tegra20-ehci", TEGRA_USB2_BASE, "tegra-ehci.1", 73 OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xC5004000, "tegra-ehci.1",
87 &tegra_ehci2_pdata), 74 &tegra_ehci2_pdata),
88 OF_DEV_AUXDATA("nvidia,tegra20-ehci", TEGRA_USB3_BASE, "tegra-ehci.2", 75 OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xC5008000, "tegra-ehci.2",
89 &tegra_ehci3_pdata), 76 &tegra_ehci3_pdata),
90 OF_DEV_AUXDATA("nvidia,tegra20-apbdma", TEGRA_APB_DMA_BASE, "tegra-apbdma", NULL),
91 OF_DEV_AUXDATA("nvidia,tegra20-pwm", TEGRA_PWFM_BASE, "tegra-pwm", NULL),
92 OF_DEV_AUXDATA("nvidia,tegra20-sflash", 0x7000c380, "spi", NULL),
93 OF_DEV_AUXDATA("nvidia,tegra20-slink", 0x7000D400, "spi_tegra.0", NULL),
94 OF_DEV_AUXDATA("nvidia,tegra20-slink", 0x7000D600, "spi_tegra.1", NULL),
95 OF_DEV_AUXDATA("nvidia,tegra20-slink", 0x7000D800, "spi_tegra.2", NULL),
96 OF_DEV_AUXDATA("nvidia,tegra20-slink", 0x7000DA00, "spi_tegra.3", NULL),
97 OF_DEV_AUXDATA("nvidia,tegra20-host1x", 0x50000000, "host1x", NULL),
98 OF_DEV_AUXDATA("nvidia,tegra20-dc", 0x54200000, "tegradc.0", NULL),
99 OF_DEV_AUXDATA("nvidia,tegra20-dc", 0x54240000, "tegradc.1", NULL),
100 OF_DEV_AUXDATA("nvidia,tegra20-hdmi", 0x54280000, "hdmi", NULL),
101 OF_DEV_AUXDATA("nvidia,tegra20-dsi", 0x54300000, "dsi", NULL),
102 OF_DEV_AUXDATA("nvidia,tegra20-tvo", 0x542c0000, "tvo", NULL),
103 {} 77 {}
104}; 78};
105 79
106static __initdata struct tegra_clk_init_table tegra_dt_clk_init_table[] = {
107 /* name parent rate enabled */
108 { "uarta", "pll_p", 216000000, true },
109 { "uartd", "pll_p", 216000000, true },
110 { "usbd", "clk_m", 12000000, false },
111 { "usb2", "clk_m", 12000000, false },
112 { "usb3", "clk_m", 12000000, false },
113 { "pll_a", "pll_p_out1", 56448000, true },
114 { "pll_a_out0", "pll_a", 11289600, true },
115 { "cdev1", NULL, 0, true },
116 { "blink", "clk_32k", 32768, true },
117 { "i2s1", "pll_a_out0", 11289600, false},
118 { "i2s2", "pll_a_out0", 11289600, false},
119 { "sdmmc1", "pll_p", 48000000, false},
120 { "sdmmc3", "pll_p", 48000000, false},
121 { "sdmmc4", "pll_p", 48000000, false},
122 { "spi", "pll_p", 20000000, false },
123 { "sbc1", "pll_p", 100000000, false },
124 { "sbc2", "pll_p", 100000000, false },
125 { "sbc3", "pll_p", 100000000, false },
126 { "sbc4", "pll_p", 100000000, false },
127 { "host1x", "pll_c", 150000000, false },
128 { "disp1", "pll_p", 600000000, false },
129 { "disp2", "pll_p", 600000000, false },
130 { NULL, NULL, 0, 0},
131};
132
133static void __init tegra_dt_init(void) 80static void __init tegra_dt_init(void)
134{ 81{
135 tegra_clk_init_from_table(tegra_dt_clk_init_table);
136
137 /* 82 /*
138 * Finished with the static registrations now; fill in the missing 83 * Finished with the static registrations now; fill in the missing
139 * devices 84 * devices
@@ -202,8 +147,7 @@ DT_MACHINE_START(TEGRA_DT, "nVidia Tegra20 (Flattened Device Tree)")
202 .smp = smp_ops(tegra_smp_ops), 147 .smp = smp_ops(tegra_smp_ops),
203 .init_early = tegra20_init_early, 148 .init_early = tegra20_init_early,
204 .init_irq = tegra_dt_init_irq, 149 .init_irq = tegra_dt_init_irq,
205 .handle_irq = gic_handle_irq, 150 .init_time = clocksource_of_init,
206 .timer = &tegra_sys_timer,
207 .init_machine = tegra_dt_init, 151 .init_machine = tegra_dt_init,
208 .init_late = tegra_dt_init_late, 152 .init_late = tegra_dt_init_late,
209 .restart = tegra_assert_system_reset, 153 .restart = tegra_assert_system_reset,
diff --git a/arch/arm/mach-tegra/board-dt-tegra30.c b/arch/arm/mach-tegra/board-dt-tegra30.c
index 6497d1236b08..bf68567e549d 100644
--- a/arch/arm/mach-tegra/board-dt-tegra30.c
+++ b/arch/arm/mach-tegra/board-dt-tegra30.c
@@ -23,6 +23,7 @@
23 * 23 *
24 */ 24 */
25 25
26#include <linux/clocksource.h>
26#include <linux/kernel.h> 27#include <linux/kernel.h>
27#include <linux/of.h> 28#include <linux/of.h>
28#include <linux/of_address.h> 29#include <linux/of_address.h>
@@ -31,75 +32,14 @@
31#include <linux/of_platform.h> 32#include <linux/of_platform.h>
32 33
33#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
34#include <asm/hardware/gic.h>
35 35
36#include "board.h" 36#include "board.h"
37#include "clock.h"
38#include "common.h" 37#include "common.h"
39#include "iomap.h" 38#include "iomap.h"
40 39
41struct of_dev_auxdata tegra30_auxdata_lookup[] __initdata = {
42 OF_DEV_AUXDATA("nvidia,tegra20-sdhci", 0x78000000, "sdhci-tegra.0", NULL),
43 OF_DEV_AUXDATA("nvidia,tegra20-sdhci", 0x78000200, "sdhci-tegra.1", NULL),
44 OF_DEV_AUXDATA("nvidia,tegra20-sdhci", 0x78000400, "sdhci-tegra.2", NULL),
45 OF_DEV_AUXDATA("nvidia,tegra20-sdhci", 0x78000600, "sdhci-tegra.3", NULL),
46 OF_DEV_AUXDATA("nvidia,tegra20-i2c", 0x7000C000, "tegra-i2c.0", NULL),
47 OF_DEV_AUXDATA("nvidia,tegra20-i2c", 0x7000C400, "tegra-i2c.1", NULL),
48 OF_DEV_AUXDATA("nvidia,tegra20-i2c", 0x7000C500, "tegra-i2c.2", NULL),
49 OF_DEV_AUXDATA("nvidia,tegra20-i2c", 0x7000C700, "tegra-i2c.3", NULL),
50 OF_DEV_AUXDATA("nvidia,tegra20-i2c", 0x7000D000, "tegra-i2c.4", NULL),
51 OF_DEV_AUXDATA("nvidia,tegra30-ahub", 0x70080000, "tegra30-ahub", NULL),
52 OF_DEV_AUXDATA("nvidia,tegra30-apbdma", 0x6000a000, "tegra-apbdma", NULL),
53 OF_DEV_AUXDATA("nvidia,tegra30-pwm", TEGRA_PWFM_BASE, "tegra-pwm", NULL),
54 OF_DEV_AUXDATA("nvidia,tegra30-slink", 0x7000D400, "spi_tegra.0", NULL),
55 OF_DEV_AUXDATA("nvidia,tegra30-slink", 0x7000D600, "spi_tegra.1", NULL),
56 OF_DEV_AUXDATA("nvidia,tegra30-slink", 0x7000D800, "spi_tegra.2", NULL),
57 OF_DEV_AUXDATA("nvidia,tegra30-slink", 0x7000DA00, "spi_tegra.3", NULL),
58 OF_DEV_AUXDATA("nvidia,tegra30-slink", 0x7000DC00, "spi_tegra.4", NULL),
59 OF_DEV_AUXDATA("nvidia,tegra30-slink", 0x7000DE00, "spi_tegra.5", NULL),
60 OF_DEV_AUXDATA("nvidia,tegra30-host1x", 0x50000000, "host1x", NULL),
61 OF_DEV_AUXDATA("nvidia,tegra30-dc", 0x54200000, "tegradc.0", NULL),
62 OF_DEV_AUXDATA("nvidia,tegra30-dc", 0x54240000, "tegradc.1", NULL),
63 OF_DEV_AUXDATA("nvidia,tegra30-hdmi", 0x54280000, "hdmi", NULL),
64 OF_DEV_AUXDATA("nvidia,tegra30-dsi", 0x54300000, "dsi", NULL),
65 OF_DEV_AUXDATA("nvidia,tegra30-tvo", 0x542c0000, "tvo", NULL),
66 {}
67};
68
69static __initdata struct tegra_clk_init_table tegra_dt_clk_init_table[] = {
70 /* name parent rate enabled */
71 { "uarta", "pll_p", 408000000, true },
72 { "pll_a", "pll_p_out1", 564480000, true },
73 { "pll_a_out0", "pll_a", 11289600, true },
74 { "extern1", "pll_a_out0", 0, true },
75 { "clk_out_1", "extern1", 0, true },
76 { "blink", "clk_32k", 32768, true },
77 { "i2s0", "pll_a_out0", 11289600, false},
78 { "i2s1", "pll_a_out0", 11289600, false},
79 { "i2s2", "pll_a_out0", 11289600, false},
80 { "i2s3", "pll_a_out0", 11289600, false},
81 { "i2s4", "pll_a_out0", 11289600, false},
82 { "sdmmc1", "pll_p", 48000000, false},
83 { "sdmmc3", "pll_p", 48000000, false},
84 { "sdmmc4", "pll_p", 48000000, false},
85 { "sbc1", "pll_p", 100000000, false},
86 { "sbc2", "pll_p", 100000000, false},
87 { "sbc3", "pll_p", 100000000, false},
88 { "sbc4", "pll_p", 100000000, false},
89 { "sbc5", "pll_p", 100000000, false},
90 { "sbc6", "pll_p", 100000000, false},
91 { "host1x", "pll_c", 150000000, false},
92 { "disp1", "pll_p", 600000000, false},
93 { "disp2", "pll_p", 600000000, false},
94 { NULL, NULL, 0, 0},
95};
96
97static void __init tegra30_dt_init(void) 40static void __init tegra30_dt_init(void)
98{ 41{
99 tegra_clk_init_from_table(tegra_dt_clk_init_table); 42 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
100
101 of_platform_populate(NULL, of_default_bus_match_table,
102 tegra30_auxdata_lookup, NULL);
103} 43}
104 44
105static const char *tegra30_dt_board_compat[] = { 45static const char *tegra30_dt_board_compat[] = {
@@ -112,8 +52,7 @@ DT_MACHINE_START(TEGRA30_DT, "NVIDIA Tegra30 (Flattened Device Tree)")
112 .map_io = tegra_map_common_io, 52 .map_io = tegra_map_common_io,
113 .init_early = tegra30_init_early, 53 .init_early = tegra30_init_early,
114 .init_irq = tegra_dt_init_irq, 54 .init_irq = tegra_dt_init_irq,
115 .handle_irq = gic_handle_irq, 55 .init_time = clocksource_of_init,
116 .timer = &tegra_sys_timer,
117 .init_machine = tegra30_dt_init, 56 .init_machine = tegra30_dt_init,
118 .init_late = tegra_init_late, 57 .init_late = tegra_init_late,
119 .restart = tegra_assert_system_reset, 58 .restart = tegra_assert_system_reset,
diff --git a/arch/arm/mach-tegra/board.h b/arch/arm/mach-tegra/board.h
index 91fbe733a21e..86851c81a350 100644
--- a/arch/arm/mach-tegra/board.h
+++ b/arch/arm/mach-tegra/board.h
@@ -1,6 +1,7 @@
1/* 1/*
2 * arch/arm/mach-tegra/board.h 2 * arch/arm/mach-tegra/board.h
3 * 3 *
4 * Copyright (c) 2013 NVIDIA Corporation. All rights reserved.
4 * Copyright (C) 2010 Google, Inc. 5 * Copyright (C) 2010 Google, Inc.
5 * 6 *
6 * Author: 7 * Author:
@@ -27,6 +28,7 @@ void tegra_assert_system_reset(char mode, const char *cmd);
27 28
28void __init tegra20_init_early(void); 29void __init tegra20_init_early(void);
29void __init tegra30_init_early(void); 30void __init tegra30_init_early(void);
31void __init tegra114_init_early(void);
30void __init tegra_map_common_io(void); 32void __init tegra_map_common_io(void);
31void __init tegra_init_irq(void); 33void __init tegra_init_irq(void);
32void __init tegra_dt_init_irq(void); 34void __init tegra_dt_init_irq(void);
@@ -55,5 +57,4 @@ static inline int harmony_pcie_init(void) { return 0; }
55 57
56void __init tegra_paz00_wifikill_init(void); 58void __init tegra_paz00_wifikill_init(void);
57 59
58extern struct sys_timer tegra_sys_timer;
59#endif 60#endif
diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c
deleted file mode 100644
index 867bf8bf5561..000000000000
--- a/arch/arm/mach-tegra/clock.c
+++ /dev/null
@@ -1,166 +0,0 @@
1/*
2 *
3 * Copyright (C) 2010 Google, Inc.
4 * Copyright (c) 2012 NVIDIA CORPORATION. All rights reserved.
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/clkdev.h>
23#include <linux/init.h>
24#include <linux/list.h>
25#include <linux/module.h>
26#include <linux/sched.h>
27#include <linux/seq_file.h>
28#include <linux/slab.h>
29
30#include "board.h"
31#include "clock.h"
32#include "tegra_cpu_car.h"
33
34/* Global data of Tegra CPU CAR ops */
35struct tegra_cpu_car_ops *tegra_cpu_car_ops;
36
37/*
38 * Locking:
39 *
40 * An additional mutex, clock_list_lock, is used to protect the list of all
41 * clocks.
42 *
43 */
44static DEFINE_MUTEX(clock_list_lock);
45static LIST_HEAD(clocks);
46
47void tegra_clk_add(struct clk *clk)
48{
49 struct clk_tegra *c = to_clk_tegra(__clk_get_hw(clk));
50
51 mutex_lock(&clock_list_lock);
52 list_add(&c->node, &clocks);
53 mutex_unlock(&clock_list_lock);
54}
55
56struct clk *tegra_get_clock_by_name(const char *name)
57{
58 struct clk_tegra *c;
59 struct clk *ret = NULL;
60 mutex_lock(&clock_list_lock);
61 list_for_each_entry(c, &clocks, node) {
62 if (strcmp(__clk_get_name(c->hw.clk), name) == 0) {
63 ret = c->hw.clk;
64 break;
65 }
66 }
67 mutex_unlock(&clock_list_lock);
68 return ret;
69}
70
71static int tegra_clk_init_one_from_table(struct tegra_clk_init_table *table)
72{
73 struct clk *c;
74 struct clk *p;
75 struct clk *parent;
76
77 int ret = 0;
78
79 c = tegra_get_clock_by_name(table->name);
80
81 if (!c) {
82 pr_warn("Unable to initialize clock %s\n",
83 table->name);
84 return -ENODEV;
85 }
86
87 parent = clk_get_parent(c);
88
89 if (table->parent) {
90 p = tegra_get_clock_by_name(table->parent);
91 if (!p) {
92 pr_warn("Unable to find parent %s of clock %s\n",
93 table->parent, table->name);
94 return -ENODEV;
95 }
96
97 if (parent != p) {
98 ret = clk_set_parent(c, p);
99 if (ret) {
100 pr_warn("Unable to set parent %s of clock %s: %d\n",
101 table->parent, table->name, ret);
102 return -EINVAL;
103 }
104 }
105 }
106
107 if (table->rate && table->rate != clk_get_rate(c)) {
108 ret = clk_set_rate(c, table->rate);
109 if (ret) {
110 pr_warn("Unable to set clock %s to rate %lu: %d\n",
111 table->name, table->rate, ret);
112 return -EINVAL;
113 }
114 }
115
116 if (table->enabled) {
117 ret = clk_prepare_enable(c);
118 if (ret) {
119 pr_warn("Unable to enable clock %s: %d\n",
120 table->name, ret);
121 return -EINVAL;
122 }
123 }
124
125 return 0;
126}
127
128void tegra_clk_init_from_table(struct tegra_clk_init_table *table)
129{
130 for (; table->name; table++)
131 tegra_clk_init_one_from_table(table);
132}
133
134void tegra_periph_reset_deassert(struct clk *c)
135{
136 struct clk_tegra *clk = to_clk_tegra(__clk_get_hw(c));
137 BUG_ON(!clk->reset);
138 clk->reset(__clk_get_hw(c), false);
139}
140EXPORT_SYMBOL(tegra_periph_reset_deassert);
141
142void tegra_periph_reset_assert(struct clk *c)
143{
144 struct clk_tegra *clk = to_clk_tegra(__clk_get_hw(c));
145 BUG_ON(!clk->reset);
146 clk->reset(__clk_get_hw(c), true);
147}
148EXPORT_SYMBOL(tegra_periph_reset_assert);
149
150/* Several extended clock configuration bits (e.g., clock routing, clock
151 * phase control) are included in PLL and peripheral clock source
152 * registers. */
153int tegra_clk_cfg_ex(struct clk *c, enum tegra_clk_ex_param p, u32 setting)
154{
155 int ret = 0;
156 struct clk_tegra *clk = to_clk_tegra(__clk_get_hw(c));
157
158 if (!clk->clk_cfg_ex) {
159 ret = -ENOSYS;
160 goto out;
161 }
162 ret = clk->clk_cfg_ex(__clk_get_hw(c), p, setting);
163
164out:
165 return ret;
166}
diff --git a/arch/arm/mach-tegra/clock.h b/arch/arm/mach-tegra/clock.h
deleted file mode 100644
index 2aa37f5c44c0..000000000000
--- a/arch/arm/mach-tegra/clock.h
+++ /dev/null
@@ -1,153 +0,0 @@
1/*
2 * arch/arm/mach-tegra/include/mach/clock.h
3 *
4 * Copyright (C) 2010 Google, Inc.
5 * Copyright (c) 2012 NVIDIA CORPORATION. All rights reserved.
6 *
7 * Author:
8 * Colin Cross <ccross@google.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#ifndef __MACH_TEGRA_CLOCK_H
22#define __MACH_TEGRA_CLOCK_H
23
24#include <linux/clk-provider.h>
25#include <linux/clkdev.h>
26#include <linux/list.h>
27
28#include <mach/clk.h>
29
30#define DIV_BUS (1 << 0)
31#define DIV_U71 (1 << 1)
32#define DIV_U71_FIXED (1 << 2)
33#define DIV_2 (1 << 3)
34#define DIV_U16 (1 << 4)
35#define PLL_FIXED (1 << 5)
36#define PLL_HAS_CPCON (1 << 6)
37#define MUX (1 << 7)
38#define PLLD (1 << 8)
39#define PERIPH_NO_RESET (1 << 9)
40#define PERIPH_NO_ENB (1 << 10)
41#define PERIPH_EMC_ENB (1 << 11)
42#define PERIPH_MANUAL_RESET (1 << 12)
43#define PLL_ALT_MISC_REG (1 << 13)
44#define PLLU (1 << 14)
45#define PLLX (1 << 15)
46#define MUX_PWM (1 << 16)
47#define MUX8 (1 << 17)
48#define DIV_U71_UART (1 << 18)
49#define MUX_CLK_OUT (1 << 19)
50#define PLLM (1 << 20)
51#define DIV_U71_INT (1 << 21)
52#define DIV_U71_IDLE (1 << 22)
53#define ENABLE_ON_INIT (1 << 28)
54#define PERIPH_ON_APB (1 << 29)
55
56struct clk_tegra;
57#define to_clk_tegra(_hw) container_of(_hw, struct clk_tegra, hw)
58
59struct clk_mux_sel {
60 struct clk *input;
61 u32 value;
62};
63
64struct clk_pll_freq_table {
65 unsigned long input_rate;
66 unsigned long output_rate;
67 u16 n;
68 u16 m;
69 u8 p;
70 u8 cpcon;
71};
72
73enum clk_state {
74 UNINITIALIZED = 0,
75 ON,
76 OFF,
77};
78
79struct clk_tegra {
80 /* node for master clocks list */
81 struct list_head node; /* node for list of all clocks */
82 struct clk_lookup lookup;
83 struct clk_hw hw;
84
85 bool set;
86 unsigned long fixed_rate;
87 unsigned long max_rate;
88 unsigned long min_rate;
89 u32 flags;
90 const char *name;
91
92 enum clk_state state;
93 u32 div;
94 u32 mul;
95
96 u32 reg;
97 u32 reg_shift;
98
99 struct list_head shared_bus_list;
100
101 union {
102 struct {
103 unsigned int clk_num;
104 } periph;
105 struct {
106 unsigned long input_min;
107 unsigned long input_max;
108 unsigned long cf_min;
109 unsigned long cf_max;
110 unsigned long vco_min;
111 unsigned long vco_max;
112 const struct clk_pll_freq_table *freq_table;
113 int lock_delay;
114 unsigned long fixed_rate;
115 } pll;
116 struct {
117 u32 sel;
118 u32 reg_mask;
119 } mux;
120 struct {
121 struct clk *main;
122 struct clk *backup;
123 } cpu;
124 struct {
125 struct list_head node;
126 bool enabled;
127 unsigned long rate;
128 } shared_bus_user;
129 } u;
130
131 void (*reset)(struct clk_hw *, bool);
132 int (*clk_cfg_ex)(struct clk_hw *, enum tegra_clk_ex_param, u32);
133};
134
135struct clk_duplicate {
136 const char *name;
137 struct clk_lookup lookup;
138};
139
140struct tegra_clk_init_table {
141 const char *name;
142 const char *parent;
143 unsigned long rate;
144 bool enabled;
145};
146
147void tegra_clk_add(struct clk *c);
148void tegra2_init_clocks(void);
149void tegra30_init_clocks(void);
150struct clk *tegra_get_clock_by_name(const char *name);
151void tegra_clk_init_from_table(struct tegra_clk_init_table *table);
152
153#endif
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index d54cfc54b9fe..5449a3f2977b 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -1,6 +1,7 @@
1/* 1/*
2 * arch/arm/mach-tegra/common.c 2 * arch/arm/mach-tegra/common.c
3 * 3 *
4 * Copyright (c) 2013 NVIDIA Corporation. All rights reserved.
4 * Copyright (C) 2010 Google, Inc. 5 * Copyright (C) 2010 Google, Inc.
5 * 6 *
6 * Author: 7 * Author:
@@ -21,15 +22,14 @@
21#include <linux/io.h> 22#include <linux/io.h>
22#include <linux/clk.h> 23#include <linux/clk.h>
23#include <linux/delay.h> 24#include <linux/delay.h>
24#include <linux/of_irq.h> 25#include <linux/irqchip.h>
26#include <linux/clk/tegra.h>
25 27
26#include <asm/hardware/cache-l2x0.h> 28#include <asm/hardware/cache-l2x0.h>
27#include <asm/hardware/gic.h>
28 29
29#include <mach/powergate.h> 30#include <mach/powergate.h>
30 31
31#include "board.h" 32#include "board.h"
32#include "clock.h"
33#include "common.h" 33#include "common.h"
34#include "fuse.h" 34#include "fuse.h"
35#include "iomap.h" 35#include "iomap.h"
@@ -37,6 +37,7 @@
37#include "apbio.h" 37#include "apbio.h"
38#include "sleep.h" 38#include "sleep.h"
39#include "pm.h" 39#include "pm.h"
40#include "reset.h"
40 41
41/* 42/*
42 * Storage for debug-macro.S's state. 43 * Storage for debug-macro.S's state.
@@ -57,15 +58,11 @@ u32 tegra_uart_config[4] = {
57}; 58};
58 59
59#ifdef CONFIG_OF 60#ifdef CONFIG_OF
60static const struct of_device_id tegra_dt_irq_match[] __initconst = {
61 { .compatible = "arm,cortex-a9-gic", .data = gic_of_init },
62 { }
63};
64
65void __init tegra_dt_init_irq(void) 61void __init tegra_dt_init_irq(void)
66{ 62{
63 tegra_clocks_init();
67 tegra_init_irq(); 64 tegra_init_irq();
68 of_irq_init(tegra_dt_irq_match); 65 irqchip_init();
69} 66}
70#endif 67#endif
71 68
@@ -79,43 +76,6 @@ void tegra_assert_system_reset(char mode, const char *cmd)
79 writel_relaxed(reg, reset); 76 writel_relaxed(reg, reset);
80} 77}
81 78
82#ifdef CONFIG_ARCH_TEGRA_2x_SOC
83static __initdata struct tegra_clk_init_table tegra20_clk_init_table[] = {
84 /* name parent rate enabled */
85 { "clk_m", NULL, 0, true },
86 { "pll_p", "clk_m", 216000000, true },
87 { "pll_p_out1", "pll_p", 28800000, true },
88 { "pll_p_out2", "pll_p", 48000000, true },
89 { "pll_p_out3", "pll_p", 72000000, true },
90 { "pll_p_out4", "pll_p", 24000000, true },
91 { "pll_c", "clk_m", 600000000, true },
92 { "pll_c_out1", "pll_c", 120000000, true },
93 { "sclk", "pll_c_out1", 120000000, true },
94 { "hclk", "sclk", 120000000, true },
95 { "pclk", "hclk", 60000000, true },
96 { "csite", NULL, 0, true },
97 { "emc", NULL, 0, true },
98 { "cpu", NULL, 0, true },
99 { NULL, NULL, 0, 0},
100};
101#endif
102
103#ifdef CONFIG_ARCH_TEGRA_3x_SOC
104static __initdata struct tegra_clk_init_table tegra30_clk_init_table[] = {
105 /* name parent rate enabled */
106 { "clk_m", NULL, 0, true },
107 { "pll_p", "pll_ref", 408000000, true },
108 { "pll_p_out1", "pll_p", 9600000, true },
109 { "pll_p_out4", "pll_p", 102000000, true },
110 { "sclk", "pll_p_out4", 102000000, true },
111 { "hclk", "sclk", 102000000, true },
112 { "pclk", "hclk", 51000000, true },
113 { "csite", NULL, 0, true },
114 { NULL, NULL, 0, 0},
115};
116#endif
117
118
119static void __init tegra_init_cache(void) 79static void __init tegra_init_cache(void)
120{ 80{
121#ifdef CONFIG_CACHE_L2X0 81#ifdef CONFIG_CACHE_L2X0
@@ -134,33 +94,39 @@ static void __init tegra_init_cache(void)
134 94
135} 95}
136 96
137#ifdef CONFIG_ARCH_TEGRA_2x_SOC 97static void __init tegra_init_early(void)
138void __init tegra20_init_early(void)
139{ 98{
99 tegra_cpu_reset_handler_init();
140 tegra_apb_io_init(); 100 tegra_apb_io_init();
141 tegra_init_fuse(); 101 tegra_init_fuse();
142 tegra2_init_clocks();
143 tegra_clk_init_from_table(tegra20_clk_init_table);
144 tegra_init_cache(); 102 tegra_init_cache();
145 tegra_pmc_init(); 103 tegra_pmc_init();
146 tegra_powergate_init(); 104 tegra_powergate_init();
105}
106
107#ifdef CONFIG_ARCH_TEGRA_2x_SOC
108void __init tegra20_init_early(void)
109{
110 tegra_init_early();
147 tegra20_hotplug_init(); 111 tegra20_hotplug_init();
148} 112}
149#endif 113#endif
114
150#ifdef CONFIG_ARCH_TEGRA_3x_SOC 115#ifdef CONFIG_ARCH_TEGRA_3x_SOC
151void __init tegra30_init_early(void) 116void __init tegra30_init_early(void)
152{ 117{
153 tegra_apb_io_init(); 118 tegra_init_early();
154 tegra_init_fuse();
155 tegra30_init_clocks();
156 tegra_clk_init_from_table(tegra30_clk_init_table);
157 tegra_init_cache();
158 tegra_pmc_init();
159 tegra_powergate_init();
160 tegra30_hotplug_init(); 119 tegra30_hotplug_init();
161} 120}
162#endif 121#endif
163 122
123#ifdef CONFIG_ARCH_TEGRA_114_SOC
124void __init tegra114_init_early(void)
125{
126 tegra_init_early();
127}
128#endif
129
164void __init tegra_init_late(void) 130void __init tegra_init_late(void)
165{ 131{
166 tegra_powergate_debugfs_init(); 132 tegra_powergate_debugfs_init();
diff --git a/arch/arm/mach-tegra/common.h b/arch/arm/mach-tegra/common.h
index 02f71b4f1e51..32f8eb3fe344 100644
--- a/arch/arm/mach-tegra/common.h
+++ b/arch/arm/mach-tegra/common.h
@@ -1,4 +1,5 @@
1extern struct smp_operations tegra_smp_ops; 1extern struct smp_operations tegra_smp_ops;
2 2
3extern int tegra_cpu_kill(unsigned int cpu);
3extern void tegra_cpu_die(unsigned int cpu); 4extern void tegra_cpu_die(unsigned int cpu);
4extern int tegra_cpu_disable(unsigned int cpu); 5extern int tegra_cpu_disable(unsigned int cpu);
diff --git a/arch/arm/mach-tegra/cpu-tegra.c b/arch/arm/mach-tegra/cpu-tegra.c
index a74d3c7d2e26..e3d6e15ff188 100644
--- a/arch/arm/mach-tegra/cpu-tegra.c
+++ b/arch/arm/mach-tegra/cpu-tegra.c
@@ -214,24 +214,6 @@ static int tegra_cpu_init(struct cpufreq_policy *policy)
214 if (policy->cpu >= NUM_CPUS) 214 if (policy->cpu >= NUM_CPUS)
215 return -EINVAL; 215 return -EINVAL;
216 216
217 cpu_clk = clk_get_sys(NULL, "cpu");
218 if (IS_ERR(cpu_clk))
219 return PTR_ERR(cpu_clk);
220
221 pll_x_clk = clk_get_sys(NULL, "pll_x");
222 if (IS_ERR(pll_x_clk))
223 return PTR_ERR(pll_x_clk);
224
225 pll_p_clk = clk_get_sys(NULL, "pll_p");
226 if (IS_ERR(pll_p_clk))
227 return PTR_ERR(pll_p_clk);
228
229 emc_clk = clk_get_sys("cpu", "emc");
230 if (IS_ERR(emc_clk)) {
231 clk_put(cpu_clk);
232 return PTR_ERR(emc_clk);
233 }
234
235 clk_prepare_enable(emc_clk); 217 clk_prepare_enable(emc_clk);
236 clk_prepare_enable(cpu_clk); 218 clk_prepare_enable(cpu_clk);
237 219
@@ -243,8 +225,7 @@ static int tegra_cpu_init(struct cpufreq_policy *policy)
243 /* FIXME: what's the actual transition time? */ 225 /* FIXME: what's the actual transition time? */
244 policy->cpuinfo.transition_latency = 300 * 1000; 226 policy->cpuinfo.transition_latency = 300 * 1000;
245 227
246 policy->shared_type = CPUFREQ_SHARED_TYPE_ALL; 228 cpumask_copy(policy->cpus, cpu_possible_mask);
247 cpumask_copy(policy->related_cpus, cpu_possible_mask);
248 229
249 if (policy->cpu == 0) 230 if (policy->cpu == 0)
250 register_pm_notifier(&tegra_cpu_pm_notifier); 231 register_pm_notifier(&tegra_cpu_pm_notifier);
@@ -256,8 +237,6 @@ static int tegra_cpu_exit(struct cpufreq_policy *policy)
256{ 237{
257 cpufreq_frequency_table_cpuinfo(policy, freq_table); 238 cpufreq_frequency_table_cpuinfo(policy, freq_table);
258 clk_disable_unprepare(emc_clk); 239 clk_disable_unprepare(emc_clk);
259 clk_put(emc_clk);
260 clk_put(cpu_clk);
261 return 0; 240 return 0;
262} 241}
263 242
@@ -278,12 +257,32 @@ static struct cpufreq_driver tegra_cpufreq_driver = {
278 257
279static int __init tegra_cpufreq_init(void) 258static int __init tegra_cpufreq_init(void)
280{ 259{
260 cpu_clk = clk_get_sys(NULL, "cpu");
261 if (IS_ERR(cpu_clk))
262 return PTR_ERR(cpu_clk);
263
264 pll_x_clk = clk_get_sys(NULL, "pll_x");
265 if (IS_ERR(pll_x_clk))
266 return PTR_ERR(pll_x_clk);
267
268 pll_p_clk = clk_get_sys(NULL, "pll_p_cclk");
269 if (IS_ERR(pll_p_clk))
270 return PTR_ERR(pll_p_clk);
271
272 emc_clk = clk_get_sys("cpu", "emc");
273 if (IS_ERR(emc_clk)) {
274 clk_put(cpu_clk);
275 return PTR_ERR(emc_clk);
276 }
277
281 return cpufreq_register_driver(&tegra_cpufreq_driver); 278 return cpufreq_register_driver(&tegra_cpufreq_driver);
282} 279}
283 280
284static void __exit tegra_cpufreq_exit(void) 281static void __exit tegra_cpufreq_exit(void)
285{ 282{
286 cpufreq_unregister_driver(&tegra_cpufreq_driver); 283 cpufreq_unregister_driver(&tegra_cpufreq_driver);
284 clk_put(emc_clk);
285 clk_put(cpu_clk);
287} 286}
288 287
289 288
diff --git a/arch/arm/mach-tegra/cpuidle-tegra114.c b/arch/arm/mach-tegra/cpuidle-tegra114.c
new file mode 100644
index 000000000000..0f4e8c483b34
--- /dev/null
+++ b/arch/arm/mach-tegra/cpuidle-tegra114.c
@@ -0,0 +1,61 @@
1/*
2 * Copyright (c) 2013, NVIDIA Corporation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include <linux/kernel.h>
18#include <linux/module.h>
19#include <linux/cpuidle.h>
20
21#include <asm/cpuidle.h>
22
23static struct cpuidle_driver tegra_idle_driver = {
24 .name = "tegra_idle",
25 .owner = THIS_MODULE,
26 .en_core_tk_irqen = 1,
27 .state_count = 1,
28 .states = {
29 [0] = ARM_CPUIDLE_WFI_STATE_PWR(600),
30 },
31};
32
33static DEFINE_PER_CPU(struct cpuidle_device, tegra_idle_device);
34
35int __init tegra114_cpuidle_init(void)
36{
37 int ret;
38 unsigned int cpu;
39 struct cpuidle_device *dev;
40 struct cpuidle_driver *drv = &tegra_idle_driver;
41
42 ret = cpuidle_register_driver(&tegra_idle_driver);
43 if (ret) {
44 pr_err("CPUidle driver registration failed\n");
45 return ret;
46 }
47
48 for_each_possible_cpu(cpu) {
49 dev = &per_cpu(tegra_idle_device, cpu);
50 dev->cpu = cpu;
51
52 dev->state_count = drv->state_count;
53 ret = cpuidle_register_device(dev);
54 if (ret) {
55 pr_err("CPU%u: CPUidle device registration failed\n",
56 cpu);
57 return ret;
58 }
59 }
60 return 0;
61}
diff --git a/arch/arm/mach-tegra/cpuidle-tegra20.c b/arch/arm/mach-tegra/cpuidle-tegra20.c
index d32e8b0dbd4f..825ced4f7a40 100644
--- a/arch/arm/mach-tegra/cpuidle-tegra20.c
+++ b/arch/arm/mach-tegra/cpuidle-tegra20.c
@@ -22,21 +22,199 @@
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/cpuidle.h> 24#include <linux/cpuidle.h>
25#include <linux/cpu_pm.h>
26#include <linux/clockchips.h>
27#include <linux/clk/tegra.h>
25 28
26#include <asm/cpuidle.h> 29#include <asm/cpuidle.h>
30#include <asm/proc-fns.h>
31#include <asm/suspend.h>
32#include <asm/smp_plat.h>
33
34#include "pm.h"
35#include "sleep.h"
36#include "iomap.h"
37#include "irq.h"
38#include "flowctrl.h"
39
40#ifdef CONFIG_PM_SLEEP
41static bool abort_flag;
42static atomic_t abort_barrier;
43static int tegra20_idle_lp2_coupled(struct cpuidle_device *dev,
44 struct cpuidle_driver *drv,
45 int index);
46#endif
47
48static struct cpuidle_state tegra_idle_states[] = {
49 [0] = ARM_CPUIDLE_WFI_STATE_PWR(600),
50#ifdef CONFIG_PM_SLEEP
51 [1] = {
52 .enter = tegra20_idle_lp2_coupled,
53 .exit_latency = 5000,
54 .target_residency = 10000,
55 .power_usage = 0,
56 .flags = CPUIDLE_FLAG_TIME_VALID |
57 CPUIDLE_FLAG_COUPLED,
58 .name = "powered-down",
59 .desc = "CPU power gated",
60 },
61#endif
62};
27 63
28static struct cpuidle_driver tegra_idle_driver = { 64static struct cpuidle_driver tegra_idle_driver = {
29 .name = "tegra_idle", 65 .name = "tegra_idle",
30 .owner = THIS_MODULE, 66 .owner = THIS_MODULE,
31 .en_core_tk_irqen = 1, 67 .en_core_tk_irqen = 1,
32 .state_count = 1,
33 .states = {
34 [0] = ARM_CPUIDLE_WFI_STATE_PWR(600),
35 },
36}; 68};
37 69
38static DEFINE_PER_CPU(struct cpuidle_device, tegra_idle_device); 70static DEFINE_PER_CPU(struct cpuidle_device, tegra_idle_device);
39 71
72#ifdef CONFIG_PM_SLEEP
73#ifdef CONFIG_SMP
74static void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
75
76static int tegra20_reset_sleeping_cpu_1(void)
77{
78 int ret = 0;
79
80 tegra_pen_lock();
81
82 if (readl(pmc + PMC_SCRATCH41) == CPU_RESETTABLE)
83 tegra20_cpu_shutdown(1);
84 else
85 ret = -EINVAL;
86
87 tegra_pen_unlock();
88
89 return ret;
90}
91
92static void tegra20_wake_cpu1_from_reset(void)
93{
94 tegra_pen_lock();
95
96 tegra20_cpu_clear_resettable();
97
98 /* enable cpu clock on cpu */
99 tegra_enable_cpu_clock(1);
100
101 /* take the CPU out of reset */
102 tegra_cpu_out_of_reset(1);
103
104 /* unhalt the cpu */
105 flowctrl_write_cpu_halt(1, 0);
106
107 tegra_pen_unlock();
108}
109
110static int tegra20_reset_cpu_1(void)
111{
112 if (!cpu_online(1) || !tegra20_reset_sleeping_cpu_1())
113 return 0;
114
115 tegra20_wake_cpu1_from_reset();
116 return -EBUSY;
117}
118#else
119static inline void tegra20_wake_cpu1_from_reset(void)
120{
121}
122
123static inline int tegra20_reset_cpu_1(void)
124{
125 return 0;
126}
127#endif
128
129static bool tegra20_cpu_cluster_power_down(struct cpuidle_device *dev,
130 struct cpuidle_driver *drv,
131 int index)
132{
133 struct cpuidle_state *state = &drv->states[index];
134 u32 cpu_on_time = state->exit_latency;
135 u32 cpu_off_time = state->target_residency - state->exit_latency;
136
137 while (tegra20_cpu_is_resettable_soon())
138 cpu_relax();
139
140 if (tegra20_reset_cpu_1() || !tegra_cpu_rail_off_ready())
141 return false;
142
143 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu);
144
145 tegra_idle_lp2_last(cpu_on_time, cpu_off_time);
146
147 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu);
148
149 if (cpu_online(1))
150 tegra20_wake_cpu1_from_reset();
151
152 return true;
153}
154
155#ifdef CONFIG_SMP
156static bool tegra20_idle_enter_lp2_cpu_1(struct cpuidle_device *dev,
157 struct cpuidle_driver *drv,
158 int index)
159{
160 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu);
161
162 cpu_suspend(0, tegra20_sleep_cpu_secondary_finish);
163
164 tegra20_cpu_clear_resettable();
165
166 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu);
167
168 return true;
169}
170#else
171static inline bool tegra20_idle_enter_lp2_cpu_1(struct cpuidle_device *dev,
172 struct cpuidle_driver *drv,
173 int index)
174{
175 return true;
176}
177#endif
178
179static int tegra20_idle_lp2_coupled(struct cpuidle_device *dev,
180 struct cpuidle_driver *drv,
181 int index)
182{
183 u32 cpu = is_smp() ? cpu_logical_map(dev->cpu) : dev->cpu;
184 bool entered_lp2 = false;
185
186 if (tegra_pending_sgi())
187 ACCESS_ONCE(abort_flag) = true;
188
189 cpuidle_coupled_parallel_barrier(dev, &abort_barrier);
190
191 if (abort_flag) {
192 cpuidle_coupled_parallel_barrier(dev, &abort_barrier);
193 abort_flag = false; /* clean flag for next coming */
194 return -EINTR;
195 }
196
197 local_fiq_disable();
198
199 tegra_set_cpu_in_lp2(cpu);
200 cpu_pm_enter();
201
202 if (cpu == 0)
203 entered_lp2 = tegra20_cpu_cluster_power_down(dev, drv, index);
204 else
205 entered_lp2 = tegra20_idle_enter_lp2_cpu_1(dev, drv, index);
206
207 cpu_pm_exit();
208 tegra_clear_cpu_in_lp2(cpu);
209
210 local_fiq_enable();
211
212 smp_rmb();
213
214 return entered_lp2 ? index : 0;
215}
216#endif
217
40int __init tegra20_cpuidle_init(void) 218int __init tegra20_cpuidle_init(void)
41{ 219{
42 int ret; 220 int ret;
@@ -44,6 +222,14 @@ int __init tegra20_cpuidle_init(void)
44 struct cpuidle_device *dev; 222 struct cpuidle_device *dev;
45 struct cpuidle_driver *drv = &tegra_idle_driver; 223 struct cpuidle_driver *drv = &tegra_idle_driver;
46 224
225#ifdef CONFIG_PM_SLEEP
226 tegra_tear_down_cpu = tegra20_tear_down_cpu;
227#endif
228
229 drv->state_count = ARRAY_SIZE(tegra_idle_states);
230 memcpy(drv->states, tegra_idle_states,
231 drv->state_count * sizeof(drv->states[0]));
232
47 ret = cpuidle_register_driver(&tegra_idle_driver); 233 ret = cpuidle_register_driver(&tegra_idle_driver);
48 if (ret) { 234 if (ret) {
49 pr_err("CPUidle driver registration failed\n"); 235 pr_err("CPUidle driver registration failed\n");
@@ -53,6 +239,9 @@ int __init tegra20_cpuidle_init(void)
53 for_each_possible_cpu(cpu) { 239 for_each_possible_cpu(cpu) {
54 dev = &per_cpu(tegra_idle_device, cpu); 240 dev = &per_cpu(tegra_idle_device, cpu);
55 dev->cpu = cpu; 241 dev->cpu = cpu;
242#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
243 dev->coupled_cpus = *cpu_possible_mask;
244#endif
56 245
57 dev->state_count = drv->state_count; 246 dev->state_count = drv->state_count;
58 ret = cpuidle_register_device(dev); 247 ret = cpuidle_register_device(dev);
diff --git a/arch/arm/mach-tegra/cpuidle-tegra30.c b/arch/arm/mach-tegra/cpuidle-tegra30.c
index 5e8cbf5b799f..8b50cf4ddd6f 100644
--- a/arch/arm/mach-tegra/cpuidle-tegra30.c
+++ b/arch/arm/mach-tegra/cpuidle-tegra30.c
@@ -24,6 +24,7 @@
24#include <linux/cpuidle.h> 24#include <linux/cpuidle.h>
25#include <linux/cpu_pm.h> 25#include <linux/cpu_pm.h>
26#include <linux/clockchips.h> 26#include <linux/clockchips.h>
27#include <linux/clk/tegra.h>
27 28
28#include <asm/cpuidle.h> 29#include <asm/cpuidle.h>
29#include <asm/proc-fns.h> 30#include <asm/proc-fns.h>
@@ -32,7 +33,6 @@
32 33
33#include "pm.h" 34#include "pm.h"
34#include "sleep.h" 35#include "sleep.h"
35#include "tegra_cpu_car.h"
36 36
37#ifdef CONFIG_PM_SLEEP 37#ifdef CONFIG_PM_SLEEP
38static int tegra30_idle_lp2(struct cpuidle_device *dev, 38static int tegra30_idle_lp2(struct cpuidle_device *dev,
@@ -121,9 +121,9 @@ static inline bool tegra30_cpu_core_power_down(struct cpuidle_device *dev,
121} 121}
122#endif 122#endif
123 123
124static int __cpuinit tegra30_idle_lp2(struct cpuidle_device *dev, 124static int tegra30_idle_lp2(struct cpuidle_device *dev,
125 struct cpuidle_driver *drv, 125 struct cpuidle_driver *drv,
126 int index) 126 int index)
127{ 127{
128 u32 cpu = is_smp() ? cpu_logical_map(dev->cpu) : dev->cpu; 128 u32 cpu = is_smp() ? cpu_logical_map(dev->cpu) : dev->cpu;
129 bool entered_lp2 = false; 129 bool entered_lp2 = false;
diff --git a/arch/arm/mach-tegra/cpuidle.c b/arch/arm/mach-tegra/cpuidle.c
index d0651397aec7..4b744c4661e2 100644
--- a/arch/arm/mach-tegra/cpuidle.c
+++ b/arch/arm/mach-tegra/cpuidle.c
@@ -38,6 +38,9 @@ static int __init tegra_cpuidle_init(void)
38 case TEGRA30: 38 case TEGRA30:
39 ret = tegra30_cpuidle_init(); 39 ret = tegra30_cpuidle_init();
40 break; 40 break;
41 case TEGRA114:
42 ret = tegra114_cpuidle_init();
43 break;
41 default: 44 default:
42 ret = -ENODEV; 45 ret = -ENODEV;
43 break; 46 break;
diff --git a/arch/arm/mach-tegra/cpuidle.h b/arch/arm/mach-tegra/cpuidle.h
index 496204d34e55..d733f75d0208 100644
--- a/arch/arm/mach-tegra/cpuidle.h
+++ b/arch/arm/mach-tegra/cpuidle.h
@@ -29,4 +29,10 @@ int tegra30_cpuidle_init(void);
29static inline int tegra30_cpuidle_init(void) { return -ENODEV; } 29static inline int tegra30_cpuidle_init(void) { return -ENODEV; }
30#endif 30#endif
31 31
32#ifdef CONFIG_ARCH_TEGRA_114_SOC
33int tegra114_cpuidle_init(void);
34#else
35static inline int tegra114_cpuidle_init(void) { return -ENODEV; }
36#endif
37
32#endif 38#endif
diff --git a/arch/arm/mach-tegra/flowctrl.c b/arch/arm/mach-tegra/flowctrl.c
index a2250ddae797..b477ef310dcd 100644
--- a/arch/arm/mach-tegra/flowctrl.c
+++ b/arch/arm/mach-tegra/flowctrl.c
@@ -25,15 +25,16 @@
25 25
26#include "flowctrl.h" 26#include "flowctrl.h"
27#include "iomap.h" 27#include "iomap.h"
28#include "fuse.h"
28 29
29u8 flowctrl_offset_halt_cpu[] = { 30static u8 flowctrl_offset_halt_cpu[] = {
30 FLOW_CTRL_HALT_CPU0_EVENTS, 31 FLOW_CTRL_HALT_CPU0_EVENTS,
31 FLOW_CTRL_HALT_CPU1_EVENTS, 32 FLOW_CTRL_HALT_CPU1_EVENTS,
32 FLOW_CTRL_HALT_CPU1_EVENTS + 8, 33 FLOW_CTRL_HALT_CPU1_EVENTS + 8,
33 FLOW_CTRL_HALT_CPU1_EVENTS + 16, 34 FLOW_CTRL_HALT_CPU1_EVENTS + 16,
34}; 35};
35 36
36u8 flowctrl_offset_cpu_csr[] = { 37static u8 flowctrl_offset_cpu_csr[] = {
37 FLOW_CTRL_CPU0_CSR, 38 FLOW_CTRL_CPU0_CSR,
38 FLOW_CTRL_CPU1_CSR, 39 FLOW_CTRL_CPU1_CSR,
39 FLOW_CTRL_CPU1_CSR + 8, 40 FLOW_CTRL_CPU1_CSR + 8,
@@ -75,11 +76,26 @@ void flowctrl_cpu_suspend_enter(unsigned int cpuid)
75 int i; 76 int i;
76 77
77 reg = flowctrl_read_cpu_csr(cpuid); 78 reg = flowctrl_read_cpu_csr(cpuid);
78 reg &= ~TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP; /* clear wfe bitmap */ 79 switch (tegra_chip_id) {
79 reg &= ~TEGRA30_FLOW_CTRL_CSR_WFI_BITMAP; /* clear wfi bitmap */ 80 case TEGRA20:
81 /* clear wfe bitmap */
82 reg &= ~TEGRA20_FLOW_CTRL_CSR_WFE_BITMAP;
83 /* clear wfi bitmap */
84 reg &= ~TEGRA20_FLOW_CTRL_CSR_WFI_BITMAP;
85 /* pwr gating on wfe */
86 reg |= TEGRA20_FLOW_CTRL_CSR_WFE_CPU0 << cpuid;
87 break;
88 case TEGRA30:
89 /* clear wfe bitmap */
90 reg &= ~TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP;
91 /* clear wfi bitmap */
92 reg &= ~TEGRA30_FLOW_CTRL_CSR_WFI_BITMAP;
93 /* pwr gating on wfi */
94 reg |= TEGRA30_FLOW_CTRL_CSR_WFI_CPU0 << cpuid;
95 break;
96 }
80 reg |= FLOW_CTRL_CSR_INTR_FLAG; /* clear intr flag */ 97 reg |= FLOW_CTRL_CSR_INTR_FLAG; /* clear intr flag */
81 reg |= FLOW_CTRL_CSR_EVENT_FLAG; /* clear event flag */ 98 reg |= FLOW_CTRL_CSR_EVENT_FLAG; /* clear event flag */
82 reg |= TEGRA30_FLOW_CTRL_CSR_WFI_CPU0 << cpuid; /* pwr gating on wfi */
83 reg |= FLOW_CTRL_CSR_ENABLE; /* pwr gating */ 99 reg |= FLOW_CTRL_CSR_ENABLE; /* pwr gating */
84 flowctrl_write_cpu_csr(cpuid, reg); 100 flowctrl_write_cpu_csr(cpuid, reg);
85 101
@@ -99,8 +115,20 @@ void flowctrl_cpu_suspend_exit(unsigned int cpuid)
99 115
100 /* Disable powergating via flow controller for CPU0 */ 116 /* Disable powergating via flow controller for CPU0 */
101 reg = flowctrl_read_cpu_csr(cpuid); 117 reg = flowctrl_read_cpu_csr(cpuid);
102 reg &= ~TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP; /* clear wfe bitmap */ 118 switch (tegra_chip_id) {
103 reg &= ~TEGRA30_FLOW_CTRL_CSR_WFI_BITMAP; /* clear wfi bitmap */ 119 case TEGRA20:
120 /* clear wfe bitmap */
121 reg &= ~TEGRA20_FLOW_CTRL_CSR_WFE_BITMAP;
122 /* clear wfi bitmap */
123 reg &= ~TEGRA20_FLOW_CTRL_CSR_WFI_BITMAP;
124 break;
125 case TEGRA30:
126 /* clear wfe bitmap */
127 reg &= ~TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP;
128 /* clear wfi bitmap */
129 reg &= ~TEGRA30_FLOW_CTRL_CSR_WFI_BITMAP;
130 break;
131 }
104 reg &= ~FLOW_CTRL_CSR_ENABLE; /* clear enable */ 132 reg &= ~FLOW_CTRL_CSR_ENABLE; /* clear enable */
105 reg |= FLOW_CTRL_CSR_INTR_FLAG; /* clear intr */ 133 reg |= FLOW_CTRL_CSR_INTR_FLAG; /* clear intr */
106 reg |= FLOW_CTRL_CSR_EVENT_FLAG; /* clear event */ 134 reg |= FLOW_CTRL_CSR_EVENT_FLAG; /* clear event */
diff --git a/arch/arm/mach-tegra/flowctrl.h b/arch/arm/mach-tegra/flowctrl.h
index 0798dec1832d..67eab56699bd 100644
--- a/arch/arm/mach-tegra/flowctrl.h
+++ b/arch/arm/mach-tegra/flowctrl.h
@@ -34,6 +34,10 @@
34#define FLOW_CTRL_HALT_CPU1_EVENTS 0x14 34#define FLOW_CTRL_HALT_CPU1_EVENTS 0x14
35#define FLOW_CTRL_CPU1_CSR 0x18 35#define FLOW_CTRL_CPU1_CSR 0x18
36 36
37#define TEGRA20_FLOW_CTRL_CSR_WFE_CPU0 (1 << 4)
38#define TEGRA20_FLOW_CTRL_CSR_WFE_BITMAP (3 << 4)
39#define TEGRA20_FLOW_CTRL_CSR_WFI_BITMAP 0
40
37#define TEGRA30_FLOW_CTRL_CSR_WFI_CPU0 (1 << 8) 41#define TEGRA30_FLOW_CTRL_CSR_WFI_CPU0 (1 << 8)
38#define TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP (0xF << 4) 42#define TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP (0xF << 4)
39#define TEGRA30_FLOW_CTRL_CSR_WFI_BITMAP (0xF << 8) 43#define TEGRA30_FLOW_CTRL_CSR_WFI_BITMAP (0xF << 8)
diff --git a/arch/arm/mach-tegra/fuse.c b/arch/arm/mach-tegra/fuse.c
index 8121742711fe..f7db0782a6b6 100644
--- a/arch/arm/mach-tegra/fuse.c
+++ b/arch/arm/mach-tegra/fuse.c
@@ -20,6 +20,7 @@
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/io.h> 21#include <linux/io.h>
22#include <linux/export.h> 22#include <linux/export.h>
23#include <linux/tegra-soc.h>
23 24
24#include "fuse.h" 25#include "fuse.h"
25#include "iomap.h" 26#include "iomap.h"
@@ -105,6 +106,11 @@ static void tegra_get_process_id(void)
105 tegra_core_process_id = (reg >> 12) & 3; 106 tegra_core_process_id = (reg >> 12) & 3;
106} 107}
107 108
109u32 tegra_read_chipid(void)
110{
111 return readl_relaxed(IO_ADDRESS(TEGRA_APB_MISC_BASE) + 0x804);
112}
113
108void tegra_init_fuse(void) 114void tegra_init_fuse(void)
109{ 115{
110 u32 id; 116 u32 id;
@@ -119,7 +125,7 @@ void tegra_init_fuse(void)
119 reg = tegra_apb_readl(TEGRA_APB_MISC_BASE + STRAP_OPT); 125 reg = tegra_apb_readl(TEGRA_APB_MISC_BASE + STRAP_OPT);
120 tegra_bct_strapping = (reg & RAM_ID_MASK) >> RAM_CODE_SHIFT; 126 tegra_bct_strapping = (reg & RAM_ID_MASK) >> RAM_CODE_SHIFT;
121 127
122 id = readl_relaxed(IO_ADDRESS(TEGRA_APB_MISC_BASE) + 0x804); 128 id = tegra_read_chipid();
123 tegra_chip_id = (id >> 8) & 0xff; 129 tegra_chip_id = (id >> 8) & 0xff;
124 130
125 switch (tegra_chip_id) { 131 switch (tegra_chip_id) {
diff --git a/arch/arm/mach-tegra/fuse.h b/arch/arm/mach-tegra/fuse.h
index ff1383dd61a7..da78434678c7 100644
--- a/arch/arm/mach-tegra/fuse.h
+++ b/arch/arm/mach-tegra/fuse.h
@@ -37,6 +37,7 @@ enum tegra_revision {
37 37
38#define TEGRA20 0x20 38#define TEGRA20 0x20
39#define TEGRA30 0x30 39#define TEGRA30 0x30
40#define TEGRA114 0x35
40 41
41extern int tegra_sku_id; 42extern int tegra_sku_id;
42extern int tegra_cpu_process_id; 43extern int tegra_cpu_process_id;
diff --git a/arch/arm/mach-tegra/headsmp.S b/arch/arm/mach-tegra/headsmp.S
index 4a317fae6860..fd473f2b4c3d 100644
--- a/arch/arm/mach-tegra/headsmp.S
+++ b/arch/arm/mach-tegra/headsmp.S
@@ -1,66 +1,9 @@
1#include <linux/linkage.h> 1#include <linux/linkage.h>
2#include <linux/init.h> 2#include <linux/init.h>
3 3
4#include <asm/cache.h>
5#include <asm/asm-offsets.h>
6#include <asm/hardware/cache-l2x0.h>
7
8#include "flowctrl.h"
9#include "iomap.h"
10#include "reset.h"
11#include "sleep.h" 4#include "sleep.h"
12 5
13#define APB_MISC_GP_HIDREV 0x804
14#define PMC_SCRATCH41 0x140
15
16#define RESET_DATA(x) ((TEGRA_RESET_##x)*4)
17
18 .section ".text.head", "ax" 6 .section ".text.head", "ax"
19 __CPUINIT
20
21/*
22 * Tegra specific entry point for secondary CPUs.
23 * The secondary kernel init calls v7_flush_dcache_all before it enables
24 * the L1; however, the L1 comes out of reset in an undefined state, so
25 * the clean + invalidate performed by v7_flush_dcache_all causes a bunch
26 * of cache lines with uninitialized data and uninitialized tags to get
27 * written out to memory, which does really unpleasant things to the main
28 * processor. We fix this by performing an invalidate, rather than a
29 * clean + invalidate, before jumping into the kernel.
30 */
31ENTRY(v7_invalidate_l1)
32 mov r0, #0
33 mcr p15, 2, r0, c0, c0, 0
34 mrc p15, 1, r0, c0, c0, 0
35
36 ldr r1, =0x7fff
37 and r2, r1, r0, lsr #13
38
39 ldr r1, =0x3ff
40
41 and r3, r1, r0, lsr #3 @ NumWays - 1
42 add r2, r2, #1 @ NumSets
43
44 and r0, r0, #0x7
45 add r0, r0, #4 @ SetShift
46
47 clz r1, r3 @ WayShift
48 add r4, r3, #1 @ NumWays
491: sub r2, r2, #1 @ NumSets--
50 mov r3, r4 @ Temp = NumWays
512: subs r3, r3, #1 @ Temp--
52 mov r5, r3, lsl r1
53 mov r6, r2, lsl r0
54 orr r5, r5, r6 @ Reg = (Temp<<WayShift)|(NumSets<<SetShift)
55 mcr p15, 0, r5, c7, c6, 2
56 bgt 2b
57 cmp r2, #0
58 bgt 1b
59 dsb
60 isb
61 mov pc, lr
62ENDPROC(v7_invalidate_l1)
63
64 7
65ENTRY(tegra_secondary_startup) 8ENTRY(tegra_secondary_startup)
66 bl v7_invalidate_l1 9 bl v7_invalidate_l1
@@ -69,210 +12,3 @@ ENTRY(tegra_secondary_startup)
69 mcr p14, 0, r0, c7, c12, 6 12 mcr p14, 0, r0, c7, c12, 6
70 b secondary_startup 13 b secondary_startup
71ENDPROC(tegra_secondary_startup) 14ENDPROC(tegra_secondary_startup)
72
73#ifdef CONFIG_PM_SLEEP
74/*
75 * tegra_resume
76 *
77 * CPU boot vector when restarting the a CPU following
78 * an LP2 transition. Also branched to by LP0 and LP1 resume after
79 * re-enabling sdram.
80 */
81ENTRY(tegra_resume)
82 bl v7_invalidate_l1
83 /* Enable coresight */
84 mov32 r0, 0xC5ACCE55
85 mcr p14, 0, r0, c7, c12, 6
86
87 cpu_id r0
88 cmp r0, #0 @ CPU0?
89 bne cpu_resume @ no
90
91#ifdef CONFIG_ARCH_TEGRA_3x_SOC
92 /* Are we on Tegra20? */
93 mov32 r6, TEGRA_APB_MISC_BASE
94 ldr r0, [r6, #APB_MISC_GP_HIDREV]
95 and r0, r0, #0xff00
96 cmp r0, #(0x20 << 8)
97 beq 1f @ Yes
98 /* Clear the flow controller flags for this CPU. */
99 mov32 r2, TEGRA_FLOW_CTRL_BASE + FLOW_CTRL_CPU0_CSR @ CPU0 CSR
100 ldr r1, [r2]
101 /* Clear event & intr flag */
102 orr r1, r1, \
103 #FLOW_CTRL_CSR_INTR_FLAG | FLOW_CTRL_CSR_EVENT_FLAG
104 movw r0, #0x0FFD @ enable, cluster_switch, immed, & bitmaps
105 bic r1, r1, r0
106 str r1, [r2]
1071:
108#endif
109
110#ifdef CONFIG_HAVE_ARM_SCU
111 /* enable SCU */
112 mov32 r0, TEGRA_ARM_PERIF_BASE
113 ldr r1, [r0]
114 orr r1, r1, #1
115 str r1, [r0]
116#endif
117
118 /* L2 cache resume & re-enable */
119 l2_cache_resume r0, r1, r2, l2x0_saved_regs_addr
120
121 b cpu_resume
122ENDPROC(tegra_resume)
123#endif
124
125#ifdef CONFIG_CACHE_L2X0
126 .globl l2x0_saved_regs_addr
127l2x0_saved_regs_addr:
128 .long 0
129#endif
130
131 .align L1_CACHE_SHIFT
132ENTRY(__tegra_cpu_reset_handler_start)
133
134/*
135 * __tegra_cpu_reset_handler:
136 *
137 * Common handler for all CPU reset events.
138 *
139 * Register usage within the reset handler:
140 *
141 * R7 = CPU present (to the OS) mask
142 * R8 = CPU in LP1 state mask
143 * R9 = CPU in LP2 state mask
144 * R10 = CPU number
145 * R11 = CPU mask
146 * R12 = pointer to reset handler data
147 *
148 * NOTE: This code is copied to IRAM. All code and data accesses
149 * must be position-independent.
150 */
151
152 .align L1_CACHE_SHIFT
153ENTRY(__tegra_cpu_reset_handler)
154
155 cpsid aif, 0x13 @ SVC mode, interrupts disabled
156 mrc p15, 0, r10, c0, c0, 5 @ MPIDR
157 and r10, r10, #0x3 @ R10 = CPU number
158 mov r11, #1
159 mov r11, r11, lsl r10 @ R11 = CPU mask
160 adr r12, __tegra_cpu_reset_handler_data
161
162#ifdef CONFIG_SMP
163 /* Does the OS know about this CPU? */
164 ldr r7, [r12, #RESET_DATA(MASK_PRESENT)]
165 tst r7, r11 @ if !present
166 bleq __die @ CPU not present (to OS)
167#endif
168
169#ifdef CONFIG_ARCH_TEGRA_2x_SOC
170 /* Are we on Tegra20? */
171 mov32 r6, TEGRA_APB_MISC_BASE
172 ldr r0, [r6, #APB_MISC_GP_HIDREV]
173 and r0, r0, #0xff00
174 cmp r0, #(0x20 << 8)
175 bne 1f
176 /* If not CPU0, don't let CPU0 reset CPU1 now that CPU1 is coming up. */
177 mov32 r6, TEGRA_PMC_BASE
178 mov r0, #0
179 cmp r10, #0
180 strne r0, [r6, #PMC_SCRATCH41]
1811:
182#endif
183
184 /* Waking up from LP2? */
185 ldr r9, [r12, #RESET_DATA(MASK_LP2)]
186 tst r9, r11 @ if in_lp2
187 beq __is_not_lp2
188 ldr lr, [r12, #RESET_DATA(STARTUP_LP2)]
189 cmp lr, #0
190 bleq __die @ no LP2 startup handler
191 bx lr
192
193__is_not_lp2:
194
195#ifdef CONFIG_SMP
196 /*
197 * Can only be secondary boot (initial or hotplug) but CPU 0
198 * cannot be here.
199 */
200 cmp r10, #0
201 bleq __die @ CPU0 cannot be here
202 ldr lr, [r12, #RESET_DATA(STARTUP_SECONDARY)]
203 cmp lr, #0
204 bleq __die @ no secondary startup handler
205 bx lr
206#endif
207
208/*
209 * We don't know why the CPU reset. Just kill it.
210 * The LR register will contain the address we died at + 4.
211 */
212
213__die:
214 sub lr, lr, #4
215 mov32 r7, TEGRA_PMC_BASE
216 str lr, [r7, #PMC_SCRATCH41]
217
218 mov32 r7, TEGRA_CLK_RESET_BASE
219
220 /* Are we on Tegra20? */
221 mov32 r6, TEGRA_APB_MISC_BASE
222 ldr r0, [r6, #APB_MISC_GP_HIDREV]
223 and r0, r0, #0xff00
224 cmp r0, #(0x20 << 8)
225 bne 1f
226
227#ifdef CONFIG_ARCH_TEGRA_2x_SOC
228 mov32 r0, 0x1111
229 mov r1, r0, lsl r10
230 str r1, [r7, #0x340] @ CLK_RST_CPU_CMPLX_SET
231#endif
2321:
233#ifdef CONFIG_ARCH_TEGRA_3x_SOC
234 mov32 r6, TEGRA_FLOW_CTRL_BASE
235
236 cmp r10, #0
237 moveq r1, #FLOW_CTRL_HALT_CPU0_EVENTS
238 moveq r2, #FLOW_CTRL_CPU0_CSR
239 movne r1, r10, lsl #3
240 addne r2, r1, #(FLOW_CTRL_CPU1_CSR-8)
241 addne r1, r1, #(FLOW_CTRL_HALT_CPU1_EVENTS-8)
242
243 /* Clear CPU "event" and "interrupt" flags and power gate
244 it when halting but not before it is in the "WFI" state. */
245 ldr r0, [r6, +r2]
246 orr r0, r0, #FLOW_CTRL_CSR_INTR_FLAG | FLOW_CTRL_CSR_EVENT_FLAG
247 orr r0, r0, #FLOW_CTRL_CSR_ENABLE
248 str r0, [r6, +r2]
249
250 /* Unconditionally halt this CPU */
251 mov r0, #FLOW_CTRL_WAITEVENT
252 str r0, [r6, +r1]
253 ldr r0, [r6, +r1] @ memory barrier
254
255 dsb
256 isb
257 wfi @ CPU should be power gated here
258
259 /* If the CPU didn't power gate above just kill it's clock. */
260
261 mov r0, r11, lsl #8
262 str r0, [r7, #348] @ CLK_CPU_CMPLX_SET
263#endif
264
265 /* If the CPU still isn't dead, just spin here. */
266 b .
267ENDPROC(__tegra_cpu_reset_handler)
268
269 .align L1_CACHE_SHIFT
270 .type __tegra_cpu_reset_handler_data, %object
271 .globl __tegra_cpu_reset_handler_data
272__tegra_cpu_reset_handler_data:
273 .rept TEGRA_RESET_DATA_SIZE
274 .long 0
275 .endr
276 .align L1_CACHE_SHIFT
277
278ENTRY(__tegra_cpu_reset_handler_end)
diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c
index dca5141a2c31..a599f6e36dea 100644
--- a/arch/arm/mach-tegra/hotplug.c
+++ b/arch/arm/mach-tegra/hotplug.c
@@ -10,15 +10,26 @@
10 */ 10 */
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/smp.h> 12#include <linux/smp.h>
13#include <linux/clk/tegra.h>
13 14
14#include <asm/cacheflush.h> 15#include <asm/cacheflush.h>
15#include <asm/smp_plat.h> 16#include <asm/smp_plat.h>
16 17
17#include "sleep.h" 18#include "sleep.h"
18#include "tegra_cpu_car.h"
19 19
20static void (*tegra_hotplug_shutdown)(void); 20static void (*tegra_hotplug_shutdown)(void);
21 21
22int tegra_cpu_kill(unsigned cpu)
23{
24 cpu = cpu_logical_map(cpu);
25
26 /* Clock gate the CPU */
27 tegra_wait_cpu_in_reset(cpu);
28 tegra_disable_cpu_clock(cpu);
29
30 return 1;
31}
32
22/* 33/*
23 * platform-specific code to shutdown a CPU 34 * platform-specific code to shutdown a CPU
24 * 35 *
@@ -26,18 +37,12 @@ static void (*tegra_hotplug_shutdown)(void);
26 */ 37 */
27void __ref tegra_cpu_die(unsigned int cpu) 38void __ref tegra_cpu_die(unsigned int cpu)
28{ 39{
29 cpu = cpu_logical_map(cpu); 40 /* Clean L1 data cache */
30 41 tegra_disable_clean_inv_dcache();
31 /* Flush the L1 data cache. */
32 flush_cache_all();
33 42
34 /* Shut down the current CPU. */ 43 /* Shut down the current CPU. */
35 tegra_hotplug_shutdown(); 44 tegra_hotplug_shutdown();
36 45
37 /* Clock gate the CPU */
38 tegra_wait_cpu_in_reset(cpu);
39 tegra_disable_cpu_clock(cpu);
40
41 /* Should never return here. */ 46 /* Should never return here. */
42 BUG(); 47 BUG();
43} 48}
diff --git a/arch/arm/mach-tegra/include/mach/clk.h b/arch/arm/mach-tegra/include/mach/clk.h
deleted file mode 100644
index 95f3a547c770..000000000000
--- a/arch/arm/mach-tegra/include/mach/clk.h
+++ /dev/null
@@ -1,44 +0,0 @@
1/*
2 * arch/arm/mach-tegra/include/mach/clk.h
3 *
4 * Copyright (C) 2010 Google, Inc.
5 *
6 * Author:
7 * Erik Gilling <konkers@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_CLK_H
21#define __MACH_CLK_H
22
23struct clk;
24
25enum tegra_clk_ex_param {
26 TEGRA_CLK_VI_INP_SEL,
27 TEGRA_CLK_DTV_INVERT,
28 TEGRA_CLK_NAND_PAD_DIV2_ENB,
29 TEGRA_CLK_PLLD_CSI_OUT_ENB,
30 TEGRA_CLK_PLLD_DSI_OUT_ENB,
31 TEGRA_CLK_PLLD_MIPI_MUX_SEL,
32};
33
34void tegra_periph_reset_deassert(struct clk *c);
35void tegra_periph_reset_assert(struct clk *c);
36
37#ifndef CONFIG_COMMON_CLK
38unsigned long clk_get_rate_all_locked(struct clk *c);
39#endif
40
41void tegra2_sdmmc_tap_delay(struct clk *c, int delay);
42int tegra_clk_cfg_ex(struct clk *c, enum tegra_clk_ex_param p, u32 setting);
43
44#endif
diff --git a/arch/arm/mach-tegra/include/mach/uncompress.h b/arch/arm/mach-tegra/include/mach/uncompress.h
index 485003f9b636..08386418196f 100644
--- a/arch/arm/mach-tegra/include/mach/uncompress.h
+++ b/arch/arm/mach-tegra/include/mach/uncompress.h
@@ -172,8 +172,4 @@ static inline void arch_decomp_setup(void)
172 uart[UART_LCR << DEBUG_UART_SHIFT] = 3; 172 uart[UART_LCR << DEBUG_UART_SHIFT] = 3;
173} 173}
174 174
175static inline void arch_decomp_wdog(void)
176{
177}
178
179#endif 175#endif
diff --git a/arch/arm/mach-tegra/iomap.h b/arch/arm/mach-tegra/iomap.h
index db8be51cad80..399fbca27102 100644
--- a/arch/arm/mach-tegra/iomap.h
+++ b/arch/arm/mach-tegra/iomap.h
@@ -240,15 +240,6 @@
240#define TEGRA_CSITE_BASE 0x70040000 240#define TEGRA_CSITE_BASE 0x70040000
241#define TEGRA_CSITE_SIZE SZ_256K 241#define TEGRA_CSITE_SIZE SZ_256K
242 242
243#define TEGRA_USB_BASE 0xC5000000
244#define TEGRA_USB_SIZE SZ_16K
245
246#define TEGRA_USB2_BASE 0xC5004000
247#define TEGRA_USB2_SIZE SZ_16K
248
249#define TEGRA_USB3_BASE 0xC5008000
250#define TEGRA_USB3_SIZE SZ_16K
251
252#define TEGRA_SDMMC1_BASE 0xC8000000 243#define TEGRA_SDMMC1_BASE 0xC8000000
253#define TEGRA_SDMMC1_SIZE SZ_512 244#define TEGRA_SDMMC1_SIZE SZ_512
254 245
diff --git a/arch/arm/mach-tegra/irq.c b/arch/arm/mach-tegra/irq.c
index b7886f183511..1952e82797cc 100644
--- a/arch/arm/mach-tegra/irq.c
+++ b/arch/arm/mach-tegra/irq.c
@@ -22,8 +22,7 @@
22#include <linux/irq.h> 22#include <linux/irq.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/of.h> 24#include <linux/of.h>
25 25#include <linux/irqchip/arm-gic.h>
26#include <asm/hardware/gic.h>
27 26
28#include "board.h" 27#include "board.h"
29#include "iomap.h" 28#include "iomap.h"
@@ -45,6 +44,8 @@
45 44
46#define FIRST_LEGACY_IRQ 32 45#define FIRST_LEGACY_IRQ 32
47 46
47#define SGI_MASK 0xFFFF
48
48static int num_ictlrs; 49static int num_ictlrs;
49 50
50static void __iomem *ictlr_reg_base[] = { 51static void __iomem *ictlr_reg_base[] = {
@@ -55,6 +56,19 @@ static void __iomem *ictlr_reg_base[] = {
55 IO_ADDRESS(TEGRA_QUINARY_ICTLR_BASE), 56 IO_ADDRESS(TEGRA_QUINARY_ICTLR_BASE),
56}; 57};
57 58
59bool tegra_pending_sgi(void)
60{
61 u32 pending_set;
62 void __iomem *distbase = IO_ADDRESS(TEGRA_ARM_INT_DIST_BASE);
63
64 pending_set = readl_relaxed(distbase + GIC_DIST_PENDING_SET);
65
66 if (pending_set & SGI_MASK)
67 return true;
68
69 return false;
70}
71
58static inline void tegra_irq_write_mask(unsigned int irq, unsigned long reg) 72static inline void tegra_irq_write_mask(unsigned int irq, unsigned long reg)
59{ 73{
60 void __iomem *base; 74 void __iomem *base;
diff --git a/arch/arm/mach-tegra/irq.h b/arch/arm/mach-tegra/irq.h
new file mode 100644
index 000000000000..5142649bba05
--- /dev/null
+++ b/arch/arm/mach-tegra/irq.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright (c) 2012, NVIDIA Corporation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef __TEGRA_IRQ_H
18#define __TEGRA_IRQ_H
19
20bool tegra_pending_sgi(void);
21
22#endif
diff --git a/arch/arm/mach-tegra/pcie.c b/arch/arm/mach-tegra/pcie.c
index bffcd643d7a3..b60165f1ca02 100644
--- a/arch/arm/mach-tegra/pcie.c
+++ b/arch/arm/mach-tegra/pcie.c
@@ -33,11 +33,11 @@
33#include <linux/clk.h> 33#include <linux/clk.h>
34#include <linux/delay.h> 34#include <linux/delay.h>
35#include <linux/export.h> 35#include <linux/export.h>
36#include <linux/clk/tegra.h>
36 37
37#include <asm/sizes.h> 38#include <asm/sizes.h>
38#include <asm/mach/pci.h> 39#include <asm/mach/pci.h>
39 40
40#include <mach/clk.h>
41#include <mach/powergate.h> 41#include <mach/powergate.h>
42 42
43#include "board.h" 43#include "board.h"
diff --git a/arch/arm/mach-tegra/platsmp.c b/arch/arm/mach-tegra/platsmp.c
index 1b926df99c4b..2c6b3d55213b 100644
--- a/arch/arm/mach-tegra/platsmp.c
+++ b/arch/arm/mach-tegra/platsmp.c
@@ -18,25 +18,26 @@
18#include <linux/jiffies.h> 18#include <linux/jiffies.h>
19#include <linux/smp.h> 19#include <linux/smp.h>
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/irqchip/arm-gic.h>
22#include <linux/clk/tegra.h>
21 23
22#include <asm/cacheflush.h> 24#include <asm/cacheflush.h>
23#include <asm/hardware/gic.h>
24#include <asm/mach-types.h> 25#include <asm/mach-types.h>
25#include <asm/smp_scu.h> 26#include <asm/smp_scu.h>
27#include <asm/smp_plat.h>
26 28
27#include <mach/powergate.h> 29#include <mach/powergate.h>
28 30
29#include "fuse.h" 31#include "fuse.h"
30#include "flowctrl.h" 32#include "flowctrl.h"
31#include "reset.h" 33#include "reset.h"
32#include "tegra_cpu_car.h"
33 34
34#include "common.h" 35#include "common.h"
35#include "iomap.h" 36#include "iomap.h"
36 37
37extern void tegra_secondary_startup(void); 38extern void tegra_secondary_startup(void);
38 39
39static void __iomem *scu_base = IO_ADDRESS(TEGRA_ARM_PERIF_BASE); 40static cpumask_t tegra_cpu_init_mask;
40 41
41#define EVP_CPU_RESET_VECTOR \ 42#define EVP_CPU_RESET_VECTOR \
42 (IO_ADDRESS(TEGRA_EXCEPTION_VECTORS_BASE) + 0x100) 43 (IO_ADDRESS(TEGRA_EXCEPTION_VECTORS_BASE) + 0x100)
@@ -50,6 +51,7 @@ static void __cpuinit tegra_secondary_init(unsigned int cpu)
50 */ 51 */
51 gic_secondary_init(0); 52 gic_secondary_init(0);
52 53
54 cpumask_set_cpu(cpu, &tegra_cpu_init_mask);
53} 55}
54 56
55static int tegra20_power_up_cpu(unsigned int cpu) 57static int tegra20_power_up_cpu(unsigned int cpu)
@@ -72,14 +74,42 @@ static int tegra30_power_up_cpu(unsigned int cpu)
72 if (pwrgateid < 0) 74 if (pwrgateid < 0)
73 return pwrgateid; 75 return pwrgateid;
74 76
75 /* If this is the first boot, toggle powergates directly. */ 77 /*
78 * The power up sequence of cold boot CPU and warm boot CPU
79 * was different.
80 *
81 * For warm boot CPU that was resumed from CPU hotplug, the
82 * power will be resumed automatically after un-halting the
83 * flow controller of the warm boot CPU. We need to wait for
84 * the confirmaiton that the CPU is powered then removing
85 * the IO clamps.
86 * For cold boot CPU, do not wait. After the cold boot CPU be
87 * booted, it will run to tegra_secondary_init() and set
88 * tegra_cpu_init_mask which influences what tegra30_power_up_cpu()
89 * next time around.
90 */
91 if (cpumask_test_cpu(cpu, &tegra_cpu_init_mask)) {
92 timeout = jiffies + msecs_to_jiffies(50);
93 do {
94 if (!tegra_powergate_is_powered(pwrgateid))
95 goto remove_clamps;
96 udelay(10);
97 } while (time_before(jiffies, timeout));
98 }
99
100 /*
101 * The power status of the cold boot CPU is power gated as
102 * default. To power up the cold boot CPU, the power should
103 * be un-gated by un-toggling the power gate register
104 * manually.
105 */
76 if (!tegra_powergate_is_powered(pwrgateid)) { 106 if (!tegra_powergate_is_powered(pwrgateid)) {
77 ret = tegra_powergate_power_on(pwrgateid); 107 ret = tegra_powergate_power_on(pwrgateid);
78 if (ret) 108 if (ret)
79 return ret; 109 return ret;
80 110
81 /* Wait for the power to come up. */ 111 /* Wait for the power to come up. */
82 timeout = jiffies + 10*HZ; 112 timeout = jiffies + msecs_to_jiffies(100);
83 while (tegra_powergate_is_powered(pwrgateid)) { 113 while (tegra_powergate_is_powered(pwrgateid)) {
84 if (time_after(jiffies, timeout)) 114 if (time_after(jiffies, timeout))
85 return -ETIMEDOUT; 115 return -ETIMEDOUT;
@@ -87,6 +117,7 @@ static int tegra30_power_up_cpu(unsigned int cpu)
87 } 117 }
88 } 118 }
89 119
120remove_clamps:
90 /* CPU partition is powered. Enable the CPU clock. */ 121 /* CPU partition is powered. Enable the CPU clock. */
91 tegra_enable_cpu_clock(cpu); 122 tegra_enable_cpu_clock(cpu);
92 udelay(10); 123 udelay(10);
@@ -105,6 +136,8 @@ static int __cpuinit tegra_boot_secondary(unsigned int cpu, struct task_struct *
105{ 136{
106 int status; 137 int status;
107 138
139 cpu = cpu_logical_map(cpu);
140
108 /* 141 /*
109 * Force the CPU into reset. The CPU must remain in reset when the 142 * Force the CPU into reset. The CPU must remain in reset when the
110 * flow controller state is cleared (which will cause the flow 143 * flow controller state is cleared (which will cause the flow
@@ -143,38 +176,21 @@ done:
143 return status; 176 return status;
144} 177}
145 178
146/*
147 * Initialise the CPU possible map early - this describes the CPUs
148 * which may be present or become present in the system.
149 */
150static void __init tegra_smp_init_cpus(void)
151{
152 unsigned int i, ncores = scu_get_core_count(scu_base);
153
154 if (ncores > nr_cpu_ids) {
155 pr_warn("SMP: %u cores greater than maximum (%u), clipping\n",
156 ncores, nr_cpu_ids);
157 ncores = nr_cpu_ids;
158 }
159
160 for (i = 0; i < ncores; i++)
161 set_cpu_possible(i, true);
162
163 set_smp_cross_call(gic_raise_softirq);
164}
165
166static void __init tegra_smp_prepare_cpus(unsigned int max_cpus) 179static void __init tegra_smp_prepare_cpus(unsigned int max_cpus)
167{ 180{
168 tegra_cpu_reset_handler_init(); 181 /* Always mark the boot CPU (CPU0) as initialized. */
169 scu_enable(scu_base); 182 cpumask_set_cpu(0, &tegra_cpu_init_mask);
183
184 if (scu_a9_has_base())
185 scu_enable(IO_ADDRESS(scu_a9_get_base()));
170} 186}
171 187
172struct smp_operations tegra_smp_ops __initdata = { 188struct smp_operations tegra_smp_ops __initdata = {
173 .smp_init_cpus = tegra_smp_init_cpus,
174 .smp_prepare_cpus = tegra_smp_prepare_cpus, 189 .smp_prepare_cpus = tegra_smp_prepare_cpus,
175 .smp_secondary_init = tegra_secondary_init, 190 .smp_secondary_init = tegra_secondary_init,
176 .smp_boot_secondary = tegra_boot_secondary, 191 .smp_boot_secondary = tegra_boot_secondary,
177#ifdef CONFIG_HOTPLUG_CPU 192#ifdef CONFIG_HOTPLUG_CPU
193 .cpu_kill = tegra_cpu_kill,
178 .cpu_die = tegra_cpu_die, 194 .cpu_die = tegra_cpu_die,
179 .cpu_disable = tegra_cpu_disable, 195 .cpu_disable = tegra_cpu_disable,
180#endif 196#endif
diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c
index 1b11707eaca0..523604de666f 100644
--- a/arch/arm/mach-tegra/pm.c
+++ b/arch/arm/mach-tegra/pm.c
@@ -24,6 +24,7 @@
24#include <linux/cpu_pm.h> 24#include <linux/cpu_pm.h>
25#include <linux/clk.h> 25#include <linux/clk.h>
26#include <linux/err.h> 26#include <linux/err.h>
27#include <linux/clk/tegra.h>
27 28
28#include <asm/smp_plat.h> 29#include <asm/smp_plat.h>
29#include <asm/cacheflush.h> 30#include <asm/cacheflush.h>
@@ -35,8 +36,8 @@
35#include "iomap.h" 36#include "iomap.h"
36#include "reset.h" 37#include "reset.h"
37#include "flowctrl.h" 38#include "flowctrl.h"
39#include "fuse.h"
38#include "sleep.h" 40#include "sleep.h"
39#include "tegra_cpu_car.h"
40 41
41#define TEGRA_POWER_CPU_PWRREQ_OE (1 << 16) /* CPU pwr req enable */ 42#define TEGRA_POWER_CPU_PWRREQ_OE (1 << 16) /* CPU pwr req enable */
42 43
@@ -148,7 +149,7 @@ static void suspend_cpu_complex(void)
148 save_cpu_arch_register(); 149 save_cpu_arch_register();
149} 150}
150 151
151void __cpuinit tegra_clear_cpu_in_lp2(int phy_cpu_id) 152void tegra_clear_cpu_in_lp2(int phy_cpu_id)
152{ 153{
153 u32 *cpu_in_lp2 = tegra_cpu_lp2_mask; 154 u32 *cpu_in_lp2 = tegra_cpu_lp2_mask;
154 155
@@ -160,7 +161,7 @@ void __cpuinit tegra_clear_cpu_in_lp2(int phy_cpu_id)
160 spin_unlock(&tegra_lp2_lock); 161 spin_unlock(&tegra_lp2_lock);
161} 162}
162 163
163bool __cpuinit tegra_set_cpu_in_lp2(int phy_cpu_id) 164bool tegra_set_cpu_in_lp2(int phy_cpu_id)
164{ 165{
165 bool last_cpu = false; 166 bool last_cpu = false;
166 cpumask_t *cpu_lp2_mask = tegra_cpu_lp2_mask; 167 cpumask_t *cpu_lp2_mask = tegra_cpu_lp2_mask;
@@ -173,6 +174,8 @@ bool __cpuinit tegra_set_cpu_in_lp2(int phy_cpu_id)
173 174
174 if ((phy_cpu_id == 0) && cpumask_equal(cpu_lp2_mask, cpu_online_mask)) 175 if ((phy_cpu_id == 0) && cpumask_equal(cpu_lp2_mask, cpu_online_mask))
175 last_cpu = true; 176 last_cpu = true;
177 else if (tegra_chip_id == TEGRA20 && phy_cpu_id == 1)
178 tegra20_cpu_set_resettable_soon();
176 179
177 spin_unlock(&tegra_lp2_lock); 180 spin_unlock(&tegra_lp2_lock);
178 return last_cpu; 181 return last_cpu;
diff --git a/arch/arm/mach-tegra/powergate.c b/arch/arm/mach-tegra/powergate.c
index 2cc1185d902e..c6bc8f85759c 100644
--- a/arch/arm/mach-tegra/powergate.c
+++ b/arch/arm/mach-tegra/powergate.c
@@ -26,8 +26,8 @@
26#include <linux/io.h> 26#include <linux/io.h>
27#include <linux/seq_file.h> 27#include <linux/seq_file.h>
28#include <linux/spinlock.h> 28#include <linux/spinlock.h>
29#include <linux/clk/tegra.h>
29 30
30#include <mach/clk.h>
31#include <mach/powergate.h> 31#include <mach/powergate.h>
32 32
33#include "fuse.h" 33#include "fuse.h"
diff --git a/arch/arm/mach-tegra/reset-handler.S b/arch/arm/mach-tegra/reset-handler.S
new file mode 100644
index 000000000000..54382ceade4a
--- /dev/null
+++ b/arch/arm/mach-tegra/reset-handler.S
@@ -0,0 +1,239 @@
1/*
2 * Copyright (c) 2012, NVIDIA Corporation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include <linux/linkage.h>
18#include <linux/init.h>
19
20#include <asm/cache.h>
21#include <asm/asm-offsets.h>
22#include <asm/hardware/cache-l2x0.h>
23
24#include "flowctrl.h"
25#include "iomap.h"
26#include "reset.h"
27#include "sleep.h"
28
29#define APB_MISC_GP_HIDREV 0x804
30#define PMC_SCRATCH41 0x140
31
32#define RESET_DATA(x) ((TEGRA_RESET_##x)*4)
33
34#ifdef CONFIG_PM_SLEEP
35/*
36 * tegra_resume
37 *
38 * CPU boot vector when restarting the a CPU following
39 * an LP2 transition. Also branched to by LP0 and LP1 resume after
40 * re-enabling sdram.
41 */
42ENTRY(tegra_resume)
43 bl v7_invalidate_l1
44 /* Enable coresight */
45 mov32 r0, 0xC5ACCE55
46 mcr p14, 0, r0, c7, c12, 6
47
48 cpu_id r0
49 cmp r0, #0 @ CPU0?
50 bne cpu_resume @ no
51
52#ifdef CONFIG_ARCH_TEGRA_3x_SOC
53 /* Are we on Tegra20? */
54 mov32 r6, TEGRA_APB_MISC_BASE
55 ldr r0, [r6, #APB_MISC_GP_HIDREV]
56 and r0, r0, #0xff00
57 cmp r0, #(0x20 << 8)
58 beq 1f @ Yes
59 /* Clear the flow controller flags for this CPU. */
60 mov32 r2, TEGRA_FLOW_CTRL_BASE + FLOW_CTRL_CPU0_CSR @ CPU0 CSR
61 ldr r1, [r2]
62 /* Clear event & intr flag */
63 orr r1, r1, \
64 #FLOW_CTRL_CSR_INTR_FLAG | FLOW_CTRL_CSR_EVENT_FLAG
65 movw r0, #0x0FFD @ enable, cluster_switch, immed, & bitmaps
66 bic r1, r1, r0
67 str r1, [r2]
681:
69#endif
70
71#ifdef CONFIG_HAVE_ARM_SCU
72 /* enable SCU */
73 mov32 r0, TEGRA_ARM_PERIF_BASE
74 ldr r1, [r0]
75 orr r1, r1, #1
76 str r1, [r0]
77#endif
78
79 /* L2 cache resume & re-enable */
80 l2_cache_resume r0, r1, r2, l2x0_saved_regs_addr
81
82 b cpu_resume
83ENDPROC(tegra_resume)
84#endif
85
86#ifdef CONFIG_CACHE_L2X0
87 .globl l2x0_saved_regs_addr
88l2x0_saved_regs_addr:
89 .long 0
90#endif
91
92 .align L1_CACHE_SHIFT
93ENTRY(__tegra_cpu_reset_handler_start)
94
95/*
96 * __tegra_cpu_reset_handler:
97 *
98 * Common handler for all CPU reset events.
99 *
100 * Register usage within the reset handler:
101 *
102 * R7 = CPU present (to the OS) mask
103 * R8 = CPU in LP1 state mask
104 * R9 = CPU in LP2 state mask
105 * R10 = CPU number
106 * R11 = CPU mask
107 * R12 = pointer to reset handler data
108 *
109 * NOTE: This code is copied to IRAM. All code and data accesses
110 * must be position-independent.
111 */
112
113 .align L1_CACHE_SHIFT
114ENTRY(__tegra_cpu_reset_handler)
115
116 cpsid aif, 0x13 @ SVC mode, interrupts disabled
117 mrc p15, 0, r10, c0, c0, 5 @ MPIDR
118 and r10, r10, #0x3 @ R10 = CPU number
119 mov r11, #1
120 mov r11, r11, lsl r10 @ R11 = CPU mask
121 adr r12, __tegra_cpu_reset_handler_data
122
123#ifdef CONFIG_SMP
124 /* Does the OS know about this CPU? */
125 ldr r7, [r12, #RESET_DATA(MASK_PRESENT)]
126 tst r7, r11 @ if !present
127 bleq __die @ CPU not present (to OS)
128#endif
129
130#ifdef CONFIG_ARCH_TEGRA_2x_SOC
131 /* Are we on Tegra20? */
132 mov32 r6, TEGRA_APB_MISC_BASE
133 ldr r0, [r6, #APB_MISC_GP_HIDREV]
134 and r0, r0, #0xff00
135 cmp r0, #(0x20 << 8)
136 bne 1f
137 /* If not CPU0, don't let CPU0 reset CPU1 now that CPU1 is coming up. */
138 mov32 r6, TEGRA_PMC_BASE
139 mov r0, #0
140 cmp r10, #0
141 strne r0, [r6, #PMC_SCRATCH41]
1421:
143#endif
144
145 /* Waking up from LP2? */
146 ldr r9, [r12, #RESET_DATA(MASK_LP2)]
147 tst r9, r11 @ if in_lp2
148 beq __is_not_lp2
149 ldr lr, [r12, #RESET_DATA(STARTUP_LP2)]
150 cmp lr, #0
151 bleq __die @ no LP2 startup handler
152 bx lr
153
154__is_not_lp2:
155
156#ifdef CONFIG_SMP
157 /*
158 * Can only be secondary boot (initial or hotplug) but CPU 0
159 * cannot be here.
160 */
161 cmp r10, #0
162 bleq __die @ CPU0 cannot be here
163 ldr lr, [r12, #RESET_DATA(STARTUP_SECONDARY)]
164 cmp lr, #0
165 bleq __die @ no secondary startup handler
166 bx lr
167#endif
168
169/*
170 * We don't know why the CPU reset. Just kill it.
171 * The LR register will contain the address we died at + 4.
172 */
173
174__die:
175 sub lr, lr, #4
176 mov32 r7, TEGRA_PMC_BASE
177 str lr, [r7, #PMC_SCRATCH41]
178
179 mov32 r7, TEGRA_CLK_RESET_BASE
180
181 /* Are we on Tegra20? */
182 mov32 r6, TEGRA_APB_MISC_BASE
183 ldr r0, [r6, #APB_MISC_GP_HIDREV]
184 and r0, r0, #0xff00
185 cmp r0, #(0x20 << 8)
186 bne 1f
187
188#ifdef CONFIG_ARCH_TEGRA_2x_SOC
189 mov32 r0, 0x1111
190 mov r1, r0, lsl r10
191 str r1, [r7, #0x340] @ CLK_RST_CPU_CMPLX_SET
192#endif
1931:
194#ifdef CONFIG_ARCH_TEGRA_3x_SOC
195 mov32 r6, TEGRA_FLOW_CTRL_BASE
196
197 cmp r10, #0
198 moveq r1, #FLOW_CTRL_HALT_CPU0_EVENTS
199 moveq r2, #FLOW_CTRL_CPU0_CSR
200 movne r1, r10, lsl #3
201 addne r2, r1, #(FLOW_CTRL_CPU1_CSR-8)
202 addne r1, r1, #(FLOW_CTRL_HALT_CPU1_EVENTS-8)
203
204 /* Clear CPU "event" and "interrupt" flags and power gate
205 it when halting but not before it is in the "WFI" state. */
206 ldr r0, [r6, +r2]
207 orr r0, r0, #FLOW_CTRL_CSR_INTR_FLAG | FLOW_CTRL_CSR_EVENT_FLAG
208 orr r0, r0, #FLOW_CTRL_CSR_ENABLE
209 str r0, [r6, +r2]
210
211 /* Unconditionally halt this CPU */
212 mov r0, #FLOW_CTRL_WAITEVENT
213 str r0, [r6, +r1]
214 ldr r0, [r6, +r1] @ memory barrier
215
216 dsb
217 isb
218 wfi @ CPU should be power gated here
219
220 /* If the CPU didn't power gate above just kill it's clock. */
221
222 mov r0, r11, lsl #8
223 str r0, [r7, #348] @ CLK_CPU_CMPLX_SET
224#endif
225
226 /* If the CPU still isn't dead, just spin here. */
227 b .
228ENDPROC(__tegra_cpu_reset_handler)
229
230 .align L1_CACHE_SHIFT
231 .type __tegra_cpu_reset_handler_data, %object
232 .globl __tegra_cpu_reset_handler_data
233__tegra_cpu_reset_handler_data:
234 .rept TEGRA_RESET_DATA_SIZE
235 .long 0
236 .endr
237 .align L1_CACHE_SHIFT
238
239ENTRY(__tegra_cpu_reset_handler_end)
diff --git a/arch/arm/mach-tegra/reset.c b/arch/arm/mach-tegra/reset.c
index 3fd89ecd158e..1ac434e0068f 100644
--- a/arch/arm/mach-tegra/reset.c
+++ b/arch/arm/mach-tegra/reset.c
@@ -75,7 +75,7 @@ void __init tegra_cpu_reset_handler_init(void)
75 75
76#ifdef CONFIG_SMP 76#ifdef CONFIG_SMP
77 __tegra_cpu_reset_handler_data[TEGRA_RESET_MASK_PRESENT] = 77 __tegra_cpu_reset_handler_data[TEGRA_RESET_MASK_PRESENT] =
78 *((u32 *)cpu_present_mask); 78 *((u32 *)cpu_possible_mask);
79 __tegra_cpu_reset_handler_data[TEGRA_RESET_STARTUP_SECONDARY] = 79 __tegra_cpu_reset_handler_data[TEGRA_RESET_STARTUP_SECONDARY] =
80 virt_to_phys((void *)tegra_secondary_startup); 80 virt_to_phys((void *)tegra_secondary_startup);
81#endif 81#endif
diff --git a/arch/arm/mach-tegra/sleep-tegra20.S b/arch/arm/mach-tegra/sleep-tegra20.S
index 72ce709799da..9f6bfafdd512 100644
--- a/arch/arm/mach-tegra/sleep-tegra20.S
+++ b/arch/arm/mach-tegra/sleep-tegra20.S
@@ -21,6 +21,8 @@
21#include <linux/linkage.h> 21#include <linux/linkage.h>
22 22
23#include <asm/assembler.h> 23#include <asm/assembler.h>
24#include <asm/proc-fns.h>
25#include <asm/cp15.h>
24 26
25#include "sleep.h" 27#include "sleep.h"
26#include "flowctrl.h" 28#include "flowctrl.h"
@@ -33,9 +35,6 @@
33 * should never return 35 * should never return
34 */ 36 */
35ENTRY(tegra20_hotplug_shutdown) 37ENTRY(tegra20_hotplug_shutdown)
36 /* Turn off SMP coherency */
37 exit_smp r4, r5
38
39 /* Put this CPU down */ 38 /* Put this CPU down */
40 cpu_id r0 39 cpu_id r0
41 bl tegra20_cpu_shutdown 40 bl tegra20_cpu_shutdown
@@ -58,6 +57,9 @@ ENDPROC(tegra20_hotplug_shutdown)
58ENTRY(tegra20_cpu_shutdown) 57ENTRY(tegra20_cpu_shutdown)
59 cmp r0, #0 58 cmp r0, #0
60 moveq pc, lr @ must not be called for CPU 0 59 moveq pc, lr @ must not be called for CPU 0
60 mov32 r1, TEGRA_PMC_VIRT + PMC_SCRATCH41
61 mov r12, #CPU_RESETTABLE
62 str r12, [r1]
61 63
62 cpu_to_halt_reg r1, r0 64 cpu_to_halt_reg r1, r0
63 ldr r3, =TEGRA_FLOW_CTRL_VIRT 65 ldr r3, =TEGRA_FLOW_CTRL_VIRT
@@ -78,3 +80,198 @@ ENTRY(tegra20_cpu_shutdown)
78 mov pc, lr 80 mov pc, lr
79ENDPROC(tegra20_cpu_shutdown) 81ENDPROC(tegra20_cpu_shutdown)
80#endif 82#endif
83
84#ifdef CONFIG_PM_SLEEP
85/*
86 * tegra_pen_lock
87 *
88 * spinlock implementation with no atomic test-and-set and no coherence
89 * using Peterson's algorithm on strongly-ordered registers
90 * used to synchronize a cpu waking up from wfi with entering lp2 on idle
91 *
92 * The reference link of Peterson's algorithm:
93 * http://en.wikipedia.org/wiki/Peterson's_algorithm
94 *
95 * SCRATCH37 = r1 = !turn (inverted from Peterson's algorithm)
96 * on cpu 0:
97 * r2 = flag[0] (in SCRATCH38)
98 * r3 = flag[1] (in SCRATCH39)
99 * on cpu1:
100 * r2 = flag[1] (in SCRATCH39)
101 * r3 = flag[0] (in SCRATCH38)
102 *
103 * must be called with MMU on
104 * corrupts r0-r3, r12
105 */
106ENTRY(tegra_pen_lock)
107 mov32 r3, TEGRA_PMC_VIRT
108 cpu_id r0
109 add r1, r3, #PMC_SCRATCH37
110 cmp r0, #0
111 addeq r2, r3, #PMC_SCRATCH38
112 addeq r3, r3, #PMC_SCRATCH39
113 addne r2, r3, #PMC_SCRATCH39
114 addne r3, r3, #PMC_SCRATCH38
115
116 mov r12, #1
117 str r12, [r2] @ flag[cpu] = 1
118 dsb
119 str r12, [r1] @ !turn = cpu
1201: dsb
121 ldr r12, [r3]
122 cmp r12, #1 @ flag[!cpu] == 1?
123 ldreq r12, [r1]
124 cmpeq r12, r0 @ !turn == cpu?
125 beq 1b @ while !turn == cpu && flag[!cpu] == 1
126
127 mov pc, lr @ locked
128ENDPROC(tegra_pen_lock)
129
130ENTRY(tegra_pen_unlock)
131 dsb
132 mov32 r3, TEGRA_PMC_VIRT
133 cpu_id r0
134 cmp r0, #0
135 addeq r2, r3, #PMC_SCRATCH38
136 addne r2, r3, #PMC_SCRATCH39
137 mov r12, #0
138 str r12, [r2]
139 mov pc, lr
140ENDPROC(tegra_pen_unlock)
141
142/*
143 * tegra20_cpu_clear_resettable(void)
144 *
145 * Called to clear the "resettable soon" flag in PMC_SCRATCH41 when
146 * it is expected that the secondary CPU will be idle soon.
147 */
148ENTRY(tegra20_cpu_clear_resettable)
149 mov32 r1, TEGRA_PMC_VIRT + PMC_SCRATCH41
150 mov r12, #CPU_NOT_RESETTABLE
151 str r12, [r1]
152 mov pc, lr
153ENDPROC(tegra20_cpu_clear_resettable)
154
155/*
156 * tegra20_cpu_set_resettable_soon(void)
157 *
158 * Called to set the "resettable soon" flag in PMC_SCRATCH41 when
159 * it is expected that the secondary CPU will be idle soon.
160 */
161ENTRY(tegra20_cpu_set_resettable_soon)
162 mov32 r1, TEGRA_PMC_VIRT + PMC_SCRATCH41
163 mov r12, #CPU_RESETTABLE_SOON
164 str r12, [r1]
165 mov pc, lr
166ENDPROC(tegra20_cpu_set_resettable_soon)
167
168/*
169 * tegra20_cpu_is_resettable_soon(void)
170 *
171 * Returns true if the "resettable soon" flag in PMC_SCRATCH41 has been
172 * set because it is expected that the secondary CPU will be idle soon.
173 */
174ENTRY(tegra20_cpu_is_resettable_soon)
175 mov32 r1, TEGRA_PMC_VIRT + PMC_SCRATCH41
176 ldr r12, [r1]
177 cmp r12, #CPU_RESETTABLE_SOON
178 moveq r0, #1
179 movne r0, #0
180 mov pc, lr
181ENDPROC(tegra20_cpu_is_resettable_soon)
182
183/*
184 * tegra20_sleep_cpu_secondary_finish(unsigned long v2p)
185 *
186 * Enters WFI on secondary CPU by exiting coherency.
187 */
188ENTRY(tegra20_sleep_cpu_secondary_finish)
189 stmfd sp!, {r4-r11, lr}
190
191 mrc p15, 0, r11, c1, c0, 1 @ save actlr before exiting coherency
192
193 /* Flush and disable the L1 data cache */
194 bl tegra_disable_clean_inv_dcache
195
196 mov32 r0, TEGRA_PMC_VIRT + PMC_SCRATCH41
197 mov r3, #CPU_RESETTABLE
198 str r3, [r0]
199
200 bl cpu_do_idle
201
202 /*
203 * cpu may be reset while in wfi, which will return through
204 * tegra_resume to cpu_resume
205 * or interrupt may wake wfi, which will return here
206 * cpu state is unchanged - MMU is on, cache is on, coherency
207 * is off, and the data cache is off
208 *
209 * r11 contains the original actlr
210 */
211
212 bl tegra_pen_lock
213
214 mov32 r3, TEGRA_PMC_VIRT
215 add r0, r3, #PMC_SCRATCH41
216 mov r3, #CPU_NOT_RESETTABLE
217 str r3, [r0]
218
219 bl tegra_pen_unlock
220
221 /* Re-enable the data cache */
222 mrc p15, 0, r10, c1, c0, 0
223 orr r10, r10, #CR_C
224 mcr p15, 0, r10, c1, c0, 0
225 isb
226
227 mcr p15, 0, r11, c1, c0, 1 @ reenable coherency
228
229 /* Invalidate the TLBs & BTAC */
230 mov r1, #0
231 mcr p15, 0, r1, c8, c3, 0 @ invalidate shared TLBs
232 mcr p15, 0, r1, c7, c1, 6 @ invalidate shared BTAC
233 dsb
234 isb
235
236 /* the cpu was running with coherency disabled,
237 * caches may be out of date */
238 bl v7_flush_kern_cache_louis
239
240 ldmfd sp!, {r4 - r11, pc}
241ENDPROC(tegra20_sleep_cpu_secondary_finish)
242
243/*
244 * tegra20_tear_down_cpu
245 *
246 * Switches the CPU cluster to PLL-P and enters sleep.
247 */
248ENTRY(tegra20_tear_down_cpu)
249 bl tegra_switch_cpu_to_pllp
250 b tegra20_enter_sleep
251ENDPROC(tegra20_tear_down_cpu)
252
253/*
254 * tegra20_enter_sleep
255 *
256 * uses flow controller to enter sleep state
257 * executes from IRAM with SDRAM in selfrefresh when target state is LP0 or LP1
258 * executes from SDRAM with target state is LP2
259 */
260tegra20_enter_sleep:
261 mov32 r6, TEGRA_FLOW_CTRL_BASE
262
263 mov r0, #FLOW_CTRL_WAIT_FOR_INTERRUPT
264 orr r0, r0, #FLOW_CTRL_HALT_CPU_IRQ | FLOW_CTRL_HALT_CPU_FIQ
265 cpu_id r1
266 cpu_to_halt_reg r1, r1
267 str r0, [r6, r1]
268 dsb
269 ldr r0, [r6, r1] /* memory barrier */
270
271halted:
272 dsb
273 wfe /* CPU should be power gated here */
274 isb
275 b halted
276
277#endif
diff --git a/arch/arm/mach-tegra/sleep-tegra30.S b/arch/arm/mach-tegra/sleep-tegra30.S
index 562a8e7e413d..63a15bd9b653 100644
--- a/arch/arm/mach-tegra/sleep-tegra30.S
+++ b/arch/arm/mach-tegra/sleep-tegra30.S
@@ -32,9 +32,6 @@
32 * Should never return. 32 * Should never return.
33 */ 33 */
34ENTRY(tegra30_hotplug_shutdown) 34ENTRY(tegra30_hotplug_shutdown)
35 /* Turn off SMP coherency */
36 exit_smp r4, r5
37
38 /* Powergate this CPU */ 35 /* Powergate this CPU */
39 mov r0, #TEGRA30_POWER_HOTPLUG_SHUTDOWN 36 mov r0, #TEGRA30_POWER_HOTPLUG_SHUTDOWN
40 bl tegra30_cpu_shutdown 37 bl tegra30_cpu_shutdown
diff --git a/arch/arm/mach-tegra/sleep.S b/arch/arm/mach-tegra/sleep.S
index 26afa7cbed11..364d84523fba 100644
--- a/arch/arm/mach-tegra/sleep.S
+++ b/arch/arm/mach-tegra/sleep.S
@@ -34,7 +34,10 @@
34#include "flowctrl.h" 34#include "flowctrl.h"
35#include "sleep.h" 35#include "sleep.h"
36 36
37#ifdef CONFIG_PM_SLEEP 37#define CLK_RESET_CCLK_BURST 0x20
38#define CLK_RESET_CCLK_DIVIDER 0x24
39
40#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_PM_SLEEP)
38/* 41/*
39 * tegra_disable_clean_inv_dcache 42 * tegra_disable_clean_inv_dcache
40 * 43 *
@@ -60,7 +63,9 @@ ENTRY(tegra_disable_clean_inv_dcache)
60 63
61 ldmfd sp!, {r0, r4-r5, r7, r9-r11, pc} 64 ldmfd sp!, {r0, r4-r5, r7, r9-r11, pc}
62ENDPROC(tegra_disable_clean_inv_dcache) 65ENDPROC(tegra_disable_clean_inv_dcache)
66#endif
63 67
68#ifdef CONFIG_PM_SLEEP
64/* 69/*
65 * tegra_sleep_cpu_finish(unsigned long v2p) 70 * tegra_sleep_cpu_finish(unsigned long v2p)
66 * 71 *
@@ -108,4 +113,20 @@ ENTRY(tegra_shut_off_mmu)
108 mov pc, r0 113 mov pc, r0
109ENDPROC(tegra_shut_off_mmu) 114ENDPROC(tegra_shut_off_mmu)
110 .popsection 115 .popsection
116
117/*
118 * tegra_switch_cpu_to_pllp
119 *
120 * In LP2 the normal cpu clock pllx will be turned off. Switch the CPU to pllp
121 */
122ENTRY(tegra_switch_cpu_to_pllp)
123 /* in LP2 idle (SDRAM active), set the CPU burst policy to PLLP */
124 mov32 r5, TEGRA_CLK_RESET_BASE
125 mov r0, #(2 << 28) @ burst policy = run mode
126 orr r0, r0, #(4 << 4) @ use PLLP in run mode burst
127 str r0, [r5, #CLK_RESET_CCLK_BURST]
128 mov r0, #0
129 str r0, [r5, #CLK_RESET_CCLK_DIVIDER]
130 mov pc, lr
131ENDPROC(tegra_switch_cpu_to_pllp)
111#endif 132#endif
diff --git a/arch/arm/mach-tegra/sleep.h b/arch/arm/mach-tegra/sleep.h
index 9821ee725420..4ffae541726e 100644
--- a/arch/arm/mach-tegra/sleep.h
+++ b/arch/arm/mach-tegra/sleep.h
@@ -25,6 +25,19 @@
25 + IO_PPSB_VIRT) 25 + IO_PPSB_VIRT)
26#define TEGRA_CLK_RESET_VIRT (TEGRA_CLK_RESET_BASE - IO_PPSB_PHYS \ 26#define TEGRA_CLK_RESET_VIRT (TEGRA_CLK_RESET_BASE - IO_PPSB_PHYS \
27 + IO_PPSB_VIRT) 27 + IO_PPSB_VIRT)
28#define TEGRA_PMC_VIRT (TEGRA_PMC_BASE - IO_APB_PHYS + IO_APB_VIRT)
29
30/* PMC_SCRATCH37-39 and 41 are used for tegra_pen_lock and idle */
31#define PMC_SCRATCH37 0x130
32#define PMC_SCRATCH38 0x134
33#define PMC_SCRATCH39 0x138
34#define PMC_SCRATCH41 0x140
35
36#ifdef CONFIG_ARCH_TEGRA_2x_SOC
37#define CPU_RESETTABLE 2
38#define CPU_RESETTABLE_SOON 1
39#define CPU_NOT_RESETTABLE 0
40#endif
28 41
29#ifdef __ASSEMBLY__ 42#ifdef __ASSEMBLY__
30/* returns the offset of the flow controller halt register for a cpu */ 43/* returns the offset of the flow controller halt register for a cpu */
@@ -104,8 +117,11 @@ exit_l2_resume:
104.endm 117.endm
105#endif /* CONFIG_CACHE_L2X0 */ 118#endif /* CONFIG_CACHE_L2X0 */
106#else 119#else
120void tegra_pen_lock(void);
121void tegra_pen_unlock(void);
107void tegra_resume(void); 122void tegra_resume(void);
108int tegra_sleep_cpu_finish(unsigned long); 123int tegra_sleep_cpu_finish(unsigned long);
124void tegra_disable_clean_inv_dcache(void);
109 125
110#ifdef CONFIG_HOTPLUG_CPU 126#ifdef CONFIG_HOTPLUG_CPU
111void tegra20_hotplug_init(void); 127void tegra20_hotplug_init(void);
@@ -115,6 +131,17 @@ static inline void tegra20_hotplug_init(void) {}
115static inline void tegra30_hotplug_init(void) {} 131static inline void tegra30_hotplug_init(void) {}
116#endif 132#endif
117 133
134void tegra20_cpu_shutdown(int cpu);
135int tegra20_cpu_is_resettable_soon(void);
136void tegra20_cpu_clear_resettable(void);
137#ifdef CONFIG_ARCH_TEGRA_2x_SOC
138void tegra20_cpu_set_resettable_soon(void);
139#else
140static inline void tegra20_cpu_set_resettable_soon(void) {}
141#endif
142
143int tegra20_sleep_cpu_secondary_finish(unsigned long);
144void tegra20_tear_down_cpu(void);
118int tegra30_sleep_cpu_secondary_finish(unsigned long); 145int tegra30_sleep_cpu_secondary_finish(unsigned long);
119void tegra30_tear_down_cpu(void); 146void tegra30_tear_down_cpu(void);
120 147
diff --git a/arch/arm/mach-tegra/tegra20_clocks.c b/arch/arm/mach-tegra/tegra20_clocks.c
deleted file mode 100644
index 4eb6bc81a87b..000000000000
--- a/arch/arm/mach-tegra/tegra20_clocks.c
+++ /dev/null
@@ -1,1623 +0,0 @@
1/*
2 * arch/arm/mach-tegra/tegra20_clocks.c
3 *
4 * Copyright (C) 2010 Google, Inc.
5 * Copyright (c) 2010-2012 NVIDIA CORPORATION. All rights reserved.
6 *
7 * Author:
8 * Colin Cross <ccross@google.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/kernel.h>
22#include <linux/module.h>
23#include <linux/list.h>
24#include <linux/spinlock.h>
25#include <linux/delay.h>
26#include <linux/io.h>
27#include <linux/clkdev.h>
28#include <linux/clk.h>
29
30#include "clock.h"
31#include "fuse.h"
32#include "iomap.h"
33#include "tegra2_emc.h"
34#include "tegra_cpu_car.h"
35
36#define RST_DEVICES 0x004
37#define RST_DEVICES_SET 0x300
38#define RST_DEVICES_CLR 0x304
39#define RST_DEVICES_NUM 3
40
41#define CLK_OUT_ENB 0x010
42#define CLK_OUT_ENB_SET 0x320
43#define CLK_OUT_ENB_CLR 0x324
44#define CLK_OUT_ENB_NUM 3
45
46#define CLK_MASK_ARM 0x44
47#define MISC_CLK_ENB 0x48
48
49#define OSC_CTRL 0x50
50#define OSC_CTRL_OSC_FREQ_MASK (3<<30)
51#define OSC_CTRL_OSC_FREQ_13MHZ (0<<30)
52#define OSC_CTRL_OSC_FREQ_19_2MHZ (1<<30)
53#define OSC_CTRL_OSC_FREQ_12MHZ (2<<30)
54#define OSC_CTRL_OSC_FREQ_26MHZ (3<<30)
55#define OSC_CTRL_MASK (0x3f2 | OSC_CTRL_OSC_FREQ_MASK)
56
57#define OSC_FREQ_DET 0x58
58#define OSC_FREQ_DET_TRIG (1<<31)
59
60#define OSC_FREQ_DET_STATUS 0x5C
61#define OSC_FREQ_DET_BUSY (1<<31)
62#define OSC_FREQ_DET_CNT_MASK 0xFFFF
63
64#define PERIPH_CLK_SOURCE_I2S1 0x100
65#define PERIPH_CLK_SOURCE_EMC 0x19c
66#define PERIPH_CLK_SOURCE_OSC 0x1fc
67#define PERIPH_CLK_SOURCE_NUM \
68 ((PERIPH_CLK_SOURCE_OSC - PERIPH_CLK_SOURCE_I2S1) / 4)
69
70#define PERIPH_CLK_SOURCE_MASK (3<<30)
71#define PERIPH_CLK_SOURCE_SHIFT 30
72#define PERIPH_CLK_SOURCE_PWM_MASK (7<<28)
73#define PERIPH_CLK_SOURCE_PWM_SHIFT 28
74#define PERIPH_CLK_SOURCE_ENABLE (1<<28)
75#define PERIPH_CLK_SOURCE_DIVU71_MASK 0xFF
76#define PERIPH_CLK_SOURCE_DIVU16_MASK 0xFFFF
77#define PERIPH_CLK_SOURCE_DIV_SHIFT 0
78
79#define SDMMC_CLK_INT_FB_SEL (1 << 23)
80#define SDMMC_CLK_INT_FB_DLY_SHIFT 16
81#define SDMMC_CLK_INT_FB_DLY_MASK (0xF << SDMMC_CLK_INT_FB_DLY_SHIFT)
82
83#define PLL_BASE 0x0
84#define PLL_BASE_BYPASS (1<<31)
85#define PLL_BASE_ENABLE (1<<30)
86#define PLL_BASE_REF_ENABLE (1<<29)
87#define PLL_BASE_OVERRIDE (1<<28)
88#define PLL_BASE_DIVP_MASK (0x7<<20)
89#define PLL_BASE_DIVP_SHIFT 20
90#define PLL_BASE_DIVN_MASK (0x3FF<<8)
91#define PLL_BASE_DIVN_SHIFT 8
92#define PLL_BASE_DIVM_MASK (0x1F)
93#define PLL_BASE_DIVM_SHIFT 0
94
95#define PLL_OUT_RATIO_MASK (0xFF<<8)
96#define PLL_OUT_RATIO_SHIFT 8
97#define PLL_OUT_OVERRIDE (1<<2)
98#define PLL_OUT_CLKEN (1<<1)
99#define PLL_OUT_RESET_DISABLE (1<<0)
100
101#define PLL_MISC(c) (((c)->flags & PLL_ALT_MISC_REG) ? 0x4 : 0xc)
102
103#define PLL_MISC_DCCON_SHIFT 20
104#define PLL_MISC_CPCON_SHIFT 8
105#define PLL_MISC_CPCON_MASK (0xF<<PLL_MISC_CPCON_SHIFT)
106#define PLL_MISC_LFCON_SHIFT 4
107#define PLL_MISC_LFCON_MASK (0xF<<PLL_MISC_LFCON_SHIFT)
108#define PLL_MISC_VCOCON_SHIFT 0
109#define PLL_MISC_VCOCON_MASK (0xF<<PLL_MISC_VCOCON_SHIFT)
110
111#define PLLU_BASE_POST_DIV (1<<20)
112
113#define PLLD_MISC_CLKENABLE (1<<30)
114#define PLLD_MISC_DIV_RST (1<<23)
115#define PLLD_MISC_DCCON_SHIFT 12
116
117#define PLLE_MISC_READY (1 << 15)
118
119#define PERIPH_CLK_TO_ENB_REG(c) ((c->u.periph.clk_num / 32) * 4)
120#define PERIPH_CLK_TO_ENB_SET_REG(c) ((c->u.periph.clk_num / 32) * 8)
121#define PERIPH_CLK_TO_ENB_BIT(c) (1 << (c->u.periph.clk_num % 32))
122
123#define SUPER_CLK_MUX 0x00
124#define SUPER_STATE_SHIFT 28
125#define SUPER_STATE_MASK (0xF << SUPER_STATE_SHIFT)
126#define SUPER_STATE_STANDBY (0x0 << SUPER_STATE_SHIFT)
127#define SUPER_STATE_IDLE (0x1 << SUPER_STATE_SHIFT)
128#define SUPER_STATE_RUN (0x2 << SUPER_STATE_SHIFT)
129#define SUPER_STATE_IRQ (0x3 << SUPER_STATE_SHIFT)
130#define SUPER_STATE_FIQ (0x4 << SUPER_STATE_SHIFT)
131#define SUPER_SOURCE_MASK 0xF
132#define SUPER_FIQ_SOURCE_SHIFT 12
133#define SUPER_IRQ_SOURCE_SHIFT 8
134#define SUPER_RUN_SOURCE_SHIFT 4
135#define SUPER_IDLE_SOURCE_SHIFT 0
136
137#define SUPER_CLK_DIVIDER 0x04
138
139#define BUS_CLK_DISABLE (1<<3)
140#define BUS_CLK_DIV_MASK 0x3
141
142#define PMC_CTRL 0x0
143 #define PMC_CTRL_BLINK_ENB (1 << 7)
144
145#define PMC_DPD_PADS_ORIDE 0x1c
146 #define PMC_DPD_PADS_ORIDE_BLINK_ENB (1 << 20)
147
148#define PMC_BLINK_TIMER_DATA_ON_SHIFT 0
149#define PMC_BLINK_TIMER_DATA_ON_MASK 0x7fff
150#define PMC_BLINK_TIMER_ENB (1 << 15)
151#define PMC_BLINK_TIMER_DATA_OFF_SHIFT 16
152#define PMC_BLINK_TIMER_DATA_OFF_MASK 0xffff
153
154/* Tegra CPU clock and reset control regs */
155#define TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX 0x4c
156#define TEGRA_CLK_RST_CONTROLLER_RST_CPU_CMPLX_SET 0x340
157#define TEGRA_CLK_RST_CONTROLLER_RST_CPU_CMPLX_CLR 0x344
158
159#define CPU_CLOCK(cpu) (0x1 << (8 + cpu))
160#define CPU_RESET(cpu) (0x1111ul << (cpu))
161
162static void __iomem *reg_clk_base = IO_ADDRESS(TEGRA_CLK_RESET_BASE);
163static void __iomem *reg_pmc_base = IO_ADDRESS(TEGRA_PMC_BASE);
164
165/*
166 * Some clocks share a register with other clocks. Any clock op that
167 * non-atomically modifies a register used by another clock must lock
168 * clock_register_lock first.
169 */
170static DEFINE_SPINLOCK(clock_register_lock);
171
172/*
173 * Some peripheral clocks share an enable bit, so refcount the enable bits
174 * in registers CLK_ENABLE_L, CLK_ENABLE_H, and CLK_ENABLE_U
175 */
176static int tegra_periph_clk_enable_refcount[3 * 32];
177
178#define clk_writel(value, reg) \
179 __raw_writel(value, reg_clk_base + (reg))
180#define clk_readl(reg) \
181 __raw_readl(reg_clk_base + (reg))
182#define pmc_writel(value, reg) \
183 __raw_writel(value, reg_pmc_base + (reg))
184#define pmc_readl(reg) \
185 __raw_readl(reg_pmc_base + (reg))
186
187static unsigned long clk_measure_input_freq(void)
188{
189 u32 clock_autodetect;
190 clk_writel(OSC_FREQ_DET_TRIG | 1, OSC_FREQ_DET);
191 do {} while (clk_readl(OSC_FREQ_DET_STATUS) & OSC_FREQ_DET_BUSY);
192 clock_autodetect = clk_readl(OSC_FREQ_DET_STATUS);
193 if (clock_autodetect >= 732 - 3 && clock_autodetect <= 732 + 3) {
194 return 12000000;
195 } else if (clock_autodetect >= 794 - 3 && clock_autodetect <= 794 + 3) {
196 return 13000000;
197 } else if (clock_autodetect >= 1172 - 3 && clock_autodetect <= 1172 + 3) {
198 return 19200000;
199 } else if (clock_autodetect >= 1587 - 3 && clock_autodetect <= 1587 + 3) {
200 return 26000000;
201 } else {
202 pr_err("%s: Unexpected clock autodetect value %d",
203 __func__, clock_autodetect);
204 BUG();
205 return 0;
206 }
207}
208
209static int clk_div71_get_divider(unsigned long parent_rate, unsigned long rate)
210{
211 s64 divider_u71 = parent_rate * 2;
212 divider_u71 += rate - 1;
213 do_div(divider_u71, rate);
214
215 if (divider_u71 - 2 < 0)
216 return 0;
217
218 if (divider_u71 - 2 > 255)
219 return -EINVAL;
220
221 return divider_u71 - 2;
222}
223
224static int clk_div16_get_divider(unsigned long parent_rate, unsigned long rate)
225{
226 s64 divider_u16;
227
228 divider_u16 = parent_rate;
229 divider_u16 += rate - 1;
230 do_div(divider_u16, rate);
231
232 if (divider_u16 - 1 < 0)
233 return 0;
234
235 if (divider_u16 - 1 > 0xFFFF)
236 return -EINVAL;
237
238 return divider_u16 - 1;
239}
240
241static unsigned long tegra_clk_fixed_recalc_rate(struct clk_hw *hw,
242 unsigned long parent_rate)
243{
244 return to_clk_tegra(hw)->fixed_rate;
245}
246
247struct clk_ops tegra_clk_32k_ops = {
248 .recalc_rate = tegra_clk_fixed_recalc_rate,
249};
250
251/* clk_m functions */
252static unsigned long tegra20_clk_m_recalc_rate(struct clk_hw *hw,
253 unsigned long prate)
254{
255 if (!to_clk_tegra(hw)->fixed_rate)
256 to_clk_tegra(hw)->fixed_rate = clk_measure_input_freq();
257 return to_clk_tegra(hw)->fixed_rate;
258}
259
260static void tegra20_clk_m_init(struct clk_hw *hw)
261{
262 struct clk_tegra *c = to_clk_tegra(hw);
263 u32 osc_ctrl = clk_readl(OSC_CTRL);
264 u32 auto_clock_control = osc_ctrl & ~OSC_CTRL_OSC_FREQ_MASK;
265
266 switch (c->fixed_rate) {
267 case 12000000:
268 auto_clock_control |= OSC_CTRL_OSC_FREQ_12MHZ;
269 break;
270 case 13000000:
271 auto_clock_control |= OSC_CTRL_OSC_FREQ_13MHZ;
272 break;
273 case 19200000:
274 auto_clock_control |= OSC_CTRL_OSC_FREQ_19_2MHZ;
275 break;
276 case 26000000:
277 auto_clock_control |= OSC_CTRL_OSC_FREQ_26MHZ;
278 break;
279 default:
280 BUG();
281 }
282 clk_writel(auto_clock_control, OSC_CTRL);
283}
284
285struct clk_ops tegra_clk_m_ops = {
286 .init = tegra20_clk_m_init,
287 .recalc_rate = tegra20_clk_m_recalc_rate,
288};
289
290/* super clock functions */
291/* "super clocks" on tegra have two-stage muxes and a clock skipping
292 * super divider. We will ignore the clock skipping divider, since we
293 * can't lower the voltage when using the clock skip, but we can if we
294 * lower the PLL frequency.
295 */
296static int tegra20_super_clk_is_enabled(struct clk_hw *hw)
297{
298 struct clk_tegra *c = to_clk_tegra(hw);
299 u32 val;
300
301 val = clk_readl(c->reg + SUPER_CLK_MUX);
302 BUG_ON(((val & SUPER_STATE_MASK) != SUPER_STATE_RUN) &&
303 ((val & SUPER_STATE_MASK) != SUPER_STATE_IDLE));
304 c->state = ON;
305 return c->state;
306}
307
308static int tegra20_super_clk_enable(struct clk_hw *hw)
309{
310 struct clk_tegra *c = to_clk_tegra(hw);
311 clk_writel(0, c->reg + SUPER_CLK_DIVIDER);
312 return 0;
313}
314
315static void tegra20_super_clk_disable(struct clk_hw *hw)
316{
317 pr_debug("%s on clock %s\n", __func__, __clk_get_name(hw->clk));
318
319 /* oops - don't disable the CPU clock! */
320 BUG();
321}
322
323static u8 tegra20_super_clk_get_parent(struct clk_hw *hw)
324{
325 struct clk_tegra *c = to_clk_tegra(hw);
326 int val = clk_readl(c->reg + SUPER_CLK_MUX);
327 int source;
328 int shift;
329
330 BUG_ON(((val & SUPER_STATE_MASK) != SUPER_STATE_RUN) &&
331 ((val & SUPER_STATE_MASK) != SUPER_STATE_IDLE));
332 shift = ((val & SUPER_STATE_MASK) == SUPER_STATE_IDLE) ?
333 SUPER_IDLE_SOURCE_SHIFT : SUPER_RUN_SOURCE_SHIFT;
334 source = (val >> shift) & SUPER_SOURCE_MASK;
335 return source;
336}
337
338static int tegra20_super_clk_set_parent(struct clk_hw *hw, u8 index)
339{
340 struct clk_tegra *c = to_clk_tegra(hw);
341 u32 val = clk_readl(c->reg + SUPER_CLK_MUX);
342 int shift;
343
344 BUG_ON(((val & SUPER_STATE_MASK) != SUPER_STATE_RUN) &&
345 ((val & SUPER_STATE_MASK) != SUPER_STATE_IDLE));
346 shift = ((val & SUPER_STATE_MASK) == SUPER_STATE_IDLE) ?
347 SUPER_IDLE_SOURCE_SHIFT : SUPER_RUN_SOURCE_SHIFT;
348 val &= ~(SUPER_SOURCE_MASK << shift);
349 val |= index << shift;
350
351 clk_writel(val, c->reg);
352
353 return 0;
354}
355
356/* FIX ME: Need to switch parents to change the source PLL rate */
357static unsigned long tegra20_super_clk_recalc_rate(struct clk_hw *hw,
358 unsigned long prate)
359{
360 return prate;
361}
362
363static long tegra20_super_clk_round_rate(struct clk_hw *hw, unsigned long rate,
364 unsigned long *prate)
365{
366 return *prate;
367}
368
369static int tegra20_super_clk_set_rate(struct clk_hw *hw, unsigned long rate,
370 unsigned long parent_rate)
371{
372 return 0;
373}
374
375struct clk_ops tegra_super_ops = {
376 .is_enabled = tegra20_super_clk_is_enabled,
377 .enable = tegra20_super_clk_enable,
378 .disable = tegra20_super_clk_disable,
379 .set_parent = tegra20_super_clk_set_parent,
380 .get_parent = tegra20_super_clk_get_parent,
381 .set_rate = tegra20_super_clk_set_rate,
382 .round_rate = tegra20_super_clk_round_rate,
383 .recalc_rate = tegra20_super_clk_recalc_rate,
384};
385
386static unsigned long tegra20_twd_clk_recalc_rate(struct clk_hw *hw,
387 unsigned long parent_rate)
388{
389 struct clk_tegra *c = to_clk_tegra(hw);
390 u64 rate = parent_rate;
391
392 if (c->mul != 0 && c->div != 0) {
393 rate *= c->mul;
394 rate += c->div - 1; /* round up */
395 do_div(rate, c->div);
396 }
397
398 return rate;
399}
400
401struct clk_ops tegra_twd_ops = {
402 .recalc_rate = tegra20_twd_clk_recalc_rate,
403};
404
405static u8 tegra20_cop_clk_get_parent(struct clk_hw *hw)
406{
407 return 0;
408}
409
410struct clk_ops tegra_cop_ops = {
411 .get_parent = tegra20_cop_clk_get_parent,
412};
413
414/* virtual cop clock functions. Used to acquire the fake 'cop' clock to
415 * reset the COP block (i.e. AVP) */
416void tegra2_cop_clk_reset(struct clk_hw *hw, bool assert)
417{
418 unsigned long reg = assert ? RST_DEVICES_SET : RST_DEVICES_CLR;
419
420 pr_debug("%s %s\n", __func__, assert ? "assert" : "deassert");
421 clk_writel(1 << 1, reg);
422}
423
424/* bus clock functions */
425static int tegra20_bus_clk_is_enabled(struct clk_hw *hw)
426{
427 struct clk_tegra *c = to_clk_tegra(hw);
428 u32 val = clk_readl(c->reg);
429
430 c->state = ((val >> c->reg_shift) & BUS_CLK_DISABLE) ? OFF : ON;
431 return c->state;
432}
433
434static int tegra20_bus_clk_enable(struct clk_hw *hw)
435{
436 struct clk_tegra *c = to_clk_tegra(hw);
437 unsigned long flags;
438 u32 val;
439
440 spin_lock_irqsave(&clock_register_lock, flags);
441
442 val = clk_readl(c->reg);
443 val &= ~(BUS_CLK_DISABLE << c->reg_shift);
444 clk_writel(val, c->reg);
445
446 spin_unlock_irqrestore(&clock_register_lock, flags);
447
448 return 0;
449}
450
451static void tegra20_bus_clk_disable(struct clk_hw *hw)
452{
453 struct clk_tegra *c = to_clk_tegra(hw);
454 unsigned long flags;
455 u32 val;
456
457 spin_lock_irqsave(&clock_register_lock, flags);
458
459 val = clk_readl(c->reg);
460 val |= BUS_CLK_DISABLE << c->reg_shift;
461 clk_writel(val, c->reg);
462
463 spin_unlock_irqrestore(&clock_register_lock, flags);
464}
465
466static unsigned long tegra20_bus_clk_recalc_rate(struct clk_hw *hw,
467 unsigned long prate)
468{
469 struct clk_tegra *c = to_clk_tegra(hw);
470 u32 val = clk_readl(c->reg);
471 u64 rate = prate;
472
473 c->div = ((val >> c->reg_shift) & BUS_CLK_DIV_MASK) + 1;
474 c->mul = 1;
475
476 if (c->mul != 0 && c->div != 0) {
477 rate *= c->mul;
478 rate += c->div - 1; /* round up */
479 do_div(rate, c->div);
480 }
481 return rate;
482}
483
484static int tegra20_bus_clk_set_rate(struct clk_hw *hw, unsigned long rate,
485 unsigned long parent_rate)
486{
487 struct clk_tegra *c = to_clk_tegra(hw);
488 int ret = -EINVAL;
489 unsigned long flags;
490 u32 val;
491 int i;
492
493 spin_lock_irqsave(&clock_register_lock, flags);
494
495 val = clk_readl(c->reg);
496 for (i = 1; i <= 4; i++) {
497 if (rate == parent_rate / i) {
498 val &= ~(BUS_CLK_DIV_MASK << c->reg_shift);
499 val |= (i - 1) << c->reg_shift;
500 clk_writel(val, c->reg);
501 c->div = i;
502 c->mul = 1;
503 ret = 0;
504 break;
505 }
506 }
507
508 spin_unlock_irqrestore(&clock_register_lock, flags);
509
510 return ret;
511}
512
513static long tegra20_bus_clk_round_rate(struct clk_hw *hw, unsigned long rate,
514 unsigned long *prate)
515{
516 unsigned long parent_rate = *prate;
517 s64 divider;
518
519 if (rate >= parent_rate)
520 return rate;
521
522 divider = parent_rate;
523 divider += rate - 1;
524 do_div(divider, rate);
525
526 if (divider < 0)
527 return divider;
528
529 if (divider > 4)
530 divider = 4;
531 do_div(parent_rate, divider);
532
533 return parent_rate;
534}
535
536struct clk_ops tegra_bus_ops = {
537 .is_enabled = tegra20_bus_clk_is_enabled,
538 .enable = tegra20_bus_clk_enable,
539 .disable = tegra20_bus_clk_disable,
540 .set_rate = tegra20_bus_clk_set_rate,
541 .round_rate = tegra20_bus_clk_round_rate,
542 .recalc_rate = tegra20_bus_clk_recalc_rate,
543};
544
545/* Blink output functions */
546static int tegra20_blink_clk_is_enabled(struct clk_hw *hw)
547{
548 struct clk_tegra *c = to_clk_tegra(hw);
549 u32 val;
550
551 val = pmc_readl(PMC_CTRL);
552 c->state = (val & PMC_CTRL_BLINK_ENB) ? ON : OFF;
553 return c->state;
554}
555
556static unsigned long tegra20_blink_clk_recalc_rate(struct clk_hw *hw,
557 unsigned long prate)
558{
559 struct clk_tegra *c = to_clk_tegra(hw);
560 u64 rate = prate;
561 u32 val;
562
563 c->mul = 1;
564 val = pmc_readl(c->reg);
565
566 if (val & PMC_BLINK_TIMER_ENB) {
567 unsigned int on_off;
568
569 on_off = (val >> PMC_BLINK_TIMER_DATA_ON_SHIFT) &
570 PMC_BLINK_TIMER_DATA_ON_MASK;
571 val >>= PMC_BLINK_TIMER_DATA_OFF_SHIFT;
572 val &= PMC_BLINK_TIMER_DATA_OFF_MASK;
573 on_off += val;
574 /* each tick in the blink timer is 4 32KHz clocks */
575 c->div = on_off * 4;
576 } else {
577 c->div = 1;
578 }
579
580 if (c->mul != 0 && c->div != 0) {
581 rate *= c->mul;
582 rate += c->div - 1; /* round up */
583 do_div(rate, c->div);
584 }
585 return rate;
586}
587
588static int tegra20_blink_clk_enable(struct clk_hw *hw)
589{
590 u32 val;
591
592 val = pmc_readl(PMC_DPD_PADS_ORIDE);
593 pmc_writel(val | PMC_DPD_PADS_ORIDE_BLINK_ENB, PMC_DPD_PADS_ORIDE);
594
595 val = pmc_readl(PMC_CTRL);
596 pmc_writel(val | PMC_CTRL_BLINK_ENB, PMC_CTRL);
597
598 return 0;
599}
600
601static void tegra20_blink_clk_disable(struct clk_hw *hw)
602{
603 u32 val;
604
605 val = pmc_readl(PMC_CTRL);
606 pmc_writel(val & ~PMC_CTRL_BLINK_ENB, PMC_CTRL);
607
608 val = pmc_readl(PMC_DPD_PADS_ORIDE);
609 pmc_writel(val & ~PMC_DPD_PADS_ORIDE_BLINK_ENB, PMC_DPD_PADS_ORIDE);
610}
611
612static int tegra20_blink_clk_set_rate(struct clk_hw *hw, unsigned long rate,
613 unsigned long parent_rate)
614{
615 struct clk_tegra *c = to_clk_tegra(hw);
616
617 if (rate >= parent_rate) {
618 c->div = 1;
619 pmc_writel(0, c->reg);
620 } else {
621 unsigned int on_off;
622 u32 val;
623
624 on_off = DIV_ROUND_UP(parent_rate / 8, rate);
625 c->div = on_off * 8;
626
627 val = (on_off & PMC_BLINK_TIMER_DATA_ON_MASK) <<
628 PMC_BLINK_TIMER_DATA_ON_SHIFT;
629 on_off &= PMC_BLINK_TIMER_DATA_OFF_MASK;
630 on_off <<= PMC_BLINK_TIMER_DATA_OFF_SHIFT;
631 val |= on_off;
632 val |= PMC_BLINK_TIMER_ENB;
633 pmc_writel(val, c->reg);
634 }
635
636 return 0;
637}
638
639static long tegra20_blink_clk_round_rate(struct clk_hw *hw, unsigned long rate,
640 unsigned long *prate)
641{
642 int div;
643 int mul;
644 long round_rate = *prate;
645
646 mul = 1;
647
648 if (rate >= *prate) {
649 div = 1;
650 } else {
651 div = DIV_ROUND_UP(*prate / 8, rate);
652 div *= 8;
653 }
654
655 round_rate *= mul;
656 round_rate += div - 1;
657 do_div(round_rate, div);
658
659 return round_rate;
660}
661
662struct clk_ops tegra_blink_clk_ops = {
663 .is_enabled = tegra20_blink_clk_is_enabled,
664 .enable = tegra20_blink_clk_enable,
665 .disable = tegra20_blink_clk_disable,
666 .set_rate = tegra20_blink_clk_set_rate,
667 .round_rate = tegra20_blink_clk_round_rate,
668 .recalc_rate = tegra20_blink_clk_recalc_rate,
669};
670
671/* PLL Functions */
672static int tegra20_pll_clk_wait_for_lock(struct clk_tegra *c)
673{
674 udelay(c->u.pll.lock_delay);
675 return 0;
676}
677
678static int tegra20_pll_clk_is_enabled(struct clk_hw *hw)
679{
680 struct clk_tegra *c = to_clk_tegra(hw);
681 u32 val = clk_readl(c->reg + PLL_BASE);
682
683 c->state = (val & PLL_BASE_ENABLE) ? ON : OFF;
684 return c->state;
685}
686
687static unsigned long tegra20_pll_clk_recalc_rate(struct clk_hw *hw,
688 unsigned long prate)
689{
690 struct clk_tegra *c = to_clk_tegra(hw);
691 u32 val = clk_readl(c->reg + PLL_BASE);
692 u64 rate = prate;
693
694 if (c->flags & PLL_FIXED && !(val & PLL_BASE_OVERRIDE)) {
695 const struct clk_pll_freq_table *sel;
696 for (sel = c->u.pll.freq_table; sel->input_rate != 0; sel++) {
697 if (sel->input_rate == prate &&
698 sel->output_rate == c->u.pll.fixed_rate) {
699 c->mul = sel->n;
700 c->div = sel->m * sel->p;
701 break;
702 }
703 }
704 pr_err("Clock %s has unknown fixed frequency\n",
705 __clk_get_name(hw->clk));
706 BUG();
707 } else if (val & PLL_BASE_BYPASS) {
708 c->mul = 1;
709 c->div = 1;
710 } else {
711 c->mul = (val & PLL_BASE_DIVN_MASK) >> PLL_BASE_DIVN_SHIFT;
712 c->div = (val & PLL_BASE_DIVM_MASK) >> PLL_BASE_DIVM_SHIFT;
713 if (c->flags & PLLU)
714 c->div *= (val & PLLU_BASE_POST_DIV) ? 1 : 2;
715 else
716 c->div *= (val & PLL_BASE_DIVP_MASK) ? 2 : 1;
717 }
718
719 if (c->mul != 0 && c->div != 0) {
720 rate *= c->mul;
721 rate += c->div - 1; /* round up */
722 do_div(rate, c->div);
723 }
724 return rate;
725}
726
727static int tegra20_pll_clk_enable(struct clk_hw *hw)
728{
729 struct clk_tegra *c = to_clk_tegra(hw);
730 u32 val;
731 pr_debug("%s on clock %s\n", __func__, __clk_get_name(hw->clk));
732
733 val = clk_readl(c->reg + PLL_BASE);
734 val &= ~PLL_BASE_BYPASS;
735 val |= PLL_BASE_ENABLE;
736 clk_writel(val, c->reg + PLL_BASE);
737
738 tegra20_pll_clk_wait_for_lock(c);
739
740 return 0;
741}
742
743static void tegra20_pll_clk_disable(struct clk_hw *hw)
744{
745 struct clk_tegra *c = to_clk_tegra(hw);
746 u32 val;
747 pr_debug("%s on clock %s\n", __func__, __clk_get_name(hw->clk));
748
749 val = clk_readl(c->reg);
750 val &= ~(PLL_BASE_BYPASS | PLL_BASE_ENABLE);
751 clk_writel(val, c->reg);
752}
753
754static int tegra20_pll_clk_set_rate(struct clk_hw *hw, unsigned long rate,
755 unsigned long parent_rate)
756{
757 struct clk_tegra *c = to_clk_tegra(hw);
758 unsigned long input_rate = parent_rate;
759 const struct clk_pll_freq_table *sel;
760 u32 val;
761
762 pr_debug("%s: %s %lu\n", __func__, __clk_get_name(hw->clk), rate);
763
764 if (c->flags & PLL_FIXED) {
765 int ret = 0;
766 if (rate != c->u.pll.fixed_rate) {
767 pr_err("%s: Can not change %s fixed rate %lu to %lu\n",
768 __func__, __clk_get_name(hw->clk),
769 c->u.pll.fixed_rate, rate);
770 ret = -EINVAL;
771 }
772 return ret;
773 }
774
775 for (sel = c->u.pll.freq_table; sel->input_rate != 0; sel++) {
776 if (sel->input_rate == input_rate && sel->output_rate == rate) {
777 c->mul = sel->n;
778 c->div = sel->m * sel->p;
779
780 val = clk_readl(c->reg + PLL_BASE);
781 if (c->flags & PLL_FIXED)
782 val |= PLL_BASE_OVERRIDE;
783 val &= ~(PLL_BASE_DIVP_MASK | PLL_BASE_DIVN_MASK |
784 PLL_BASE_DIVM_MASK);
785 val |= (sel->m << PLL_BASE_DIVM_SHIFT) |
786 (sel->n << PLL_BASE_DIVN_SHIFT);
787 BUG_ON(sel->p < 1 || sel->p > 2);
788 if (c->flags & PLLU) {
789 if (sel->p == 1)
790 val |= PLLU_BASE_POST_DIV;
791 } else {
792 if (sel->p == 2)
793 val |= 1 << PLL_BASE_DIVP_SHIFT;
794 }
795 clk_writel(val, c->reg + PLL_BASE);
796
797 if (c->flags & PLL_HAS_CPCON) {
798 val = clk_readl(c->reg + PLL_MISC(c));
799 val &= ~PLL_MISC_CPCON_MASK;
800 val |= sel->cpcon << PLL_MISC_CPCON_SHIFT;
801 clk_writel(val, c->reg + PLL_MISC(c));
802 }
803
804 if (c->state == ON)
805 tegra20_pll_clk_enable(hw);
806 return 0;
807 }
808 }
809 return -EINVAL;
810}
811
812static long tegra20_pll_clk_round_rate(struct clk_hw *hw, unsigned long rate,
813 unsigned long *prate)
814{
815 struct clk_tegra *c = to_clk_tegra(hw);
816 const struct clk_pll_freq_table *sel;
817 unsigned long input_rate = *prate;
818 u64 output_rate = *prate;
819 int mul;
820 int div;
821
822 if (c->flags & PLL_FIXED)
823 return c->u.pll.fixed_rate;
824
825 for (sel = c->u.pll.freq_table; sel->input_rate != 0; sel++)
826 if (sel->input_rate == input_rate && sel->output_rate == rate) {
827 mul = sel->n;
828 div = sel->m * sel->p;
829 break;
830 }
831
832 if (sel->input_rate == 0)
833 return -EINVAL;
834
835 output_rate *= mul;
836 output_rate += div - 1; /* round up */
837 do_div(output_rate, div);
838
839 return output_rate;
840}
841
842struct clk_ops tegra_pll_ops = {
843 .is_enabled = tegra20_pll_clk_is_enabled,
844 .enable = tegra20_pll_clk_enable,
845 .disable = tegra20_pll_clk_disable,
846 .set_rate = tegra20_pll_clk_set_rate,
847 .recalc_rate = tegra20_pll_clk_recalc_rate,
848 .round_rate = tegra20_pll_clk_round_rate,
849};
850
851static void tegra20_pllx_clk_init(struct clk_hw *hw)
852{
853 struct clk_tegra *c = to_clk_tegra(hw);
854
855 if (tegra_sku_id == 7)
856 c->max_rate = 750000000;
857}
858
859struct clk_ops tegra_pllx_ops = {
860 .init = tegra20_pllx_clk_init,
861 .is_enabled = tegra20_pll_clk_is_enabled,
862 .enable = tegra20_pll_clk_enable,
863 .disable = tegra20_pll_clk_disable,
864 .set_rate = tegra20_pll_clk_set_rate,
865 .recalc_rate = tegra20_pll_clk_recalc_rate,
866 .round_rate = tegra20_pll_clk_round_rate,
867};
868
869static int tegra20_plle_clk_enable(struct clk_hw *hw)
870{
871 struct clk_tegra *c = to_clk_tegra(hw);
872 u32 val;
873
874 pr_debug("%s on clock %s\n", __func__, __clk_get_name(hw->clk));
875
876 mdelay(1);
877
878 val = clk_readl(c->reg + PLL_BASE);
879 if (!(val & PLLE_MISC_READY))
880 return -EBUSY;
881
882 val = clk_readl(c->reg + PLL_BASE);
883 val |= PLL_BASE_ENABLE | PLL_BASE_BYPASS;
884 clk_writel(val, c->reg + PLL_BASE);
885
886 return 0;
887}
888
889struct clk_ops tegra_plle_ops = {
890 .is_enabled = tegra20_pll_clk_is_enabled,
891 .enable = tegra20_plle_clk_enable,
892 .set_rate = tegra20_pll_clk_set_rate,
893 .recalc_rate = tegra20_pll_clk_recalc_rate,
894 .round_rate = tegra20_pll_clk_round_rate,
895};
896
897/* Clock divider ops */
898static int tegra20_pll_div_clk_is_enabled(struct clk_hw *hw)
899{
900 struct clk_tegra *c = to_clk_tegra(hw);
901 u32 val = clk_readl(c->reg);
902
903 val >>= c->reg_shift;
904 c->state = (val & PLL_OUT_CLKEN) ? ON : OFF;
905 if (!(val & PLL_OUT_RESET_DISABLE))
906 c->state = OFF;
907 return c->state;
908}
909
910static unsigned long tegra20_pll_div_clk_recalc_rate(struct clk_hw *hw,
911 unsigned long prate)
912{
913 struct clk_tegra *c = to_clk_tegra(hw);
914 u64 rate = prate;
915 u32 val = clk_readl(c->reg);
916 u32 divu71;
917
918 val >>= c->reg_shift;
919
920 if (c->flags & DIV_U71) {
921 divu71 = (val & PLL_OUT_RATIO_MASK) >> PLL_OUT_RATIO_SHIFT;
922 c->div = (divu71 + 2);
923 c->mul = 2;
924 } else if (c->flags & DIV_2) {
925 c->div = 2;
926 c->mul = 1;
927 } else {
928 c->div = 1;
929 c->mul = 1;
930 }
931
932 rate *= c->mul;
933 rate += c->div - 1; /* round up */
934 do_div(rate, c->div);
935
936 return rate;
937}
938
939static int tegra20_pll_div_clk_enable(struct clk_hw *hw)
940{
941 struct clk_tegra *c = to_clk_tegra(hw);
942 unsigned long flags;
943 u32 new_val;
944 u32 val;
945
946 pr_debug("%s: %s\n", __func__, __clk_get_name(hw->clk));
947
948 if (c->flags & DIV_U71) {
949 spin_lock_irqsave(&clock_register_lock, flags);
950 val = clk_readl(c->reg);
951 new_val = val >> c->reg_shift;
952 new_val &= 0xFFFF;
953
954 new_val |= PLL_OUT_CLKEN | PLL_OUT_RESET_DISABLE;
955
956 val &= ~(0xFFFF << c->reg_shift);
957 val |= new_val << c->reg_shift;
958 clk_writel(val, c->reg);
959 spin_unlock_irqrestore(&clock_register_lock, flags);
960 return 0;
961 } else if (c->flags & DIV_2) {
962 BUG_ON(!(c->flags & PLLD));
963 spin_lock_irqsave(&clock_register_lock, flags);
964 val = clk_readl(c->reg);
965 val &= ~PLLD_MISC_DIV_RST;
966 clk_writel(val, c->reg);
967 spin_unlock_irqrestore(&clock_register_lock, flags);
968 return 0;
969 }
970 return -EINVAL;
971}
972
973static void tegra20_pll_div_clk_disable(struct clk_hw *hw)
974{
975 struct clk_tegra *c = to_clk_tegra(hw);
976 unsigned long flags;
977 u32 new_val;
978 u32 val;
979
980 pr_debug("%s: %s\n", __func__, __clk_get_name(hw->clk));
981
982 if (c->flags & DIV_U71) {
983 spin_lock_irqsave(&clock_register_lock, flags);
984 val = clk_readl(c->reg);
985 new_val = val >> c->reg_shift;
986 new_val &= 0xFFFF;
987
988 new_val &= ~(PLL_OUT_CLKEN | PLL_OUT_RESET_DISABLE);
989
990 val &= ~(0xFFFF << c->reg_shift);
991 val |= new_val << c->reg_shift;
992 clk_writel(val, c->reg);
993 spin_unlock_irqrestore(&clock_register_lock, flags);
994 } else if (c->flags & DIV_2) {
995 BUG_ON(!(c->flags & PLLD));
996 spin_lock_irqsave(&clock_register_lock, flags);
997 val = clk_readl(c->reg);
998 val |= PLLD_MISC_DIV_RST;
999 clk_writel(val, c->reg);
1000 spin_unlock_irqrestore(&clock_register_lock, flags);
1001 }
1002}
1003
1004static int tegra20_pll_div_clk_set_rate(struct clk_hw *hw, unsigned long rate,
1005 unsigned long parent_rate)
1006{
1007 struct clk_tegra *c = to_clk_tegra(hw);
1008 unsigned long flags;
1009 int divider_u71;
1010 u32 new_val;
1011 u32 val;
1012
1013 pr_debug("%s: %s %lu\n", __func__, __clk_get_name(hw->clk), rate);
1014
1015 if (c->flags & DIV_U71) {
1016 divider_u71 = clk_div71_get_divider(parent_rate, rate);
1017 if (divider_u71 >= 0) {
1018 spin_lock_irqsave(&clock_register_lock, flags);
1019 val = clk_readl(c->reg);
1020 new_val = val >> c->reg_shift;
1021 new_val &= 0xFFFF;
1022 if (c->flags & DIV_U71_FIXED)
1023 new_val |= PLL_OUT_OVERRIDE;
1024 new_val &= ~PLL_OUT_RATIO_MASK;
1025 new_val |= divider_u71 << PLL_OUT_RATIO_SHIFT;
1026
1027 val &= ~(0xFFFF << c->reg_shift);
1028 val |= new_val << c->reg_shift;
1029 clk_writel(val, c->reg);
1030 c->div = divider_u71 + 2;
1031 c->mul = 2;
1032 spin_unlock_irqrestore(&clock_register_lock, flags);
1033 return 0;
1034 }
1035 } else if (c->flags & DIV_2) {
1036 if (parent_rate == rate * 2)
1037 return 0;
1038 }
1039 return -EINVAL;
1040}
1041
1042static long tegra20_pll_div_clk_round_rate(struct clk_hw *hw, unsigned long rate,
1043 unsigned long *prate)
1044{
1045 struct clk_tegra *c = to_clk_tegra(hw);
1046 unsigned long parent_rate = *prate;
1047 int divider;
1048
1049 pr_debug("%s: %s %lu\n", __func__, __clk_get_name(hw->clk), rate);
1050
1051 if (c->flags & DIV_U71) {
1052 divider = clk_div71_get_divider(parent_rate, rate);
1053 if (divider < 0)
1054 return divider;
1055 return DIV_ROUND_UP(parent_rate * 2, divider + 2);
1056 } else if (c->flags & DIV_2) {
1057 return DIV_ROUND_UP(parent_rate, 2);
1058 }
1059 return -EINVAL;
1060}
1061
1062struct clk_ops tegra_pll_div_ops = {
1063 .is_enabled = tegra20_pll_div_clk_is_enabled,
1064 .enable = tegra20_pll_div_clk_enable,
1065 .disable = tegra20_pll_div_clk_disable,
1066 .set_rate = tegra20_pll_div_clk_set_rate,
1067 .round_rate = tegra20_pll_div_clk_round_rate,
1068 .recalc_rate = tegra20_pll_div_clk_recalc_rate,
1069};
1070
1071/* Periph clk ops */
1072
1073static int tegra20_periph_clk_is_enabled(struct clk_hw *hw)
1074{
1075 struct clk_tegra *c = to_clk_tegra(hw);
1076
1077 c->state = ON;
1078
1079 if (!c->u.periph.clk_num)
1080 goto out;
1081
1082 if (!(clk_readl(CLK_OUT_ENB + PERIPH_CLK_TO_ENB_REG(c)) &
1083 PERIPH_CLK_TO_ENB_BIT(c)))
1084 c->state = OFF;
1085
1086 if (!(c->flags & PERIPH_NO_RESET))
1087 if (clk_readl(RST_DEVICES + PERIPH_CLK_TO_ENB_REG(c)) &
1088 PERIPH_CLK_TO_ENB_BIT(c))
1089 c->state = OFF;
1090
1091out:
1092 return c->state;
1093}
1094
1095static int tegra20_periph_clk_enable(struct clk_hw *hw)
1096{
1097 struct clk_tegra *c = to_clk_tegra(hw);
1098 unsigned long flags;
1099 u32 val;
1100
1101 pr_debug("%s on clock %s\n", __func__, __clk_get_name(hw->clk));
1102
1103 if (!c->u.periph.clk_num)
1104 return 0;
1105
1106 tegra_periph_clk_enable_refcount[c->u.periph.clk_num]++;
1107 if (tegra_periph_clk_enable_refcount[c->u.periph.clk_num] > 1)
1108 return 0;
1109
1110 spin_lock_irqsave(&clock_register_lock, flags);
1111
1112 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1113 CLK_OUT_ENB_SET + PERIPH_CLK_TO_ENB_SET_REG(c));
1114 if (!(c->flags & PERIPH_NO_RESET) && !(c->flags & PERIPH_MANUAL_RESET))
1115 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1116 RST_DEVICES_CLR + PERIPH_CLK_TO_ENB_SET_REG(c));
1117 if (c->flags & PERIPH_EMC_ENB) {
1118 /* The EMC peripheral clock has 2 extra enable bits */
1119 /* FIXME: Do they need to be disabled? */
1120 val = clk_readl(c->reg);
1121 val |= 0x3 << 24;
1122 clk_writel(val, c->reg);
1123 }
1124
1125 spin_unlock_irqrestore(&clock_register_lock, flags);
1126
1127 return 0;
1128}
1129
1130static void tegra20_periph_clk_disable(struct clk_hw *hw)
1131{
1132 struct clk_tegra *c = to_clk_tegra(hw);
1133 unsigned long flags;
1134
1135 pr_debug("%s on clock %s\n", __func__, __clk_get_name(hw->clk));
1136
1137 if (!c->u.periph.clk_num)
1138 return;
1139
1140 tegra_periph_clk_enable_refcount[c->u.periph.clk_num]--;
1141
1142 if (tegra_periph_clk_enable_refcount[c->u.periph.clk_num] > 0)
1143 return;
1144
1145 spin_lock_irqsave(&clock_register_lock, flags);
1146
1147 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1148 CLK_OUT_ENB_CLR + PERIPH_CLK_TO_ENB_SET_REG(c));
1149
1150 spin_unlock_irqrestore(&clock_register_lock, flags);
1151}
1152
1153void tegra2_periph_clk_reset(struct clk_hw *hw, bool assert)
1154{
1155 struct clk_tegra *c = to_clk_tegra(hw);
1156 unsigned long base = assert ? RST_DEVICES_SET : RST_DEVICES_CLR;
1157
1158 pr_debug("%s %s on clock %s\n", __func__,
1159 assert ? "assert" : "deassert", __clk_get_name(hw->clk));
1160
1161 BUG_ON(!c->u.periph.clk_num);
1162
1163 if (!(c->flags & PERIPH_NO_RESET))
1164 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1165 base + PERIPH_CLK_TO_ENB_SET_REG(c));
1166}
1167
1168static int tegra20_periph_clk_set_parent(struct clk_hw *hw, u8 index)
1169{
1170 struct clk_tegra *c = to_clk_tegra(hw);
1171 u32 val;
1172 u32 mask;
1173 u32 shift;
1174
1175 pr_debug("%s: %s %d\n", __func__, __clk_get_name(hw->clk), index);
1176
1177 if (c->flags & MUX_PWM) {
1178 shift = PERIPH_CLK_SOURCE_PWM_SHIFT;
1179 mask = PERIPH_CLK_SOURCE_PWM_MASK;
1180 } else {
1181 shift = PERIPH_CLK_SOURCE_SHIFT;
1182 mask = PERIPH_CLK_SOURCE_MASK;
1183 }
1184
1185 val = clk_readl(c->reg);
1186 val &= ~mask;
1187 val |= (index) << shift;
1188
1189 clk_writel(val, c->reg);
1190
1191 return 0;
1192}
1193
1194static u8 tegra20_periph_clk_get_parent(struct clk_hw *hw)
1195{
1196 struct clk_tegra *c = to_clk_tegra(hw);
1197 u32 val = clk_readl(c->reg);
1198 u32 mask;
1199 u32 shift;
1200
1201 if (c->flags & MUX_PWM) {
1202 shift = PERIPH_CLK_SOURCE_PWM_SHIFT;
1203 mask = PERIPH_CLK_SOURCE_PWM_MASK;
1204 } else {
1205 shift = PERIPH_CLK_SOURCE_SHIFT;
1206 mask = PERIPH_CLK_SOURCE_MASK;
1207 }
1208
1209 if (c->flags & MUX)
1210 return (val & mask) >> shift;
1211 else
1212 return 0;
1213}
1214
1215static unsigned long tegra20_periph_clk_recalc_rate(struct clk_hw *hw,
1216 unsigned long prate)
1217{
1218 struct clk_tegra *c = to_clk_tegra(hw);
1219 unsigned long rate = prate;
1220 u32 val = clk_readl(c->reg);
1221
1222 if (c->flags & DIV_U71) {
1223 u32 divu71 = val & PERIPH_CLK_SOURCE_DIVU71_MASK;
1224 c->div = divu71 + 2;
1225 c->mul = 2;
1226 } else if (c->flags & DIV_U16) {
1227 u32 divu16 = val & PERIPH_CLK_SOURCE_DIVU16_MASK;
1228 c->div = divu16 + 1;
1229 c->mul = 1;
1230 } else {
1231 c->div = 1;
1232 c->mul = 1;
1233 return rate;
1234 }
1235
1236 if (c->mul != 0 && c->div != 0) {
1237 rate *= c->mul;
1238 rate += c->div - 1; /* round up */
1239 do_div(rate, c->div);
1240 }
1241
1242 return rate;
1243}
1244
1245static int tegra20_periph_clk_set_rate(struct clk_hw *hw, unsigned long rate,
1246 unsigned long parent_rate)
1247{
1248 struct clk_tegra *c = to_clk_tegra(hw);
1249 u32 val;
1250 int divider;
1251
1252 val = clk_readl(c->reg);
1253
1254 if (c->flags & DIV_U71) {
1255 divider = clk_div71_get_divider(parent_rate, rate);
1256
1257 if (divider >= 0) {
1258 val = clk_readl(c->reg);
1259 val &= ~PERIPH_CLK_SOURCE_DIVU71_MASK;
1260 val |= divider;
1261 clk_writel(val, c->reg);
1262 c->div = divider + 2;
1263 c->mul = 2;
1264 return 0;
1265 }
1266 } else if (c->flags & DIV_U16) {
1267 divider = clk_div16_get_divider(parent_rate, rate);
1268 if (divider >= 0) {
1269 val = clk_readl(c->reg);
1270 val &= ~PERIPH_CLK_SOURCE_DIVU16_MASK;
1271 val |= divider;
1272 clk_writel(val, c->reg);
1273 c->div = divider + 1;
1274 c->mul = 1;
1275 return 0;
1276 }
1277 } else if (parent_rate <= rate) {
1278 c->div = 1;
1279 c->mul = 1;
1280 return 0;
1281 }
1282
1283 return -EINVAL;
1284}
1285
1286static long tegra20_periph_clk_round_rate(struct clk_hw *hw,
1287 unsigned long rate, unsigned long *prate)
1288{
1289 struct clk_tegra *c = to_clk_tegra(hw);
1290 unsigned long parent_rate = __clk_get_rate(__clk_get_parent(hw->clk));
1291 int divider;
1292
1293 pr_debug("%s: %s %lu\n", __func__, __clk_get_name(hw->clk), rate);
1294
1295 if (prate)
1296 parent_rate = *prate;
1297
1298 if (c->flags & DIV_U71) {
1299 divider = clk_div71_get_divider(parent_rate, rate);
1300 if (divider < 0)
1301 return divider;
1302
1303 return DIV_ROUND_UP(parent_rate * 2, divider + 2);
1304 } else if (c->flags & DIV_U16) {
1305 divider = clk_div16_get_divider(parent_rate, rate);
1306 if (divider < 0)
1307 return divider;
1308 return DIV_ROUND_UP(parent_rate, divider + 1);
1309 }
1310 return -EINVAL;
1311}
1312
1313struct clk_ops tegra_periph_clk_ops = {
1314 .is_enabled = tegra20_periph_clk_is_enabled,
1315 .enable = tegra20_periph_clk_enable,
1316 .disable = tegra20_periph_clk_disable,
1317 .set_parent = tegra20_periph_clk_set_parent,
1318 .get_parent = tegra20_periph_clk_get_parent,
1319 .set_rate = tegra20_periph_clk_set_rate,
1320 .round_rate = tegra20_periph_clk_round_rate,
1321 .recalc_rate = tegra20_periph_clk_recalc_rate,
1322};
1323
1324/* External memory controller clock ops */
1325static void tegra20_emc_clk_init(struct clk_hw *hw)
1326{
1327 struct clk_tegra *c = to_clk_tegra(hw);
1328 c->max_rate = __clk_get_rate(hw->clk);
1329}
1330
1331static long tegra20_emc_clk_round_rate(struct clk_hw *hw, unsigned long rate,
1332 unsigned long *prate)
1333{
1334 struct clk_tegra *c = to_clk_tegra(hw);
1335 long emc_rate;
1336 long clk_rate;
1337
1338 /*
1339 * The slowest entry in the EMC clock table that is at least as
1340 * fast as rate.
1341 */
1342 emc_rate = tegra_emc_round_rate(rate);
1343 if (emc_rate < 0)
1344 return c->max_rate;
1345
1346 /*
1347 * The fastest rate the PLL will generate that is at most the
1348 * requested rate.
1349 */
1350 clk_rate = tegra20_periph_clk_round_rate(hw, emc_rate, NULL);
1351
1352 /*
1353 * If this fails, and emc_rate > clk_rate, it's because the maximum
1354 * rate in the EMC tables is larger than the maximum rate of the EMC
1355 * clock. The EMC clock's max rate is the rate it was running when the
1356 * kernel booted. Such a mismatch is probably due to using the wrong
1357 * BCT, i.e. using a Tegra20 BCT with an EMC table written for Tegra25.
1358 */
1359 WARN_ONCE(emc_rate != clk_rate,
1360 "emc_rate %ld != clk_rate %ld",
1361 emc_rate, clk_rate);
1362
1363 return emc_rate;
1364}
1365
1366static int tegra20_emc_clk_set_rate(struct clk_hw *hw, unsigned long rate,
1367 unsigned long parent_rate)
1368{
1369 int ret;
1370
1371 /*
1372 * The Tegra2 memory controller has an interlock with the clock
1373 * block that allows memory shadowed registers to be updated,
1374 * and then transfer them to the main registers at the same
1375 * time as the clock update without glitches.
1376 */
1377 ret = tegra_emc_set_rate(rate);
1378 if (ret < 0)
1379 return ret;
1380
1381 ret = tegra20_periph_clk_set_rate(hw, rate, parent_rate);
1382 udelay(1);
1383
1384 return ret;
1385}
1386
1387struct clk_ops tegra_emc_clk_ops = {
1388 .init = tegra20_emc_clk_init,
1389 .is_enabled = tegra20_periph_clk_is_enabled,
1390 .enable = tegra20_periph_clk_enable,
1391 .disable = tegra20_periph_clk_disable,
1392 .set_parent = tegra20_periph_clk_set_parent,
1393 .get_parent = tegra20_periph_clk_get_parent,
1394 .set_rate = tegra20_emc_clk_set_rate,
1395 .round_rate = tegra20_emc_clk_round_rate,
1396 .recalc_rate = tegra20_periph_clk_recalc_rate,
1397};
1398
1399/* Clock doubler ops */
1400static int tegra20_clk_double_is_enabled(struct clk_hw *hw)
1401{
1402 struct clk_tegra *c = to_clk_tegra(hw);
1403
1404 c->state = ON;
1405
1406 if (!c->u.periph.clk_num)
1407 goto out;
1408
1409 if (!(clk_readl(CLK_OUT_ENB + PERIPH_CLK_TO_ENB_REG(c)) &
1410 PERIPH_CLK_TO_ENB_BIT(c)))
1411 c->state = OFF;
1412
1413out:
1414 return c->state;
1415};
1416
1417static unsigned long tegra20_clk_double_recalc_rate(struct clk_hw *hw,
1418 unsigned long prate)
1419{
1420 struct clk_tegra *c = to_clk_tegra(hw);
1421 u64 rate = prate;
1422
1423 c->mul = 2;
1424 c->div = 1;
1425
1426 rate *= c->mul;
1427 rate += c->div - 1; /* round up */
1428 do_div(rate, c->div);
1429
1430 return rate;
1431}
1432
1433static long tegra20_clk_double_round_rate(struct clk_hw *hw, unsigned long rate,
1434 unsigned long *prate)
1435{
1436 unsigned long output_rate = *prate;
1437
1438 do_div(output_rate, 2);
1439 return output_rate;
1440}
1441
1442static int tegra20_clk_double_set_rate(struct clk_hw *hw, unsigned long rate,
1443 unsigned long parent_rate)
1444{
1445 if (rate != 2 * parent_rate)
1446 return -EINVAL;
1447 return 0;
1448}
1449
1450struct clk_ops tegra_clk_double_ops = {
1451 .is_enabled = tegra20_clk_double_is_enabled,
1452 .enable = tegra20_periph_clk_enable,
1453 .disable = tegra20_periph_clk_disable,
1454 .set_rate = tegra20_clk_double_set_rate,
1455 .recalc_rate = tegra20_clk_double_recalc_rate,
1456 .round_rate = tegra20_clk_double_round_rate,
1457};
1458
1459/* Audio sync clock ops */
1460static int tegra20_audio_sync_clk_is_enabled(struct clk_hw *hw)
1461{
1462 struct clk_tegra *c = to_clk_tegra(hw);
1463 u32 val = clk_readl(c->reg);
1464
1465 c->state = (val & (1<<4)) ? OFF : ON;
1466 return c->state;
1467}
1468
1469static int tegra20_audio_sync_clk_enable(struct clk_hw *hw)
1470{
1471 struct clk_tegra *c = to_clk_tegra(hw);
1472
1473 clk_writel(0, c->reg);
1474 return 0;
1475}
1476
1477static void tegra20_audio_sync_clk_disable(struct clk_hw *hw)
1478{
1479 struct clk_tegra *c = to_clk_tegra(hw);
1480 clk_writel(1, c->reg);
1481}
1482
1483static u8 tegra20_audio_sync_clk_get_parent(struct clk_hw *hw)
1484{
1485 struct clk_tegra *c = to_clk_tegra(hw);
1486 u32 val = clk_readl(c->reg);
1487 int source;
1488
1489 source = val & 0xf;
1490 return source;
1491}
1492
1493static int tegra20_audio_sync_clk_set_parent(struct clk_hw *hw, u8 index)
1494{
1495 struct clk_tegra *c = to_clk_tegra(hw);
1496 u32 val;
1497
1498 val = clk_readl(c->reg);
1499 val &= ~0xf;
1500 val |= index;
1501
1502 clk_writel(val, c->reg);
1503
1504 return 0;
1505}
1506
1507struct clk_ops tegra_audio_sync_clk_ops = {
1508 .is_enabled = tegra20_audio_sync_clk_is_enabled,
1509 .enable = tegra20_audio_sync_clk_enable,
1510 .disable = tegra20_audio_sync_clk_disable,
1511 .set_parent = tegra20_audio_sync_clk_set_parent,
1512 .get_parent = tegra20_audio_sync_clk_get_parent,
1513};
1514
1515/* cdev1 and cdev2 (dap_mclk1 and dap_mclk2) ops */
1516
1517static int tegra20_cdev_clk_is_enabled(struct clk_hw *hw)
1518{
1519 struct clk_tegra *c = to_clk_tegra(hw);
1520 /* We could un-tristate the cdev1 or cdev2 pingroup here; this is
1521 * currently done in the pinmux code. */
1522 c->state = ON;
1523
1524 BUG_ON(!c->u.periph.clk_num);
1525
1526 if (!(clk_readl(CLK_OUT_ENB + PERIPH_CLK_TO_ENB_REG(c)) &
1527 PERIPH_CLK_TO_ENB_BIT(c)))
1528 c->state = OFF;
1529 return c->state;
1530}
1531
1532static int tegra20_cdev_clk_enable(struct clk_hw *hw)
1533{
1534 struct clk_tegra *c = to_clk_tegra(hw);
1535 BUG_ON(!c->u.periph.clk_num);
1536
1537 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1538 CLK_OUT_ENB_SET + PERIPH_CLK_TO_ENB_SET_REG(c));
1539 return 0;
1540}
1541
1542static void tegra20_cdev_clk_disable(struct clk_hw *hw)
1543{
1544 struct clk_tegra *c = to_clk_tegra(hw);
1545 BUG_ON(!c->u.periph.clk_num);
1546
1547 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1548 CLK_OUT_ENB_CLR + PERIPH_CLK_TO_ENB_SET_REG(c));
1549}
1550
1551static unsigned long tegra20_cdev_recalc_rate(struct clk_hw *hw,
1552 unsigned long prate)
1553{
1554 return to_clk_tegra(hw)->fixed_rate;
1555}
1556
1557struct clk_ops tegra_cdev_clk_ops = {
1558 .is_enabled = tegra20_cdev_clk_is_enabled,
1559 .enable = tegra20_cdev_clk_enable,
1560 .disable = tegra20_cdev_clk_disable,
1561 .recalc_rate = tegra20_cdev_recalc_rate,
1562};
1563
1564/* Tegra20 CPU clock and reset control functions */
1565static void tegra20_wait_cpu_in_reset(u32 cpu)
1566{
1567 unsigned int reg;
1568
1569 do {
1570 reg = readl(reg_clk_base +
1571 TEGRA_CLK_RST_CONTROLLER_RST_CPU_CMPLX_SET);
1572 cpu_relax();
1573 } while (!(reg & (1 << cpu))); /* check CPU been reset or not */
1574
1575 return;
1576}
1577
1578static void tegra20_put_cpu_in_reset(u32 cpu)
1579{
1580 writel(CPU_RESET(cpu),
1581 reg_clk_base + TEGRA_CLK_RST_CONTROLLER_RST_CPU_CMPLX_SET);
1582 dmb();
1583}
1584
1585static void tegra20_cpu_out_of_reset(u32 cpu)
1586{
1587 writel(CPU_RESET(cpu),
1588 reg_clk_base + TEGRA_CLK_RST_CONTROLLER_RST_CPU_CMPLX_CLR);
1589 wmb();
1590}
1591
1592static void tegra20_enable_cpu_clock(u32 cpu)
1593{
1594 unsigned int reg;
1595
1596 reg = readl(reg_clk_base + TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX);
1597 writel(reg & ~CPU_CLOCK(cpu),
1598 reg_clk_base + TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX);
1599 barrier();
1600 reg = readl(reg_clk_base + TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX);
1601}
1602
1603static void tegra20_disable_cpu_clock(u32 cpu)
1604{
1605 unsigned int reg;
1606
1607 reg = readl(reg_clk_base + TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX);
1608 writel(reg | CPU_CLOCK(cpu),
1609 reg_clk_base + TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX);
1610}
1611
1612static struct tegra_cpu_car_ops tegra20_cpu_car_ops = {
1613 .wait_for_reset = tegra20_wait_cpu_in_reset,
1614 .put_in_reset = tegra20_put_cpu_in_reset,
1615 .out_of_reset = tegra20_cpu_out_of_reset,
1616 .enable_clock = tegra20_enable_cpu_clock,
1617 .disable_clock = tegra20_disable_cpu_clock,
1618};
1619
1620void __init tegra20_cpu_car_ops_init(void)
1621{
1622 tegra_cpu_car_ops = &tegra20_cpu_car_ops;
1623}
diff --git a/arch/arm/mach-tegra/tegra20_clocks.h b/arch/arm/mach-tegra/tegra20_clocks.h
deleted file mode 100644
index 8bfd31bcc490..000000000000
--- a/arch/arm/mach-tegra/tegra20_clocks.h
+++ /dev/null
@@ -1,42 +0,0 @@
1/*
2 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef __MACH_TEGRA20_CLOCK_H
18#define __MACH_TEGRA20_CLOCK_H
19
20extern struct clk_ops tegra_clk_32k_ops;
21extern struct clk_ops tegra_pll_ops;
22extern struct clk_ops tegra_clk_m_ops;
23extern struct clk_ops tegra_pll_div_ops;
24extern struct clk_ops tegra_pllx_ops;
25extern struct clk_ops tegra_plle_ops;
26extern struct clk_ops tegra_clk_double_ops;
27extern struct clk_ops tegra_cdev_clk_ops;
28extern struct clk_ops tegra_audio_sync_clk_ops;
29extern struct clk_ops tegra_super_ops;
30extern struct clk_ops tegra_cpu_ops;
31extern struct clk_ops tegra_twd_ops;
32extern struct clk_ops tegra_cop_ops;
33extern struct clk_ops tegra_bus_ops;
34extern struct clk_ops tegra_blink_clk_ops;
35extern struct clk_ops tegra_emc_clk_ops;
36extern struct clk_ops tegra_periph_clk_ops;
37extern struct clk_ops tegra_clk_shared_bus_ops;
38
39void tegra2_periph_clk_reset(struct clk_hw *hw, bool assert);
40void tegra2_cop_clk_reset(struct clk_hw *hw, bool assert);
41
42#endif
diff --git a/arch/arm/mach-tegra/tegra20_clocks_data.c b/arch/arm/mach-tegra/tegra20_clocks_data.c
deleted file mode 100644
index a23a0734e352..000000000000
--- a/arch/arm/mach-tegra/tegra20_clocks_data.c
+++ /dev/null
@@ -1,1143 +0,0 @@
1/*
2 * arch/arm/mach-tegra/tegra2_clocks.c
3 *
4 * Copyright (C) 2010 Google, Inc.
5 * Copyright (c) 2012 NVIDIA CORPORATION. All rights reserved.
6 *
7 * Author:
8 * Colin Cross <ccross@google.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/clk-private.h>
22#include <linux/kernel.h>
23#include <linux/module.h>
24#include <linux/list.h>
25#include <linux/spinlock.h>
26#include <linux/delay.h>
27#include <linux/io.h>
28#include <linux/clk.h>
29
30#include "clock.h"
31#include "fuse.h"
32#include "tegra2_emc.h"
33#include "tegra20_clocks.h"
34#include "tegra_cpu_car.h"
35
36/* Clock definitions */
37
38#define DEFINE_CLK_TEGRA(_name, _rate, _ops, _flags, \
39 _parent_names, _parents, _parent) \
40 static struct clk tegra_##_name = { \
41 .hw = &tegra_##_name##_hw.hw, \
42 .name = #_name, \
43 .rate = _rate, \
44 .ops = _ops, \
45 .flags = _flags, \
46 .parent_names = _parent_names, \
47 .parents = _parents, \
48 .num_parents = ARRAY_SIZE(_parent_names), \
49 .parent = _parent, \
50 };
51
52static struct clk tegra_clk_32k;
53static struct clk_tegra tegra_clk_32k_hw = {
54 .hw = {
55 .clk = &tegra_clk_32k,
56 },
57 .fixed_rate = 32768,
58};
59
60static struct clk tegra_clk_32k = {
61 .name = "clk_32k",
62 .rate = 32768,
63 .ops = &tegra_clk_32k_ops,
64 .hw = &tegra_clk_32k_hw.hw,
65 .flags = CLK_IS_ROOT,
66};
67
68static struct clk tegra_clk_m;
69static struct clk_tegra tegra_clk_m_hw = {
70 .hw = {
71 .clk = &tegra_clk_m,
72 },
73 .flags = ENABLE_ON_INIT,
74 .reg = 0x1fc,
75 .reg_shift = 28,
76 .max_rate = 26000000,
77 .fixed_rate = 0,
78};
79
80static struct clk tegra_clk_m = {
81 .name = "clk_m",
82 .ops = &tegra_clk_m_ops,
83 .hw = &tegra_clk_m_hw.hw,
84 .flags = CLK_IS_ROOT,
85};
86
87#define DEFINE_PLL(_name, _flags, _reg, _max_rate, _input_min, \
88 _input_max, _cf_min, _cf_max, _vco_min, \
89 _vco_max, _freq_table, _lock_delay, _ops, \
90 _fixed_rate, _parent) \
91 static const char *tegra_##_name##_parent_names[] = { \
92 #_parent, \
93 }; \
94 static struct clk *tegra_##_name##_parents[] = { \
95 &tegra_##_parent, \
96 }; \
97 static struct clk tegra_##_name; \
98 static struct clk_tegra tegra_##_name##_hw = { \
99 .hw = { \
100 .clk = &tegra_##_name, \
101 }, \
102 .flags = _flags, \
103 .reg = _reg, \
104 .max_rate = _max_rate, \
105 .u.pll = { \
106 .input_min = _input_min, \
107 .input_max = _input_max, \
108 .cf_min = _cf_min, \
109 .cf_max = _cf_max, \
110 .vco_min = _vco_min, \
111 .vco_max = _vco_max, \
112 .freq_table = _freq_table, \
113 .lock_delay = _lock_delay, \
114 .fixed_rate = _fixed_rate, \
115 }, \
116 }; \
117 static struct clk tegra_##_name = { \
118 .name = #_name, \
119 .ops = &_ops, \
120 .hw = &tegra_##_name##_hw.hw, \
121 .parent = &tegra_##_parent, \
122 .parent_names = tegra_##_name##_parent_names, \
123 .parents = tegra_##_name##_parents, \
124 .num_parents = 1, \
125 };
126
127#define DEFINE_PLL_OUT(_name, _flags, _reg, _reg_shift, \
128 _max_rate, _ops, _parent, _clk_flags) \
129 static const char *tegra_##_name##_parent_names[] = { \
130 #_parent, \
131 }; \
132 static struct clk *tegra_##_name##_parents[] = { \
133 &tegra_##_parent, \
134 }; \
135 static struct clk tegra_##_name; \
136 static struct clk_tegra tegra_##_name##_hw = { \
137 .hw = { \
138 .clk = &tegra_##_name, \
139 }, \
140 .flags = _flags, \
141 .reg = _reg, \
142 .max_rate = _max_rate, \
143 .reg_shift = _reg_shift, \
144 }; \
145 static struct clk tegra_##_name = { \
146 .name = #_name, \
147 .ops = &tegra_pll_div_ops, \
148 .hw = &tegra_##_name##_hw.hw, \
149 .parent = &tegra_##_parent, \
150 .parent_names = tegra_##_name##_parent_names, \
151 .parents = tegra_##_name##_parents, \
152 .num_parents = 1, \
153 .flags = _clk_flags, \
154 };
155
156
157static struct clk_pll_freq_table tegra_pll_s_freq_table[] = {
158 {32768, 12000000, 366, 1, 1, 0},
159 {32768, 13000000, 397, 1, 1, 0},
160 {32768, 19200000, 586, 1, 1, 0},
161 {32768, 26000000, 793, 1, 1, 0},
162 {0, 0, 0, 0, 0, 0},
163};
164
165DEFINE_PLL(pll_s, PLL_ALT_MISC_REG, 0xf0, 26000000, 32768, 32768, 0,
166 0, 12000000, 26000000, tegra_pll_s_freq_table, 300,
167 tegra_pll_ops, 0, clk_32k);
168
169static struct clk_pll_freq_table tegra_pll_c_freq_table[] = {
170 { 12000000, 600000000, 600, 12, 1, 8 },
171 { 13000000, 600000000, 600, 13, 1, 8 },
172 { 19200000, 600000000, 500, 16, 1, 6 },
173 { 26000000, 600000000, 600, 26, 1, 8 },
174 { 0, 0, 0, 0, 0, 0 },
175};
176
177DEFINE_PLL(pll_c, PLL_HAS_CPCON, 0x80, 600000000, 2000000, 31000000, 1000000,
178 6000000, 20000000, 1400000000, tegra_pll_c_freq_table, 300,
179 tegra_pll_ops, 0, clk_m);
180
181DEFINE_PLL_OUT(pll_c_out1, DIV_U71, 0x84, 0, 600000000,
182 tegra_pll_div_ops, pll_c, 0);
183
184static struct clk_pll_freq_table tegra_pll_m_freq_table[] = {
185 { 12000000, 666000000, 666, 12, 1, 8},
186 { 13000000, 666000000, 666, 13, 1, 8},
187 { 19200000, 666000000, 555, 16, 1, 8},
188 { 26000000, 666000000, 666, 26, 1, 8},
189 { 12000000, 600000000, 600, 12, 1, 8},
190 { 13000000, 600000000, 600, 13, 1, 8},
191 { 19200000, 600000000, 375, 12, 1, 6},
192 { 26000000, 600000000, 600, 26, 1, 8},
193 { 0, 0, 0, 0, 0, 0 },
194};
195
196DEFINE_PLL(pll_m, PLL_HAS_CPCON, 0x90, 800000000, 2000000, 31000000, 1000000,
197 6000000, 20000000, 1200000000, tegra_pll_m_freq_table, 300,
198 tegra_pll_ops, 0, clk_m);
199
200DEFINE_PLL_OUT(pll_m_out1, DIV_U71, 0x94, 0, 600000000,
201 tegra_pll_div_ops, pll_m, 0);
202
203static struct clk_pll_freq_table tegra_pll_p_freq_table[] = {
204 { 12000000, 216000000, 432, 12, 2, 8},
205 { 13000000, 216000000, 432, 13, 2, 8},
206 { 19200000, 216000000, 90, 4, 2, 1},
207 { 26000000, 216000000, 432, 26, 2, 8},
208 { 12000000, 432000000, 432, 12, 1, 8},
209 { 13000000, 432000000, 432, 13, 1, 8},
210 { 19200000, 432000000, 90, 4, 1, 1},
211 { 26000000, 432000000, 432, 26, 1, 8},
212 { 0, 0, 0, 0, 0, 0 },
213};
214
215
216DEFINE_PLL(pll_p, ENABLE_ON_INIT | PLL_FIXED | PLL_HAS_CPCON, 0xa0, 432000000,
217 2000000, 31000000, 1000000, 6000000, 20000000, 1400000000,
218 tegra_pll_p_freq_table, 300, tegra_pll_ops, 216000000, clk_m);
219
220DEFINE_PLL_OUT(pll_p_out1, ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED, 0xa4, 0,
221 432000000, tegra_pll_div_ops, pll_p, 0);
222DEFINE_PLL_OUT(pll_p_out2, ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED, 0xa4, 16,
223 432000000, tegra_pll_div_ops, pll_p, 0);
224DEFINE_PLL_OUT(pll_p_out3, ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED, 0xa8, 0,
225 432000000, tegra_pll_div_ops, pll_p, 0);
226DEFINE_PLL_OUT(pll_p_out4, ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED, 0xa8, 16,
227 432000000, tegra_pll_div_ops, pll_p, 0);
228
229static struct clk_pll_freq_table tegra_pll_a_freq_table[] = {
230 { 28800000, 56448000, 49, 25, 1, 1},
231 { 28800000, 73728000, 64, 25, 1, 1},
232 { 28800000, 24000000, 5, 6, 1, 1},
233 { 0, 0, 0, 0, 0, 0 },
234};
235
236DEFINE_PLL(pll_a, PLL_HAS_CPCON, 0xb0, 73728000, 2000000, 31000000, 1000000,
237 6000000, 20000000, 1400000000, tegra_pll_a_freq_table, 300,
238 tegra_pll_ops, 0, pll_p_out1);
239
240DEFINE_PLL_OUT(pll_a_out0, DIV_U71, 0xb4, 0, 73728000,
241 tegra_pll_div_ops, pll_a, 0);
242
243static struct clk_pll_freq_table tegra_pll_d_freq_table[] = {
244 { 12000000, 216000000, 216, 12, 1, 4},
245 { 13000000, 216000000, 216, 13, 1, 4},
246 { 19200000, 216000000, 135, 12, 1, 3},
247 { 26000000, 216000000, 216, 26, 1, 4},
248
249 { 12000000, 297000000, 99, 4, 1, 4 },
250 { 12000000, 339000000, 113, 4, 1, 4 },
251
252 { 12000000, 594000000, 594, 12, 1, 8},
253 { 13000000, 594000000, 594, 13, 1, 8},
254 { 19200000, 594000000, 495, 16, 1, 8},
255 { 26000000, 594000000, 594, 26, 1, 8},
256
257 { 12000000, 616000000, 616, 12, 1, 8},
258
259 { 12000000, 1000000000, 1000, 12, 1, 12},
260 { 13000000, 1000000000, 1000, 13, 1, 12},
261 { 19200000, 1000000000, 625, 12, 1, 8},
262 { 26000000, 1000000000, 1000, 26, 1, 12},
263
264 { 0, 0, 0, 0, 0, 0 },
265};
266
267DEFINE_PLL(pll_d, PLL_HAS_CPCON | PLLD, 0xd0, 1000000000, 2000000, 40000000,
268 1000000, 6000000, 40000000, 1000000000, tegra_pll_d_freq_table,
269 1000, tegra_pll_ops, 0, clk_m);
270
271DEFINE_PLL_OUT(pll_d_out0, DIV_2 | PLLD, 0, 0, 500000000,
272 tegra_pll_div_ops, pll_d, CLK_SET_RATE_PARENT);
273
274static struct clk_pll_freq_table tegra_pll_u_freq_table[] = {
275 { 12000000, 480000000, 960, 12, 2, 0},
276 { 13000000, 480000000, 960, 13, 2, 0},
277 { 19200000, 480000000, 200, 4, 2, 0},
278 { 26000000, 480000000, 960, 26, 2, 0},
279 { 0, 0, 0, 0, 0, 0 },
280};
281
282DEFINE_PLL(pll_u, PLLU, 0xc0, 480000000, 2000000, 40000000, 1000000, 6000000,
283 48000000, 960000000, tegra_pll_u_freq_table, 1000,
284 tegra_pll_ops, 0, clk_m);
285
286static struct clk_pll_freq_table tegra_pll_x_freq_table[] = {
287 /* 1 GHz */
288 { 12000000, 1000000000, 1000, 12, 1, 12},
289 { 13000000, 1000000000, 1000, 13, 1, 12},
290 { 19200000, 1000000000, 625, 12, 1, 8},
291 { 26000000, 1000000000, 1000, 26, 1, 12},
292
293 /* 912 MHz */
294 { 12000000, 912000000, 912, 12, 1, 12},
295 { 13000000, 912000000, 912, 13, 1, 12},
296 { 19200000, 912000000, 760, 16, 1, 8},
297 { 26000000, 912000000, 912, 26, 1, 12},
298
299 /* 816 MHz */
300 { 12000000, 816000000, 816, 12, 1, 12},
301 { 13000000, 816000000, 816, 13, 1, 12},
302 { 19200000, 816000000, 680, 16, 1, 8},
303 { 26000000, 816000000, 816, 26, 1, 12},
304
305 /* 760 MHz */
306 { 12000000, 760000000, 760, 12, 1, 12},
307 { 13000000, 760000000, 760, 13, 1, 12},
308 { 19200000, 760000000, 950, 24, 1, 8},
309 { 26000000, 760000000, 760, 26, 1, 12},
310
311 /* 750 MHz */
312 { 12000000, 750000000, 750, 12, 1, 12},
313 { 13000000, 750000000, 750, 13, 1, 12},
314 { 19200000, 750000000, 625, 16, 1, 8},
315 { 26000000, 750000000, 750, 26, 1, 12},
316
317 /* 608 MHz */
318 { 12000000, 608000000, 608, 12, 1, 12},
319 { 13000000, 608000000, 608, 13, 1, 12},
320 { 19200000, 608000000, 380, 12, 1, 8},
321 { 26000000, 608000000, 608, 26, 1, 12},
322
323 /* 456 MHz */
324 { 12000000, 456000000, 456, 12, 1, 12},
325 { 13000000, 456000000, 456, 13, 1, 12},
326 { 19200000, 456000000, 380, 16, 1, 8},
327 { 26000000, 456000000, 456, 26, 1, 12},
328
329 /* 312 MHz */
330 { 12000000, 312000000, 312, 12, 1, 12},
331 { 13000000, 312000000, 312, 13, 1, 12},
332 { 19200000, 312000000, 260, 16, 1, 8},
333 { 26000000, 312000000, 312, 26, 1, 12},
334
335 { 0, 0, 0, 0, 0, 0 },
336};
337
338DEFINE_PLL(pll_x, PLL_HAS_CPCON | PLL_ALT_MISC_REG, 0xe0, 1000000000, 2000000,
339 31000000, 1000000, 6000000, 20000000, 1200000000,
340 tegra_pll_x_freq_table, 300, tegra_pllx_ops, 0, clk_m);
341
342static struct clk_pll_freq_table tegra_pll_e_freq_table[] = {
343 { 12000000, 100000000, 200, 24, 1, 0 },
344 { 0, 0, 0, 0, 0, 0 },
345};
346
347DEFINE_PLL(pll_e, PLL_ALT_MISC_REG, 0xe8, 100000000, 12000000, 12000000, 0, 0,
348 0, 0, tegra_pll_e_freq_table, 0, tegra_plle_ops, 0, clk_m);
349
350static const char *tegra_common_parent_names[] = {
351 "clk_m",
352};
353
354static struct clk *tegra_common_parents[] = {
355 &tegra_clk_m,
356};
357
358static struct clk tegra_clk_d;
359static struct clk_tegra tegra_clk_d_hw = {
360 .hw = {
361 .clk = &tegra_clk_d,
362 },
363 .flags = PERIPH_NO_RESET,
364 .reg = 0x34,
365 .reg_shift = 12,
366 .max_rate = 52000000,
367 .u.periph = {
368 .clk_num = 90,
369 },
370};
371
372static struct clk tegra_clk_d = {
373 .name = "clk_d",
374 .hw = &tegra_clk_d_hw.hw,
375 .ops = &tegra_clk_double_ops,
376 .parent = &tegra_clk_m,
377 .parent_names = tegra_common_parent_names,
378 .parents = tegra_common_parents,
379 .num_parents = ARRAY_SIZE(tegra_common_parent_names),
380};
381
382static struct clk tegra_cdev1;
383static struct clk_tegra tegra_cdev1_hw = {
384 .hw = {
385 .clk = &tegra_cdev1,
386 },
387 .fixed_rate = 26000000,
388 .u.periph = {
389 .clk_num = 94,
390 },
391};
392static struct clk tegra_cdev1 = {
393 .name = "cdev1",
394 .hw = &tegra_cdev1_hw.hw,
395 .ops = &tegra_cdev_clk_ops,
396 .flags = CLK_IS_ROOT,
397};
398
399/* dap_mclk2, belongs to the cdev2 pingroup. */
400static struct clk tegra_cdev2;
401static struct clk_tegra tegra_cdev2_hw = {
402 .hw = {
403 .clk = &tegra_cdev2,
404 },
405 .fixed_rate = 26000000,
406 .u.periph = {
407 .clk_num = 93,
408 },
409};
410static struct clk tegra_cdev2 = {
411 .name = "cdev2",
412 .hw = &tegra_cdev2_hw.hw,
413 .ops = &tegra_cdev_clk_ops,
414 .flags = CLK_IS_ROOT,
415};
416
417/* initialized before peripheral clocks */
418static struct clk_mux_sel mux_audio_sync_clk[8+1];
419static const struct audio_sources {
420 const char *name;
421 int value;
422} mux_audio_sync_clk_sources[] = {
423 { .name = "spdif_in", .value = 0 },
424 { .name = "i2s1", .value = 1 },
425 { .name = "i2s2", .value = 2 },
426 { .name = "pll_a_out0", .value = 4 },
427#if 0 /* FIXME: not implemented */
428 { .name = "ac97", .value = 3 },
429 { .name = "ext_audio_clk2", .value = 5 },
430 { .name = "ext_audio_clk1", .value = 6 },
431 { .name = "ext_vimclk", .value = 7 },
432#endif
433 { NULL, 0 }
434};
435
436static const char *audio_parent_names[] = {
437 "spdif_in",
438 "i2s1",
439 "i2s2",
440 "dummy",
441 "pll_a_out0",
442 "dummy",
443 "dummy",
444 "dummy",
445};
446
447static struct clk *audio_parents[] = {
448 NULL,
449 NULL,
450 NULL,
451 NULL,
452 NULL,
453 NULL,
454 NULL,
455 NULL,
456};
457
458static struct clk tegra_audio;
459static struct clk_tegra tegra_audio_hw = {
460 .hw = {
461 .clk = &tegra_audio,
462 },
463 .reg = 0x38,
464 .max_rate = 73728000,
465};
466DEFINE_CLK_TEGRA(audio, 0, &tegra_audio_sync_clk_ops, 0, audio_parent_names,
467 audio_parents, NULL);
468
469static const char *audio_2x_parent_names[] = {
470 "audio",
471};
472
473static struct clk *audio_2x_parents[] = {
474 &tegra_audio,
475};
476
477static struct clk tegra_audio_2x;
478static struct clk_tegra tegra_audio_2x_hw = {
479 .hw = {
480 .clk = &tegra_audio_2x,
481 },
482 .flags = PERIPH_NO_RESET,
483 .max_rate = 48000000,
484 .reg = 0x34,
485 .reg_shift = 8,
486 .u.periph = {
487 .clk_num = 89,
488 },
489};
490DEFINE_CLK_TEGRA(audio_2x, 0, &tegra_clk_double_ops, 0, audio_2x_parent_names,
491 audio_2x_parents, &tegra_audio);
492
493static struct clk_lookup tegra_audio_clk_lookups[] = {
494 { .con_id = "audio", .clk = &tegra_audio },
495 { .con_id = "audio_2x", .clk = &tegra_audio_2x }
496};
497
498/* This is called after peripheral clocks are initialized, as the
499 * audio_sync clock depends on some of the peripheral clocks.
500 */
501
502static void init_audio_sync_clock_mux(void)
503{
504 int i;
505 struct clk_mux_sel *sel = mux_audio_sync_clk;
506 const struct audio_sources *src = mux_audio_sync_clk_sources;
507 struct clk_lookup *lookup;
508
509 for (i = 0; src->name; i++, sel++, src++) {
510 sel->input = tegra_get_clock_by_name(src->name);
511 if (!sel->input)
512 pr_err("%s: could not find clk %s\n", __func__,
513 src->name);
514 audio_parents[src->value] = sel->input;
515 sel->value = src->value;
516 }
517
518 lookup = tegra_audio_clk_lookups;
519 for (i = 0; i < ARRAY_SIZE(tegra_audio_clk_lookups); i++, lookup++) {
520 struct clk *c = lookup->clk;
521 struct clk_tegra *clk = to_clk_tegra(c->hw);
522 __clk_init(NULL, c);
523 INIT_LIST_HEAD(&clk->shared_bus_list);
524 clk->lookup.con_id = lookup->con_id;
525 clk->lookup.clk = c;
526 clkdev_add(&clk->lookup);
527 tegra_clk_add(c);
528 }
529}
530
531static const char *mux_cclk[] = {
532 "clk_m",
533 "pll_c",
534 "clk_32k",
535 "pll_m",
536 "pll_p",
537 "pll_p_out4",
538 "pll_p_out3",
539 "clk_d",
540 "pll_x",
541};
542
543
544static struct clk *mux_cclk_p[] = {
545 &tegra_clk_m,
546 &tegra_pll_c,
547 &tegra_clk_32k,
548 &tegra_pll_m,
549 &tegra_pll_p,
550 &tegra_pll_p_out4,
551 &tegra_pll_p_out3,
552 &tegra_clk_d,
553 &tegra_pll_x,
554};
555
556static const char *mux_sclk[] = {
557 "clk_m",
558 "pll_c_out1",
559 "pll_p_out4",
560 "pllp_p_out3",
561 "pll_p_out2",
562 "clk_d",
563 "clk_32k",
564 "pll_m_out1",
565};
566
567static struct clk *mux_sclk_p[] = {
568 &tegra_clk_m,
569 &tegra_pll_c_out1,
570 &tegra_pll_p_out4,
571 &tegra_pll_p_out3,
572 &tegra_pll_p_out2,
573 &tegra_clk_d,
574 &tegra_clk_32k,
575 &tegra_pll_m_out1,
576};
577
578static struct clk tegra_cclk;
579static struct clk_tegra tegra_cclk_hw = {
580 .hw = {
581 .clk = &tegra_cclk,
582 },
583 .reg = 0x20,
584 .max_rate = 1000000000,
585};
586DEFINE_CLK_TEGRA(cclk, 0, &tegra_super_ops, 0, mux_cclk,
587 mux_cclk_p, NULL);
588
589static const char *mux_twd[] = {
590 "cclk",
591};
592
593static struct clk *mux_twd_p[] = {
594 &tegra_cclk,
595};
596
597static struct clk tegra_clk_twd;
598static struct clk_tegra tegra_clk_twd_hw = {
599 .hw = {
600 .clk = &tegra_clk_twd,
601 },
602 .max_rate = 1000000000,
603 .mul = 1,
604 .div = 4,
605};
606
607static struct clk tegra_clk_twd = {
608 .name = "twd",
609 .ops = &tegra_twd_ops,
610 .hw = &tegra_clk_twd_hw.hw,
611 .parent = &tegra_cclk,
612 .parent_names = mux_twd,
613 .parents = mux_twd_p,
614 .num_parents = ARRAY_SIZE(mux_twd),
615};
616
617static struct clk tegra_sclk;
618static struct clk_tegra tegra_sclk_hw = {
619 .hw = {
620 .clk = &tegra_sclk,
621 },
622 .reg = 0x28,
623 .max_rate = 240000000,
624 .min_rate = 120000000,
625};
626DEFINE_CLK_TEGRA(sclk, 0, &tegra_super_ops, 0, mux_sclk,
627 mux_sclk_p, NULL);
628
629static const char *tegra_cop_parent_names[] = {
630 "tegra_sclk",
631};
632
633static struct clk *tegra_cop_parents[] = {
634 &tegra_sclk,
635};
636
637static struct clk tegra_cop;
638static struct clk_tegra tegra_cop_hw = {
639 .hw = {
640 .clk = &tegra_cop,
641 },
642 .max_rate = 240000000,
643 .reset = &tegra2_cop_clk_reset,
644};
645DEFINE_CLK_TEGRA(cop, 0, &tegra_cop_ops, CLK_SET_RATE_PARENT,
646 tegra_cop_parent_names, tegra_cop_parents, &tegra_sclk);
647
648static const char *tegra_hclk_parent_names[] = {
649 "tegra_sclk",
650};
651
652static struct clk *tegra_hclk_parents[] = {
653 &tegra_sclk,
654};
655
656static struct clk tegra_hclk;
657static struct clk_tegra tegra_hclk_hw = {
658 .hw = {
659 .clk = &tegra_hclk,
660 },
661 .flags = DIV_BUS,
662 .reg = 0x30,
663 .reg_shift = 4,
664 .max_rate = 240000000,
665};
666DEFINE_CLK_TEGRA(hclk, 0, &tegra_bus_ops, 0, tegra_hclk_parent_names,
667 tegra_hclk_parents, &tegra_sclk);
668
669static const char *tegra_pclk_parent_names[] = {
670 "tegra_hclk",
671};
672
673static struct clk *tegra_pclk_parents[] = {
674 &tegra_hclk,
675};
676
677static struct clk tegra_pclk;
678static struct clk_tegra tegra_pclk_hw = {
679 .hw = {
680 .clk = &tegra_pclk,
681 },
682 .flags = DIV_BUS,
683 .reg = 0x30,
684 .reg_shift = 0,
685 .max_rate = 120000000,
686};
687DEFINE_CLK_TEGRA(pclk, 0, &tegra_bus_ops, 0, tegra_pclk_parent_names,
688 tegra_pclk_parents, &tegra_hclk);
689
690static const char *tegra_blink_parent_names[] = {
691 "clk_32k",
692};
693
694static struct clk *tegra_blink_parents[] = {
695 &tegra_clk_32k,
696};
697
698static struct clk tegra_blink;
699static struct clk_tegra tegra_blink_hw = {
700 .hw = {
701 .clk = &tegra_blink,
702 },
703 .reg = 0x40,
704 .max_rate = 32768,
705};
706DEFINE_CLK_TEGRA(blink, 0, &tegra_blink_clk_ops, 0, tegra_blink_parent_names,
707 tegra_blink_parents, &tegra_clk_32k);
708
709static const char *mux_pllm_pllc_pllp_plla[] = {
710 "pll_m",
711 "pll_c",
712 "pll_p",
713 "pll_a_out0",
714};
715
716static struct clk *mux_pllm_pllc_pllp_plla_p[] = {
717 &tegra_pll_m,
718 &tegra_pll_c,
719 &tegra_pll_p,
720 &tegra_pll_a_out0,
721};
722
723static const char *mux_pllm_pllc_pllp_clkm[] = {
724 "pll_m",
725 "pll_c",
726 "pll_p",
727 "clk_m",
728};
729
730static struct clk *mux_pllm_pllc_pllp_clkm_p[] = {
731 &tegra_pll_m,
732 &tegra_pll_c,
733 &tegra_pll_p,
734 &tegra_clk_m,
735};
736
737static const char *mux_pllp_pllc_pllm_clkm[] = {
738 "pll_p",
739 "pll_c",
740 "pll_m",
741 "clk_m",
742};
743
744static struct clk *mux_pllp_pllc_pllm_clkm_p[] = {
745 &tegra_pll_p,
746 &tegra_pll_c,
747 &tegra_pll_m,
748 &tegra_clk_m,
749};
750
751static const char *mux_pllaout0_audio2x_pllp_clkm[] = {
752 "pll_a_out0",
753 "audio_2x",
754 "pll_p",
755 "clk_m",
756};
757
758static struct clk *mux_pllaout0_audio2x_pllp_clkm_p[] = {
759 &tegra_pll_a_out0,
760 &tegra_audio_2x,
761 &tegra_pll_p,
762 &tegra_clk_m,
763};
764
765static const char *mux_pllp_plld_pllc_clkm[] = {
766 "pllp",
767 "pll_d_out0",
768 "pll_c",
769 "clk_m",
770};
771
772static struct clk *mux_pllp_plld_pllc_clkm_p[] = {
773 &tegra_pll_p,
774 &tegra_pll_d_out0,
775 &tegra_pll_c,
776 &tegra_clk_m,
777};
778
779static const char *mux_pllp_pllc_audio_clkm_clk32[] = {
780 "pll_p",
781 "pll_c",
782 "audio",
783 "clk_m",
784 "clk_32k",
785};
786
787static struct clk *mux_pllp_pllc_audio_clkm_clk32_p[] = {
788 &tegra_pll_p,
789 &tegra_pll_c,
790 &tegra_audio,
791 &tegra_clk_m,
792 &tegra_clk_32k,
793};
794
795static const char *mux_pllp_pllc_pllm[] = {
796 "pll_p",
797 "pll_c",
798 "pll_m"
799};
800
801static struct clk *mux_pllp_pllc_pllm_p[] = {
802 &tegra_pll_p,
803 &tegra_pll_c,
804 &tegra_pll_m,
805};
806
807static const char *mux_clk_m[] = {
808 "clk_m",
809};
810
811static struct clk *mux_clk_m_p[] = {
812 &tegra_clk_m,
813};
814
815static const char *mux_pllp_out3[] = {
816 "pll_p_out3",
817};
818
819static struct clk *mux_pllp_out3_p[] = {
820 &tegra_pll_p_out3,
821};
822
823static const char *mux_plld[] = {
824 "pll_d",
825};
826
827static struct clk *mux_plld_p[] = {
828 &tegra_pll_d,
829};
830
831static const char *mux_clk_32k[] = {
832 "clk_32k",
833};
834
835static struct clk *mux_clk_32k_p[] = {
836 &tegra_clk_32k,
837};
838
839static const char *mux_pclk[] = {
840 "pclk",
841};
842
843static struct clk *mux_pclk_p[] = {
844 &tegra_pclk,
845};
846
847static struct clk tegra_emc;
848static struct clk_tegra tegra_emc_hw = {
849 .hw = {
850 .clk = &tegra_emc,
851 },
852 .reg = 0x19c,
853 .max_rate = 800000000,
854 .flags = MUX | DIV_U71 | PERIPH_EMC_ENB,
855 .reset = &tegra2_periph_clk_reset,
856 .u.periph = {
857 .clk_num = 57,
858 },
859};
860DEFINE_CLK_TEGRA(emc, 0, &tegra_emc_clk_ops, 0, mux_pllm_pllc_pllp_clkm,
861 mux_pllm_pllc_pllp_clkm_p, NULL);
862
863#define PERIPH_CLK(_name, _dev, _con, _clk_num, _reg, \
864 _max, _inputs, _flags) \
865 static struct clk tegra_##_name; \
866 static struct clk_tegra tegra_##_name##_hw = { \
867 .hw = { \
868 .clk = &tegra_##_name, \
869 }, \
870 .lookup = { \
871 .dev_id = _dev, \
872 .con_id = _con, \
873 }, \
874 .reg = _reg, \
875 .flags = _flags, \
876 .max_rate = _max, \
877 .u.periph = { \
878 .clk_num = _clk_num, \
879 }, \
880 .reset = tegra2_periph_clk_reset, \
881 }; \
882 static struct clk tegra_##_name = { \
883 .name = #_name, \
884 .ops = &tegra_periph_clk_ops, \
885 .hw = &tegra_##_name##_hw.hw, \
886 .parent_names = _inputs, \
887 .parents = _inputs##_p, \
888 .num_parents = ARRAY_SIZE(_inputs), \
889 };
890
891PERIPH_CLK(apbdma, "tegra-apbdma", NULL, 34, 0, 108000000, mux_pclk, 0);
892PERIPH_CLK(rtc, "rtc-tegra", NULL, 4, 0, 32768, mux_clk_32k, PERIPH_NO_RESET);
893PERIPH_CLK(timer, "timer", NULL, 5, 0, 26000000, mux_clk_m, 0);
894PERIPH_CLK(i2s1, "tegra20-i2s.0", NULL, 11, 0x100, 26000000, mux_pllaout0_audio2x_pllp_clkm, MUX | DIV_U71);
895PERIPH_CLK(i2s2, "tegra20-i2s.1", NULL, 18, 0x104, 26000000, mux_pllaout0_audio2x_pllp_clkm, MUX | DIV_U71);
896PERIPH_CLK(spdif_out, "spdif_out", NULL, 10, 0x108, 100000000, mux_pllaout0_audio2x_pllp_clkm, MUX | DIV_U71);
897PERIPH_CLK(spdif_in, "spdif_in", NULL, 10, 0x10c, 100000000, mux_pllp_pllc_pllm, MUX | DIV_U71);
898PERIPH_CLK(pwm, "tegra-pwm", NULL, 17, 0x110, 432000000, mux_pllp_pllc_audio_clkm_clk32, MUX | DIV_U71 | MUX_PWM);
899PERIPH_CLK(spi, "spi", NULL, 43, 0x114, 40000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
900PERIPH_CLK(xio, "xio", NULL, 45, 0x120, 150000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
901PERIPH_CLK(twc, "twc", NULL, 16, 0x12c, 150000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
902PERIPH_CLK(sbc1, "spi_tegra.0", NULL, 41, 0x134, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
903PERIPH_CLK(sbc2, "spi_tegra.1", NULL, 44, 0x118, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
904PERIPH_CLK(sbc3, "spi_tegra.2", NULL, 46, 0x11c, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
905PERIPH_CLK(sbc4, "spi_tegra.3", NULL, 68, 0x1b4, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
906PERIPH_CLK(ide, "ide", NULL, 25, 0x144, 100000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* requires min voltage */
907PERIPH_CLK(ndflash, "tegra_nand", NULL, 13, 0x160, 164000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
908PERIPH_CLK(vfir, "vfir", NULL, 7, 0x168, 72000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
909PERIPH_CLK(sdmmc1, "sdhci-tegra.0", NULL, 14, 0x150, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
910PERIPH_CLK(sdmmc2, "sdhci-tegra.1", NULL, 9, 0x154, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
911PERIPH_CLK(sdmmc3, "sdhci-tegra.2", NULL, 69, 0x1bc, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
912PERIPH_CLK(sdmmc4, "sdhci-tegra.3", NULL, 15, 0x164, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
913PERIPH_CLK(vcp, "tegra-avp", "vcp", 29, 0, 250000000, mux_clk_m, 0);
914PERIPH_CLK(bsea, "tegra-avp", "bsea", 62, 0, 250000000, mux_clk_m, 0);
915PERIPH_CLK(bsev, "tegra-aes", "bsev", 63, 0, 250000000, mux_clk_m, 0);
916PERIPH_CLK(vde, "tegra-avp", "vde", 61, 0x1c8, 250000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage and process_id */
917PERIPH_CLK(csite, "csite", NULL, 73, 0x1d4, 144000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* max rate ??? */
918/* FIXME: what is la? */
919PERIPH_CLK(la, "la", NULL, 76, 0x1f8, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
920PERIPH_CLK(owr, "tegra_w1", NULL, 71, 0x1cc, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
921PERIPH_CLK(nor, "nor", NULL, 42, 0x1d0, 92000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* requires min voltage */
922PERIPH_CLK(mipi, "mipi", NULL, 50, 0x174, 60000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
923PERIPH_CLK(i2c1, "tegra-i2c.0", "div-clk", 12, 0x124, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U16);
924PERIPH_CLK(i2c2, "tegra-i2c.1", "div-clk", 54, 0x198, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U16);
925PERIPH_CLK(i2c3, "tegra-i2c.2", "div-clk", 67, 0x1b8, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U16);
926PERIPH_CLK(dvc, "tegra-i2c.3", "div-clk", 47, 0x128, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U16);
927PERIPH_CLK(uarta, "tegra-uart.0", NULL, 6, 0x178, 600000000, mux_pllp_pllc_pllm_clkm, MUX);
928PERIPH_CLK(uartb, "tegra-uart.1", NULL, 7, 0x17c, 600000000, mux_pllp_pllc_pllm_clkm, MUX);
929PERIPH_CLK(uartc, "tegra-uart.2", NULL, 55, 0x1a0, 600000000, mux_pllp_pllc_pllm_clkm, MUX);
930PERIPH_CLK(uartd, "tegra-uart.3", NULL, 65, 0x1c0, 600000000, mux_pllp_pllc_pllm_clkm, MUX);
931PERIPH_CLK(uarte, "tegra-uart.4", NULL, 66, 0x1c4, 600000000, mux_pllp_pllc_pllm_clkm, MUX);
932PERIPH_CLK(3d, "3d", NULL, 24, 0x158, 300000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | PERIPH_MANUAL_RESET); /* scales with voltage and process_id */
933PERIPH_CLK(2d, "2d", NULL, 21, 0x15c, 300000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71); /* scales with voltage and process_id */
934PERIPH_CLK(vi, "tegra_camera", "vi", 20, 0x148, 150000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71); /* scales with voltage and process_id */
935PERIPH_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 */
936PERIPH_CLK(epp, "epp", NULL, 19, 0x16c, 300000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71); /* scales with voltage and process_id */
937PERIPH_CLK(mpe, "mpe", NULL, 60, 0x170, 250000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71); /* scales with voltage and process_id */
938PERIPH_CLK(host1x, "host1x", NULL, 28, 0x180, 166000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71); /* scales with voltage and process_id */
939PERIPH_CLK(cve, "cve", NULL, 49, 0x140, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71); /* requires min voltage */
940PERIPH_CLK(tvo, "tvo", NULL, 49, 0x188, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71); /* requires min voltage */
941PERIPH_CLK(hdmi, "hdmi", NULL, 51, 0x18c, 600000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71); /* requires min voltage */
942PERIPH_CLK(tvdac, "tvdac", NULL, 53, 0x194, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71); /* requires min voltage */
943PERIPH_CLK(disp1, "tegradc.0", NULL, 27, 0x138, 600000000, mux_pllp_plld_pllc_clkm, MUX); /* scales with voltage and process_id */
944PERIPH_CLK(disp2, "tegradc.1", NULL, 26, 0x13c, 600000000, mux_pllp_plld_pllc_clkm, MUX); /* scales with voltage and process_id */
945PERIPH_CLK(usbd, "fsl-tegra-udc", NULL, 22, 0, 480000000, mux_clk_m, 0); /* requires min voltage */
946PERIPH_CLK(usb2, "tegra-ehci.1", NULL, 58, 0, 480000000, mux_clk_m, 0); /* requires min voltage */
947PERIPH_CLK(usb3, "tegra-ehci.2", NULL, 59, 0, 480000000, mux_clk_m, 0); /* requires min voltage */
948PERIPH_CLK(dsi, "dsi", NULL, 48, 0, 500000000, mux_plld, 0); /* scales with voltage */
949PERIPH_CLK(csi, "tegra_camera", "csi", 52, 0, 72000000, mux_pllp_out3, 0);
950PERIPH_CLK(isp, "tegra_camera", "isp", 23, 0, 150000000, mux_clk_m, 0); /* same frequency as VI */
951PERIPH_CLK(csus, "tegra_camera", "csus", 92, 0, 150000000, mux_clk_m, PERIPH_NO_RESET);
952PERIPH_CLK(pex, NULL, "pex", 70, 0, 26000000, mux_clk_m, PERIPH_MANUAL_RESET);
953PERIPH_CLK(afi, NULL, "afi", 72, 0, 26000000, mux_clk_m, PERIPH_MANUAL_RESET);
954PERIPH_CLK(pcie_xclk, NULL, "pcie_xclk", 74, 0, 26000000, mux_clk_m, PERIPH_MANUAL_RESET);
955
956static struct clk *tegra_list_clks[] = {
957 &tegra_apbdma,
958 &tegra_rtc,
959 &tegra_timer,
960 &tegra_i2s1,
961 &tegra_i2s2,
962 &tegra_spdif_out,
963 &tegra_spdif_in,
964 &tegra_pwm,
965 &tegra_spi,
966 &tegra_xio,
967 &tegra_twc,
968 &tegra_sbc1,
969 &tegra_sbc2,
970 &tegra_sbc3,
971 &tegra_sbc4,
972 &tegra_ide,
973 &tegra_ndflash,
974 &tegra_vfir,
975 &tegra_sdmmc1,
976 &tegra_sdmmc2,
977 &tegra_sdmmc3,
978 &tegra_sdmmc4,
979 &tegra_vcp,
980 &tegra_bsea,
981 &tegra_bsev,
982 &tegra_vde,
983 &tegra_csite,
984 &tegra_la,
985 &tegra_owr,
986 &tegra_nor,
987 &tegra_mipi,
988 &tegra_i2c1,
989 &tegra_i2c2,
990 &tegra_i2c3,
991 &tegra_dvc,
992 &tegra_uarta,
993 &tegra_uartb,
994 &tegra_uartc,
995 &tegra_uartd,
996 &tegra_uarte,
997 &tegra_3d,
998 &tegra_2d,
999 &tegra_vi,
1000 &tegra_vi_sensor,
1001 &tegra_epp,
1002 &tegra_mpe,
1003 &tegra_host1x,
1004 &tegra_cve,
1005 &tegra_tvo,
1006 &tegra_hdmi,
1007 &tegra_tvdac,
1008 &tegra_disp1,
1009 &tegra_disp2,
1010 &tegra_usbd,
1011 &tegra_usb2,
1012 &tegra_usb3,
1013 &tegra_dsi,
1014 &tegra_csi,
1015 &tegra_isp,
1016 &tegra_csus,
1017 &tegra_pex,
1018 &tegra_afi,
1019 &tegra_pcie_xclk,
1020};
1021
1022#define CLK_DUPLICATE(_name, _dev, _con) \
1023 { \
1024 .name = _name, \
1025 .lookup = { \
1026 .dev_id = _dev, \
1027 .con_id = _con, \
1028 }, \
1029 }
1030
1031/* Some clocks may be used by different drivers depending on the board
1032 * configuration. List those here to register them twice in the clock lookup
1033 * table under two names.
1034 */
1035static struct clk_duplicate tegra_clk_duplicates[] = {
1036 CLK_DUPLICATE("uarta", "serial8250.0", NULL),
1037 CLK_DUPLICATE("uartb", "serial8250.1", NULL),
1038 CLK_DUPLICATE("uartc", "serial8250.2", NULL),
1039 CLK_DUPLICATE("uartd", "serial8250.3", NULL),
1040 CLK_DUPLICATE("uarte", "serial8250.4", NULL),
1041 CLK_DUPLICATE("usbd", "utmip-pad", NULL),
1042 CLK_DUPLICATE("usbd", "tegra-ehci.0", NULL),
1043 CLK_DUPLICATE("usbd", "tegra-otg", NULL),
1044 CLK_DUPLICATE("2d", "tegra_grhost", "gr2d"),
1045 CLK_DUPLICATE("3d", "tegra_grhost", "gr3d"),
1046 CLK_DUPLICATE("epp", "tegra_grhost", "epp"),
1047 CLK_DUPLICATE("mpe", "tegra_grhost", "mpe"),
1048 CLK_DUPLICATE("cop", "tegra-avp", "cop"),
1049 CLK_DUPLICATE("vde", "tegra-aes", "vde"),
1050 CLK_DUPLICATE("cclk", NULL, "cpu"),
1051 CLK_DUPLICATE("twd", "smp_twd", NULL),
1052 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.0", "fast-clk"),
1053 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.1", "fast-clk"),
1054 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.2", "fast-clk"),
1055 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.3", "fast-clk"),
1056 CLK_DUPLICATE("pll_p", "tegradc.0", "parent"),
1057 CLK_DUPLICATE("pll_p", "tegradc.1", "parent"),
1058 CLK_DUPLICATE("pll_d_out0", "hdmi", "parent"),
1059};
1060
1061#define CLK(dev, con, ck) \
1062 { \
1063 .dev_id = dev, \
1064 .con_id = con, \
1065 .clk = ck, \
1066 }
1067
1068static struct clk *tegra_ptr_clks[] = {
1069 &tegra_clk_32k,
1070 &tegra_pll_s,
1071 &tegra_clk_m,
1072 &tegra_pll_m,
1073 &tegra_pll_m_out1,
1074 &tegra_pll_c,
1075 &tegra_pll_c_out1,
1076 &tegra_pll_p,
1077 &tegra_pll_p_out1,
1078 &tegra_pll_p_out2,
1079 &tegra_pll_p_out3,
1080 &tegra_pll_p_out4,
1081 &tegra_pll_a,
1082 &tegra_pll_a_out0,
1083 &tegra_pll_d,
1084 &tegra_pll_d_out0,
1085 &tegra_pll_u,
1086 &tegra_pll_x,
1087 &tegra_pll_e,
1088 &tegra_cclk,
1089 &tegra_clk_twd,
1090 &tegra_sclk,
1091 &tegra_hclk,
1092 &tegra_pclk,
1093 &tegra_clk_d,
1094 &tegra_cdev1,
1095 &tegra_cdev2,
1096 &tegra_blink,
1097 &tegra_cop,
1098 &tegra_emc,
1099};
1100
1101static void tegra2_init_one_clock(struct clk *c)
1102{
1103 struct clk_tegra *clk = to_clk_tegra(c->hw);
1104 int ret;
1105
1106 ret = __clk_init(NULL, c);
1107 if (ret)
1108 pr_err("clk init failed %s\n", __clk_get_name(c));
1109
1110 INIT_LIST_HEAD(&clk->shared_bus_list);
1111 if (!clk->lookup.dev_id && !clk->lookup.con_id)
1112 clk->lookup.con_id = c->name;
1113 clk->lookup.clk = c;
1114 clkdev_add(&clk->lookup);
1115 tegra_clk_add(c);
1116}
1117
1118void __init tegra2_init_clocks(void)
1119{
1120 int i;
1121 struct clk *c;
1122
1123 for (i = 0; i < ARRAY_SIZE(tegra_ptr_clks); i++)
1124 tegra2_init_one_clock(tegra_ptr_clks[i]);
1125
1126 for (i = 0; i < ARRAY_SIZE(tegra_list_clks); i++)
1127 tegra2_init_one_clock(tegra_list_clks[i]);
1128
1129 for (i = 0; i < ARRAY_SIZE(tegra_clk_duplicates); i++) {
1130 c = tegra_get_clock_by_name(tegra_clk_duplicates[i].name);
1131 if (!c) {
1132 pr_err("%s: Unknown duplicate clock %s\n", __func__,
1133 tegra_clk_duplicates[i].name);
1134 continue;
1135 }
1136
1137 tegra_clk_duplicates[i].lookup.clk = c;
1138 clkdev_add(&tegra_clk_duplicates[i].lookup);
1139 }
1140
1141 init_audio_sync_clock_mux();
1142 tegra20_cpu_car_ops_init();
1143}
diff --git a/arch/arm/mach-tegra/tegra2_emc.c b/arch/arm/mach-tegra/tegra2_emc.c
index e18aa2f83ebf..ce7ce42a1ac9 100644
--- a/arch/arm/mach-tegra/tegra2_emc.c
+++ b/arch/arm/mach-tegra/tegra2_emc.c
@@ -312,11 +312,9 @@ static int tegra_emc_probe(struct platform_device *pdev)
312 return -ENOMEM; 312 return -ENOMEM;
313 } 313 }
314 314
315 emc_regbase = devm_request_and_ioremap(&pdev->dev, res); 315 emc_regbase = devm_ioremap_resource(&pdev->dev, res);
316 if (!emc_regbase) { 316 if (IS_ERR(emc_regbase))
317 dev_err(&pdev->dev, "failed to remap registers\n"); 317 return PTR_ERR(emc_regbase);
318 return -ENOMEM;
319 }
320 318
321 pdata = pdev->dev.platform_data; 319 pdata = pdev->dev.platform_data;
322 320
diff --git a/arch/arm/mach-tegra/tegra30_clocks.c b/arch/arm/mach-tegra/tegra30_clocks.c
deleted file mode 100644
index d7147779f8ea..000000000000
--- a/arch/arm/mach-tegra/tegra30_clocks.c
+++ /dev/null
@@ -1,2506 +0,0 @@
1/*
2 * arch/arm/mach-tegra/tegra30_clocks.c
3 *
4 * Copyright (c) 2010-2012 NVIDIA CORPORATION. All rights reserved.
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; version 2 of the License.
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 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
20
21#include <linux/kernel.h>
22#include <linux/module.h>
23#include <linux/list.h>
24#include <linux/spinlock.h>
25#include <linux/delay.h>
26#include <linux/err.h>
27#include <linux/io.h>
28#include <linux/clk.h>
29#include <linux/cpufreq.h>
30#include <linux/syscore_ops.h>
31
32#include <asm/clkdev.h>
33
34#include <mach/powergate.h>
35
36#include "clock.h"
37#include "fuse.h"
38#include "iomap.h"
39#include "tegra_cpu_car.h"
40
41#define USE_PLL_LOCK_BITS 0
42
43#define RST_DEVICES_L 0x004
44#define RST_DEVICES_H 0x008
45#define RST_DEVICES_U 0x00C
46#define RST_DEVICES_V 0x358
47#define RST_DEVICES_W 0x35C
48#define RST_DEVICES_SET_L 0x300
49#define RST_DEVICES_CLR_L 0x304
50#define RST_DEVICES_SET_V 0x430
51#define RST_DEVICES_CLR_V 0x434
52#define RST_DEVICES_NUM 5
53
54#define CLK_OUT_ENB_L 0x010
55#define CLK_OUT_ENB_H 0x014
56#define CLK_OUT_ENB_U 0x018
57#define CLK_OUT_ENB_V 0x360
58#define CLK_OUT_ENB_W 0x364
59#define CLK_OUT_ENB_SET_L 0x320
60#define CLK_OUT_ENB_CLR_L 0x324
61#define CLK_OUT_ENB_SET_V 0x440
62#define CLK_OUT_ENB_CLR_V 0x444
63#define CLK_OUT_ENB_NUM 5
64
65#define RST_DEVICES_V_SWR_CPULP_RST_DIS (0x1 << 1)
66#define CLK_OUT_ENB_V_CLK_ENB_CPULP_EN (0x1 << 1)
67
68#define PERIPH_CLK_TO_BIT(c) (1 << (c->u.periph.clk_num % 32))
69#define PERIPH_CLK_TO_RST_REG(c) \
70 periph_clk_to_reg((c), RST_DEVICES_L, RST_DEVICES_V, 4)
71#define PERIPH_CLK_TO_RST_SET_REG(c) \
72 periph_clk_to_reg((c), RST_DEVICES_SET_L, RST_DEVICES_SET_V, 8)
73#define PERIPH_CLK_TO_RST_CLR_REG(c) \
74 periph_clk_to_reg((c), RST_DEVICES_CLR_L, RST_DEVICES_CLR_V, 8)
75
76#define PERIPH_CLK_TO_ENB_REG(c) \
77 periph_clk_to_reg((c), CLK_OUT_ENB_L, CLK_OUT_ENB_V, 4)
78#define PERIPH_CLK_TO_ENB_SET_REG(c) \
79 periph_clk_to_reg((c), CLK_OUT_ENB_SET_L, CLK_OUT_ENB_SET_V, 8)
80#define PERIPH_CLK_TO_ENB_CLR_REG(c) \
81 periph_clk_to_reg((c), CLK_OUT_ENB_CLR_L, CLK_OUT_ENB_CLR_V, 8)
82
83#define CLK_MASK_ARM 0x44
84#define MISC_CLK_ENB 0x48
85
86#define OSC_CTRL 0x50
87#define OSC_CTRL_OSC_FREQ_MASK (0xF<<28)
88#define OSC_CTRL_OSC_FREQ_13MHZ (0x0<<28)
89#define OSC_CTRL_OSC_FREQ_19_2MHZ (0x4<<28)
90#define OSC_CTRL_OSC_FREQ_12MHZ (0x8<<28)
91#define OSC_CTRL_OSC_FREQ_26MHZ (0xC<<28)
92#define OSC_CTRL_OSC_FREQ_16_8MHZ (0x1<<28)
93#define OSC_CTRL_OSC_FREQ_38_4MHZ (0x5<<28)
94#define OSC_CTRL_OSC_FREQ_48MHZ (0x9<<28)
95#define OSC_CTRL_MASK (0x3f2 | OSC_CTRL_OSC_FREQ_MASK)
96
97#define OSC_CTRL_PLL_REF_DIV_MASK (3<<26)
98#define OSC_CTRL_PLL_REF_DIV_1 (0<<26)
99#define OSC_CTRL_PLL_REF_DIV_2 (1<<26)
100#define OSC_CTRL_PLL_REF_DIV_4 (2<<26)
101
102#define OSC_FREQ_DET 0x58
103#define OSC_FREQ_DET_TRIG (1<<31)
104
105#define OSC_FREQ_DET_STATUS 0x5C
106#define OSC_FREQ_DET_BUSY (1<<31)
107#define OSC_FREQ_DET_CNT_MASK 0xFFFF
108
109#define PERIPH_CLK_SOURCE_I2S1 0x100
110#define PERIPH_CLK_SOURCE_EMC 0x19c
111#define PERIPH_CLK_SOURCE_OSC 0x1fc
112#define PERIPH_CLK_SOURCE_NUM1 \
113 ((PERIPH_CLK_SOURCE_OSC - PERIPH_CLK_SOURCE_I2S1) / 4)
114
115#define PERIPH_CLK_SOURCE_G3D2 0x3b0
116#define PERIPH_CLK_SOURCE_SE 0x42c
117#define PERIPH_CLK_SOURCE_NUM2 \
118 ((PERIPH_CLK_SOURCE_SE - PERIPH_CLK_SOURCE_G3D2) / 4 + 1)
119
120#define AUDIO_DLY_CLK 0x49c
121#define AUDIO_SYNC_CLK_SPDIF 0x4b4
122#define PERIPH_CLK_SOURCE_NUM3 \
123 ((AUDIO_SYNC_CLK_SPDIF - AUDIO_DLY_CLK) / 4 + 1)
124
125#define PERIPH_CLK_SOURCE_NUM (PERIPH_CLK_SOURCE_NUM1 + \
126 PERIPH_CLK_SOURCE_NUM2 + \
127 PERIPH_CLK_SOURCE_NUM3)
128
129#define CPU_SOFTRST_CTRL 0x380
130
131#define PERIPH_CLK_SOURCE_DIVU71_MASK 0xFF
132#define PERIPH_CLK_SOURCE_DIVU16_MASK 0xFFFF
133#define PERIPH_CLK_SOURCE_DIV_SHIFT 0
134#define PERIPH_CLK_SOURCE_DIVIDLE_SHIFT 8
135#define PERIPH_CLK_SOURCE_DIVIDLE_VAL 50
136#define PERIPH_CLK_UART_DIV_ENB (1<<24)
137#define PERIPH_CLK_VI_SEL_EX_SHIFT 24
138#define PERIPH_CLK_VI_SEL_EX_MASK (0x3<<PERIPH_CLK_VI_SEL_EX_SHIFT)
139#define PERIPH_CLK_NAND_DIV_EX_ENB (1<<8)
140#define PERIPH_CLK_DTV_POLARITY_INV (1<<25)
141
142#define AUDIO_SYNC_SOURCE_MASK 0x0F
143#define AUDIO_SYNC_DISABLE_BIT 0x10
144#define AUDIO_SYNC_TAP_NIBBLE_SHIFT(c) ((c->reg_shift - 24) * 4)
145
146#define PLL_BASE 0x0
147#define PLL_BASE_BYPASS (1<<31)
148#define PLL_BASE_ENABLE (1<<30)
149#define PLL_BASE_REF_ENABLE (1<<29)
150#define PLL_BASE_OVERRIDE (1<<28)
151#define PLL_BASE_LOCK (1<<27)
152#define PLL_BASE_DIVP_MASK (0x7<<20)
153#define PLL_BASE_DIVP_SHIFT 20
154#define PLL_BASE_DIVN_MASK (0x3FF<<8)
155#define PLL_BASE_DIVN_SHIFT 8
156#define PLL_BASE_DIVM_MASK (0x1F)
157#define PLL_BASE_DIVM_SHIFT 0
158
159#define PLL_OUT_RATIO_MASK (0xFF<<8)
160#define PLL_OUT_RATIO_SHIFT 8
161#define PLL_OUT_OVERRIDE (1<<2)
162#define PLL_OUT_CLKEN (1<<1)
163#define PLL_OUT_RESET_DISABLE (1<<0)
164
165#define PLL_MISC(c) \
166 (((c)->flags & PLL_ALT_MISC_REG) ? 0x4 : 0xc)
167#define PLL_MISC_LOCK_ENABLE(c) \
168 (((c)->flags & (PLLU | PLLD)) ? (1<<22) : (1<<18))
169
170#define PLL_MISC_DCCON_SHIFT 20
171#define PLL_MISC_CPCON_SHIFT 8
172#define PLL_MISC_CPCON_MASK (0xF<<PLL_MISC_CPCON_SHIFT)
173#define PLL_MISC_LFCON_SHIFT 4
174#define PLL_MISC_LFCON_MASK (0xF<<PLL_MISC_LFCON_SHIFT)
175#define PLL_MISC_VCOCON_SHIFT 0
176#define PLL_MISC_VCOCON_MASK (0xF<<PLL_MISC_VCOCON_SHIFT)
177#define PLLD_MISC_CLKENABLE (1<<30)
178
179#define PLLU_BASE_POST_DIV (1<<20)
180
181#define PLLD_BASE_DSIB_MUX_SHIFT 25
182#define PLLD_BASE_DSIB_MUX_MASK (1<<PLLD_BASE_DSIB_MUX_SHIFT)
183#define PLLD_BASE_CSI_CLKENABLE (1<<26)
184#define PLLD_MISC_DSI_CLKENABLE (1<<30)
185#define PLLD_MISC_DIV_RST (1<<23)
186#define PLLD_MISC_DCCON_SHIFT 12
187
188#define PLLDU_LFCON_SET_DIVN 600
189
190/* FIXME: OUT_OF_TABLE_CPCON per pll */
191#define OUT_OF_TABLE_CPCON 0x8
192
193#define SUPER_CLK_MUX 0x00
194#define SUPER_STATE_SHIFT 28
195#define SUPER_STATE_MASK (0xF << SUPER_STATE_SHIFT)
196#define SUPER_STATE_STANDBY (0x0 << SUPER_STATE_SHIFT)
197#define SUPER_STATE_IDLE (0x1 << SUPER_STATE_SHIFT)
198#define SUPER_STATE_RUN (0x2 << SUPER_STATE_SHIFT)
199#define SUPER_STATE_IRQ (0x3 << SUPER_STATE_SHIFT)
200#define SUPER_STATE_FIQ (0x4 << SUPER_STATE_SHIFT)
201#define SUPER_LP_DIV2_BYPASS (0x1 << 16)
202#define SUPER_SOURCE_MASK 0xF
203#define SUPER_FIQ_SOURCE_SHIFT 12
204#define SUPER_IRQ_SOURCE_SHIFT 8
205#define SUPER_RUN_SOURCE_SHIFT 4
206#define SUPER_IDLE_SOURCE_SHIFT 0
207
208#define SUPER_CLK_DIVIDER 0x04
209#define SUPER_CLOCK_DIV_U71_SHIFT 16
210#define SUPER_CLOCK_DIV_U71_MASK (0xff << SUPER_CLOCK_DIV_U71_SHIFT)
211/* guarantees safe cpu backup */
212#define SUPER_CLOCK_DIV_U71_MIN 0x2
213
214#define BUS_CLK_DISABLE (1<<3)
215#define BUS_CLK_DIV_MASK 0x3
216
217#define PMC_CTRL 0x0
218 #define PMC_CTRL_BLINK_ENB (1 << 7)
219
220#define PMC_DPD_PADS_ORIDE 0x1c
221 #define PMC_DPD_PADS_ORIDE_BLINK_ENB (1 << 20)
222
223#define PMC_BLINK_TIMER_DATA_ON_SHIFT 0
224#define PMC_BLINK_TIMER_DATA_ON_MASK 0x7fff
225#define PMC_BLINK_TIMER_ENB (1 << 15)
226#define PMC_BLINK_TIMER_DATA_OFF_SHIFT 16
227#define PMC_BLINK_TIMER_DATA_OFF_MASK 0xffff
228
229#define PMC_PLLP_WB0_OVERRIDE 0xf8
230#define PMC_PLLP_WB0_OVERRIDE_PLLM_ENABLE (1 << 12)
231
232#define UTMIP_PLL_CFG2 0x488
233#define UTMIP_PLL_CFG2_STABLE_COUNT(x) (((x) & 0xfff) << 6)
234#define UTMIP_PLL_CFG2_ACTIVE_DLY_COUNT(x) (((x) & 0x3f) << 18)
235#define UTMIP_PLL_CFG2_FORCE_PD_SAMP_A_POWERDOWN (1 << 0)
236#define UTMIP_PLL_CFG2_FORCE_PD_SAMP_B_POWERDOWN (1 << 2)
237#define UTMIP_PLL_CFG2_FORCE_PD_SAMP_C_POWERDOWN (1 << 4)
238
239#define UTMIP_PLL_CFG1 0x484
240#define UTMIP_PLL_CFG1_ENABLE_DLY_COUNT(x) (((x) & 0x1f) << 27)
241#define UTMIP_PLL_CFG1_XTAL_FREQ_COUNT(x) (((x) & 0xfff) << 0)
242#define UTMIP_PLL_CFG1_FORCE_PLL_ENABLE_POWERDOWN (1 << 14)
243#define UTMIP_PLL_CFG1_FORCE_PLL_ACTIVE_POWERDOWN (1 << 12)
244#define UTMIP_PLL_CFG1_FORCE_PLLU_POWERDOWN (1 << 16)
245
246#define PLLE_BASE_CML_ENABLE (1<<31)
247#define PLLE_BASE_ENABLE (1<<30)
248#define PLLE_BASE_DIVCML_SHIFT 24
249#define PLLE_BASE_DIVCML_MASK (0xf<<PLLE_BASE_DIVCML_SHIFT)
250#define PLLE_BASE_DIVP_SHIFT 16
251#define PLLE_BASE_DIVP_MASK (0x3f<<PLLE_BASE_DIVP_SHIFT)
252#define PLLE_BASE_DIVN_SHIFT 8
253#define PLLE_BASE_DIVN_MASK (0xFF<<PLLE_BASE_DIVN_SHIFT)
254#define PLLE_BASE_DIVM_SHIFT 0
255#define PLLE_BASE_DIVM_MASK (0xFF<<PLLE_BASE_DIVM_SHIFT)
256#define PLLE_BASE_DIV_MASK \
257 (PLLE_BASE_DIVCML_MASK | PLLE_BASE_DIVP_MASK | \
258 PLLE_BASE_DIVN_MASK | PLLE_BASE_DIVM_MASK)
259#define PLLE_BASE_DIV(m, n, p, cml) \
260 (((cml)<<PLLE_BASE_DIVCML_SHIFT) | ((p)<<PLLE_BASE_DIVP_SHIFT) | \
261 ((n)<<PLLE_BASE_DIVN_SHIFT) | ((m)<<PLLE_BASE_DIVM_SHIFT))
262
263#define PLLE_MISC_SETUP_BASE_SHIFT 16
264#define PLLE_MISC_SETUP_BASE_MASK (0xFFFF<<PLLE_MISC_SETUP_BASE_SHIFT)
265#define PLLE_MISC_READY (1<<15)
266#define PLLE_MISC_LOCK (1<<11)
267#define PLLE_MISC_LOCK_ENABLE (1<<9)
268#define PLLE_MISC_SETUP_EX_SHIFT 2
269#define PLLE_MISC_SETUP_EX_MASK (0x3<<PLLE_MISC_SETUP_EX_SHIFT)
270#define PLLE_MISC_SETUP_MASK \
271 (PLLE_MISC_SETUP_BASE_MASK | PLLE_MISC_SETUP_EX_MASK)
272#define PLLE_MISC_SETUP_VALUE \
273 ((0x7<<PLLE_MISC_SETUP_BASE_SHIFT) | (0x0<<PLLE_MISC_SETUP_EX_SHIFT))
274
275#define PLLE_SS_CTRL 0x68
276#define PLLE_SS_INCINTRV_SHIFT 24
277#define PLLE_SS_INCINTRV_MASK (0x3f<<PLLE_SS_INCINTRV_SHIFT)
278#define PLLE_SS_INC_SHIFT 16
279#define PLLE_SS_INC_MASK (0xff<<PLLE_SS_INC_SHIFT)
280#define PLLE_SS_MAX_SHIFT 0
281#define PLLE_SS_MAX_MASK (0x1ff<<PLLE_SS_MAX_SHIFT)
282#define PLLE_SS_COEFFICIENTS_MASK \
283 (PLLE_SS_INCINTRV_MASK | PLLE_SS_INC_MASK | PLLE_SS_MAX_MASK)
284#define PLLE_SS_COEFFICIENTS_12MHZ \
285 ((0x18<<PLLE_SS_INCINTRV_SHIFT) | (0x1<<PLLE_SS_INC_SHIFT) | \
286 (0x24<<PLLE_SS_MAX_SHIFT))
287#define PLLE_SS_DISABLE ((1<<12) | (1<<11) | (1<<10))
288
289#define PLLE_AUX 0x48c
290#define PLLE_AUX_PLLP_SEL (1<<2)
291#define PLLE_AUX_CML_SATA_ENABLE (1<<1)
292#define PLLE_AUX_CML_PCIE_ENABLE (1<<0)
293
294#define PMC_SATA_PWRGT 0x1ac
295#define PMC_SATA_PWRGT_PLLE_IDDQ_VALUE (1<<5)
296#define PMC_SATA_PWRGT_PLLE_IDDQ_SWCTL (1<<4)
297
298#define ROUND_DIVIDER_UP 0
299#define ROUND_DIVIDER_DOWN 1
300
301/* FIXME: recommended safety delay after lock is detected */
302#define PLL_POST_LOCK_DELAY 100
303
304/* Tegra CPU clock and reset control regs */
305#define TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX 0x4c
306#define TEGRA_CLK_RST_CONTROLLER_RST_CPU_CMPLX_SET 0x340
307#define TEGRA_CLK_RST_CONTROLLER_RST_CPU_CMPLX_CLR 0x344
308#define TEGRA30_CLK_RST_CONTROLLER_CLK_CPU_CMPLX_CLR 0x34c
309#define TEGRA30_CLK_RST_CONTROLLER_CPU_CMPLX_STATUS 0x470
310
311#define CPU_CLOCK(cpu) (0x1 << (8 + cpu))
312#define CPU_RESET(cpu) (0x1111ul << (cpu))
313
314#define CLK_RESET_CCLK_BURST 0x20
315#define CLK_RESET_CCLK_DIVIDER 0x24
316#define CLK_RESET_PLLX_BASE 0xe0
317#define CLK_RESET_PLLX_MISC 0xe4
318
319#define CLK_RESET_SOURCE_CSITE 0x1d4
320
321#define CLK_RESET_CCLK_BURST_POLICY_SHIFT 28
322#define CLK_RESET_CCLK_RUN_POLICY_SHIFT 4
323#define CLK_RESET_CCLK_IDLE_POLICY_SHIFT 0
324#define CLK_RESET_CCLK_IDLE_POLICY 1
325#define CLK_RESET_CCLK_RUN_POLICY 2
326#define CLK_RESET_CCLK_BURST_POLICY_PLLX 8
327
328#ifdef CONFIG_PM_SLEEP
329static struct cpu_clk_suspend_context {
330 u32 pllx_misc;
331 u32 pllx_base;
332
333 u32 cpu_burst;
334 u32 clk_csite_src;
335 u32 cclk_divider;
336} tegra30_cpu_clk_sctx;
337#endif
338
339/**
340* Structure defining the fields for USB UTMI clocks Parameters.
341*/
342struct utmi_clk_param {
343 /* Oscillator Frequency in KHz */
344 u32 osc_frequency;
345 /* UTMIP PLL Enable Delay Count */
346 u8 enable_delay_count;
347 /* UTMIP PLL Stable count */
348 u8 stable_count;
349 /* UTMIP PLL Active delay count */
350 u8 active_delay_count;
351 /* UTMIP PLL Xtal frequency count */
352 u8 xtal_freq_count;
353};
354
355static const struct utmi_clk_param utmi_parameters[] = {
356 {
357 .osc_frequency = 13000000,
358 .enable_delay_count = 0x02,
359 .stable_count = 0x33,
360 .active_delay_count = 0x05,
361 .xtal_freq_count = 0x7F
362 },
363 {
364 .osc_frequency = 19200000,
365 .enable_delay_count = 0x03,
366 .stable_count = 0x4B,
367 .active_delay_count = 0x06,
368 .xtal_freq_count = 0xBB},
369 {
370 .osc_frequency = 12000000,
371 .enable_delay_count = 0x02,
372 .stable_count = 0x2F,
373 .active_delay_count = 0x04,
374 .xtal_freq_count = 0x76
375 },
376 {
377 .osc_frequency = 26000000,
378 .enable_delay_count = 0x04,
379 .stable_count = 0x66,
380 .active_delay_count = 0x09,
381 .xtal_freq_count = 0xFE
382 },
383 {
384 .osc_frequency = 16800000,
385 .enable_delay_count = 0x03,
386 .stable_count = 0x41,
387 .active_delay_count = 0x0A,
388 .xtal_freq_count = 0xA4
389 },
390};
391
392static void __iomem *reg_clk_base = IO_ADDRESS(TEGRA_CLK_RESET_BASE);
393static void __iomem *reg_pmc_base = IO_ADDRESS(TEGRA_PMC_BASE);
394static void __iomem *misc_gp_hidrev_base = IO_ADDRESS(TEGRA_APB_MISC_BASE);
395
396#define MISC_GP_HIDREV 0x804
397
398/*
399 * Some peripheral clocks share an enable bit, so refcount the enable bits
400 * in registers CLK_ENABLE_L, ... CLK_ENABLE_W
401 */
402static int tegra_periph_clk_enable_refcount[CLK_OUT_ENB_NUM * 32];
403
404#define clk_writel(value, reg) \
405 __raw_writel(value, reg_clk_base + (reg))
406#define clk_readl(reg) \
407 __raw_readl(reg_clk_base + (reg))
408#define pmc_writel(value, reg) \
409 __raw_writel(value, reg_pmc_base + (reg))
410#define pmc_readl(reg) \
411 __raw_readl(reg_pmc_base + (reg))
412#define chipid_readl() \
413 __raw_readl(misc_gp_hidrev_base + MISC_GP_HIDREV)
414
415#define clk_writel_delay(value, reg) \
416 do { \
417 __raw_writel((value), reg_clk_base + (reg)); \
418 udelay(2); \
419 } while (0)
420
421static inline int clk_set_div(struct clk_tegra *c, u32 n)
422{
423 struct clk *clk = c->hw.clk;
424
425 return clk_set_rate(clk,
426 (__clk_get_rate(__clk_get_parent(clk)) + n - 1) / n);
427}
428
429static inline u32 periph_clk_to_reg(
430 struct clk_tegra *c, u32 reg_L, u32 reg_V, int offs)
431{
432 u32 reg = c->u.periph.clk_num / 32;
433 BUG_ON(reg >= RST_DEVICES_NUM);
434 if (reg < 3)
435 reg = reg_L + (reg * offs);
436 else
437 reg = reg_V + ((reg - 3) * offs);
438 return reg;
439}
440
441static unsigned long clk_measure_input_freq(void)
442{
443 u32 clock_autodetect;
444 clk_writel(OSC_FREQ_DET_TRIG | 1, OSC_FREQ_DET);
445 do {} while (clk_readl(OSC_FREQ_DET_STATUS) & OSC_FREQ_DET_BUSY);
446 clock_autodetect = clk_readl(OSC_FREQ_DET_STATUS);
447 if (clock_autodetect >= 732 - 3 && clock_autodetect <= 732 + 3) {
448 return 12000000;
449 } else if (clock_autodetect >= 794 - 3 && clock_autodetect <= 794 + 3) {
450 return 13000000;
451 } else if (clock_autodetect >= 1172 - 3 && clock_autodetect <= 1172 + 3) {
452 return 19200000;
453 } else if (clock_autodetect >= 1587 - 3 && clock_autodetect <= 1587 + 3) {
454 return 26000000;
455 } else if (clock_autodetect >= 1025 - 3 && clock_autodetect <= 1025 + 3) {
456 return 16800000;
457 } else if (clock_autodetect >= 2344 - 3 && clock_autodetect <= 2344 + 3) {
458 return 38400000;
459 } else if (clock_autodetect >= 2928 - 3 && clock_autodetect <= 2928 + 3) {
460 return 48000000;
461 } else {
462 pr_err("%s: Unexpected clock autodetect value %d", __func__,
463 clock_autodetect);
464 BUG();
465 return 0;
466 }
467}
468
469static int clk_div71_get_divider(unsigned long parent_rate, unsigned long rate,
470 u32 flags, u32 round_mode)
471{
472 s64 divider_u71 = parent_rate;
473 if (!rate)
474 return -EINVAL;
475
476 if (!(flags & DIV_U71_INT))
477 divider_u71 *= 2;
478 if (round_mode == ROUND_DIVIDER_UP)
479 divider_u71 += rate - 1;
480 do_div(divider_u71, rate);
481 if (flags & DIV_U71_INT)
482 divider_u71 *= 2;
483
484 if (divider_u71 - 2 < 0)
485 return 0;
486
487 if (divider_u71 - 2 > 255)
488 return -EINVAL;
489
490 return divider_u71 - 2;
491}
492
493static int clk_div16_get_divider(unsigned long parent_rate, unsigned long rate)
494{
495 s64 divider_u16;
496
497 divider_u16 = parent_rate;
498 if (!rate)
499 return -EINVAL;
500 divider_u16 += rate - 1;
501 do_div(divider_u16, rate);
502
503 if (divider_u16 - 1 < 0)
504 return 0;
505
506 if (divider_u16 - 1 > 0xFFFF)
507 return -EINVAL;
508
509 return divider_u16 - 1;
510}
511
512static unsigned long tegra30_clk_fixed_recalc_rate(struct clk_hw *hw,
513 unsigned long parent_rate)
514{
515 return to_clk_tegra(hw)->fixed_rate;
516}
517
518struct clk_ops tegra30_clk_32k_ops = {
519 .recalc_rate = tegra30_clk_fixed_recalc_rate,
520};
521
522/* clk_m functions */
523static unsigned long tegra30_clk_m_recalc_rate(struct clk_hw *hw,
524 unsigned long parent_rate)
525{
526 if (!to_clk_tegra(hw)->fixed_rate)
527 to_clk_tegra(hw)->fixed_rate = clk_measure_input_freq();
528 return to_clk_tegra(hw)->fixed_rate;
529}
530
531static void tegra30_clk_m_init(struct clk_hw *hw)
532{
533 u32 osc_ctrl = clk_readl(OSC_CTRL);
534 u32 auto_clock_control = osc_ctrl & ~OSC_CTRL_OSC_FREQ_MASK;
535 u32 pll_ref_div = osc_ctrl & OSC_CTRL_PLL_REF_DIV_MASK;
536
537 switch (to_clk_tegra(hw)->fixed_rate) {
538 case 12000000:
539 auto_clock_control |= OSC_CTRL_OSC_FREQ_12MHZ;
540 BUG_ON(pll_ref_div != OSC_CTRL_PLL_REF_DIV_1);
541 break;
542 case 13000000:
543 auto_clock_control |= OSC_CTRL_OSC_FREQ_13MHZ;
544 BUG_ON(pll_ref_div != OSC_CTRL_PLL_REF_DIV_1);
545 break;
546 case 19200000:
547 auto_clock_control |= OSC_CTRL_OSC_FREQ_19_2MHZ;
548 BUG_ON(pll_ref_div != OSC_CTRL_PLL_REF_DIV_1);
549 break;
550 case 26000000:
551 auto_clock_control |= OSC_CTRL_OSC_FREQ_26MHZ;
552 BUG_ON(pll_ref_div != OSC_CTRL_PLL_REF_DIV_1);
553 break;
554 case 16800000:
555 auto_clock_control |= OSC_CTRL_OSC_FREQ_16_8MHZ;
556 BUG_ON(pll_ref_div != OSC_CTRL_PLL_REF_DIV_1);
557 break;
558 case 38400000:
559 auto_clock_control |= OSC_CTRL_OSC_FREQ_38_4MHZ;
560 BUG_ON(pll_ref_div != OSC_CTRL_PLL_REF_DIV_2);
561 break;
562 case 48000000:
563 auto_clock_control |= OSC_CTRL_OSC_FREQ_48MHZ;
564 BUG_ON(pll_ref_div != OSC_CTRL_PLL_REF_DIV_4);
565 break;
566 default:
567 pr_err("%s: Unexpected clock rate %ld", __func__,
568 to_clk_tegra(hw)->fixed_rate);
569 BUG();
570 }
571 clk_writel(auto_clock_control, OSC_CTRL);
572}
573
574struct clk_ops tegra30_clk_m_ops = {
575 .init = tegra30_clk_m_init,
576 .recalc_rate = tegra30_clk_m_recalc_rate,
577};
578
579static unsigned long tegra30_clk_m_div_recalc_rate(struct clk_hw *hw,
580 unsigned long parent_rate)
581{
582 struct clk_tegra *c = to_clk_tegra(hw);
583 u64 rate = parent_rate;
584
585 if (c->mul != 0 && c->div != 0) {
586 rate *= c->mul;
587 rate += c->div - 1; /* round up */
588 do_div(rate, c->div);
589 }
590
591 return rate;
592}
593
594struct clk_ops tegra_clk_m_div_ops = {
595 .recalc_rate = tegra30_clk_m_div_recalc_rate,
596};
597
598/* PLL reference divider functions */
599static unsigned long tegra30_pll_ref_recalc_rate(struct clk_hw *hw,
600 unsigned long parent_rate)
601{
602 struct clk_tegra *c = to_clk_tegra(hw);
603 unsigned long rate = parent_rate;
604 u32 pll_ref_div = clk_readl(OSC_CTRL) & OSC_CTRL_PLL_REF_DIV_MASK;
605
606 switch (pll_ref_div) {
607 case OSC_CTRL_PLL_REF_DIV_1:
608 c->div = 1;
609 break;
610 case OSC_CTRL_PLL_REF_DIV_2:
611 c->div = 2;
612 break;
613 case OSC_CTRL_PLL_REF_DIV_4:
614 c->div = 4;
615 break;
616 default:
617 pr_err("%s: Invalid pll ref divider %d", __func__, pll_ref_div);
618 BUG();
619 }
620 c->mul = 1;
621
622 if (c->mul != 0 && c->div != 0) {
623 rate *= c->mul;
624 rate += c->div - 1; /* round up */
625 do_div(rate, c->div);
626 }
627
628 return rate;
629}
630
631struct clk_ops tegra_pll_ref_ops = {
632 .recalc_rate = tegra30_pll_ref_recalc_rate,
633};
634
635/* super clock functions */
636/* "super clocks" on tegra30 have two-stage muxes, fractional 7.1 divider and
637 * clock skipping super divider. We will ignore the clock skipping divider,
638 * since we can't lower the voltage when using the clock skip, but we can if
639 * we lower the PLL frequency. We will use 7.1 divider for CPU super-clock
640 * only when its parent is a fixed rate PLL, since we can't change PLL rate
641 * in this case.
642 */
643static void tegra30_super_clk_init(struct clk_hw *hw)
644{
645 struct clk_tegra *c = to_clk_tegra(hw);
646 struct clk_tegra *p =
647 to_clk_tegra(__clk_get_hw(__clk_get_parent(hw->clk)));
648
649 c->state = ON;
650 if (c->flags & DIV_U71) {
651 /* Init safe 7.1 divider value (does not affect PLLX path) */
652 clk_writel(SUPER_CLOCK_DIV_U71_MIN << SUPER_CLOCK_DIV_U71_SHIFT,
653 c->reg + SUPER_CLK_DIVIDER);
654 c->mul = 2;
655 c->div = 2;
656 if (!(p->flags & PLLX))
657 c->div += SUPER_CLOCK_DIV_U71_MIN;
658 } else
659 clk_writel(0, c->reg + SUPER_CLK_DIVIDER);
660}
661
662static u8 tegra30_super_clk_get_parent(struct clk_hw *hw)
663{
664 struct clk_tegra *c = to_clk_tegra(hw);
665 u32 val;
666 int source;
667 int shift;
668
669 val = clk_readl(c->reg + SUPER_CLK_MUX);
670 BUG_ON(((val & SUPER_STATE_MASK) != SUPER_STATE_RUN) &&
671 ((val & SUPER_STATE_MASK) != SUPER_STATE_IDLE));
672 shift = ((val & SUPER_STATE_MASK) == SUPER_STATE_IDLE) ?
673 SUPER_IDLE_SOURCE_SHIFT : SUPER_RUN_SOURCE_SHIFT;
674 source = (val >> shift) & SUPER_SOURCE_MASK;
675 if (c->flags & DIV_2)
676 source |= val & SUPER_LP_DIV2_BYPASS;
677
678 return source;
679}
680
681static int tegra30_super_clk_set_parent(struct clk_hw *hw, u8 index)
682{
683 struct clk_tegra *c = to_clk_tegra(hw);
684 struct clk_tegra *p =
685 to_clk_tegra(__clk_get_hw(clk_get_parent(hw->clk)));
686 u32 val;
687 int shift;
688
689 val = clk_readl(c->reg + SUPER_CLK_MUX);
690 BUG_ON(((val & SUPER_STATE_MASK) != SUPER_STATE_RUN) &&
691 ((val & SUPER_STATE_MASK) != SUPER_STATE_IDLE));
692 shift = ((val & SUPER_STATE_MASK) == SUPER_STATE_IDLE) ?
693 SUPER_IDLE_SOURCE_SHIFT : SUPER_RUN_SOURCE_SHIFT;
694
695 /* For LP mode super-clock switch between PLLX direct
696 and divided-by-2 outputs is allowed only when other
697 than PLLX clock source is current parent */
698 if ((c->flags & DIV_2) && (p->flags & PLLX) &&
699 ((index ^ val) & SUPER_LP_DIV2_BYPASS)) {
700 if (p->flags & PLLX)
701 return -EINVAL;
702 val ^= SUPER_LP_DIV2_BYPASS;
703 clk_writel_delay(val, c->reg);
704 }
705 val &= ~(SUPER_SOURCE_MASK << shift);
706 val |= (index & SUPER_SOURCE_MASK) << shift;
707
708 /* 7.1 divider for CPU super-clock does not affect
709 PLLX path */
710 if (c->flags & DIV_U71) {
711 u32 div = 0;
712 if (!(p->flags & PLLX)) {
713 div = clk_readl(c->reg +
714 SUPER_CLK_DIVIDER);
715 div &= SUPER_CLOCK_DIV_U71_MASK;
716 div >>= SUPER_CLOCK_DIV_U71_SHIFT;
717 }
718 c->div = div + 2;
719 c->mul = 2;
720 }
721 clk_writel_delay(val, c->reg);
722
723 return 0;
724}
725
726/*
727 * Do not use super clocks "skippers", since dividing using a clock skipper
728 * does not allow the voltage to be scaled down. Instead adjust the rate of
729 * the parent clock. This requires that the parent of a super clock have no
730 * other children, otherwise the rate will change underneath the other
731 * children. Special case: if fixed rate PLL is CPU super clock parent the
732 * rate of this PLL can't be changed, and it has many other children. In
733 * this case use 7.1 fractional divider to adjust the super clock rate.
734 */
735static int tegra30_super_clk_set_rate(struct clk_hw *hw, unsigned long rate,
736 unsigned long parent_rate)
737{
738 struct clk_tegra *c = to_clk_tegra(hw);
739 struct clk *parent = __clk_get_parent(hw->clk);
740 struct clk_tegra *cparent = to_clk_tegra(__clk_get_hw(parent));
741
742 if ((c->flags & DIV_U71) && (cparent->flags & PLL_FIXED)) {
743 int div = clk_div71_get_divider(parent_rate,
744 rate, c->flags, ROUND_DIVIDER_DOWN);
745 div = max(div, SUPER_CLOCK_DIV_U71_MIN);
746
747 clk_writel(div << SUPER_CLOCK_DIV_U71_SHIFT,
748 c->reg + SUPER_CLK_DIVIDER);
749 c->div = div + 2;
750 c->mul = 2;
751 return 0;
752 }
753 return 0;
754}
755
756static unsigned long tegra30_super_clk_recalc_rate(struct clk_hw *hw,
757 unsigned long parent_rate)
758{
759 struct clk_tegra *c = to_clk_tegra(hw);
760 u64 rate = parent_rate;
761
762 if (c->mul != 0 && c->div != 0) {
763 rate *= c->mul;
764 rate += c->div - 1; /* round up */
765 do_div(rate, c->div);
766 }
767
768 return rate;
769}
770
771static long tegra30_super_clk_round_rate(struct clk_hw *hw, unsigned long rate,
772 unsigned long *prate)
773{
774 struct clk_tegra *c = to_clk_tegra(hw);
775 struct clk *parent = __clk_get_parent(hw->clk);
776 struct clk_tegra *cparent = to_clk_tegra(__clk_get_hw(parent));
777 int mul = 2;
778 int div;
779
780 if ((c->flags & DIV_U71) && (cparent->flags & PLL_FIXED)) {
781 div = clk_div71_get_divider(*prate,
782 rate, c->flags, ROUND_DIVIDER_DOWN);
783 div = max(div, SUPER_CLOCK_DIV_U71_MIN) + 2;
784 rate = *prate * mul;
785 rate += div - 1; /* round up */
786 do_div(rate, c->div);
787
788 return rate;
789 }
790 return *prate;
791}
792
793struct clk_ops tegra30_super_ops = {
794 .init = tegra30_super_clk_init,
795 .set_parent = tegra30_super_clk_set_parent,
796 .get_parent = tegra30_super_clk_get_parent,
797 .recalc_rate = tegra30_super_clk_recalc_rate,
798 .round_rate = tegra30_super_clk_round_rate,
799 .set_rate = tegra30_super_clk_set_rate,
800};
801
802static unsigned long tegra30_twd_clk_recalc_rate(struct clk_hw *hw,
803 unsigned long parent_rate)
804{
805 struct clk_tegra *c = to_clk_tegra(hw);
806 u64 rate = parent_rate;
807
808 if (c->mul != 0 && c->div != 0) {
809 rate *= c->mul;
810 rate += c->div - 1; /* round up */
811 do_div(rate, c->div);
812 }
813
814 return rate;
815}
816
817struct clk_ops tegra30_twd_ops = {
818 .recalc_rate = tegra30_twd_clk_recalc_rate,
819};
820
821/* bus clock functions */
822static int tegra30_bus_clk_is_enabled(struct clk_hw *hw)
823{
824 struct clk_tegra *c = to_clk_tegra(hw);
825 u32 val = clk_readl(c->reg);
826
827 c->state = ((val >> c->reg_shift) & BUS_CLK_DISABLE) ? OFF : ON;
828 return c->state;
829}
830
831static int tegra30_bus_clk_enable(struct clk_hw *hw)
832{
833 struct clk_tegra *c = to_clk_tegra(hw);
834 u32 val;
835
836 val = clk_readl(c->reg);
837 val &= ~(BUS_CLK_DISABLE << c->reg_shift);
838 clk_writel(val, c->reg);
839
840 return 0;
841}
842
843static void tegra30_bus_clk_disable(struct clk_hw *hw)
844{
845 struct clk_tegra *c = to_clk_tegra(hw);
846 u32 val;
847
848 val = clk_readl(c->reg);
849 val |= BUS_CLK_DISABLE << c->reg_shift;
850 clk_writel(val, c->reg);
851}
852
853static unsigned long tegra30_bus_clk_recalc_rate(struct clk_hw *hw,
854 unsigned long prate)
855{
856 struct clk_tegra *c = to_clk_tegra(hw);
857 u32 val = clk_readl(c->reg);
858 u64 rate = prate;
859
860 c->div = ((val >> c->reg_shift) & BUS_CLK_DIV_MASK) + 1;
861 c->mul = 1;
862
863 if (c->mul != 0 && c->div != 0) {
864 rate *= c->mul;
865 rate += c->div - 1; /* round up */
866 do_div(rate, c->div);
867 }
868 return rate;
869}
870
871static int tegra30_bus_clk_set_rate(struct clk_hw *hw, unsigned long rate,
872 unsigned long parent_rate)
873{
874 struct clk_tegra *c = to_clk_tegra(hw);
875 int ret = -EINVAL;
876 u32 val;
877 int i;
878
879 val = clk_readl(c->reg);
880 for (i = 1; i <= 4; i++) {
881 if (rate == parent_rate / i) {
882 val &= ~(BUS_CLK_DIV_MASK << c->reg_shift);
883 val |= (i - 1) << c->reg_shift;
884 clk_writel(val, c->reg);
885 c->div = i;
886 c->mul = 1;
887 ret = 0;
888 break;
889 }
890 }
891
892 return ret;
893}
894
895static long tegra30_bus_clk_round_rate(struct clk_hw *hw, unsigned long rate,
896 unsigned long *prate)
897{
898 unsigned long parent_rate = *prate;
899 s64 divider;
900
901 if (rate >= parent_rate)
902 return parent_rate;
903
904 divider = parent_rate;
905 divider += rate - 1;
906 do_div(divider, rate);
907
908 if (divider < 0)
909 return divider;
910
911 if (divider > 4)
912 divider = 4;
913 do_div(parent_rate, divider);
914
915 return parent_rate;
916}
917
918struct clk_ops tegra30_bus_ops = {
919 .is_enabled = tegra30_bus_clk_is_enabled,
920 .enable = tegra30_bus_clk_enable,
921 .disable = tegra30_bus_clk_disable,
922 .set_rate = tegra30_bus_clk_set_rate,
923 .round_rate = tegra30_bus_clk_round_rate,
924 .recalc_rate = tegra30_bus_clk_recalc_rate,
925};
926
927/* Blink output functions */
928static int tegra30_blink_clk_is_enabled(struct clk_hw *hw)
929{
930 struct clk_tegra *c = to_clk_tegra(hw);
931 u32 val;
932
933 val = pmc_readl(PMC_CTRL);
934 c->state = (val & PMC_CTRL_BLINK_ENB) ? ON : OFF;
935 return c->state;
936}
937
938static int tegra30_blink_clk_enable(struct clk_hw *hw)
939{
940 u32 val;
941
942 val = pmc_readl(PMC_DPD_PADS_ORIDE);
943 pmc_writel(val | PMC_DPD_PADS_ORIDE_BLINK_ENB, PMC_DPD_PADS_ORIDE);
944
945 val = pmc_readl(PMC_CTRL);
946 pmc_writel(val | PMC_CTRL_BLINK_ENB, PMC_CTRL);
947
948 return 0;
949}
950
951static void tegra30_blink_clk_disable(struct clk_hw *hw)
952{
953 u32 val;
954
955 val = pmc_readl(PMC_CTRL);
956 pmc_writel(val & ~PMC_CTRL_BLINK_ENB, PMC_CTRL);
957
958 val = pmc_readl(PMC_DPD_PADS_ORIDE);
959 pmc_writel(val & ~PMC_DPD_PADS_ORIDE_BLINK_ENB, PMC_DPD_PADS_ORIDE);
960}
961
962static int tegra30_blink_clk_set_rate(struct clk_hw *hw, unsigned long rate,
963 unsigned long parent_rate)
964{
965 struct clk_tegra *c = to_clk_tegra(hw);
966
967 if (rate >= parent_rate) {
968 c->div = 1;
969 pmc_writel(0, c->reg);
970 } else {
971 unsigned int on_off;
972 u32 val;
973
974 on_off = DIV_ROUND_UP(parent_rate / 8, rate);
975 c->div = on_off * 8;
976
977 val = (on_off & PMC_BLINK_TIMER_DATA_ON_MASK) <<
978 PMC_BLINK_TIMER_DATA_ON_SHIFT;
979 on_off &= PMC_BLINK_TIMER_DATA_OFF_MASK;
980 on_off <<= PMC_BLINK_TIMER_DATA_OFF_SHIFT;
981 val |= on_off;
982 val |= PMC_BLINK_TIMER_ENB;
983 pmc_writel(val, c->reg);
984 }
985
986 return 0;
987}
988
989static unsigned long tegra30_blink_clk_recalc_rate(struct clk_hw *hw,
990 unsigned long parent_rate)
991{
992 struct clk_tegra *c = to_clk_tegra(hw);
993 u64 rate = parent_rate;
994 u32 val;
995 u32 mul;
996 u32 div;
997 u32 on_off;
998
999 mul = 1;
1000 val = pmc_readl(c->reg);
1001
1002 if (val & PMC_BLINK_TIMER_ENB) {
1003 on_off = (val >> PMC_BLINK_TIMER_DATA_ON_SHIFT) &
1004 PMC_BLINK_TIMER_DATA_ON_MASK;
1005 val >>= PMC_BLINK_TIMER_DATA_OFF_SHIFT;
1006 val &= PMC_BLINK_TIMER_DATA_OFF_MASK;
1007 on_off += val;
1008 /* each tick in the blink timer is 4 32KHz clocks */
1009 div = on_off * 4;
1010 } else {
1011 div = 1;
1012 }
1013
1014 if (mul != 0 && div != 0) {
1015 rate *= mul;
1016 rate += div - 1; /* round up */
1017 do_div(rate, div);
1018 }
1019 return rate;
1020}
1021
1022static long tegra30_blink_clk_round_rate(struct clk_hw *hw, unsigned long rate,
1023 unsigned long *prate)
1024{
1025 int div;
1026 int mul;
1027 long round_rate = *prate;
1028
1029 mul = 1;
1030
1031 if (rate >= *prate) {
1032 div = 1;
1033 } else {
1034 div = DIV_ROUND_UP(*prate / 8, rate);
1035 div *= 8;
1036 }
1037
1038 round_rate *= mul;
1039 round_rate += div - 1;
1040 do_div(round_rate, div);
1041
1042 return round_rate;
1043}
1044
1045struct clk_ops tegra30_blink_clk_ops = {
1046 .is_enabled = tegra30_blink_clk_is_enabled,
1047 .enable = tegra30_blink_clk_enable,
1048 .disable = tegra30_blink_clk_disable,
1049 .recalc_rate = tegra30_blink_clk_recalc_rate,
1050 .round_rate = tegra30_blink_clk_round_rate,
1051 .set_rate = tegra30_blink_clk_set_rate,
1052};
1053
1054static void tegra30_utmi_param_configure(struct clk_hw *hw)
1055{
1056 unsigned long main_rate =
1057 __clk_get_rate(__clk_get_parent(__clk_get_parent(hw->clk)));
1058 u32 reg;
1059 int i;
1060
1061 for (i = 0; i < ARRAY_SIZE(utmi_parameters); i++) {
1062 if (main_rate == utmi_parameters[i].osc_frequency)
1063 break;
1064 }
1065
1066 if (i >= ARRAY_SIZE(utmi_parameters)) {
1067 pr_err("%s: Unexpected main rate %lu\n", __func__, main_rate);
1068 return;
1069 }
1070
1071 reg = clk_readl(UTMIP_PLL_CFG2);
1072
1073 /* Program UTMIP PLL stable and active counts */
1074 /* [FIXME] arclk_rst.h says WRONG! This should be 1ms -> 0x50 Check! */
1075 reg &= ~UTMIP_PLL_CFG2_STABLE_COUNT(~0);
1076 reg |= UTMIP_PLL_CFG2_STABLE_COUNT(
1077 utmi_parameters[i].stable_count);
1078
1079 reg &= ~UTMIP_PLL_CFG2_ACTIVE_DLY_COUNT(~0);
1080
1081 reg |= UTMIP_PLL_CFG2_ACTIVE_DLY_COUNT(
1082 utmi_parameters[i].active_delay_count);
1083
1084 /* Remove power downs from UTMIP PLL control bits */
1085 reg &= ~UTMIP_PLL_CFG2_FORCE_PD_SAMP_A_POWERDOWN;
1086 reg &= ~UTMIP_PLL_CFG2_FORCE_PD_SAMP_B_POWERDOWN;
1087 reg &= ~UTMIP_PLL_CFG2_FORCE_PD_SAMP_C_POWERDOWN;
1088
1089 clk_writel(reg, UTMIP_PLL_CFG2);
1090
1091 /* Program UTMIP PLL delay and oscillator frequency counts */
1092 reg = clk_readl(UTMIP_PLL_CFG1);
1093 reg &= ~UTMIP_PLL_CFG1_ENABLE_DLY_COUNT(~0);
1094
1095 reg |= UTMIP_PLL_CFG1_ENABLE_DLY_COUNT(
1096 utmi_parameters[i].enable_delay_count);
1097
1098 reg &= ~UTMIP_PLL_CFG1_XTAL_FREQ_COUNT(~0);
1099 reg |= UTMIP_PLL_CFG1_XTAL_FREQ_COUNT(
1100 utmi_parameters[i].xtal_freq_count);
1101
1102 /* Remove power downs from UTMIP PLL control bits */
1103 reg &= ~UTMIP_PLL_CFG1_FORCE_PLL_ENABLE_POWERDOWN;
1104 reg &= ~UTMIP_PLL_CFG1_FORCE_PLL_ACTIVE_POWERDOWN;
1105 reg &= ~UTMIP_PLL_CFG1_FORCE_PLLU_POWERDOWN;
1106
1107 clk_writel(reg, UTMIP_PLL_CFG1);
1108}
1109
1110/* PLL Functions */
1111static int tegra30_pll_clk_wait_for_lock(struct clk_tegra *c, u32 lock_reg,
1112 u32 lock_bit)
1113{
1114 int ret = 0;
1115
1116#if USE_PLL_LOCK_BITS
1117 int i;
1118 for (i = 0; i < c->u.pll.lock_delay; i++) {
1119 if (clk_readl(lock_reg) & lock_bit) {
1120 udelay(PLL_POST_LOCK_DELAY);
1121 return 0;
1122 }
1123 udelay(2); /* timeout = 2 * lock time */
1124 }
1125 pr_err("Timed out waiting for lock bit on pll %s",
1126 __clk_get_name(hw->clk));
1127 ret = -1;
1128#else
1129 udelay(c->u.pll.lock_delay);
1130#endif
1131 return ret;
1132}
1133
1134static int tegra30_pll_clk_is_enabled(struct clk_hw *hw)
1135{
1136 struct clk_tegra *c = to_clk_tegra(hw);
1137 u32 val = clk_readl(c->reg + PLL_BASE);
1138
1139 c->state = (val & PLL_BASE_ENABLE) ? ON : OFF;
1140 return c->state;
1141}
1142
1143static void tegra30_pll_clk_init(struct clk_hw *hw)
1144{
1145 struct clk_tegra *c = to_clk_tegra(hw);
1146
1147 if (c->flags & PLLU)
1148 tegra30_utmi_param_configure(hw);
1149}
1150
1151static int tegra30_pll_clk_enable(struct clk_hw *hw)
1152{
1153 struct clk_tegra *c = to_clk_tegra(hw);
1154 u32 val;
1155 pr_debug("%s on clock %s\n", __func__, __clk_get_name(hw->clk));
1156
1157#if USE_PLL_LOCK_BITS
1158 val = clk_readl(c->reg + PLL_MISC(c));
1159 val |= PLL_MISC_LOCK_ENABLE(c);
1160 clk_writel(val, c->reg + PLL_MISC(c));
1161#endif
1162 val = clk_readl(c->reg + PLL_BASE);
1163 val &= ~PLL_BASE_BYPASS;
1164 val |= PLL_BASE_ENABLE;
1165 clk_writel(val, c->reg + PLL_BASE);
1166
1167 if (c->flags & PLLM) {
1168 val = pmc_readl(PMC_PLLP_WB0_OVERRIDE);
1169 val |= PMC_PLLP_WB0_OVERRIDE_PLLM_ENABLE;
1170 pmc_writel(val, PMC_PLLP_WB0_OVERRIDE);
1171 }
1172
1173 tegra30_pll_clk_wait_for_lock(c, c->reg + PLL_BASE, PLL_BASE_LOCK);
1174
1175 return 0;
1176}
1177
1178static void tegra30_pll_clk_disable(struct clk_hw *hw)
1179{
1180 struct clk_tegra *c = to_clk_tegra(hw);
1181 u32 val;
1182 pr_debug("%s on clock %s\n", __func__, __clk_get_name(hw->clk));
1183
1184 val = clk_readl(c->reg);
1185 val &= ~(PLL_BASE_BYPASS | PLL_BASE_ENABLE);
1186 clk_writel(val, c->reg);
1187
1188 if (c->flags & PLLM) {
1189 val = pmc_readl(PMC_PLLP_WB0_OVERRIDE);
1190 val &= ~PMC_PLLP_WB0_OVERRIDE_PLLM_ENABLE;
1191 pmc_writel(val, PMC_PLLP_WB0_OVERRIDE);
1192 }
1193}
1194
1195static int tegra30_pll_clk_set_rate(struct clk_hw *hw, unsigned long rate,
1196 unsigned long parent_rate)
1197{
1198 struct clk_tegra *c = to_clk_tegra(hw);
1199 u32 val, p_div, old_base;
1200 unsigned long input_rate;
1201 const struct clk_pll_freq_table *sel;
1202 struct clk_pll_freq_table cfg;
1203
1204 if (c->flags & PLL_FIXED) {
1205 int ret = 0;
1206 if (rate != c->u.pll.fixed_rate) {
1207 pr_err("%s: Can not change %s fixed rate %lu to %lu\n",
1208 __func__, __clk_get_name(hw->clk),
1209 c->u.pll.fixed_rate, rate);
1210 ret = -EINVAL;
1211 }
1212 return ret;
1213 }
1214
1215 if (c->flags & PLLM) {
1216 if (rate != __clk_get_rate(hw->clk)) {
1217 pr_err("%s: Can not change memory %s rate in flight\n",
1218 __func__, __clk_get_name(hw->clk));
1219 return -EINVAL;
1220 }
1221 }
1222
1223 p_div = 0;
1224 input_rate = parent_rate;
1225
1226 /* Check if the target rate is tabulated */
1227 for (sel = c->u.pll.freq_table; sel->input_rate != 0; sel++) {
1228 if (sel->input_rate == input_rate && sel->output_rate == rate) {
1229 if (c->flags & PLLU) {
1230 BUG_ON(sel->p < 1 || sel->p > 2);
1231 if (sel->p == 1)
1232 p_div = PLLU_BASE_POST_DIV;
1233 } else {
1234 BUG_ON(sel->p < 1);
1235 for (val = sel->p; val > 1; val >>= 1)
1236 p_div++;
1237 p_div <<= PLL_BASE_DIVP_SHIFT;
1238 }
1239 break;
1240 }
1241 }
1242
1243 /* Configure out-of-table rate */
1244 if (sel->input_rate == 0) {
1245 unsigned long cfreq;
1246 BUG_ON(c->flags & PLLU);
1247 sel = &cfg;
1248
1249 switch (input_rate) {
1250 case 12000000:
1251 case 26000000:
1252 cfreq = (rate <= 1000000 * 1000) ? 1000000 : 2000000;
1253 break;
1254 case 13000000:
1255 cfreq = (rate <= 1000000 * 1000) ? 1000000 : 2600000;
1256 break;
1257 case 16800000:
1258 case 19200000:
1259 cfreq = (rate <= 1200000 * 1000) ? 1200000 : 2400000;
1260 break;
1261 default:
1262 pr_err("%s: Unexpected reference rate %lu\n",
1263 __func__, input_rate);
1264 BUG();
1265 }
1266
1267 /* Raise VCO to guarantee 0.5% accuracy */
1268 for (cfg.output_rate = rate; cfg.output_rate < 200 * cfreq;
1269 cfg.output_rate <<= 1)
1270 p_div++;
1271
1272 cfg.p = 0x1 << p_div;
1273 cfg.m = input_rate / cfreq;
1274 cfg.n = cfg.output_rate / cfreq;
1275 cfg.cpcon = OUT_OF_TABLE_CPCON;
1276
1277 if ((cfg.m > (PLL_BASE_DIVM_MASK >> PLL_BASE_DIVM_SHIFT)) ||
1278 (cfg.n > (PLL_BASE_DIVN_MASK >> PLL_BASE_DIVN_SHIFT)) ||
1279 (p_div > (PLL_BASE_DIVP_MASK >> PLL_BASE_DIVP_SHIFT)) ||
1280 (cfg.output_rate > c->u.pll.vco_max)) {
1281 pr_err("%s: Failed to set %s out-of-table rate %lu\n",
1282 __func__, __clk_get_name(hw->clk), rate);
1283 return -EINVAL;
1284 }
1285 p_div <<= PLL_BASE_DIVP_SHIFT;
1286 }
1287
1288 c->mul = sel->n;
1289 c->div = sel->m * sel->p;
1290
1291 old_base = val = clk_readl(c->reg + PLL_BASE);
1292 val &= ~(PLL_BASE_DIVM_MASK | PLL_BASE_DIVN_MASK |
1293 ((c->flags & PLLU) ? PLLU_BASE_POST_DIV : PLL_BASE_DIVP_MASK));
1294 val |= (sel->m << PLL_BASE_DIVM_SHIFT) |
1295 (sel->n << PLL_BASE_DIVN_SHIFT) | p_div;
1296 if (val == old_base)
1297 return 0;
1298
1299 if (c->state == ON) {
1300 tegra30_pll_clk_disable(hw);
1301 val &= ~(PLL_BASE_BYPASS | PLL_BASE_ENABLE);
1302 }
1303 clk_writel(val, c->reg + PLL_BASE);
1304
1305 if (c->flags & PLL_HAS_CPCON) {
1306 val = clk_readl(c->reg + PLL_MISC(c));
1307 val &= ~PLL_MISC_CPCON_MASK;
1308 val |= sel->cpcon << PLL_MISC_CPCON_SHIFT;
1309 if (c->flags & (PLLU | PLLD)) {
1310 val &= ~PLL_MISC_LFCON_MASK;
1311 if (sel->n >= PLLDU_LFCON_SET_DIVN)
1312 val |= 0x1 << PLL_MISC_LFCON_SHIFT;
1313 } else if (c->flags & (PLLX | PLLM)) {
1314 val &= ~(0x1 << PLL_MISC_DCCON_SHIFT);
1315 if (rate >= (c->u.pll.vco_max >> 1))
1316 val |= 0x1 << PLL_MISC_DCCON_SHIFT;
1317 }
1318 clk_writel(val, c->reg + PLL_MISC(c));
1319 }
1320
1321 if (c->state == ON)
1322 tegra30_pll_clk_enable(hw);
1323
1324 c->u.pll.fixed_rate = rate;
1325
1326 return 0;
1327}
1328
1329static long tegra30_pll_round_rate(struct clk_hw *hw, unsigned long rate,
1330 unsigned long *prate)
1331{
1332 struct clk_tegra *c = to_clk_tegra(hw);
1333 unsigned long input_rate = *prate;
1334 u64 output_rate = *prate;
1335 const struct clk_pll_freq_table *sel;
1336 struct clk_pll_freq_table cfg;
1337 int mul;
1338 int div;
1339 u32 p_div;
1340 u32 val;
1341
1342 if (c->flags & PLL_FIXED)
1343 return c->u.pll.fixed_rate;
1344
1345 if (c->flags & PLLM)
1346 return __clk_get_rate(hw->clk);
1347
1348 p_div = 0;
1349 /* Check if the target rate is tabulated */
1350 for (sel = c->u.pll.freq_table; sel->input_rate != 0; sel++) {
1351 if (sel->input_rate == input_rate && sel->output_rate == rate) {
1352 if (c->flags & PLLU) {
1353 BUG_ON(sel->p < 1 || sel->p > 2);
1354 if (sel->p == 1)
1355 p_div = PLLU_BASE_POST_DIV;
1356 } else {
1357 BUG_ON(sel->p < 1);
1358 for (val = sel->p; val > 1; val >>= 1)
1359 p_div++;
1360 p_div <<= PLL_BASE_DIVP_SHIFT;
1361 }
1362 break;
1363 }
1364 }
1365
1366 if (sel->input_rate == 0) {
1367 unsigned long cfreq;
1368 BUG_ON(c->flags & PLLU);
1369 sel = &cfg;
1370
1371 switch (input_rate) {
1372 case 12000000:
1373 case 26000000:
1374 cfreq = (rate <= 1000000 * 1000) ? 1000000 : 2000000;
1375 break;
1376 case 13000000:
1377 cfreq = (rate <= 1000000 * 1000) ? 1000000 : 2600000;
1378 break;
1379 case 16800000:
1380 case 19200000:
1381 cfreq = (rate <= 1200000 * 1000) ? 1200000 : 2400000;
1382 break;
1383 default:
1384 pr_err("%s: Unexpected reference rate %lu\n",
1385 __func__, input_rate);
1386 BUG();
1387 }
1388
1389 /* Raise VCO to guarantee 0.5% accuracy */
1390 for (cfg.output_rate = rate; cfg.output_rate < 200 * cfreq;
1391 cfg.output_rate <<= 1)
1392 p_div++;
1393
1394 cfg.p = 0x1 << p_div;
1395 cfg.m = input_rate / cfreq;
1396 cfg.n = cfg.output_rate / cfreq;
1397 }
1398
1399 mul = sel->n;
1400 div = sel->m * sel->p;
1401
1402 output_rate *= mul;
1403 output_rate += div - 1; /* round up */
1404 do_div(output_rate, div);
1405
1406 return output_rate;
1407}
1408
1409static unsigned long tegra30_pll_recalc_rate(struct clk_hw *hw,
1410 unsigned long parent_rate)
1411{
1412 struct clk_tegra *c = to_clk_tegra(hw);
1413 u64 rate = parent_rate;
1414 u32 val = clk_readl(c->reg + PLL_BASE);
1415
1416 if (c->flags & PLL_FIXED && !(val & PLL_BASE_OVERRIDE)) {
1417 const struct clk_pll_freq_table *sel;
1418 for (sel = c->u.pll.freq_table; sel->input_rate != 0; sel++) {
1419 if (sel->input_rate == parent_rate &&
1420 sel->output_rate == c->u.pll.fixed_rate) {
1421 c->mul = sel->n;
1422 c->div = sel->m * sel->p;
1423 break;
1424 }
1425 }
1426 pr_err("Clock %s has unknown fixed frequency\n",
1427 __clk_get_name(hw->clk));
1428 BUG();
1429 } else if (val & PLL_BASE_BYPASS) {
1430 c->mul = 1;
1431 c->div = 1;
1432 } else {
1433 c->mul = (val & PLL_BASE_DIVN_MASK) >> PLL_BASE_DIVN_SHIFT;
1434 c->div = (val & PLL_BASE_DIVM_MASK) >> PLL_BASE_DIVM_SHIFT;
1435 if (c->flags & PLLU)
1436 c->div *= (val & PLLU_BASE_POST_DIV) ? 1 : 2;
1437 else
1438 c->div *= (0x1 << ((val & PLL_BASE_DIVP_MASK) >>
1439 PLL_BASE_DIVP_SHIFT));
1440 }
1441
1442 if (c->mul != 0 && c->div != 0) {
1443 rate *= c->mul;
1444 rate += c->div - 1; /* round up */
1445 do_div(rate, c->div);
1446 }
1447
1448 return rate;
1449}
1450
1451struct clk_ops tegra30_pll_ops = {
1452 .is_enabled = tegra30_pll_clk_is_enabled,
1453 .init = tegra30_pll_clk_init,
1454 .enable = tegra30_pll_clk_enable,
1455 .disable = tegra30_pll_clk_disable,
1456 .recalc_rate = tegra30_pll_recalc_rate,
1457 .round_rate = tegra30_pll_round_rate,
1458 .set_rate = tegra30_pll_clk_set_rate,
1459};
1460
1461int tegra30_plld_clk_cfg_ex(struct clk_hw *hw,
1462 enum tegra_clk_ex_param p, u32 setting)
1463{
1464 struct clk_tegra *c = to_clk_tegra(hw);
1465 u32 val, mask, reg;
1466
1467 switch (p) {
1468 case TEGRA_CLK_PLLD_CSI_OUT_ENB:
1469 mask = PLLD_BASE_CSI_CLKENABLE;
1470 reg = c->reg + PLL_BASE;
1471 break;
1472 case TEGRA_CLK_PLLD_DSI_OUT_ENB:
1473 mask = PLLD_MISC_DSI_CLKENABLE;
1474 reg = c->reg + PLL_MISC(c);
1475 break;
1476 case TEGRA_CLK_PLLD_MIPI_MUX_SEL:
1477 if (!(c->flags & PLL_ALT_MISC_REG)) {
1478 mask = PLLD_BASE_DSIB_MUX_MASK;
1479 reg = c->reg + PLL_BASE;
1480 break;
1481 }
1482 /* fall through - error since PLLD2 does not have MUX_SEL control */
1483 default:
1484 return -EINVAL;
1485 }
1486
1487 val = clk_readl(reg);
1488 if (setting)
1489 val |= mask;
1490 else
1491 val &= ~mask;
1492 clk_writel(val, reg);
1493 return 0;
1494}
1495
1496static int tegra30_plle_clk_is_enabled(struct clk_hw *hw)
1497{
1498 struct clk_tegra *c = to_clk_tegra(hw);
1499 u32 val;
1500
1501 val = clk_readl(c->reg + PLL_BASE);
1502 c->state = (val & PLLE_BASE_ENABLE) ? ON : OFF;
1503 return c->state;
1504}
1505
1506static void tegra30_plle_clk_disable(struct clk_hw *hw)
1507{
1508 struct clk_tegra *c = to_clk_tegra(hw);
1509 u32 val;
1510
1511 val = clk_readl(c->reg + PLL_BASE);
1512 val &= ~(PLLE_BASE_CML_ENABLE | PLLE_BASE_ENABLE);
1513 clk_writel(val, c->reg + PLL_BASE);
1514}
1515
1516static void tegra30_plle_training(struct clk_tegra *c)
1517{
1518 u32 val;
1519
1520 /* PLLE is already disabled, and setup cleared;
1521 * create falling edge on PLLE IDDQ input */
1522 val = pmc_readl(PMC_SATA_PWRGT);
1523 val |= PMC_SATA_PWRGT_PLLE_IDDQ_VALUE;
1524 pmc_writel(val, PMC_SATA_PWRGT);
1525
1526 val = pmc_readl(PMC_SATA_PWRGT);
1527 val |= PMC_SATA_PWRGT_PLLE_IDDQ_SWCTL;
1528 pmc_writel(val, PMC_SATA_PWRGT);
1529
1530 val = pmc_readl(PMC_SATA_PWRGT);
1531 val &= ~PMC_SATA_PWRGT_PLLE_IDDQ_VALUE;
1532 pmc_writel(val, PMC_SATA_PWRGT);
1533
1534 do {
1535 val = clk_readl(c->reg + PLL_MISC(c));
1536 } while (!(val & PLLE_MISC_READY));
1537}
1538
1539static int tegra30_plle_configure(struct clk_hw *hw, bool force_training)
1540{
1541 struct clk_tegra *c = to_clk_tegra(hw);
1542 struct clk *parent = __clk_get_parent(hw->clk);
1543 const struct clk_pll_freq_table *sel;
1544 u32 val;
1545
1546 unsigned long rate = c->u.pll.fixed_rate;
1547 unsigned long input_rate = __clk_get_rate(parent);
1548
1549 for (sel = c->u.pll.freq_table; sel->input_rate != 0; sel++) {
1550 if (sel->input_rate == input_rate && sel->output_rate == rate)
1551 break;
1552 }
1553
1554 if (sel->input_rate == 0)
1555 return -ENOSYS;
1556
1557 /* disable PLLE, clear setup fiels */
1558 tegra30_plle_clk_disable(hw);
1559
1560 val = clk_readl(c->reg + PLL_MISC(c));
1561 val &= ~(PLLE_MISC_LOCK_ENABLE | PLLE_MISC_SETUP_MASK);
1562 clk_writel(val, c->reg + PLL_MISC(c));
1563
1564 /* training */
1565 val = clk_readl(c->reg + PLL_MISC(c));
1566 if (force_training || (!(val & PLLE_MISC_READY)))
1567 tegra30_plle_training(c);
1568
1569 /* configure dividers, setup, disable SS */
1570 val = clk_readl(c->reg + PLL_BASE);
1571 val &= ~PLLE_BASE_DIV_MASK;
1572 val |= PLLE_BASE_DIV(sel->m, sel->n, sel->p, sel->cpcon);
1573 clk_writel(val, c->reg + PLL_BASE);
1574 c->mul = sel->n;
1575 c->div = sel->m * sel->p;
1576
1577 val = clk_readl(c->reg + PLL_MISC(c));
1578 val |= PLLE_MISC_SETUP_VALUE;
1579 val |= PLLE_MISC_LOCK_ENABLE;
1580 clk_writel(val, c->reg + PLL_MISC(c));
1581
1582 val = clk_readl(PLLE_SS_CTRL);
1583 val |= PLLE_SS_DISABLE;
1584 clk_writel(val, PLLE_SS_CTRL);
1585
1586 /* enable and lock PLLE*/
1587 val = clk_readl(c->reg + PLL_BASE);
1588 val |= (PLLE_BASE_CML_ENABLE | PLLE_BASE_ENABLE);
1589 clk_writel(val, c->reg + PLL_BASE);
1590
1591 tegra30_pll_clk_wait_for_lock(c, c->reg + PLL_MISC(c), PLLE_MISC_LOCK);
1592
1593 return 0;
1594}
1595
1596static int tegra30_plle_clk_enable(struct clk_hw *hw)
1597{
1598 struct clk_tegra *c = to_clk_tegra(hw);
1599
1600 return tegra30_plle_configure(hw, !c->set);
1601}
1602
1603static unsigned long tegra30_plle_clk_recalc_rate(struct clk_hw *hw,
1604 unsigned long parent_rate)
1605{
1606 struct clk_tegra *c = to_clk_tegra(hw);
1607 unsigned long rate = parent_rate;
1608 u32 val;
1609
1610 val = clk_readl(c->reg + PLL_BASE);
1611 c->mul = (val & PLLE_BASE_DIVN_MASK) >> PLLE_BASE_DIVN_SHIFT;
1612 c->div = (val & PLLE_BASE_DIVM_MASK) >> PLLE_BASE_DIVM_SHIFT;
1613 c->div *= (val & PLLE_BASE_DIVP_MASK) >> PLLE_BASE_DIVP_SHIFT;
1614
1615 if (c->mul != 0 && c->div != 0) {
1616 rate *= c->mul;
1617 rate += c->div - 1; /* round up */
1618 do_div(rate, c->div);
1619 }
1620 return rate;
1621}
1622
1623struct clk_ops tegra30_plle_ops = {
1624 .is_enabled = tegra30_plle_clk_is_enabled,
1625 .enable = tegra30_plle_clk_enable,
1626 .disable = tegra30_plle_clk_disable,
1627 .recalc_rate = tegra30_plle_clk_recalc_rate,
1628};
1629
1630/* Clock divider ops */
1631static int tegra30_pll_div_clk_is_enabled(struct clk_hw *hw)
1632{
1633 struct clk_tegra *c = to_clk_tegra(hw);
1634
1635 if (c->flags & DIV_U71) {
1636 u32 val = clk_readl(c->reg);
1637 val >>= c->reg_shift;
1638 c->state = (val & PLL_OUT_CLKEN) ? ON : OFF;
1639 if (!(val & PLL_OUT_RESET_DISABLE))
1640 c->state = OFF;
1641 } else {
1642 c->state = ON;
1643 }
1644 return c->state;
1645}
1646
1647static int tegra30_pll_div_clk_enable(struct clk_hw *hw)
1648{
1649 struct clk_tegra *c = to_clk_tegra(hw);
1650 u32 val;
1651 u32 new_val;
1652
1653 pr_debug("%s: %s\n", __func__, __clk_get_name(hw->clk));
1654 if (c->flags & DIV_U71) {
1655 val = clk_readl(c->reg);
1656 new_val = val >> c->reg_shift;
1657 new_val &= 0xFFFF;
1658
1659 new_val |= PLL_OUT_CLKEN | PLL_OUT_RESET_DISABLE;
1660
1661 val &= ~(0xFFFF << c->reg_shift);
1662 val |= new_val << c->reg_shift;
1663 clk_writel_delay(val, c->reg);
1664 return 0;
1665 } else if (c->flags & DIV_2) {
1666 return 0;
1667 }
1668 return -EINVAL;
1669}
1670
1671static void tegra30_pll_div_clk_disable(struct clk_hw *hw)
1672{
1673 struct clk_tegra *c = to_clk_tegra(hw);
1674 u32 val;
1675 u32 new_val;
1676
1677 pr_debug("%s: %s\n", __func__, __clk_get_name(hw->clk));
1678 if (c->flags & DIV_U71) {
1679 val = clk_readl(c->reg);
1680 new_val = val >> c->reg_shift;
1681 new_val &= 0xFFFF;
1682
1683 new_val &= ~(PLL_OUT_CLKEN | PLL_OUT_RESET_DISABLE);
1684
1685 val &= ~(0xFFFF << c->reg_shift);
1686 val |= new_val << c->reg_shift;
1687 clk_writel_delay(val, c->reg);
1688 }
1689}
1690
1691static int tegra30_pll_div_clk_set_rate(struct clk_hw *hw, unsigned long rate,
1692 unsigned long parent_rate)
1693{
1694 struct clk_tegra *c = to_clk_tegra(hw);
1695 u32 val;
1696 u32 new_val;
1697 int divider_u71;
1698
1699 if (c->flags & DIV_U71) {
1700 divider_u71 = clk_div71_get_divider(
1701 parent_rate, rate, c->flags, ROUND_DIVIDER_UP);
1702 if (divider_u71 >= 0) {
1703 val = clk_readl(c->reg);
1704 new_val = val >> c->reg_shift;
1705 new_val &= 0xFFFF;
1706 if (c->flags & DIV_U71_FIXED)
1707 new_val |= PLL_OUT_OVERRIDE;
1708 new_val &= ~PLL_OUT_RATIO_MASK;
1709 new_val |= divider_u71 << PLL_OUT_RATIO_SHIFT;
1710
1711 val &= ~(0xFFFF << c->reg_shift);
1712 val |= new_val << c->reg_shift;
1713 clk_writel_delay(val, c->reg);
1714 c->div = divider_u71 + 2;
1715 c->mul = 2;
1716 c->fixed_rate = rate;
1717 return 0;
1718 }
1719 } else if (c->flags & DIV_2) {
1720 c->fixed_rate = rate;
1721 return 0;
1722 }
1723
1724 return -EINVAL;
1725}
1726
1727static unsigned long tegra30_pll_div_clk_recalc_rate(struct clk_hw *hw,
1728 unsigned long parent_rate)
1729{
1730 struct clk_tegra *c = to_clk_tegra(hw);
1731 u64 rate = parent_rate;
1732
1733 if (c->flags & DIV_U71) {
1734 u32 divu71;
1735 u32 val = clk_readl(c->reg);
1736 val >>= c->reg_shift;
1737
1738 divu71 = (val & PLL_OUT_RATIO_MASK) >> PLL_OUT_RATIO_SHIFT;
1739 c->div = (divu71 + 2);
1740 c->mul = 2;
1741 } else if (c->flags & DIV_2) {
1742 if (c->flags & (PLLD | PLLX)) {
1743 c->div = 2;
1744 c->mul = 1;
1745 } else
1746 BUG();
1747 } else {
1748 c->div = 1;
1749 c->mul = 1;
1750 }
1751 if (c->mul != 0 && c->div != 0) {
1752 rate *= c->mul;
1753 rate += c->div - 1; /* round up */
1754 do_div(rate, c->div);
1755 }
1756
1757 return rate;
1758}
1759
1760static long tegra30_pll_div_clk_round_rate(struct clk_hw *hw,
1761 unsigned long rate, unsigned long *prate)
1762{
1763 struct clk_tegra *c = to_clk_tegra(hw);
1764 unsigned long parent_rate = __clk_get_rate(__clk_get_parent(hw->clk));
1765 int divider;
1766
1767 if (prate)
1768 parent_rate = *prate;
1769
1770 if (c->flags & DIV_U71) {
1771 divider = clk_div71_get_divider(
1772 parent_rate, rate, c->flags, ROUND_DIVIDER_UP);
1773 if (divider < 0)
1774 return divider;
1775 return DIV_ROUND_UP(parent_rate * 2, divider + 2);
1776 } else if (c->flags & DIV_2) {
1777 *prate = rate * 2;
1778 return rate;
1779 }
1780
1781 return -EINVAL;
1782}
1783
1784struct clk_ops tegra30_pll_div_ops = {
1785 .is_enabled = tegra30_pll_div_clk_is_enabled,
1786 .enable = tegra30_pll_div_clk_enable,
1787 .disable = tegra30_pll_div_clk_disable,
1788 .set_rate = tegra30_pll_div_clk_set_rate,
1789 .recalc_rate = tegra30_pll_div_clk_recalc_rate,
1790 .round_rate = tegra30_pll_div_clk_round_rate,
1791};
1792
1793/* Periph clk ops */
1794static inline u32 periph_clk_source_mask(struct clk_tegra *c)
1795{
1796 if (c->flags & MUX8)
1797 return 7 << 29;
1798 else if (c->flags & MUX_PWM)
1799 return 3 << 28;
1800 else if (c->flags & MUX_CLK_OUT)
1801 return 3 << (c->u.periph.clk_num + 4);
1802 else if (c->flags & PLLD)
1803 return PLLD_BASE_DSIB_MUX_MASK;
1804 else
1805 return 3 << 30;
1806}
1807
1808static inline u32 periph_clk_source_shift(struct clk_tegra *c)
1809{
1810 if (c->flags & MUX8)
1811 return 29;
1812 else if (c->flags & MUX_PWM)
1813 return 28;
1814 else if (c->flags & MUX_CLK_OUT)
1815 return c->u.periph.clk_num + 4;
1816 else if (c->flags & PLLD)
1817 return PLLD_BASE_DSIB_MUX_SHIFT;
1818 else
1819 return 30;
1820}
1821
1822static int tegra30_periph_clk_is_enabled(struct clk_hw *hw)
1823{
1824 struct clk_tegra *c = to_clk_tegra(hw);
1825
1826 c->state = ON;
1827 if (!(clk_readl(PERIPH_CLK_TO_ENB_REG(c)) & PERIPH_CLK_TO_BIT(c)))
1828 c->state = OFF;
1829 if (!(c->flags & PERIPH_NO_RESET))
1830 if (clk_readl(PERIPH_CLK_TO_RST_REG(c)) & PERIPH_CLK_TO_BIT(c))
1831 c->state = OFF;
1832 return c->state;
1833}
1834
1835static int tegra30_periph_clk_enable(struct clk_hw *hw)
1836{
1837 struct clk_tegra *c = to_clk_tegra(hw);
1838
1839 tegra_periph_clk_enable_refcount[c->u.periph.clk_num]++;
1840 if (tegra_periph_clk_enable_refcount[c->u.periph.clk_num] > 1)
1841 return 0;
1842
1843 clk_writel_delay(PERIPH_CLK_TO_BIT(c), PERIPH_CLK_TO_ENB_SET_REG(c));
1844 if (!(c->flags & PERIPH_NO_RESET) &&
1845 !(c->flags & PERIPH_MANUAL_RESET)) {
1846 if (clk_readl(PERIPH_CLK_TO_RST_REG(c)) &
1847 PERIPH_CLK_TO_BIT(c)) {
1848 udelay(5); /* reset propagation delay */
1849 clk_writel(PERIPH_CLK_TO_BIT(c),
1850 PERIPH_CLK_TO_RST_CLR_REG(c));
1851 }
1852 }
1853 return 0;
1854}
1855
1856static void tegra30_periph_clk_disable(struct clk_hw *hw)
1857{
1858 struct clk_tegra *c = to_clk_tegra(hw);
1859 unsigned long val;
1860
1861 tegra_periph_clk_enable_refcount[c->u.periph.clk_num]--;
1862
1863 if (tegra_periph_clk_enable_refcount[c->u.periph.clk_num] > 0)
1864 return;
1865
1866 /* If peripheral is in the APB bus then read the APB bus to
1867 * flush the write operation in apb bus. This will avoid the
1868 * peripheral access after disabling clock*/
1869 if (c->flags & PERIPH_ON_APB)
1870 val = chipid_readl();
1871
1872 clk_writel_delay(PERIPH_CLK_TO_BIT(c), PERIPH_CLK_TO_ENB_CLR_REG(c));
1873}
1874
1875void tegra30_periph_clk_reset(struct clk_hw *hw, bool assert)
1876{
1877 struct clk_tegra *c = to_clk_tegra(hw);
1878 unsigned long val;
1879
1880 if (!(c->flags & PERIPH_NO_RESET)) {
1881 if (assert) {
1882 /* If peripheral is in the APB bus then read the APB
1883 * bus to flush the write operation in apb bus. This
1884 * will avoid the peripheral access after disabling
1885 * clock */
1886 if (c->flags & PERIPH_ON_APB)
1887 val = chipid_readl();
1888
1889 clk_writel(PERIPH_CLK_TO_BIT(c),
1890 PERIPH_CLK_TO_RST_SET_REG(c));
1891 } else
1892 clk_writel(PERIPH_CLK_TO_BIT(c),
1893 PERIPH_CLK_TO_RST_CLR_REG(c));
1894 }
1895}
1896
1897static int tegra30_periph_clk_set_parent(struct clk_hw *hw, u8 index)
1898{
1899 struct clk_tegra *c = to_clk_tegra(hw);
1900 u32 val;
1901
1902 if (!(c->flags & MUX))
1903 return (index == 0) ? 0 : (-EINVAL);
1904
1905 val = clk_readl(c->reg);
1906 val &= ~periph_clk_source_mask(c);
1907 val |= (index << periph_clk_source_shift(c));
1908 clk_writel_delay(val, c->reg);
1909 return 0;
1910}
1911
1912static u8 tegra30_periph_clk_get_parent(struct clk_hw *hw)
1913{
1914 struct clk_tegra *c = to_clk_tegra(hw);
1915 u32 val = clk_readl(c->reg);
1916 int source = (val & periph_clk_source_mask(c)) >>
1917 periph_clk_source_shift(c);
1918
1919 if (!(c->flags & MUX))
1920 return 0;
1921
1922 return source;
1923}
1924
1925static int tegra30_periph_clk_set_rate(struct clk_hw *hw, unsigned long rate,
1926 unsigned long parent_rate)
1927{
1928 struct clk_tegra *c = to_clk_tegra(hw);
1929 u32 val;
1930 int divider;
1931
1932 if (c->flags & DIV_U71) {
1933 divider = clk_div71_get_divider(
1934 parent_rate, rate, c->flags, ROUND_DIVIDER_UP);
1935 if (divider >= 0) {
1936 val = clk_readl(c->reg);
1937 val &= ~PERIPH_CLK_SOURCE_DIVU71_MASK;
1938 val |= divider;
1939 if (c->flags & DIV_U71_UART) {
1940 if (divider)
1941 val |= PERIPH_CLK_UART_DIV_ENB;
1942 else
1943 val &= ~PERIPH_CLK_UART_DIV_ENB;
1944 }
1945 clk_writel_delay(val, c->reg);
1946 c->div = divider + 2;
1947 c->mul = 2;
1948 return 0;
1949 }
1950 } else if (c->flags & DIV_U16) {
1951 divider = clk_div16_get_divider(parent_rate, rate);
1952 if (divider >= 0) {
1953 val = clk_readl(c->reg);
1954 val &= ~PERIPH_CLK_SOURCE_DIVU16_MASK;
1955 val |= divider;
1956 clk_writel_delay(val, c->reg);
1957 c->div = divider + 1;
1958 c->mul = 1;
1959 return 0;
1960 }
1961 } else if (parent_rate <= rate) {
1962 c->div = 1;
1963 c->mul = 1;
1964 return 0;
1965 }
1966 return -EINVAL;
1967}
1968
1969static long tegra30_periph_clk_round_rate(struct clk_hw *hw, unsigned long rate,
1970 unsigned long *prate)
1971{
1972 struct clk_tegra *c = to_clk_tegra(hw);
1973 unsigned long parent_rate = __clk_get_rate(__clk_get_parent(hw->clk));
1974 int divider;
1975
1976 if (prate)
1977 parent_rate = *prate;
1978
1979 if (c->flags & DIV_U71) {
1980 divider = clk_div71_get_divider(
1981 parent_rate, rate, c->flags, ROUND_DIVIDER_UP);
1982 if (divider < 0)
1983 return divider;
1984
1985 return DIV_ROUND_UP(parent_rate * 2, divider + 2);
1986 } else if (c->flags & DIV_U16) {
1987 divider = clk_div16_get_divider(parent_rate, rate);
1988 if (divider < 0)
1989 return divider;
1990 return DIV_ROUND_UP(parent_rate, divider + 1);
1991 }
1992 return -EINVAL;
1993}
1994
1995static unsigned long tegra30_periph_clk_recalc_rate(struct clk_hw *hw,
1996 unsigned long parent_rate)
1997{
1998 struct clk_tegra *c = to_clk_tegra(hw);
1999 u64 rate = parent_rate;
2000 u32 val = clk_readl(c->reg);
2001
2002 if (c->flags & DIV_U71) {
2003 u32 divu71 = val & PERIPH_CLK_SOURCE_DIVU71_MASK;
2004 if ((c->flags & DIV_U71_UART) &&
2005 (!(val & PERIPH_CLK_UART_DIV_ENB))) {
2006 divu71 = 0;
2007 }
2008 if (c->flags & DIV_U71_IDLE) {
2009 val &= ~(PERIPH_CLK_SOURCE_DIVU71_MASK <<
2010 PERIPH_CLK_SOURCE_DIVIDLE_SHIFT);
2011 val |= (PERIPH_CLK_SOURCE_DIVIDLE_VAL <<
2012 PERIPH_CLK_SOURCE_DIVIDLE_SHIFT);
2013 clk_writel(val, c->reg);
2014 }
2015 c->div = divu71 + 2;
2016 c->mul = 2;
2017 } else if (c->flags & DIV_U16) {
2018 u32 divu16 = val & PERIPH_CLK_SOURCE_DIVU16_MASK;
2019 c->div = divu16 + 1;
2020 c->mul = 1;
2021 } else {
2022 c->div = 1;
2023 c->mul = 1;
2024 }
2025
2026 if (c->mul != 0 && c->div != 0) {
2027 rate *= c->mul;
2028 rate += c->div - 1; /* round up */
2029 do_div(rate, c->div);
2030 }
2031 return rate;
2032}
2033
2034struct clk_ops tegra30_periph_clk_ops = {
2035 .is_enabled = tegra30_periph_clk_is_enabled,
2036 .enable = tegra30_periph_clk_enable,
2037 .disable = tegra30_periph_clk_disable,
2038 .set_parent = tegra30_periph_clk_set_parent,
2039 .get_parent = tegra30_periph_clk_get_parent,
2040 .set_rate = tegra30_periph_clk_set_rate,
2041 .round_rate = tegra30_periph_clk_round_rate,
2042 .recalc_rate = tegra30_periph_clk_recalc_rate,
2043};
2044
2045static int tegra30_dsib_clk_set_parent(struct clk_hw *hw, u8 index)
2046{
2047 struct clk *d = clk_get_sys(NULL, "pll_d");
2048 /* The DSIB parent selection bit is in PLLD base register */
2049 tegra_clk_cfg_ex(
2050 d, TEGRA_CLK_PLLD_MIPI_MUX_SEL, index);
2051
2052 return 0;
2053}
2054
2055struct clk_ops tegra30_dsib_clk_ops = {
2056 .is_enabled = tegra30_periph_clk_is_enabled,
2057 .enable = &tegra30_periph_clk_enable,
2058 .disable = &tegra30_periph_clk_disable,
2059 .set_parent = &tegra30_dsib_clk_set_parent,
2060 .get_parent = &tegra30_periph_clk_get_parent,
2061 .set_rate = &tegra30_periph_clk_set_rate,
2062 .round_rate = &tegra30_periph_clk_round_rate,
2063 .recalc_rate = &tegra30_periph_clk_recalc_rate,
2064};
2065
2066/* Periph extended clock configuration ops */
2067int tegra30_vi_clk_cfg_ex(struct clk_hw *hw,
2068 enum tegra_clk_ex_param p, u32 setting)
2069{
2070 struct clk_tegra *c = to_clk_tegra(hw);
2071
2072 if (p == TEGRA_CLK_VI_INP_SEL) {
2073 u32 val = clk_readl(c->reg);
2074 val &= ~PERIPH_CLK_VI_SEL_EX_MASK;
2075 val |= (setting << PERIPH_CLK_VI_SEL_EX_SHIFT) &
2076 PERIPH_CLK_VI_SEL_EX_MASK;
2077 clk_writel(val, c->reg);
2078 return 0;
2079 }
2080 return -EINVAL;
2081}
2082
2083int tegra30_nand_clk_cfg_ex(struct clk_hw *hw,
2084 enum tegra_clk_ex_param p, u32 setting)
2085{
2086 struct clk_tegra *c = to_clk_tegra(hw);
2087
2088 if (p == TEGRA_CLK_NAND_PAD_DIV2_ENB) {
2089 u32 val = clk_readl(c->reg);
2090 if (setting)
2091 val |= PERIPH_CLK_NAND_DIV_EX_ENB;
2092 else
2093 val &= ~PERIPH_CLK_NAND_DIV_EX_ENB;
2094 clk_writel(val, c->reg);
2095 return 0;
2096 }
2097 return -EINVAL;
2098}
2099
2100int tegra30_dtv_clk_cfg_ex(struct clk_hw *hw,
2101 enum tegra_clk_ex_param p, u32 setting)
2102{
2103 struct clk_tegra *c = to_clk_tegra(hw);
2104
2105 if (p == TEGRA_CLK_DTV_INVERT) {
2106 u32 val = clk_readl(c->reg);
2107 if (setting)
2108 val |= PERIPH_CLK_DTV_POLARITY_INV;
2109 else
2110 val &= ~PERIPH_CLK_DTV_POLARITY_INV;
2111 clk_writel(val, c->reg);
2112 return 0;
2113 }
2114 return -EINVAL;
2115}
2116
2117/* Output clock ops */
2118
2119static DEFINE_SPINLOCK(clk_out_lock);
2120
2121static int tegra30_clk_out_is_enabled(struct clk_hw *hw)
2122{
2123 struct clk_tegra *c = to_clk_tegra(hw);
2124 u32 val = pmc_readl(c->reg);
2125
2126 c->state = (val & (0x1 << c->u.periph.clk_num)) ? ON : OFF;
2127 c->mul = 1;
2128 c->div = 1;
2129 return c->state;
2130}
2131
2132static int tegra30_clk_out_enable(struct clk_hw *hw)
2133{
2134 struct clk_tegra *c = to_clk_tegra(hw);
2135 u32 val;
2136 unsigned long flags;
2137
2138 spin_lock_irqsave(&clk_out_lock, flags);
2139 val = pmc_readl(c->reg);
2140 val |= (0x1 << c->u.periph.clk_num);
2141 pmc_writel(val, c->reg);
2142 spin_unlock_irqrestore(&clk_out_lock, flags);
2143
2144 return 0;
2145}
2146
2147static void tegra30_clk_out_disable(struct clk_hw *hw)
2148{
2149 struct clk_tegra *c = to_clk_tegra(hw);
2150 u32 val;
2151 unsigned long flags;
2152
2153 spin_lock_irqsave(&clk_out_lock, flags);
2154 val = pmc_readl(c->reg);
2155 val &= ~(0x1 << c->u.periph.clk_num);
2156 pmc_writel(val, c->reg);
2157 spin_unlock_irqrestore(&clk_out_lock, flags);
2158}
2159
2160static int tegra30_clk_out_set_parent(struct clk_hw *hw, u8 index)
2161{
2162 struct clk_tegra *c = to_clk_tegra(hw);
2163 u32 val;
2164 unsigned long flags;
2165
2166 spin_lock_irqsave(&clk_out_lock, flags);
2167 val = pmc_readl(c->reg);
2168 val &= ~periph_clk_source_mask(c);
2169 val |= (index << periph_clk_source_shift(c));
2170 pmc_writel(val, c->reg);
2171 spin_unlock_irqrestore(&clk_out_lock, flags);
2172
2173 return 0;
2174}
2175
2176static u8 tegra30_clk_out_get_parent(struct clk_hw *hw)
2177{
2178 struct clk_tegra *c = to_clk_tegra(hw);
2179 u32 val = pmc_readl(c->reg);
2180 int source;
2181
2182 source = (val & periph_clk_source_mask(c)) >>
2183 periph_clk_source_shift(c);
2184 return source;
2185}
2186
2187struct clk_ops tegra_clk_out_ops = {
2188 .is_enabled = tegra30_clk_out_is_enabled,
2189 .enable = tegra30_clk_out_enable,
2190 .disable = tegra30_clk_out_disable,
2191 .set_parent = tegra30_clk_out_set_parent,
2192 .get_parent = tegra30_clk_out_get_parent,
2193 .recalc_rate = tegra30_clk_fixed_recalc_rate,
2194};
2195
2196/* Clock doubler ops */
2197static int tegra30_clk_double_is_enabled(struct clk_hw *hw)
2198{
2199 struct clk_tegra *c = to_clk_tegra(hw);
2200
2201 c->state = ON;
2202 if (!(clk_readl(PERIPH_CLK_TO_ENB_REG(c)) & PERIPH_CLK_TO_BIT(c)))
2203 c->state = OFF;
2204 return c->state;
2205};
2206
2207static int tegra30_clk_double_set_rate(struct clk_hw *hw, unsigned long rate,
2208 unsigned long parent_rate)
2209{
2210 struct clk_tegra *c = to_clk_tegra(hw);
2211 u32 val;
2212
2213 if (rate == parent_rate) {
2214 val = clk_readl(c->reg) | (0x1 << c->reg_shift);
2215 clk_writel(val, c->reg);
2216 c->mul = 1;
2217 c->div = 1;
2218 return 0;
2219 } else if (rate == 2 * parent_rate) {
2220 val = clk_readl(c->reg) & (~(0x1 << c->reg_shift));
2221 clk_writel(val, c->reg);
2222 c->mul = 2;
2223 c->div = 1;
2224 return 0;
2225 }
2226 return -EINVAL;
2227}
2228
2229static unsigned long tegra30_clk_double_recalc_rate(struct clk_hw *hw,
2230 unsigned long parent_rate)
2231{
2232 struct clk_tegra *c = to_clk_tegra(hw);
2233 u64 rate = parent_rate;
2234
2235 u32 val = clk_readl(c->reg);
2236 c->mul = val & (0x1 << c->reg_shift) ? 1 : 2;
2237 c->div = 1;
2238
2239 if (c->mul != 0 && c->div != 0) {
2240 rate *= c->mul;
2241 rate += c->div - 1; /* round up */
2242 do_div(rate, c->div);
2243 }
2244
2245 return rate;
2246}
2247
2248static long tegra30_clk_double_round_rate(struct clk_hw *hw, unsigned long rate,
2249 unsigned long *prate)
2250{
2251 unsigned long output_rate = *prate;
2252
2253 do_div(output_rate, 2);
2254 return output_rate;
2255}
2256
2257struct clk_ops tegra30_clk_double_ops = {
2258 .is_enabled = tegra30_clk_double_is_enabled,
2259 .enable = tegra30_periph_clk_enable,
2260 .disable = tegra30_periph_clk_disable,
2261 .recalc_rate = tegra30_clk_double_recalc_rate,
2262 .round_rate = tegra30_clk_double_round_rate,
2263 .set_rate = tegra30_clk_double_set_rate,
2264};
2265
2266/* Audio sync clock ops */
2267struct clk_ops tegra_sync_source_ops = {
2268 .recalc_rate = tegra30_clk_fixed_recalc_rate,
2269};
2270
2271static int tegra30_audio_sync_clk_is_enabled(struct clk_hw *hw)
2272{
2273 struct clk_tegra *c = to_clk_tegra(hw);
2274 u32 val = clk_readl(c->reg);
2275 c->state = (val & AUDIO_SYNC_DISABLE_BIT) ? OFF : ON;
2276 return c->state;
2277}
2278
2279static int tegra30_audio_sync_clk_enable(struct clk_hw *hw)
2280{
2281 struct clk_tegra *c = to_clk_tegra(hw);
2282 u32 val = clk_readl(c->reg);
2283 clk_writel((val & (~AUDIO_SYNC_DISABLE_BIT)), c->reg);
2284 return 0;
2285}
2286
2287static void tegra30_audio_sync_clk_disable(struct clk_hw *hw)
2288{
2289 struct clk_tegra *c = to_clk_tegra(hw);
2290 u32 val = clk_readl(c->reg);
2291 clk_writel((val | AUDIO_SYNC_DISABLE_BIT), c->reg);
2292}
2293
2294static int tegra30_audio_sync_clk_set_parent(struct clk_hw *hw, u8 index)
2295{
2296 struct clk_tegra *c = to_clk_tegra(hw);
2297 u32 val;
2298
2299 val = clk_readl(c->reg);
2300 val &= ~AUDIO_SYNC_SOURCE_MASK;
2301 val |= index;
2302
2303 clk_writel(val, c->reg);
2304 return 0;
2305}
2306
2307static u8 tegra30_audio_sync_clk_get_parent(struct clk_hw *hw)
2308{
2309 struct clk_tegra *c = to_clk_tegra(hw);
2310 u32 val = clk_readl(c->reg);
2311 int source;
2312
2313 source = val & AUDIO_SYNC_SOURCE_MASK;
2314 return source;
2315}
2316
2317struct clk_ops tegra30_audio_sync_clk_ops = {
2318 .is_enabled = tegra30_audio_sync_clk_is_enabled,
2319 .enable = tegra30_audio_sync_clk_enable,
2320 .disable = tegra30_audio_sync_clk_disable,
2321 .set_parent = tegra30_audio_sync_clk_set_parent,
2322 .get_parent = tegra30_audio_sync_clk_get_parent,
2323 .recalc_rate = tegra30_clk_fixed_recalc_rate,
2324};
2325
2326/* cml0 (pcie), and cml1 (sata) clock ops */
2327static int tegra30_cml_clk_is_enabled(struct clk_hw *hw)
2328{
2329 struct clk_tegra *c = to_clk_tegra(hw);
2330 u32 val = clk_readl(c->reg);
2331 c->state = val & (0x1 << c->u.periph.clk_num) ? ON : OFF;
2332 return c->state;
2333}
2334
2335static int tegra30_cml_clk_enable(struct clk_hw *hw)
2336{
2337 struct clk_tegra *c = to_clk_tegra(hw);
2338
2339 u32 val = clk_readl(c->reg);
2340 val |= (0x1 << c->u.periph.clk_num);
2341 clk_writel(val, c->reg);
2342
2343 return 0;
2344}
2345
2346static void tegra30_cml_clk_disable(struct clk_hw *hw)
2347{
2348 struct clk_tegra *c = to_clk_tegra(hw);
2349
2350 u32 val = clk_readl(c->reg);
2351 val &= ~(0x1 << c->u.periph.clk_num);
2352 clk_writel(val, c->reg);
2353}
2354
2355struct clk_ops tegra_cml_clk_ops = {
2356 .is_enabled = tegra30_cml_clk_is_enabled,
2357 .enable = tegra30_cml_clk_enable,
2358 .disable = tegra30_cml_clk_disable,
2359 .recalc_rate = tegra30_clk_fixed_recalc_rate,
2360};
2361
2362struct clk_ops tegra_pciex_clk_ops = {
2363 .recalc_rate = tegra30_clk_fixed_recalc_rate,
2364};
2365
2366/* Tegra30 CPU clock and reset control functions */
2367static void tegra30_wait_cpu_in_reset(u32 cpu)
2368{
2369 unsigned int reg;
2370
2371 do {
2372 reg = readl(reg_clk_base +
2373 TEGRA30_CLK_RST_CONTROLLER_CPU_CMPLX_STATUS);
2374 cpu_relax();
2375 } while (!(reg & (1 << cpu))); /* check CPU been reset or not */
2376
2377 return;
2378}
2379
2380static void tegra30_put_cpu_in_reset(u32 cpu)
2381{
2382 writel(CPU_RESET(cpu),
2383 reg_clk_base + TEGRA_CLK_RST_CONTROLLER_RST_CPU_CMPLX_SET);
2384 dmb();
2385}
2386
2387static void tegra30_cpu_out_of_reset(u32 cpu)
2388{
2389 writel(CPU_RESET(cpu),
2390 reg_clk_base + TEGRA_CLK_RST_CONTROLLER_RST_CPU_CMPLX_CLR);
2391 wmb();
2392}
2393
2394static void tegra30_enable_cpu_clock(u32 cpu)
2395{
2396 unsigned int reg;
2397
2398 writel(CPU_CLOCK(cpu),
2399 reg_clk_base + TEGRA30_CLK_RST_CONTROLLER_CLK_CPU_CMPLX_CLR);
2400 reg = readl(reg_clk_base +
2401 TEGRA30_CLK_RST_CONTROLLER_CLK_CPU_CMPLX_CLR);
2402}
2403
2404static void tegra30_disable_cpu_clock(u32 cpu)
2405{
2406
2407 unsigned int reg;
2408
2409 reg = readl(reg_clk_base + TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX);
2410 writel(reg | CPU_CLOCK(cpu),
2411 reg_clk_base + TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX);
2412}
2413
2414#ifdef CONFIG_PM_SLEEP
2415static bool tegra30_cpu_rail_off_ready(void)
2416{
2417 unsigned int cpu_rst_status;
2418 int cpu_pwr_status;
2419
2420 cpu_rst_status = readl(reg_clk_base +
2421 TEGRA30_CLK_RST_CONTROLLER_CPU_CMPLX_STATUS);
2422 cpu_pwr_status = tegra_powergate_is_powered(TEGRA_POWERGATE_CPU1) ||
2423 tegra_powergate_is_powered(TEGRA_POWERGATE_CPU2) ||
2424 tegra_powergate_is_powered(TEGRA_POWERGATE_CPU3);
2425
2426 if (((cpu_rst_status & 0xE) != 0xE) || cpu_pwr_status)
2427 return false;
2428
2429 return true;
2430}
2431
2432static void tegra30_cpu_clock_suspend(void)
2433{
2434 /* switch coresite to clk_m, save off original source */
2435 tegra30_cpu_clk_sctx.clk_csite_src =
2436 readl(reg_clk_base + CLK_RESET_SOURCE_CSITE);
2437 writel(3<<30, reg_clk_base + CLK_RESET_SOURCE_CSITE);
2438
2439 tegra30_cpu_clk_sctx.cpu_burst =
2440 readl(reg_clk_base + CLK_RESET_CCLK_BURST);
2441 tegra30_cpu_clk_sctx.pllx_base =
2442 readl(reg_clk_base + CLK_RESET_PLLX_BASE);
2443 tegra30_cpu_clk_sctx.pllx_misc =
2444 readl(reg_clk_base + CLK_RESET_PLLX_MISC);
2445 tegra30_cpu_clk_sctx.cclk_divider =
2446 readl(reg_clk_base + CLK_RESET_CCLK_DIVIDER);
2447}
2448
2449static void tegra30_cpu_clock_resume(void)
2450{
2451 unsigned int reg, policy;
2452
2453 /* Is CPU complex already running on PLLX? */
2454 reg = readl(reg_clk_base + CLK_RESET_CCLK_BURST);
2455 policy = (reg >> CLK_RESET_CCLK_BURST_POLICY_SHIFT) & 0xF;
2456
2457 if (policy == CLK_RESET_CCLK_IDLE_POLICY)
2458 reg = (reg >> CLK_RESET_CCLK_IDLE_POLICY_SHIFT) & 0xF;
2459 else if (policy == CLK_RESET_CCLK_RUN_POLICY)
2460 reg = (reg >> CLK_RESET_CCLK_RUN_POLICY_SHIFT) & 0xF;
2461 else
2462 BUG();
2463
2464 if (reg != CLK_RESET_CCLK_BURST_POLICY_PLLX) {
2465 /* restore PLLX settings if CPU is on different PLL */
2466 writel(tegra30_cpu_clk_sctx.pllx_misc,
2467 reg_clk_base + CLK_RESET_PLLX_MISC);
2468 writel(tegra30_cpu_clk_sctx.pllx_base,
2469 reg_clk_base + CLK_RESET_PLLX_BASE);
2470
2471 /* wait for PLL stabilization if PLLX was enabled */
2472 if (tegra30_cpu_clk_sctx.pllx_base & (1 << 30))
2473 udelay(300);
2474 }
2475
2476 /*
2477 * Restore original burst policy setting for calls resulting from CPU
2478 * LP2 in idle or system suspend.
2479 */
2480 writel(tegra30_cpu_clk_sctx.cclk_divider,
2481 reg_clk_base + CLK_RESET_CCLK_DIVIDER);
2482 writel(tegra30_cpu_clk_sctx.cpu_burst,
2483 reg_clk_base + CLK_RESET_CCLK_BURST);
2484
2485 writel(tegra30_cpu_clk_sctx.clk_csite_src,
2486 reg_clk_base + CLK_RESET_SOURCE_CSITE);
2487}
2488#endif
2489
2490static struct tegra_cpu_car_ops tegra30_cpu_car_ops = {
2491 .wait_for_reset = tegra30_wait_cpu_in_reset,
2492 .put_in_reset = tegra30_put_cpu_in_reset,
2493 .out_of_reset = tegra30_cpu_out_of_reset,
2494 .enable_clock = tegra30_enable_cpu_clock,
2495 .disable_clock = tegra30_disable_cpu_clock,
2496#ifdef CONFIG_PM_SLEEP
2497 .rail_off_ready = tegra30_cpu_rail_off_ready,
2498 .suspend = tegra30_cpu_clock_suspend,
2499 .resume = tegra30_cpu_clock_resume,
2500#endif
2501};
2502
2503void __init tegra30_cpu_car_ops_init(void)
2504{
2505 tegra_cpu_car_ops = &tegra30_cpu_car_ops;
2506}
diff --git a/arch/arm/mach-tegra/tegra30_clocks.h b/arch/arm/mach-tegra/tegra30_clocks.h
deleted file mode 100644
index 7a34adb2f72d..000000000000
--- a/arch/arm/mach-tegra/tegra30_clocks.h
+++ /dev/null
@@ -1,54 +0,0 @@
1/*
2 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef __MACH_TEGRA30_CLOCK_H
18#define __MACH_TEGRA30_CLOCK_H
19
20extern struct clk_ops tegra30_clk_32k_ops;
21extern struct clk_ops tegra30_clk_m_ops;
22extern struct clk_ops tegra_clk_m_div_ops;
23extern struct clk_ops tegra_pll_ref_ops;
24extern struct clk_ops tegra30_pll_ops;
25extern struct clk_ops tegra30_pll_div_ops;
26extern struct clk_ops tegra_plld_ops;
27extern struct clk_ops tegra30_plle_ops;
28extern struct clk_ops tegra_cml_clk_ops;
29extern struct clk_ops tegra_pciex_clk_ops;
30extern struct clk_ops tegra_sync_source_ops;
31extern struct clk_ops tegra30_audio_sync_clk_ops;
32extern struct clk_ops tegra30_clk_double_ops;
33extern struct clk_ops tegra_clk_out_ops;
34extern struct clk_ops tegra30_super_ops;
35extern struct clk_ops tegra30_blink_clk_ops;
36extern struct clk_ops tegra30_twd_ops;
37extern struct clk_ops tegra30_bus_ops;
38extern struct clk_ops tegra30_periph_clk_ops;
39extern struct clk_ops tegra30_dsib_clk_ops;
40extern struct clk_ops tegra_nand_clk_ops;
41extern struct clk_ops tegra_vi_clk_ops;
42extern struct clk_ops tegra_dtv_clk_ops;
43extern struct clk_ops tegra_clk_shared_bus_ops;
44
45int tegra30_plld_clk_cfg_ex(struct clk_hw *hw,
46 enum tegra_clk_ex_param p, u32 setting);
47void tegra30_periph_clk_reset(struct clk_hw *hw, bool assert);
48int tegra30_vi_clk_cfg_ex(struct clk_hw *hw,
49 enum tegra_clk_ex_param p, u32 setting);
50int tegra30_nand_clk_cfg_ex(struct clk_hw *hw,
51 enum tegra_clk_ex_param p, u32 setting);
52int tegra30_dtv_clk_cfg_ex(struct clk_hw *hw,
53 enum tegra_clk_ex_param p, u32 setting);
54#endif
diff --git a/arch/arm/mach-tegra/tegra30_clocks_data.c b/arch/arm/mach-tegra/tegra30_clocks_data.c
deleted file mode 100644
index 6942c7add3bb..000000000000
--- a/arch/arm/mach-tegra/tegra30_clocks_data.c
+++ /dev/null
@@ -1,1425 +0,0 @@
1/*
2 * arch/arm/mach-tegra/tegra30_clocks.c
3 *
4 * Copyright (c) 2010-2012 NVIDIA CORPORATION. All rights reserved.
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; version 2 of the License.
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 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
20
21#include <linux/clk-private.h>
22#include <linux/kernel.h>
23#include <linux/module.h>
24#include <linux/list.h>
25#include <linux/spinlock.h>
26#include <linux/delay.h>
27#include <linux/err.h>
28#include <linux/io.h>
29#include <linux/clk.h>
30#include <linux/cpufreq.h>
31
32#include "clock.h"
33#include "fuse.h"
34#include "tegra30_clocks.h"
35#include "tegra_cpu_car.h"
36
37#define DEFINE_CLK_TEGRA(_name, _rate, _ops, _flags, \
38 _parent_names, _parents, _parent) \
39 static struct clk tegra_##_name = { \
40 .hw = &tegra_##_name##_hw.hw, \
41 .name = #_name, \
42 .rate = _rate, \
43 .ops = _ops, \
44 .flags = _flags, \
45 .parent_names = _parent_names, \
46 .parents = _parents, \
47 .num_parents = ARRAY_SIZE(_parent_names), \
48 .parent = _parent, \
49 };
50
51static struct clk tegra_clk_32k;
52static struct clk_tegra tegra_clk_32k_hw = {
53 .hw = {
54 .clk = &tegra_clk_32k,
55 },
56 .fixed_rate = 32768,
57};
58static struct clk tegra_clk_32k = {
59 .name = "clk_32k",
60 .hw = &tegra_clk_32k_hw.hw,
61 .ops = &tegra30_clk_32k_ops,
62 .flags = CLK_IS_ROOT,
63};
64
65static struct clk tegra_clk_m;
66static struct clk_tegra tegra_clk_m_hw = {
67 .hw = {
68 .clk = &tegra_clk_m,
69 },
70 .flags = ENABLE_ON_INIT,
71 .reg = 0x1fc,
72 .reg_shift = 28,
73 .max_rate = 48000000,
74};
75static struct clk tegra_clk_m = {
76 .name = "clk_m",
77 .hw = &tegra_clk_m_hw.hw,
78 .ops = &tegra30_clk_m_ops,
79 .flags = CLK_IS_ROOT | CLK_IGNORE_UNUSED,
80};
81
82static const char *clk_m_div_parent_names[] = {
83 "clk_m",
84};
85
86static struct clk *clk_m_div_parents[] = {
87 &tegra_clk_m,
88};
89
90static struct clk tegra_clk_m_div2;
91static struct clk_tegra tegra_clk_m_div2_hw = {
92 .hw = {
93 .clk = &tegra_clk_m_div2,
94 },
95 .mul = 1,
96 .div = 2,
97 .max_rate = 24000000,
98};
99DEFINE_CLK_TEGRA(clk_m_div2, 0, &tegra_clk_m_div_ops, 0,
100 clk_m_div_parent_names, clk_m_div_parents, &tegra_clk_m);
101
102static struct clk tegra_clk_m_div4;
103static struct clk_tegra tegra_clk_m_div4_hw = {
104 .hw = {
105 .clk = &tegra_clk_m_div4,
106 },
107 .mul = 1,
108 .div = 4,
109 .max_rate = 12000000,
110};
111DEFINE_CLK_TEGRA(clk_m_div4, 0, &tegra_clk_m_div_ops, 0,
112 clk_m_div_parent_names, clk_m_div_parents, &tegra_clk_m);
113
114static struct clk tegra_pll_ref;
115static struct clk_tegra tegra_pll_ref_hw = {
116 .hw = {
117 .clk = &tegra_pll_ref,
118 },
119 .flags = ENABLE_ON_INIT,
120 .max_rate = 26000000,
121};
122DEFINE_CLK_TEGRA(pll_ref, 0, &tegra_pll_ref_ops, 0, clk_m_div_parent_names,
123 clk_m_div_parents, &tegra_clk_m);
124
125#define DEFINE_PLL(_name, _flags, _reg, _max_rate, _input_min, \
126 _input_max, _cf_min, _cf_max, _vco_min, \
127 _vco_max, _freq_table, _lock_delay, _ops, \
128 _fixed_rate, _clk_cfg_ex, _parent) \
129 static struct clk tegra_##_name; \
130 static const char *_name##_parent_names[] = { \
131 #_parent, \
132 }; \
133 static struct clk *_name##_parents[] = { \
134 &tegra_##_parent, \
135 }; \
136 static struct clk_tegra tegra_##_name##_hw = { \
137 .hw = { \
138 .clk = &tegra_##_name, \
139 }, \
140 .flags = _flags, \
141 .reg = _reg, \
142 .max_rate = _max_rate, \
143 .u.pll = { \
144 .input_min = _input_min, \
145 .input_max = _input_max, \
146 .cf_min = _cf_min, \
147 .cf_max = _cf_max, \
148 .vco_min = _vco_min, \
149 .vco_max = _vco_max, \
150 .freq_table = _freq_table, \
151 .lock_delay = _lock_delay, \
152 .fixed_rate = _fixed_rate, \
153 }, \
154 .clk_cfg_ex = _clk_cfg_ex, \
155 }; \
156 DEFINE_CLK_TEGRA(_name, 0, &_ops, CLK_IGNORE_UNUSED, \
157 _name##_parent_names, _name##_parents, \
158 &tegra_##_parent);
159
160#define DEFINE_PLL_OUT(_name, _flags, _reg, _reg_shift, \
161 _max_rate, _ops, _parent, _clk_flags) \
162 static const char *_name##_parent_names[] = { \
163 #_parent, \
164 }; \
165 static struct clk *_name##_parents[] = { \
166 &tegra_##_parent, \
167 }; \
168 static struct clk tegra_##_name; \
169 static struct clk_tegra tegra_##_name##_hw = { \
170 .hw = { \
171 .clk = &tegra_##_name, \
172 }, \
173 .flags = _flags, \
174 .reg = _reg, \
175 .max_rate = _max_rate, \
176 .reg_shift = _reg_shift, \
177 }; \
178 DEFINE_CLK_TEGRA(_name, 0, &tegra30_pll_div_ops, \
179 _clk_flags, _name##_parent_names, \
180 _name##_parents, &tegra_##_parent);
181
182static struct clk_pll_freq_table tegra_pll_c_freq_table[] = {
183 { 12000000, 1040000000, 520, 6, 1, 8},
184 { 13000000, 1040000000, 480, 6, 1, 8},
185 { 16800000, 1040000000, 495, 8, 1, 8}, /* actual: 1039.5 MHz */
186 { 19200000, 1040000000, 325, 6, 1, 6},
187 { 26000000, 1040000000, 520, 13, 1, 8},
188
189 { 12000000, 832000000, 416, 6, 1, 8},
190 { 13000000, 832000000, 832, 13, 1, 8},
191 { 16800000, 832000000, 396, 8, 1, 8}, /* actual: 831.6 MHz */
192 { 19200000, 832000000, 260, 6, 1, 8},
193 { 26000000, 832000000, 416, 13, 1, 8},
194
195 { 12000000, 624000000, 624, 12, 1, 8},
196 { 13000000, 624000000, 624, 13, 1, 8},
197 { 16800000, 600000000, 520, 14, 1, 8},
198 { 19200000, 624000000, 520, 16, 1, 8},
199 { 26000000, 624000000, 624, 26, 1, 8},
200
201 { 12000000, 600000000, 600, 12, 1, 8},
202 { 13000000, 600000000, 600, 13, 1, 8},
203 { 16800000, 600000000, 500, 14, 1, 8},
204 { 19200000, 600000000, 375, 12, 1, 6},
205 { 26000000, 600000000, 600, 26, 1, 8},
206
207 { 12000000, 520000000, 520, 12, 1, 8},
208 { 13000000, 520000000, 520, 13, 1, 8},
209 { 16800000, 520000000, 495, 16, 1, 8}, /* actual: 519.75 MHz */
210 { 19200000, 520000000, 325, 12, 1, 6},
211 { 26000000, 520000000, 520, 26, 1, 8},
212
213 { 12000000, 416000000, 416, 12, 1, 8},
214 { 13000000, 416000000, 416, 13, 1, 8},
215 { 16800000, 416000000, 396, 16, 1, 8}, /* actual: 415.8 MHz */
216 { 19200000, 416000000, 260, 12, 1, 6},
217 { 26000000, 416000000, 416, 26, 1, 8},
218 { 0, 0, 0, 0, 0, 0 },
219};
220
221DEFINE_PLL(pll_c, PLL_HAS_CPCON, 0x80, 1400000000, 2000000, 31000000, 1000000,
222 6000000, 20000000, 1400000000, tegra_pll_c_freq_table, 300,
223 tegra30_pll_ops, 0, NULL, pll_ref);
224
225DEFINE_PLL_OUT(pll_c_out1, DIV_U71, 0x84, 0, 700000000,
226 tegra30_pll_div_ops, pll_c, CLK_IGNORE_UNUSED);
227
228static struct clk_pll_freq_table tegra_pll_m_freq_table[] = {
229 { 12000000, 666000000, 666, 12, 1, 8},
230 { 13000000, 666000000, 666, 13, 1, 8},
231 { 16800000, 666000000, 555, 14, 1, 8},
232 { 19200000, 666000000, 555, 16, 1, 8},
233 { 26000000, 666000000, 666, 26, 1, 8},
234 { 12000000, 600000000, 600, 12, 1, 8},
235 { 13000000, 600000000, 600, 13, 1, 8},
236 { 16800000, 600000000, 500, 14, 1, 8},
237 { 19200000, 600000000, 375, 12, 1, 6},
238 { 26000000, 600000000, 600, 26, 1, 8},
239 { 0, 0, 0, 0, 0, 0 },
240};
241
242DEFINE_PLL(pll_m, PLL_HAS_CPCON | PLLM, 0x90, 800000000, 2000000, 31000000,
243 1000000, 6000000, 20000000, 1200000000, tegra_pll_m_freq_table,
244 300, tegra30_pll_ops, 0, NULL, pll_ref);
245
246DEFINE_PLL_OUT(pll_m_out1, DIV_U71, 0x94, 0, 600000000,
247 tegra30_pll_div_ops, pll_m, CLK_IGNORE_UNUSED);
248
249static struct clk_pll_freq_table tegra_pll_p_freq_table[] = {
250 { 12000000, 216000000, 432, 12, 2, 8},
251 { 13000000, 216000000, 432, 13, 2, 8},
252 { 16800000, 216000000, 360, 14, 2, 8},
253 { 19200000, 216000000, 360, 16, 2, 8},
254 { 26000000, 216000000, 432, 26, 2, 8},
255 { 0, 0, 0, 0, 0, 0 },
256};
257
258DEFINE_PLL(pll_p, ENABLE_ON_INIT | PLL_FIXED | PLL_HAS_CPCON, 0xa0, 432000000,
259 2000000, 31000000, 1000000, 6000000, 20000000, 1400000000,
260 tegra_pll_p_freq_table, 300, tegra30_pll_ops, 408000000, NULL,
261 pll_ref);
262
263DEFINE_PLL_OUT(pll_p_out1, ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED, 0xa4,
264 0, 432000000, tegra30_pll_div_ops, pll_p, CLK_IGNORE_UNUSED);
265DEFINE_PLL_OUT(pll_p_out2, ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED, 0xa4,
266 16, 432000000, tegra30_pll_div_ops, pll_p, CLK_IGNORE_UNUSED);
267DEFINE_PLL_OUT(pll_p_out3, ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED, 0xa8,
268 0, 432000000, tegra30_pll_div_ops, pll_p, CLK_IGNORE_UNUSED);
269DEFINE_PLL_OUT(pll_p_out4, ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED, 0xa8,
270 16, 432000000, tegra30_pll_div_ops, pll_p, CLK_IGNORE_UNUSED);
271
272static struct clk_pll_freq_table tegra_pll_a_freq_table[] = {
273 { 9600000, 564480000, 294, 5, 1, 4},
274 { 9600000, 552960000, 288, 5, 1, 4},
275 { 9600000, 24000000, 5, 2, 1, 1},
276
277 { 28800000, 56448000, 49, 25, 1, 1},
278 { 28800000, 73728000, 64, 25, 1, 1},
279 { 28800000, 24000000, 5, 6, 1, 1},
280 { 0, 0, 0, 0, 0, 0 },
281};
282
283DEFINE_PLL(pll_a, PLL_HAS_CPCON, 0xb0, 700000000, 2000000, 31000000, 1000000,
284 6000000, 20000000, 1400000000, tegra_pll_a_freq_table,
285 300, tegra30_pll_ops, 0, NULL, pll_p_out1);
286
287DEFINE_PLL_OUT(pll_a_out0, DIV_U71, 0xb4, 0, 100000000, tegra30_pll_div_ops,
288 pll_a, CLK_IGNORE_UNUSED);
289
290static struct clk_pll_freq_table tegra_pll_d_freq_table[] = {
291 { 12000000, 216000000, 216, 12, 1, 4},
292 { 13000000, 216000000, 216, 13, 1, 4},
293 { 16800000, 216000000, 180, 14, 1, 4},
294 { 19200000, 216000000, 180, 16, 1, 4},
295 { 26000000, 216000000, 216, 26, 1, 4},
296
297 { 12000000, 594000000, 594, 12, 1, 8},
298 { 13000000, 594000000, 594, 13, 1, 8},
299 { 16800000, 594000000, 495, 14, 1, 8},
300 { 19200000, 594000000, 495, 16, 1, 8},
301 { 26000000, 594000000, 594, 26, 1, 8},
302
303 { 12000000, 1000000000, 1000, 12, 1, 12},
304 { 13000000, 1000000000, 1000, 13, 1, 12},
305 { 19200000, 1000000000, 625, 12, 1, 8},
306 { 26000000, 1000000000, 1000, 26, 1, 12},
307
308 { 0, 0, 0, 0, 0, 0 },
309};
310
311DEFINE_PLL(pll_d, PLL_HAS_CPCON | PLLD, 0xd0, 1000000000, 2000000, 40000000,
312 1000000, 6000000, 40000000, 1000000000, tegra_pll_d_freq_table,
313 1000, tegra30_pll_ops, 0, tegra30_plld_clk_cfg_ex, pll_ref);
314
315DEFINE_PLL_OUT(pll_d_out0, DIV_2 | PLLD, 0, 0, 500000000, tegra30_pll_div_ops,
316 pll_d, CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED);
317
318DEFINE_PLL(pll_d2, PLL_HAS_CPCON | PLL_ALT_MISC_REG | PLLD, 0x4b8, 1000000000,
319 2000000, 40000000, 1000000, 6000000, 40000000, 1000000000,
320 tegra_pll_d_freq_table, 1000, tegra30_pll_ops, 0, NULL,
321 pll_ref);
322
323DEFINE_PLL_OUT(pll_d2_out0, DIV_2 | PLLD, 0, 0, 500000000, tegra30_pll_div_ops,
324 pll_d2, CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED);
325
326static struct clk_pll_freq_table tegra_pll_u_freq_table[] = {
327 { 12000000, 480000000, 960, 12, 2, 12},
328 { 13000000, 480000000, 960, 13, 2, 12},
329 { 16800000, 480000000, 400, 7, 2, 5},
330 { 19200000, 480000000, 200, 4, 2, 3},
331 { 26000000, 480000000, 960, 26, 2, 12},
332 { 0, 0, 0, 0, 0, 0 },
333};
334
335DEFINE_PLL(pll_u, PLL_HAS_CPCON | PLLU, 0xc0, 480000000, 2000000, 40000000,
336 1000000, 6000000, 48000000, 960000000, tegra_pll_u_freq_table,
337 1000, tegra30_pll_ops, 0, NULL, pll_ref);
338
339static struct clk_pll_freq_table tegra_pll_x_freq_table[] = {
340 /* 1.7 GHz */
341 { 12000000, 1700000000, 850, 6, 1, 8},
342 { 13000000, 1700000000, 915, 7, 1, 8}, /* actual: 1699.2 MHz */
343 { 16800000, 1700000000, 708, 7, 1, 8}, /* actual: 1699.2 MHz */
344 { 19200000, 1700000000, 885, 10, 1, 8}, /* actual: 1699.2 MHz */
345 { 26000000, 1700000000, 850, 13, 1, 8},
346
347 /* 1.6 GHz */
348 { 12000000, 1600000000, 800, 6, 1, 8},
349 { 13000000, 1600000000, 738, 6, 1, 8}, /* actual: 1599.0 MHz */
350 { 16800000, 1600000000, 857, 9, 1, 8}, /* actual: 1599.7 MHz */
351 { 19200000, 1600000000, 500, 6, 1, 8},
352 { 26000000, 1600000000, 800, 13, 1, 8},
353
354 /* 1.5 GHz */
355 { 12000000, 1500000000, 750, 6, 1, 8},
356 { 13000000, 1500000000, 923, 8, 1, 8}, /* actual: 1499.8 MHz */
357 { 16800000, 1500000000, 625, 7, 1, 8},
358 { 19200000, 1500000000, 625, 8, 1, 8},
359 { 26000000, 1500000000, 750, 13, 1, 8},
360
361 /* 1.4 GHz */
362 { 12000000, 1400000000, 700, 6, 1, 8},
363 { 13000000, 1400000000, 969, 9, 1, 8}, /* actual: 1399.7 MHz */
364 { 16800000, 1400000000, 1000, 12, 1, 8},
365 { 19200000, 1400000000, 875, 12, 1, 8},
366 { 26000000, 1400000000, 700, 13, 1, 8},
367
368 /* 1.3 GHz */
369 { 12000000, 1300000000, 975, 9, 1, 8},
370 { 13000000, 1300000000, 1000, 10, 1, 8},
371 { 16800000, 1300000000, 928, 12, 1, 8}, /* actual: 1299.2 MHz */
372 { 19200000, 1300000000, 812, 12, 1, 8}, /* actual: 1299.2 MHz */
373 { 26000000, 1300000000, 650, 13, 1, 8},
374
375 /* 1.2 GHz */
376 { 12000000, 1200000000, 1000, 10, 1, 8},
377 { 13000000, 1200000000, 923, 10, 1, 8}, /* actual: 1199.9 MHz */
378 { 16800000, 1200000000, 1000, 14, 1, 8},
379 { 19200000, 1200000000, 1000, 16, 1, 8},
380 { 26000000, 1200000000, 600, 13, 1, 8},
381
382 /* 1.1 GHz */
383 { 12000000, 1100000000, 825, 9, 1, 8},
384 { 13000000, 1100000000, 846, 10, 1, 8}, /* actual: 1099.8 MHz */
385 { 16800000, 1100000000, 982, 15, 1, 8}, /* actual: 1099.8 MHz */
386 { 19200000, 1100000000, 859, 15, 1, 8}, /* actual: 1099.5 MHz */
387 { 26000000, 1100000000, 550, 13, 1, 8},
388
389 /* 1 GHz */
390 { 12000000, 1000000000, 1000, 12, 1, 8},
391 { 13000000, 1000000000, 1000, 13, 1, 8},
392 { 16800000, 1000000000, 833, 14, 1, 8}, /* actual: 999.6 MHz */
393 { 19200000, 1000000000, 625, 12, 1, 8},
394 { 26000000, 1000000000, 1000, 26, 1, 8},
395
396 { 0, 0, 0, 0, 0, 0 },
397};
398
399DEFINE_PLL(pll_x, PLL_HAS_CPCON | PLL_ALT_MISC_REG | PLLX, 0xe0, 1700000000,
400 2000000, 31000000, 1000000, 6000000, 20000000, 1700000000,
401 tegra_pll_x_freq_table, 300, tegra30_pll_ops, 0, NULL, pll_ref);
402
403DEFINE_PLL_OUT(pll_x_out0, DIV_2 | PLLX, 0, 0, 850000000, tegra30_pll_div_ops,
404 pll_x, CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED);
405
406static struct clk_pll_freq_table tegra_pll_e_freq_table[] = {
407 /* PLLE special case: use cpcon field to store cml divider value */
408 { 12000000, 100000000, 150, 1, 18, 11},
409 { 216000000, 100000000, 200, 18, 24, 13},
410 { 0, 0, 0, 0, 0, 0 },
411};
412
413DEFINE_PLL(pll_e, PLL_ALT_MISC_REG, 0xe8, 100000000, 2000000, 216000000,
414 12000000, 12000000, 1200000000, 2400000000U,
415 tegra_pll_e_freq_table, 300, tegra30_plle_ops, 100000000, NULL,
416 pll_ref);
417
418static const char *mux_plle[] = {
419 "pll_e",
420};
421
422static struct clk *mux_plle_p[] = {
423 &tegra_pll_e,
424};
425
426static struct clk tegra_cml0;
427static struct clk_tegra tegra_cml0_hw = {
428 .hw = {
429 .clk = &tegra_cml0,
430 },
431 .reg = 0x48c,
432 .fixed_rate = 100000000,
433 .u.periph = {
434 .clk_num = 0,
435 },
436};
437DEFINE_CLK_TEGRA(cml0, 0, &tegra_cml_clk_ops, 0, mux_plle,
438 mux_plle_p, &tegra_pll_e);
439
440static struct clk tegra_cml1;
441static struct clk_tegra tegra_cml1_hw = {
442 .hw = {
443 .clk = &tegra_cml1,
444 },
445 .reg = 0x48c,
446 .fixed_rate = 100000000,
447 .u.periph = {
448 .clk_num = 1,
449 },
450};
451DEFINE_CLK_TEGRA(cml1, 0, &tegra_cml_clk_ops, 0, mux_plle,
452 mux_plle_p, &tegra_pll_e);
453
454static struct clk tegra_pciex;
455static struct clk_tegra tegra_pciex_hw = {
456 .hw = {
457 .clk = &tegra_pciex,
458 },
459 .reg = 0x48c,
460 .fixed_rate = 100000000,
461 .reset = tegra30_periph_clk_reset,
462 .u.periph = {
463 .clk_num = 74,
464 },
465};
466DEFINE_CLK_TEGRA(pciex, 0, &tegra_pciex_clk_ops, 0, mux_plle,
467 mux_plle_p, &tegra_pll_e);
468
469#define SYNC_SOURCE(_name) \
470 static struct clk tegra_##_name##_sync; \
471 static struct clk_tegra tegra_##_name##_sync_hw = { \
472 .hw = { \
473 .clk = &tegra_##_name##_sync, \
474 }, \
475 .max_rate = 24000000, \
476 .fixed_rate = 24000000, \
477 }; \
478 static struct clk tegra_##_name##_sync = { \
479 .name = #_name "_sync", \
480 .hw = &tegra_##_name##_sync_hw.hw, \
481 .ops = &tegra_sync_source_ops, \
482 .flags = CLK_IS_ROOT, \
483 };
484
485SYNC_SOURCE(spdif_in);
486SYNC_SOURCE(i2s0);
487SYNC_SOURCE(i2s1);
488SYNC_SOURCE(i2s2);
489SYNC_SOURCE(i2s3);
490SYNC_SOURCE(i2s4);
491SYNC_SOURCE(vimclk);
492
493static struct clk *tegra_sync_source_list[] = {
494 &tegra_spdif_in_sync,
495 &tegra_i2s0_sync,
496 &tegra_i2s1_sync,
497 &tegra_i2s2_sync,
498 &tegra_i2s3_sync,
499 &tegra_i2s4_sync,
500 &tegra_vimclk_sync,
501};
502
503static const char *mux_audio_sync_clk[] = {
504 "spdif_in_sync",
505 "i2s0_sync",
506 "i2s1_sync",
507 "i2s2_sync",
508 "i2s3_sync",
509 "i2s4_sync",
510 "vimclk_sync",
511};
512
513#define AUDIO_SYNC_CLK(_name, _index) \
514 static struct clk tegra_##_name; \
515 static struct clk_tegra tegra_##_name##_hw = { \
516 .hw = { \
517 .clk = &tegra_##_name, \
518 }, \
519 .max_rate = 24000000, \
520 .reg = 0x4A0 + (_index) * 4, \
521 }; \
522 static struct clk tegra_##_name = { \
523 .name = #_name, \
524 .ops = &tegra30_audio_sync_clk_ops, \
525 .hw = &tegra_##_name##_hw.hw, \
526 .parent_names = mux_audio_sync_clk, \
527 .parents = tegra_sync_source_list, \
528 .num_parents = ARRAY_SIZE(mux_audio_sync_clk), \
529 };
530
531AUDIO_SYNC_CLK(audio0, 0);
532AUDIO_SYNC_CLK(audio1, 1);
533AUDIO_SYNC_CLK(audio2, 2);
534AUDIO_SYNC_CLK(audio3, 3);
535AUDIO_SYNC_CLK(audio4, 4);
536AUDIO_SYNC_CLK(audio5, 5);
537
538static struct clk *tegra_clk_audio_list[] = {
539 &tegra_audio0,
540 &tegra_audio1,
541 &tegra_audio2,
542 &tegra_audio3,
543 &tegra_audio4,
544 &tegra_audio5, /* SPDIF */
545};
546
547#define AUDIO_SYNC_2X_CLK(_name, _index) \
548 static const char *_name##_parent_names[] = { \
549 "tegra_" #_name, \
550 }; \
551 static struct clk *_name##_parents[] = { \
552 &tegra_##_name, \
553 }; \
554 static struct clk tegra_##_name##_2x; \
555 static struct clk_tegra tegra_##_name##_2x_hw = { \
556 .hw = { \
557 .clk = &tegra_##_name##_2x, \
558 }, \
559 .flags = PERIPH_NO_RESET, \
560 .max_rate = 48000000, \
561 .reg = 0x49C, \
562 .reg_shift = 24 + (_index), \
563 .u.periph = { \
564 .clk_num = 113 + (_index), \
565 }, \
566 }; \
567 static struct clk tegra_##_name##_2x = { \
568 .name = #_name "_2x", \
569 .ops = &tegra30_clk_double_ops, \
570 .hw = &tegra_##_name##_2x_hw.hw, \
571 .parent_names = _name##_parent_names, \
572 .parents = _name##_parents, \
573 .parent = &tegra_##_name, \
574 .num_parents = 1, \
575 };
576
577AUDIO_SYNC_2X_CLK(audio0, 0);
578AUDIO_SYNC_2X_CLK(audio1, 1);
579AUDIO_SYNC_2X_CLK(audio2, 2);
580AUDIO_SYNC_2X_CLK(audio3, 3);
581AUDIO_SYNC_2X_CLK(audio4, 4);
582AUDIO_SYNC_2X_CLK(audio5, 5); /* SPDIF */
583
584static struct clk *tegra_clk_audio_2x_list[] = {
585 &tegra_audio0_2x,
586 &tegra_audio1_2x,
587 &tegra_audio2_2x,
588 &tegra_audio3_2x,
589 &tegra_audio4_2x,
590 &tegra_audio5_2x, /* SPDIF */
591};
592
593#define MUX_I2S_SPDIF(_id) \
594static const char *mux_pllaout0_##_id##_2x_pllp_clkm[] = { \
595 "pll_a_out0", \
596 #_id "_2x", \
597 "pll_p", \
598 "clk_m", \
599}; \
600static struct clk *mux_pllaout0_##_id##_2x_pllp_clkm_p[] = { \
601 &tegra_pll_a_out0, \
602 &tegra_##_id##_2x, \
603 &tegra_pll_p, \
604 &tegra_clk_m, \
605};
606
607MUX_I2S_SPDIF(audio0);
608MUX_I2S_SPDIF(audio1);
609MUX_I2S_SPDIF(audio2);
610MUX_I2S_SPDIF(audio3);
611MUX_I2S_SPDIF(audio4);
612MUX_I2S_SPDIF(audio5); /* SPDIF */
613
614static struct clk tegra_extern1;
615static struct clk tegra_extern2;
616static struct clk tegra_extern3;
617
618/* External clock outputs (through PMC) */
619#define MUX_EXTERN_OUT(_id) \
620static const char *mux_clkm_clkm2_clkm4_extern##_id[] = { \
621 "clk_m", \
622 "clk_m_div2", \
623 "clk_m_div4", \
624 "extern" #_id, \
625}; \
626static struct clk *mux_clkm_clkm2_clkm4_extern##_id##_p[] = { \
627 &tegra_clk_m, \
628 &tegra_clk_m_div2, \
629 &tegra_clk_m_div4, \
630 &tegra_extern##_id, \
631};
632
633MUX_EXTERN_OUT(1);
634MUX_EXTERN_OUT(2);
635MUX_EXTERN_OUT(3);
636
637#define CLK_OUT_CLK(_name, _index) \
638 static struct clk tegra_##_name; \
639 static struct clk_tegra tegra_##_name##_hw = { \
640 .hw = { \
641 .clk = &tegra_##_name, \
642 }, \
643 .lookup = { \
644 .dev_id = #_name, \
645 .con_id = "extern" #_index, \
646 }, \
647 .flags = MUX_CLK_OUT, \
648 .fixed_rate = 216000000, \
649 .reg = 0x1a8, \
650 .u.periph = { \
651 .clk_num = (_index - 1) * 8 + 2, \
652 }, \
653 }; \
654 static struct clk tegra_##_name = { \
655 .name = #_name, \
656 .ops = &tegra_clk_out_ops, \
657 .hw = &tegra_##_name##_hw.hw, \
658 .parent_names = mux_clkm_clkm2_clkm4_extern##_index, \
659 .parents = mux_clkm_clkm2_clkm4_extern##_index##_p, \
660 .num_parents = ARRAY_SIZE(mux_clkm_clkm2_clkm4_extern##_index),\
661 };
662
663CLK_OUT_CLK(clk_out_1, 1);
664CLK_OUT_CLK(clk_out_2, 2);
665CLK_OUT_CLK(clk_out_3, 3);
666
667static struct clk *tegra_clk_out_list[] = {
668 &tegra_clk_out_1,
669 &tegra_clk_out_2,
670 &tegra_clk_out_3,
671};
672
673static const char *mux_sclk[] = {
674 "clk_m",
675 "pll_c_out1",
676 "pll_p_out4",
677 "pll_p_out3",
678 "pll_p_out2",
679 "dummy",
680 "clk_32k",
681 "pll_m_out1",
682};
683
684static struct clk *mux_sclk_p[] = {
685 &tegra_clk_m,
686 &tegra_pll_c_out1,
687 &tegra_pll_p_out4,
688 &tegra_pll_p_out3,
689 &tegra_pll_p_out2,
690 NULL,
691 &tegra_clk_32k,
692 &tegra_pll_m_out1,
693};
694
695static struct clk tegra_clk_sclk;
696static struct clk_tegra tegra_clk_sclk_hw = {
697 .hw = {
698 .clk = &tegra_clk_sclk,
699 },
700 .reg = 0x28,
701 .max_rate = 334000000,
702 .min_rate = 40000000,
703};
704
705static struct clk tegra_clk_sclk = {
706 .name = "sclk",
707 .ops = &tegra30_super_ops,
708 .hw = &tegra_clk_sclk_hw.hw,
709 .parent_names = mux_sclk,
710 .parents = mux_sclk_p,
711 .num_parents = ARRAY_SIZE(mux_sclk),
712};
713
714static const char *tegra_hclk_parent_names[] = {
715 "tegra_sclk",
716};
717
718static struct clk *tegra_hclk_parents[] = {
719 &tegra_clk_sclk,
720};
721
722static struct clk tegra_hclk;
723static struct clk_tegra tegra_hclk_hw = {
724 .hw = {
725 .clk = &tegra_hclk,
726 },
727 .flags = DIV_BUS,
728 .reg = 0x30,
729 .reg_shift = 4,
730 .max_rate = 378000000,
731 .min_rate = 12000000,
732};
733DEFINE_CLK_TEGRA(hclk, 0, &tegra30_bus_ops, 0, tegra_hclk_parent_names,
734 tegra_hclk_parents, &tegra_clk_sclk);
735
736static const char *tegra_pclk_parent_names[] = {
737 "tegra_hclk",
738};
739
740static struct clk *tegra_pclk_parents[] = {
741 &tegra_hclk,
742};
743
744static struct clk tegra_pclk;
745static struct clk_tegra tegra_pclk_hw = {
746 .hw = {
747 .clk = &tegra_pclk,
748 },
749 .flags = DIV_BUS,
750 .reg = 0x30,
751 .reg_shift = 0,
752 .max_rate = 167000000,
753 .min_rate = 12000000,
754};
755DEFINE_CLK_TEGRA(pclk, 0, &tegra30_bus_ops, 0, tegra_pclk_parent_names,
756 tegra_pclk_parents, &tegra_hclk);
757
758static const char *mux_blink[] = {
759 "clk_32k",
760};
761
762static struct clk *mux_blink_p[] = {
763 &tegra_clk_32k,
764};
765
766static struct clk tegra_clk_blink;
767static struct clk_tegra tegra_clk_blink_hw = {
768 .hw = {
769 .clk = &tegra_clk_blink,
770 },
771 .reg = 0x40,
772 .max_rate = 32768,
773};
774static struct clk tegra_clk_blink = {
775 .name = "blink",
776 .ops = &tegra30_blink_clk_ops,
777 .hw = &tegra_clk_blink_hw.hw,
778 .parent = &tegra_clk_32k,
779 .parent_names = mux_blink,
780 .parents = mux_blink_p,
781 .num_parents = ARRAY_SIZE(mux_blink),
782};
783
784static const char *mux_pllm_pllc_pllp_plla[] = {
785 "pll_m",
786 "pll_c",
787 "pll_p",
788 "pll_a_out0",
789};
790
791static const char *mux_pllp_pllc_pllm_clkm[] = {
792 "pll_p",
793 "pll_c",
794 "pll_m",
795 "clk_m",
796};
797
798static const char *mux_pllp_clkm[] = {
799 "pll_p",
800 "dummy",
801 "dummy",
802 "clk_m",
803};
804
805static const char *mux_pllp_plld_pllc_clkm[] = {
806 "pll_p",
807 "pll_d_out0",
808 "pll_c",
809 "clk_m",
810};
811
812static const char *mux_pllp_pllm_plld_plla_pllc_plld2_clkm[] = {
813 "pll_p",
814 "pll_m",
815 "pll_d_out0",
816 "pll_a_out0",
817 "pll_c",
818 "pll_d2_out0",
819 "clk_m",
820};
821
822static const char *mux_plla_pllc_pllp_clkm[] = {
823 "pll_a_out0",
824 "dummy",
825 "pll_p",
826 "clk_m"
827};
828
829static const char *mux_pllp_pllc_clk32_clkm[] = {
830 "pll_p",
831 "pll_c",
832 "clk_32k",
833 "clk_m",
834};
835
836static const char *mux_pllp_pllc_clkm_clk32[] = {
837 "pll_p",
838 "pll_c",
839 "clk_m",
840 "clk_32k",
841};
842
843static const char *mux_pllp_pllc_pllm[] = {
844 "pll_p",
845 "pll_c",
846 "pll_m",
847};
848
849static const char *mux_clk_m[] = {
850 "clk_m",
851};
852
853static const char *mux_pllp_out3[] = {
854 "pll_p_out3",
855};
856
857static const char *mux_plld_out0[] = {
858 "pll_d_out0",
859};
860
861static const char *mux_plld_out0_plld2_out0[] = {
862 "pll_d_out0",
863 "pll_d2_out0",
864};
865
866static const char *mux_clk_32k[] = {
867 "clk_32k",
868};
869
870static const char *mux_plla_clk32_pllp_clkm_plle[] = {
871 "pll_a_out0",
872 "clk_32k",
873 "pll_p",
874 "clk_m",
875 "pll_e",
876};
877
878static const char *mux_cclk_g[] = {
879 "clk_m",
880 "pll_c",
881 "clk_32k",
882 "pll_m",
883 "pll_p",
884 "pll_p_out4",
885 "pll_p_out3",
886 "dummy",
887 "pll_x",
888};
889
890static struct clk *mux_pllm_pllc_pllp_plla_p[] = {
891 &tegra_pll_m,
892 &tegra_pll_c,
893 &tegra_pll_p,
894 &tegra_pll_a_out0,
895};
896
897static struct clk *mux_pllp_pllc_pllm_clkm_p[] = {
898 &tegra_pll_p,
899 &tegra_pll_c,
900 &tegra_pll_m,
901 &tegra_clk_m,
902};
903
904static struct clk *mux_pllp_clkm_p[] = {
905 &tegra_pll_p,
906 NULL,
907 NULL,
908 &tegra_clk_m,
909};
910
911static struct clk *mux_pllp_plld_pllc_clkm_p[] = {
912 &tegra_pll_p,
913 &tegra_pll_d_out0,
914 &tegra_pll_c,
915 &tegra_clk_m,
916};
917
918static struct clk *mux_pllp_pllm_plld_plla_pllc_plld2_clkm_p[] = {
919 &tegra_pll_p,
920 &tegra_pll_m,
921 &tegra_pll_d_out0,
922 &tegra_pll_a_out0,
923 &tegra_pll_c,
924 &tegra_pll_d2_out0,
925 &tegra_clk_m,
926};
927
928static struct clk *mux_plla_pllc_pllp_clkm_p[] = {
929 &tegra_pll_a_out0,
930 NULL,
931 &tegra_pll_p,
932 &tegra_clk_m,
933};
934
935static struct clk *mux_pllp_pllc_clk32_clkm_p[] = {
936 &tegra_pll_p,
937 &tegra_pll_c,
938 &tegra_clk_32k,
939 &tegra_clk_m,
940};
941
942static struct clk *mux_pllp_pllc_clkm_clk32_p[] = {
943 &tegra_pll_p,
944 &tegra_pll_c,
945 &tegra_clk_m,
946 &tegra_clk_32k,
947};
948
949static struct clk *mux_pllp_pllc_pllm_p[] = {
950 &tegra_pll_p,
951 &tegra_pll_c,
952 &tegra_pll_m,
953};
954
955static struct clk *mux_clk_m_p[] = {
956 &tegra_clk_m,
957};
958
959static struct clk *mux_pllp_out3_p[] = {
960 &tegra_pll_p_out3,
961};
962
963static struct clk *mux_plld_out0_p[] = {
964 &tegra_pll_d_out0,
965};
966
967static struct clk *mux_plld_out0_plld2_out0_p[] = {
968 &tegra_pll_d_out0,
969 &tegra_pll_d2_out0,
970};
971
972static struct clk *mux_clk_32k_p[] = {
973 &tegra_clk_32k,
974};
975
976static struct clk *mux_plla_clk32_pllp_clkm_plle_p[] = {
977 &tegra_pll_a_out0,
978 &tegra_clk_32k,
979 &tegra_pll_p,
980 &tegra_clk_m,
981 &tegra_pll_e,
982};
983
984static struct clk *mux_cclk_g_p[] = {
985 &tegra_clk_m,
986 &tegra_pll_c,
987 &tegra_clk_32k,
988 &tegra_pll_m,
989 &tegra_pll_p,
990 &tegra_pll_p_out4,
991 &tegra_pll_p_out3,
992 NULL,
993 &tegra_pll_x,
994};
995
996static struct clk tegra_clk_cclk_g;
997static struct clk_tegra tegra_clk_cclk_g_hw = {
998 .hw = {
999 .clk = &tegra_clk_cclk_g,
1000 },
1001 .flags = DIV_U71 | DIV_U71_INT,
1002 .reg = 0x368,
1003 .max_rate = 1700000000,
1004};
1005static struct clk tegra_clk_cclk_g = {
1006 .name = "cclk_g",
1007 .ops = &tegra30_super_ops,
1008 .hw = &tegra_clk_cclk_g_hw.hw,
1009 .parent_names = mux_cclk_g,
1010 .parents = mux_cclk_g_p,
1011 .num_parents = ARRAY_SIZE(mux_cclk_g),
1012};
1013
1014static const char *mux_twd[] = {
1015 "cclk_g",
1016};
1017
1018static struct clk *mux_twd_p[] = {
1019 &tegra_clk_cclk_g,
1020};
1021
1022static struct clk tegra30_clk_twd;
1023static struct clk_tegra tegra30_clk_twd_hw = {
1024 .hw = {
1025 .clk = &tegra30_clk_twd,
1026 },
1027 .max_rate = 1400000000,
1028 .mul = 1,
1029 .div = 2,
1030};
1031
1032static struct clk tegra30_clk_twd = {
1033 .name = "twd",
1034 .ops = &tegra30_twd_ops,
1035 .hw = &tegra30_clk_twd_hw.hw,
1036 .parent = &tegra_clk_cclk_g,
1037 .parent_names = mux_twd,
1038 .parents = mux_twd_p,
1039 .num_parents = ARRAY_SIZE(mux_twd),
1040};
1041
1042#define PERIPH_CLK(_name, _dev, _con, _clk_num, _reg, \
1043 _max, _inputs, _flags) \
1044 static struct clk tegra_##_name; \
1045 static struct clk_tegra tegra_##_name##_hw = { \
1046 .hw = { \
1047 .clk = &tegra_##_name, \
1048 }, \
1049 .lookup = { \
1050 .dev_id = _dev, \
1051 .con_id = _con, \
1052 }, \
1053 .reg = _reg, \
1054 .flags = _flags, \
1055 .max_rate = _max, \
1056 .u.periph = { \
1057 .clk_num = _clk_num, \
1058 }, \
1059 .reset = &tegra30_periph_clk_reset, \
1060 }; \
1061 static struct clk tegra_##_name = { \
1062 .name = #_name, \
1063 .ops = &tegra30_periph_clk_ops, \
1064 .hw = &tegra_##_name##_hw.hw, \
1065 .parent_names = _inputs, \
1066 .parents = _inputs##_p, \
1067 .num_parents = ARRAY_SIZE(_inputs), \
1068 };
1069
1070PERIPH_CLK(apbdma, "tegra-apbdma", NULL, 34, 0, 26000000, mux_clk_m, 0);
1071PERIPH_CLK(rtc, "rtc-tegra", NULL, 4, 0, 32768, mux_clk_32k, PERIPH_NO_RESET | PERIPH_ON_APB);
1072PERIPH_CLK(kbc, "tegra-kbc", NULL, 36, 0, 32768, mux_clk_32k, PERIPH_NO_RESET | PERIPH_ON_APB);
1073PERIPH_CLK(timer, "timer", NULL, 5, 0, 26000000, mux_clk_m, 0);
1074PERIPH_CLK(kfuse, "kfuse-tegra", NULL, 40, 0, 26000000, mux_clk_m, 0);
1075PERIPH_CLK(fuse, "fuse-tegra", "fuse", 39, 0, 26000000, mux_clk_m, PERIPH_ON_APB);
1076PERIPH_CLK(fuse_burn, "fuse-tegra", "fuse_burn", 39, 0, 26000000, mux_clk_m, PERIPH_ON_APB);
1077PERIPH_CLK(apbif, "tegra30-ahub", "apbif", 107, 0, 26000000, mux_clk_m, 0);
1078PERIPH_CLK(i2s0, "tegra30-i2s.0", NULL, 30, 0x1d8, 26000000, mux_pllaout0_audio0_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1079PERIPH_CLK(i2s1, "tegra30-i2s.1", NULL, 11, 0x100, 26000000, mux_pllaout0_audio1_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1080PERIPH_CLK(i2s2, "tegra30-i2s.2", NULL, 18, 0x104, 26000000, mux_pllaout0_audio2_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1081PERIPH_CLK(i2s3, "tegra30-i2s.3", NULL, 101, 0x3bc, 26000000, mux_pllaout0_audio3_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1082PERIPH_CLK(i2s4, "tegra30-i2s.4", NULL, 102, 0x3c0, 26000000, mux_pllaout0_audio4_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1083PERIPH_CLK(spdif_out, "tegra30-spdif", "spdif_out", 10, 0x108, 100000000, mux_pllaout0_audio5_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1084PERIPH_CLK(spdif_in, "tegra30-spdif", "spdif_in", 10, 0x10c, 100000000, mux_pllp_pllc_pllm, MUX | DIV_U71 | PERIPH_ON_APB);
1085PERIPH_CLK(pwm, "tegra-pwm", NULL, 17, 0x110, 432000000, mux_pllp_pllc_clk32_clkm, MUX | MUX_PWM | DIV_U71 | PERIPH_ON_APB);
1086PERIPH_CLK(d_audio, "tegra30-ahub", "d_audio", 106, 0x3d0, 48000000, mux_plla_pllc_pllp_clkm, MUX | DIV_U71);
1087PERIPH_CLK(dam0, "tegra30-dam.0", NULL, 108, 0x3d8, 48000000, mux_plla_pllc_pllp_clkm, MUX | DIV_U71);
1088PERIPH_CLK(dam1, "tegra30-dam.1", NULL, 109, 0x3dc, 48000000, mux_plla_pllc_pllp_clkm, MUX | DIV_U71);
1089PERIPH_CLK(dam2, "tegra30-dam.2", NULL, 110, 0x3e0, 48000000, mux_plla_pllc_pllp_clkm, MUX | DIV_U71);
1090PERIPH_CLK(hda, "tegra30-hda", "hda", 125, 0x428, 108000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
1091PERIPH_CLK(hda2codec_2x, "tegra30-hda", "hda2codec", 111, 0x3e4, 48000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
1092PERIPH_CLK(hda2hdmi, "tegra30-hda", "hda2hdmi", 128, 0, 48000000, mux_clk_m, 0);
1093PERIPH_CLK(sbc1, "spi_tegra.0", NULL, 41, 0x134, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1094PERIPH_CLK(sbc2, "spi_tegra.1", NULL, 44, 0x118, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1095PERIPH_CLK(sbc3, "spi_tegra.2", NULL, 46, 0x11c, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1096PERIPH_CLK(sbc4, "spi_tegra.3", NULL, 68, 0x1b4, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1097PERIPH_CLK(sbc5, "spi_tegra.4", NULL, 104, 0x3c8, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1098PERIPH_CLK(sbc6, "spi_tegra.5", NULL, 105, 0x3cc, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1099PERIPH_CLK(sata_oob, "tegra_sata_oob", NULL, 123, 0x420, 216000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
1100PERIPH_CLK(sata, "tegra_sata", NULL, 124, 0x424, 216000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
1101PERIPH_CLK(sata_cold, "tegra_sata_cold", NULL, 129, 0, 48000000, mux_clk_m, 0);
1102PERIPH_CLK(ndflash, "tegra_nand", NULL, 13, 0x160, 240000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
1103PERIPH_CLK(ndspeed, "tegra_nand_speed", NULL, 80, 0x3f8, 240000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
1104PERIPH_CLK(vfir, "vfir", NULL, 7, 0x168, 72000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1105PERIPH_CLK(sdmmc1, "sdhci-tegra.0", NULL, 14, 0x150, 208000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
1106PERIPH_CLK(sdmmc2, "sdhci-tegra.1", NULL, 9, 0x154, 104000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
1107PERIPH_CLK(sdmmc3, "sdhci-tegra.2", NULL, 69, 0x1bc, 208000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
1108PERIPH_CLK(sdmmc4, "sdhci-tegra.3", NULL, 15, 0x164, 104000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
1109PERIPH_CLK(vcp, "tegra-avp", "vcp", 29, 0, 250000000, mux_clk_m, 0);
1110PERIPH_CLK(bsea, "tegra-avp", "bsea", 62, 0, 250000000, mux_clk_m, 0);
1111PERIPH_CLK(bsev, "tegra-aes", "bsev", 63, 0, 250000000, mux_clk_m, 0);
1112PERIPH_CLK(vde, "vde", NULL, 61, 0x1c8, 520000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_INT);
1113PERIPH_CLK(csite, "csite", NULL, 73, 0x1d4, 144000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* max rate ??? */
1114PERIPH_CLK(la, "la", NULL, 76, 0x1f8, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
1115PERIPH_CLK(owr, "tegra_w1", NULL, 71, 0x1cc, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1116PERIPH_CLK(nor, "nor", NULL, 42, 0x1d0, 127000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* requires min voltage */
1117PERIPH_CLK(mipi, "mipi", NULL, 50, 0x174, 60000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB); /* scales with voltage */
1118PERIPH_CLK(i2c1, "tegra-i2c.0", "div-clk", 12, 0x124, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB);
1119PERIPH_CLK(i2c2, "tegra-i2c.1", "div-clk", 54, 0x198, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB);
1120PERIPH_CLK(i2c3, "tegra-i2c.2", "div-clk", 67, 0x1b8, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB);
1121PERIPH_CLK(i2c4, "tegra-i2c.3", "div-clk", 103, 0x3c4, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB);
1122PERIPH_CLK(i2c5, "tegra-i2c.4", "div-clk", 47, 0x128, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB);
1123PERIPH_CLK(uarta, "tegra-uart.0", NULL, 6, 0x178, 800000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_UART | PERIPH_ON_APB);
1124PERIPH_CLK(uartb, "tegra-uart.1", NULL, 7, 0x17c, 800000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_UART | PERIPH_ON_APB);
1125PERIPH_CLK(uartc, "tegra-uart.2", NULL, 55, 0x1a0, 800000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_UART | PERIPH_ON_APB);
1126PERIPH_CLK(uartd, "tegra-uart.3", NULL, 65, 0x1c0, 800000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_UART | PERIPH_ON_APB);
1127PERIPH_CLK(uarte, "tegra-uart.4", NULL, 66, 0x1c4, 800000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_UART | PERIPH_ON_APB);
1128PERIPH_CLK(vi, "tegra_camera", "vi", 20, 0x148, 425000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT);
1129PERIPH_CLK(3d, "3d", NULL, 24, 0x158, 520000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT | DIV_U71_IDLE | PERIPH_MANUAL_RESET);
1130PERIPH_CLK(3d2, "3d2", NULL, 98, 0x3b0, 520000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT | DIV_U71_IDLE | PERIPH_MANUAL_RESET);
1131PERIPH_CLK(2d, "2d", NULL, 21, 0x15c, 520000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT | DIV_U71_IDLE);
1132PERIPH_CLK(vi_sensor, "tegra_camera", "vi_sensor", 20, 0x1a8, 150000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | PERIPH_NO_RESET);
1133PERIPH_CLK(epp, "epp", NULL, 19, 0x16c, 520000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT);
1134PERIPH_CLK(mpe, "mpe", NULL, 60, 0x170, 520000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT);
1135PERIPH_CLK(host1x, "host1x", NULL, 28, 0x180, 260000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT);
1136PERIPH_CLK(cve, "cve", NULL, 49, 0x140, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71); /* requires min voltage */
1137PERIPH_CLK(tvo, "tvo", NULL, 49, 0x188, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71); /* requires min voltage */
1138PERIPH_CLK(dtv, "dtv", NULL, 79, 0x1dc, 250000000, mux_clk_m, 0);
1139PERIPH_CLK(hdmi, "hdmi", NULL, 51, 0x18c, 148500000, mux_pllp_pllm_plld_plla_pllc_plld2_clkm, MUX | MUX8 | DIV_U71);
1140PERIPH_CLK(tvdac, "tvdac", NULL, 53, 0x194, 220000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71); /* requires min voltage */
1141PERIPH_CLK(disp1, "tegradc.0", NULL, 27, 0x138, 600000000, mux_pllp_pllm_plld_plla_pllc_plld2_clkm, MUX | MUX8);
1142PERIPH_CLK(disp2, "tegradc.1", NULL, 26, 0x13c, 600000000, mux_pllp_pllm_plld_plla_pllc_plld2_clkm, MUX | MUX8);
1143PERIPH_CLK(usbd, "fsl-tegra-udc", NULL, 22, 0, 480000000, mux_clk_m, 0); /* requires min voltage */
1144PERIPH_CLK(usb2, "tegra-ehci.1", NULL, 58, 0, 480000000, mux_clk_m, 0); /* requires min voltage */
1145PERIPH_CLK(usb3, "tegra-ehci.2", NULL, 59, 0, 480000000, mux_clk_m, 0); /* requires min voltage */
1146PERIPH_CLK(dsia, "tegradc.0", "dsia", 48, 0, 500000000, mux_plld_out0, 0);
1147PERIPH_CLK(csi, "tegra_camera", "csi", 52, 0, 102000000, mux_pllp_out3, 0);
1148PERIPH_CLK(isp, "tegra_camera", "isp", 23, 0, 150000000, mux_clk_m, 0); /* same frequency as VI */
1149PERIPH_CLK(csus, "tegra_camera", "csus", 92, 0, 150000000, mux_clk_m, PERIPH_NO_RESET);
1150PERIPH_CLK(tsensor, "tegra-tsensor", NULL, 100, 0x3b8, 216000000, mux_pllp_pllc_clkm_clk32, MUX | DIV_U71);
1151PERIPH_CLK(actmon, "actmon", NULL, 119, 0x3e8, 216000000, mux_pllp_pllc_clk32_clkm, MUX | DIV_U71);
1152PERIPH_CLK(extern1, "extern1", NULL, 120, 0x3ec, 216000000, mux_plla_clk32_pllp_clkm_plle, MUX | MUX8 | DIV_U71);
1153PERIPH_CLK(extern2, "extern2", NULL, 121, 0x3f0, 216000000, mux_plla_clk32_pllp_clkm_plle, MUX | MUX8 | DIV_U71);
1154PERIPH_CLK(extern3, "extern3", NULL, 122, 0x3f4, 216000000, mux_plla_clk32_pllp_clkm_plle, MUX | MUX8 | DIV_U71);
1155PERIPH_CLK(i2cslow, "i2cslow", NULL, 81, 0x3fc, 26000000, mux_pllp_pllc_clk32_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1156PERIPH_CLK(pcie, "tegra-pcie", "pcie", 70, 0, 250000000, mux_clk_m, 0);
1157PERIPH_CLK(afi, "tegra-pcie", "afi", 72, 0, 250000000, mux_clk_m, 0);
1158PERIPH_CLK(se, "se", NULL, 127, 0x42c, 520000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_INT);
1159
1160static struct clk tegra_dsib;
1161static struct clk_tegra tegra_dsib_hw = {
1162 .hw = {
1163 .clk = &tegra_dsib,
1164 },
1165 .lookup = {
1166 .dev_id = "tegradc.1",
1167 .con_id = "dsib",
1168 },
1169 .reg = 0xd0,
1170 .flags = MUX | PLLD,
1171 .max_rate = 500000000,
1172 .u.periph = {
1173 .clk_num = 82,
1174 },
1175 .reset = &tegra30_periph_clk_reset,
1176};
1177static struct clk tegra_dsib = {
1178 .name = "dsib",
1179 .ops = &tegra30_dsib_clk_ops,
1180 .hw = &tegra_dsib_hw.hw,
1181 .parent_names = mux_plld_out0_plld2_out0,
1182 .parents = mux_plld_out0_plld2_out0_p,
1183 .num_parents = ARRAY_SIZE(mux_plld_out0_plld2_out0),
1184};
1185
1186struct clk *tegra_list_clks[] = {
1187 &tegra_apbdma,
1188 &tegra_rtc,
1189 &tegra_kbc,
1190 &tegra_timer,
1191 &tegra_kfuse,
1192 &tegra_fuse,
1193 &tegra_fuse_burn,
1194 &tegra_apbif,
1195 &tegra_i2s0,
1196 &tegra_i2s1,
1197 &tegra_i2s2,
1198 &tegra_i2s3,
1199 &tegra_i2s4,
1200 &tegra_spdif_out,
1201 &tegra_spdif_in,
1202 &tegra_pwm,
1203 &tegra_d_audio,
1204 &tegra_dam0,
1205 &tegra_dam1,
1206 &tegra_dam2,
1207 &tegra_hda,
1208 &tegra_hda2codec_2x,
1209 &tegra_hda2hdmi,
1210 &tegra_sbc1,
1211 &tegra_sbc2,
1212 &tegra_sbc3,
1213 &tegra_sbc4,
1214 &tegra_sbc5,
1215 &tegra_sbc6,
1216 &tegra_sata_oob,
1217 &tegra_sata,
1218 &tegra_sata_cold,
1219 &tegra_ndflash,
1220 &tegra_ndspeed,
1221 &tegra_vfir,
1222 &tegra_sdmmc1,
1223 &tegra_sdmmc2,
1224 &tegra_sdmmc3,
1225 &tegra_sdmmc4,
1226 &tegra_vcp,
1227 &tegra_bsea,
1228 &tegra_bsev,
1229 &tegra_vde,
1230 &tegra_csite,
1231 &tegra_la,
1232 &tegra_owr,
1233 &tegra_nor,
1234 &tegra_mipi,
1235 &tegra_i2c1,
1236 &tegra_i2c2,
1237 &tegra_i2c3,
1238 &tegra_i2c4,
1239 &tegra_i2c5,
1240 &tegra_uarta,
1241 &tegra_uartb,
1242 &tegra_uartc,
1243 &tegra_uartd,
1244 &tegra_uarte,
1245 &tegra_vi,
1246 &tegra_3d,
1247 &tegra_3d2,
1248 &tegra_2d,
1249 &tegra_vi_sensor,
1250 &tegra_epp,
1251 &tegra_mpe,
1252 &tegra_host1x,
1253 &tegra_cve,
1254 &tegra_tvo,
1255 &tegra_dtv,
1256 &tegra_hdmi,
1257 &tegra_tvdac,
1258 &tegra_disp1,
1259 &tegra_disp2,
1260 &tegra_usbd,
1261 &tegra_usb2,
1262 &tegra_usb3,
1263 &tegra_dsia,
1264 &tegra_dsib,
1265 &tegra_csi,
1266 &tegra_isp,
1267 &tegra_csus,
1268 &tegra_tsensor,
1269 &tegra_actmon,
1270 &tegra_extern1,
1271 &tegra_extern2,
1272 &tegra_extern3,
1273 &tegra_i2cslow,
1274 &tegra_pcie,
1275 &tegra_afi,
1276 &tegra_se,
1277};
1278
1279#define CLK_DUPLICATE(_name, _dev, _con) \
1280 { \
1281 .name = _name, \
1282 .lookup = { \
1283 .dev_id = _dev, \
1284 .con_id = _con, \
1285 }, \
1286 }
1287
1288/* Some clocks may be used by different drivers depending on the board
1289 * configuration. List those here to register them twice in the clock lookup
1290 * table under two names.
1291 */
1292struct clk_duplicate tegra_clk_duplicates[] = {
1293 CLK_DUPLICATE("uarta", "serial8250.0", NULL),
1294 CLK_DUPLICATE("uartb", "serial8250.1", NULL),
1295 CLK_DUPLICATE("uartc", "serial8250.2", NULL),
1296 CLK_DUPLICATE("uartd", "serial8250.3", NULL),
1297 CLK_DUPLICATE("uarte", "serial8250.4", NULL),
1298 CLK_DUPLICATE("usbd", "utmip-pad", NULL),
1299 CLK_DUPLICATE("usbd", "tegra-ehci.0", NULL),
1300 CLK_DUPLICATE("usbd", "tegra-otg", NULL),
1301 CLK_DUPLICATE("dsib", "tegradc.0", "dsib"),
1302 CLK_DUPLICATE("dsia", "tegradc.1", "dsia"),
1303 CLK_DUPLICATE("bsev", "tegra-avp", "bsev"),
1304 CLK_DUPLICATE("bsev", "nvavp", "bsev"),
1305 CLK_DUPLICATE("vde", "tegra-aes", "vde"),
1306 CLK_DUPLICATE("bsea", "tegra-aes", "bsea"),
1307 CLK_DUPLICATE("bsea", "nvavp", "bsea"),
1308 CLK_DUPLICATE("cml1", "tegra_sata_cml", NULL),
1309 CLK_DUPLICATE("cml0", "tegra_pcie", "cml"),
1310 CLK_DUPLICATE("pciex", "tegra_pcie", "pciex"),
1311 CLK_DUPLICATE("i2c1", "tegra-i2c-slave.0", NULL),
1312 CLK_DUPLICATE("i2c2", "tegra-i2c-slave.1", NULL),
1313 CLK_DUPLICATE("i2c3", "tegra-i2c-slave.2", NULL),
1314 CLK_DUPLICATE("i2c4", "tegra-i2c-slave.3", NULL),
1315 CLK_DUPLICATE("i2c5", "tegra-i2c-slave.4", NULL),
1316 CLK_DUPLICATE("sbc1", "spi_slave_tegra.0", NULL),
1317 CLK_DUPLICATE("sbc2", "spi_slave_tegra.1", NULL),
1318 CLK_DUPLICATE("sbc3", "spi_slave_tegra.2", NULL),
1319 CLK_DUPLICATE("sbc4", "spi_slave_tegra.3", NULL),
1320 CLK_DUPLICATE("sbc5", "spi_slave_tegra.4", NULL),
1321 CLK_DUPLICATE("sbc6", "spi_slave_tegra.5", NULL),
1322 CLK_DUPLICATE("twd", "smp_twd", NULL),
1323 CLK_DUPLICATE("vcp", "nvavp", "vcp"),
1324 CLK_DUPLICATE("i2s0", NULL, "i2s0"),
1325 CLK_DUPLICATE("i2s1", NULL, "i2s1"),
1326 CLK_DUPLICATE("i2s2", NULL, "i2s2"),
1327 CLK_DUPLICATE("i2s3", NULL, "i2s3"),
1328 CLK_DUPLICATE("i2s4", NULL, "i2s4"),
1329 CLK_DUPLICATE("dam0", NULL, "dam0"),
1330 CLK_DUPLICATE("dam1", NULL, "dam1"),
1331 CLK_DUPLICATE("dam2", NULL, "dam2"),
1332 CLK_DUPLICATE("spdif_in", NULL, "spdif_in"),
1333 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.0", "fast-clk"),
1334 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.1", "fast-clk"),
1335 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.2", "fast-clk"),
1336 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.3", "fast-clk"),
1337 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.4", "fast-clk"),
1338 CLK_DUPLICATE("pll_p", "tegradc.0", "parent"),
1339 CLK_DUPLICATE("pll_p", "tegradc.1", "parent"),
1340 CLK_DUPLICATE("pll_d2_out0", "hdmi", "parent"),
1341};
1342
1343struct clk *tegra_ptr_clks[] = {
1344 &tegra_clk_32k,
1345 &tegra_clk_m,
1346 &tegra_clk_m_div2,
1347 &tegra_clk_m_div4,
1348 &tegra_pll_ref,
1349 &tegra_pll_m,
1350 &tegra_pll_m_out1,
1351 &tegra_pll_c,
1352 &tegra_pll_c_out1,
1353 &tegra_pll_p,
1354 &tegra_pll_p_out1,
1355 &tegra_pll_p_out2,
1356 &tegra_pll_p_out3,
1357 &tegra_pll_p_out4,
1358 &tegra_pll_a,
1359 &tegra_pll_a_out0,
1360 &tegra_pll_d,
1361 &tegra_pll_d_out0,
1362 &tegra_pll_d2,
1363 &tegra_pll_d2_out0,
1364 &tegra_pll_u,
1365 &tegra_pll_x,
1366 &tegra_pll_x_out0,
1367 &tegra_pll_e,
1368 &tegra_clk_cclk_g,
1369 &tegra_cml0,
1370 &tegra_cml1,
1371 &tegra_pciex,
1372 &tegra_clk_sclk,
1373 &tegra_hclk,
1374 &tegra_pclk,
1375 &tegra_clk_blink,
1376 &tegra30_clk_twd,
1377};
1378
1379static void tegra30_init_one_clock(struct clk *c)
1380{
1381 struct clk_tegra *clk = to_clk_tegra(c->hw);
1382 __clk_init(NULL, c);
1383 INIT_LIST_HEAD(&clk->shared_bus_list);
1384 if (!clk->lookup.dev_id && !clk->lookup.con_id)
1385 clk->lookup.con_id = c->name;
1386 clk->lookup.clk = c;
1387 clkdev_add(&clk->lookup);
1388 tegra_clk_add(c);
1389}
1390
1391void __init tegra30_init_clocks(void)
1392{
1393 int i;
1394 struct clk *c;
1395
1396 for (i = 0; i < ARRAY_SIZE(tegra_ptr_clks); i++)
1397 tegra30_init_one_clock(tegra_ptr_clks[i]);
1398
1399 for (i = 0; i < ARRAY_SIZE(tegra_list_clks); i++)
1400 tegra30_init_one_clock(tegra_list_clks[i]);
1401
1402 for (i = 0; i < ARRAY_SIZE(tegra_clk_duplicates); i++) {
1403 c = tegra_get_clock_by_name(tegra_clk_duplicates[i].name);
1404 if (!c) {
1405 pr_err("%s: Unknown duplicate clock %s\n", __func__,
1406 tegra_clk_duplicates[i].name);
1407 continue;
1408 }
1409
1410 tegra_clk_duplicates[i].lookup.clk = c;
1411 clkdev_add(&tegra_clk_duplicates[i].lookup);
1412 }
1413
1414 for (i = 0; i < ARRAY_SIZE(tegra_sync_source_list); i++)
1415 tegra30_init_one_clock(tegra_sync_source_list[i]);
1416 for (i = 0; i < ARRAY_SIZE(tegra_clk_audio_list); i++)
1417 tegra30_init_one_clock(tegra_clk_audio_list[i]);
1418 for (i = 0; i < ARRAY_SIZE(tegra_clk_audio_2x_list); i++)
1419 tegra30_init_one_clock(tegra_clk_audio_2x_list[i]);
1420
1421 for (i = 0; i < ARRAY_SIZE(tegra_clk_out_list); i++)
1422 tegra30_init_one_clock(tegra_clk_out_list[i]);
1423
1424 tegra30_cpu_car_ops_init();
1425}
diff --git a/arch/arm/mach-tegra/tegra_cpu_car.h b/arch/arm/mach-tegra/tegra_cpu_car.h
deleted file mode 100644
index 9764d31032b7..000000000000
--- a/arch/arm/mach-tegra/tegra_cpu_car.h
+++ /dev/null
@@ -1,124 +0,0 @@
1/*
2 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef __MACH_TEGRA_CPU_CAR_H
18#define __MACH_TEGRA_CPU_CAR_H
19
20/*
21 * Tegra CPU clock and reset control ops
22 *
23 * wait_for_reset:
24 * keep waiting until the CPU in reset state
25 * put_in_reset:
26 * put the CPU in reset state
27 * out_of_reset:
28 * release the CPU from reset state
29 * enable_clock:
30 * CPU clock un-gate
31 * disable_clock:
32 * CPU clock gate
33 * rail_off_ready:
34 * CPU is ready for rail off
35 * suspend:
36 * save the clock settings when CPU go into low-power state
37 * resume:
38 * restore the clock settings when CPU exit low-power state
39 */
40struct tegra_cpu_car_ops {
41 void (*wait_for_reset)(u32 cpu);
42 void (*put_in_reset)(u32 cpu);
43 void (*out_of_reset)(u32 cpu);
44 void (*enable_clock)(u32 cpu);
45 void (*disable_clock)(u32 cpu);
46#ifdef CONFIG_PM_SLEEP
47 bool (*rail_off_ready)(void);
48 void (*suspend)(void);
49 void (*resume)(void);
50#endif
51};
52
53extern struct tegra_cpu_car_ops *tegra_cpu_car_ops;
54
55static inline void tegra_wait_cpu_in_reset(u32 cpu)
56{
57 if (WARN_ON(!tegra_cpu_car_ops->wait_for_reset))
58 return;
59
60 tegra_cpu_car_ops->wait_for_reset(cpu);
61}
62
63static inline void tegra_put_cpu_in_reset(u32 cpu)
64{
65 if (WARN_ON(!tegra_cpu_car_ops->put_in_reset))
66 return;
67
68 tegra_cpu_car_ops->put_in_reset(cpu);
69}
70
71static inline void tegra_cpu_out_of_reset(u32 cpu)
72{
73 if (WARN_ON(!tegra_cpu_car_ops->out_of_reset))
74 return;
75
76 tegra_cpu_car_ops->out_of_reset(cpu);
77}
78
79static inline void tegra_enable_cpu_clock(u32 cpu)
80{
81 if (WARN_ON(!tegra_cpu_car_ops->enable_clock))
82 return;
83
84 tegra_cpu_car_ops->enable_clock(cpu);
85}
86
87static inline void tegra_disable_cpu_clock(u32 cpu)
88{
89 if (WARN_ON(!tegra_cpu_car_ops->disable_clock))
90 return;
91
92 tegra_cpu_car_ops->disable_clock(cpu);
93}
94
95#ifdef CONFIG_PM_SLEEP
96static inline bool tegra_cpu_rail_off_ready(void)
97{
98 if (WARN_ON(!tegra_cpu_car_ops->rail_off_ready))
99 return false;
100
101 return tegra_cpu_car_ops->rail_off_ready();
102}
103
104static inline void tegra_cpu_clock_suspend(void)
105{
106 if (WARN_ON(!tegra_cpu_car_ops->suspend))
107 return;
108
109 tegra_cpu_car_ops->suspend();
110}
111
112static inline void tegra_cpu_clock_resume(void)
113{
114 if (WARN_ON(!tegra_cpu_car_ops->resume))
115 return;
116
117 tegra_cpu_car_ops->resume();
118}
119#endif
120
121void tegra20_cpu_car_ops_init(void);
122void tegra30_cpu_car_ops_init(void);
123
124#endif /* __MACH_TEGRA_CPU_CAR_H */
diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c
deleted file mode 100644
index e4863f3e9ee7..000000000000
--- a/arch/arm/mach-tegra/timer.c
+++ /dev/null
@@ -1,292 +0,0 @@
1/*
2 * arch/arch/mach-tegra/timer.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/init.h>
21#include <linux/err.h>
22#include <linux/time.h>
23#include <linux/interrupt.h>
24#include <linux/irq.h>
25#include <linux/clockchips.h>
26#include <linux/clocksource.h>
27#include <linux/clk.h>
28#include <linux/io.h>
29#include <linux/of_address.h>
30#include <linux/of_irq.h>
31
32#include <asm/mach/time.h>
33#include <asm/smp_twd.h>
34#include <asm/sched_clock.h>
35
36#include "board.h"
37
38#define RTC_SECONDS 0x08
39#define RTC_SHADOW_SECONDS 0x0c
40#define RTC_MILLISECONDS 0x10
41
42#define TIMERUS_CNTR_1US 0x10
43#define TIMERUS_USEC_CFG 0x14
44#define TIMERUS_CNTR_FREEZE 0x4c
45
46#define TIMER1_BASE 0x0
47#define TIMER2_BASE 0x8
48#define TIMER3_BASE 0x50
49#define TIMER4_BASE 0x58
50
51#define TIMER_PTV 0x0
52#define TIMER_PCR 0x4
53
54static void __iomem *timer_reg_base;
55static void __iomem *rtc_base;
56
57static struct timespec persistent_ts;
58static u64 persistent_ms, last_persistent_ms;
59
60#define timer_writel(value, reg) \
61 __raw_writel(value, timer_reg_base + (reg))
62#define timer_readl(reg) \
63 __raw_readl(timer_reg_base + (reg))
64
65static int tegra_timer_set_next_event(unsigned long cycles,
66 struct clock_event_device *evt)
67{
68 u32 reg;
69
70 reg = 0x80000000 | ((cycles > 1) ? (cycles-1) : 0);
71 timer_writel(reg, TIMER3_BASE + TIMER_PTV);
72
73 return 0;
74}
75
76static void tegra_timer_set_mode(enum clock_event_mode mode,
77 struct clock_event_device *evt)
78{
79 u32 reg;
80
81 timer_writel(0, TIMER3_BASE + TIMER_PTV);
82
83 switch (mode) {
84 case CLOCK_EVT_MODE_PERIODIC:
85 reg = 0xC0000000 | ((1000000/HZ)-1);
86 timer_writel(reg, TIMER3_BASE + TIMER_PTV);
87 break;
88 case CLOCK_EVT_MODE_ONESHOT:
89 break;
90 case CLOCK_EVT_MODE_UNUSED:
91 case CLOCK_EVT_MODE_SHUTDOWN:
92 case CLOCK_EVT_MODE_RESUME:
93 break;
94 }
95}
96
97static struct clock_event_device tegra_clockevent = {
98 .name = "timer0",
99 .rating = 300,
100 .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC,
101 .set_next_event = tegra_timer_set_next_event,
102 .set_mode = tegra_timer_set_mode,
103};
104
105static u32 notrace tegra_read_sched_clock(void)
106{
107 return timer_readl(TIMERUS_CNTR_1US);
108}
109
110/*
111 * tegra_rtc_read - Reads the Tegra RTC registers
112 * Care must be taken that this funciton is not called while the
113 * tegra_rtc driver could be executing to avoid race conditions
114 * on the RTC shadow register
115 */
116static u64 tegra_rtc_read_ms(void)
117{
118 u32 ms = readl(rtc_base + RTC_MILLISECONDS);
119 u32 s = readl(rtc_base + RTC_SHADOW_SECONDS);
120 return (u64)s * MSEC_PER_SEC + ms;
121}
122
123/*
124 * tegra_read_persistent_clock - Return time from a persistent clock.
125 *
126 * Reads the time from a source which isn't disabled during PM, the
127 * 32k sync timer. Convert the cycles elapsed since last read into
128 * nsecs and adds to a monotonically increasing timespec.
129 * Care must be taken that this funciton is not called while the
130 * tegra_rtc driver could be executing to avoid race conditions
131 * on the RTC shadow register
132 */
133static void tegra_read_persistent_clock(struct timespec *ts)
134{
135 u64 delta;
136 struct timespec *tsp = &persistent_ts;
137
138 last_persistent_ms = persistent_ms;
139 persistent_ms = tegra_rtc_read_ms();
140 delta = persistent_ms - last_persistent_ms;
141
142 timespec_add_ns(tsp, delta * NSEC_PER_MSEC);
143 *ts = *tsp;
144}
145
146static irqreturn_t tegra_timer_interrupt(int irq, void *dev_id)
147{
148 struct clock_event_device *evt = (struct clock_event_device *)dev_id;
149 timer_writel(1<<30, TIMER3_BASE + TIMER_PCR);
150 evt->event_handler(evt);
151 return IRQ_HANDLED;
152}
153
154static struct irqaction tegra_timer_irq = {
155 .name = "timer0",
156 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_TRIGGER_HIGH,
157 .handler = tegra_timer_interrupt,
158 .dev_id = &tegra_clockevent,
159};
160
161static const struct of_device_id timer_match[] __initconst = {
162 { .compatible = "nvidia,tegra20-timer" },
163 {}
164};
165
166static const struct of_device_id rtc_match[] __initconst = {
167 { .compatible = "nvidia,tegra20-rtc" },
168 {}
169};
170
171static void __init tegra_init_timer(void)
172{
173 struct device_node *np;
174 struct clk *clk;
175 unsigned long rate;
176 int ret;
177
178 np = of_find_matching_node(NULL, timer_match);
179 if (!np) {
180 pr_err("Failed to find timer DT node\n");
181 BUG();
182 }
183
184 timer_reg_base = of_iomap(np, 0);
185 if (!timer_reg_base) {
186 pr_err("Can't map timer registers");
187 BUG();
188 }
189
190 tegra_timer_irq.irq = irq_of_parse_and_map(np, 2);
191 if (tegra_timer_irq.irq <= 0) {
192 pr_err("Failed to map timer IRQ\n");
193 BUG();
194 }
195
196 clk = clk_get_sys("timer", NULL);
197 if (IS_ERR(clk)) {
198 pr_warn("Unable to get timer clock. Assuming 12Mhz input clock.\n");
199 rate = 12000000;
200 } else {
201 clk_prepare_enable(clk);
202 rate = clk_get_rate(clk);
203 }
204
205 of_node_put(np);
206
207 np = of_find_matching_node(NULL, rtc_match);
208 if (!np) {
209 pr_err("Failed to find RTC DT node\n");
210 BUG();
211 }
212
213 rtc_base = of_iomap(np, 0);
214 if (!rtc_base) {
215 pr_err("Can't map RTC registers");
216 BUG();
217 }
218
219 /*
220 * rtc registers are used by read_persistent_clock, keep the rtc clock
221 * enabled
222 */
223 clk = clk_get_sys("rtc-tegra", NULL);
224 if (IS_ERR(clk))
225 pr_warn("Unable to get rtc-tegra clock\n");
226 else
227 clk_prepare_enable(clk);
228
229 of_node_put(np);
230
231 switch (rate) {
232 case 12000000:
233 timer_writel(0x000b, TIMERUS_USEC_CFG);
234 break;
235 case 13000000:
236 timer_writel(0x000c, TIMERUS_USEC_CFG);
237 break;
238 case 19200000:
239 timer_writel(0x045f, TIMERUS_USEC_CFG);
240 break;
241 case 26000000:
242 timer_writel(0x0019, TIMERUS_USEC_CFG);
243 break;
244 default:
245 WARN(1, "Unknown clock rate");
246 }
247
248 setup_sched_clock(tegra_read_sched_clock, 32, 1000000);
249
250 if (clocksource_mmio_init(timer_reg_base + TIMERUS_CNTR_1US,
251 "timer_us", 1000000, 300, 32, clocksource_mmio_readl_up)) {
252 pr_err("Failed to register clocksource\n");
253 BUG();
254 }
255
256 ret = setup_irq(tegra_timer_irq.irq, &tegra_timer_irq);
257 if (ret) {
258 pr_err("Failed to register timer IRQ: %d\n", ret);
259 BUG();
260 }
261
262 clockevents_calc_mult_shift(&tegra_clockevent, 1000000, 5);
263 tegra_clockevent.max_delta_ns =
264 clockevent_delta2ns(0x1fffffff, &tegra_clockevent);
265 tegra_clockevent.min_delta_ns =
266 clockevent_delta2ns(0x1, &tegra_clockevent);
267 tegra_clockevent.cpumask = cpu_all_mask;
268 tegra_clockevent.irq = tegra_timer_irq.irq;
269 clockevents_register_device(&tegra_clockevent);
270#ifdef CONFIG_HAVE_ARM_TWD
271 twd_local_timer_of_register();
272#endif
273 register_persistent_clock(NULL, tegra_read_persistent_clock);
274}
275
276struct sys_timer tegra_sys_timer = {
277 .init = tegra_init_timer,
278};
279
280#ifdef CONFIG_PM
281static u32 usec_config;
282
283void tegra_timer_suspend(void)
284{
285 usec_config = timer_readl(TIMERUS_USEC_CFG);
286}
287
288void tegra_timer_resume(void)
289{
290 timer_writel(usec_config, TIMERUS_USEC_CFG);
291}
292#endif
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c
index 4ce77cdc31cc..a683d17b2ce4 100644
--- a/arch/arm/mach-u300/core.c
+++ b/arch/arm/mach-u300/core.c
@@ -31,16 +31,16 @@
31#include <linux/dma-mapping.h> 31#include <linux/dma-mapping.h>
32#include <linux/platform_data/clk-u300.h> 32#include <linux/platform_data/clk-u300.h>
33#include <linux/platform_data/pinctrl-coh901.h> 33#include <linux/platform_data/pinctrl-coh901.h>
34#include <linux/platform_data/dma-coh901318.h>
35#include <linux/irqchip/arm-vic.h>
34 36
35#include <asm/types.h> 37#include <asm/types.h>
36#include <asm/setup.h> 38#include <asm/setup.h>
37#include <asm/memory.h> 39#include <asm/memory.h>
38#include <asm/hardware/vic.h>
39#include <asm/mach/map.h> 40#include <asm/mach/map.h>
40#include <asm/mach-types.h> 41#include <asm/mach-types.h>
41#include <asm/mach/arch.h> 42#include <asm/mach/arch.h>
42 43
43#include <mach/coh901318.h>
44#include <mach/hardware.h> 44#include <mach/hardware.h>
45#include <mach/syscon.h> 45#include <mach/syscon.h>
46#include <mach/irqs.h> 46#include <mach/irqs.h>
@@ -49,7 +49,6 @@
49#include "spi.h" 49#include "spi.h"
50#include "i2c.h" 50#include "i2c.h"
51#include "u300-gpio.h" 51#include "u300-gpio.h"
52#include "dma_channels.h"
53 52
54/* 53/*
55 * Static I/O mappings that are needed for booting the U300 platforms. The 54 * Static I/O mappings that are needed for booting the U300 platforms. The
@@ -327,1089 +326,6 @@ static struct resource dma_resource[] = {
327 } 326 }
328}; 327};
329 328
330/* points out all dma slave channels.
331 * Syntax is [A1, B1, A2, B2, .... ,-1,-1]
332 * Select all channels from A to B, end of list is marked with -1,-1
333 */
334static int dma_slave_channels[] = {
335 U300_DMA_MSL_TX_0, U300_DMA_SPI_RX,
336 U300_DMA_UART1_TX, U300_DMA_UART1_RX, -1, -1};
337
338/* points out all dma memcpy channels. */
339static int dma_memcpy_channels[] = {
340 U300_DMA_GENERAL_PURPOSE_0, U300_DMA_GENERAL_PURPOSE_8, -1, -1};
341
342/** register dma for memory access
343 *
344 * active 1 means dma intends to access memory
345 * 0 means dma wont access memory
346 */
347static void coh901318_access_memory_state(struct device *dev, bool active)
348{
349}
350
351#define flags_memcpy_config (COH901318_CX_CFG_CH_DISABLE | \
352 COH901318_CX_CFG_RM_MEMORY_TO_MEMORY | \
353 COH901318_CX_CFG_LCR_DISABLE | \
354 COH901318_CX_CFG_TC_IRQ_ENABLE | \
355 COH901318_CX_CFG_BE_IRQ_ENABLE)
356#define flags_memcpy_lli_chained (COH901318_CX_CTRL_TC_ENABLE | \
357 COH901318_CX_CTRL_BURST_COUNT_32_BYTES | \
358 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | \
359 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | \
360 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | \
361 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | \
362 COH901318_CX_CTRL_MASTER_MODE_M1RW | \
363 COH901318_CX_CTRL_TCP_DISABLE | \
364 COH901318_CX_CTRL_TC_IRQ_DISABLE | \
365 COH901318_CX_CTRL_HSP_DISABLE | \
366 COH901318_CX_CTRL_HSS_DISABLE | \
367 COH901318_CX_CTRL_DDMA_LEGACY | \
368 COH901318_CX_CTRL_PRDD_SOURCE)
369#define flags_memcpy_lli (COH901318_CX_CTRL_TC_ENABLE | \
370 COH901318_CX_CTRL_BURST_COUNT_32_BYTES | \
371 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | \
372 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | \
373 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | \
374 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | \
375 COH901318_CX_CTRL_MASTER_MODE_M1RW | \
376 COH901318_CX_CTRL_TCP_DISABLE | \
377 COH901318_CX_CTRL_TC_IRQ_DISABLE | \
378 COH901318_CX_CTRL_HSP_DISABLE | \
379 COH901318_CX_CTRL_HSS_DISABLE | \
380 COH901318_CX_CTRL_DDMA_LEGACY | \
381 COH901318_CX_CTRL_PRDD_SOURCE)
382#define flags_memcpy_lli_last (COH901318_CX_CTRL_TC_ENABLE | \
383 COH901318_CX_CTRL_BURST_COUNT_32_BYTES | \
384 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | \
385 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | \
386 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | \
387 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | \
388 COH901318_CX_CTRL_MASTER_MODE_M1RW | \
389 COH901318_CX_CTRL_TCP_DISABLE | \
390 COH901318_CX_CTRL_TC_IRQ_ENABLE | \
391 COH901318_CX_CTRL_HSP_DISABLE | \
392 COH901318_CX_CTRL_HSS_DISABLE | \
393 COH901318_CX_CTRL_DDMA_LEGACY | \
394 COH901318_CX_CTRL_PRDD_SOURCE)
395
396const struct coh_dma_channel chan_config[U300_DMA_CHANNELS] = {
397 {
398 .number = U300_DMA_MSL_TX_0,
399 .name = "MSL TX 0",
400 .priority_high = 0,
401 .dev_addr = U300_MSL_BASE + 0 * 0x40 + 0x20,
402 },
403 {
404 .number = U300_DMA_MSL_TX_1,
405 .name = "MSL TX 1",
406 .priority_high = 0,
407 .dev_addr = U300_MSL_BASE + 1 * 0x40 + 0x20,
408 .param.config = COH901318_CX_CFG_CH_DISABLE |
409 COH901318_CX_CFG_LCR_DISABLE |
410 COH901318_CX_CFG_TC_IRQ_ENABLE |
411 COH901318_CX_CFG_BE_IRQ_ENABLE,
412 .param.ctrl_lli_chained = 0 |
413 COH901318_CX_CTRL_TC_ENABLE |
414 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
415 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
416 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
417 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
418 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
419 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
420 COH901318_CX_CTRL_TCP_DISABLE |
421 COH901318_CX_CTRL_TC_IRQ_DISABLE |
422 COH901318_CX_CTRL_HSP_ENABLE |
423 COH901318_CX_CTRL_HSS_DISABLE |
424 COH901318_CX_CTRL_DDMA_LEGACY |
425 COH901318_CX_CTRL_PRDD_SOURCE,
426 .param.ctrl_lli = 0 |
427 COH901318_CX_CTRL_TC_ENABLE |
428 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
429 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
430 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
431 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
432 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
433 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
434 COH901318_CX_CTRL_TCP_ENABLE |
435 COH901318_CX_CTRL_TC_IRQ_DISABLE |
436 COH901318_CX_CTRL_HSP_ENABLE |
437 COH901318_CX_CTRL_HSS_DISABLE |
438 COH901318_CX_CTRL_DDMA_LEGACY |
439 COH901318_CX_CTRL_PRDD_SOURCE,
440 .param.ctrl_lli_last = 0 |
441 COH901318_CX_CTRL_TC_ENABLE |
442 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
443 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
444 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
445 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
446 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
447 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
448 COH901318_CX_CTRL_TCP_ENABLE |
449 COH901318_CX_CTRL_TC_IRQ_ENABLE |
450 COH901318_CX_CTRL_HSP_ENABLE |
451 COH901318_CX_CTRL_HSS_DISABLE |
452 COH901318_CX_CTRL_DDMA_LEGACY |
453 COH901318_CX_CTRL_PRDD_SOURCE,
454 },
455 {
456 .number = U300_DMA_MSL_TX_2,
457 .name = "MSL TX 2",
458 .priority_high = 0,
459 .dev_addr = U300_MSL_BASE + 2 * 0x40 + 0x20,
460 .param.config = COH901318_CX_CFG_CH_DISABLE |
461 COH901318_CX_CFG_LCR_DISABLE |
462 COH901318_CX_CFG_TC_IRQ_ENABLE |
463 COH901318_CX_CFG_BE_IRQ_ENABLE,
464 .param.ctrl_lli_chained = 0 |
465 COH901318_CX_CTRL_TC_ENABLE |
466 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
467 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
468 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
469 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
470 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
471 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
472 COH901318_CX_CTRL_TCP_DISABLE |
473 COH901318_CX_CTRL_TC_IRQ_DISABLE |
474 COH901318_CX_CTRL_HSP_ENABLE |
475 COH901318_CX_CTRL_HSS_DISABLE |
476 COH901318_CX_CTRL_DDMA_LEGACY |
477 COH901318_CX_CTRL_PRDD_SOURCE,
478 .param.ctrl_lli = 0 |
479 COH901318_CX_CTRL_TC_ENABLE |
480 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
481 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
482 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
483 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
484 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
485 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
486 COH901318_CX_CTRL_TCP_ENABLE |
487 COH901318_CX_CTRL_TC_IRQ_DISABLE |
488 COH901318_CX_CTRL_HSP_ENABLE |
489 COH901318_CX_CTRL_HSS_DISABLE |
490 COH901318_CX_CTRL_DDMA_LEGACY |
491 COH901318_CX_CTRL_PRDD_SOURCE,
492 .param.ctrl_lli_last = 0 |
493 COH901318_CX_CTRL_TC_ENABLE |
494 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
495 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
496 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
497 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
498 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
499 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
500 COH901318_CX_CTRL_TCP_ENABLE |
501 COH901318_CX_CTRL_TC_IRQ_ENABLE |
502 COH901318_CX_CTRL_HSP_ENABLE |
503 COH901318_CX_CTRL_HSS_DISABLE |
504 COH901318_CX_CTRL_DDMA_LEGACY |
505 COH901318_CX_CTRL_PRDD_SOURCE,
506 .desc_nbr_max = 10,
507 },
508 {
509 .number = U300_DMA_MSL_TX_3,
510 .name = "MSL TX 3",
511 .priority_high = 0,
512 .dev_addr = U300_MSL_BASE + 3 * 0x40 + 0x20,
513 .param.config = COH901318_CX_CFG_CH_DISABLE |
514 COH901318_CX_CFG_LCR_DISABLE |
515 COH901318_CX_CFG_TC_IRQ_ENABLE |
516 COH901318_CX_CFG_BE_IRQ_ENABLE,
517 .param.ctrl_lli_chained = 0 |
518 COH901318_CX_CTRL_TC_ENABLE |
519 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
520 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
521 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
522 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
523 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
524 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
525 COH901318_CX_CTRL_TCP_DISABLE |
526 COH901318_CX_CTRL_TC_IRQ_DISABLE |
527 COH901318_CX_CTRL_HSP_ENABLE |
528 COH901318_CX_CTRL_HSS_DISABLE |
529 COH901318_CX_CTRL_DDMA_LEGACY |
530 COH901318_CX_CTRL_PRDD_SOURCE,
531 .param.ctrl_lli = 0 |
532 COH901318_CX_CTRL_TC_ENABLE |
533 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
534 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
535 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
536 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
537 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
538 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
539 COH901318_CX_CTRL_TCP_ENABLE |
540 COH901318_CX_CTRL_TC_IRQ_DISABLE |
541 COH901318_CX_CTRL_HSP_ENABLE |
542 COH901318_CX_CTRL_HSS_DISABLE |
543 COH901318_CX_CTRL_DDMA_LEGACY |
544 COH901318_CX_CTRL_PRDD_SOURCE,
545 .param.ctrl_lli_last = 0 |
546 COH901318_CX_CTRL_TC_ENABLE |
547 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
548 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
549 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
550 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
551 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
552 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
553 COH901318_CX_CTRL_TCP_ENABLE |
554 COH901318_CX_CTRL_TC_IRQ_ENABLE |
555 COH901318_CX_CTRL_HSP_ENABLE |
556 COH901318_CX_CTRL_HSS_DISABLE |
557 COH901318_CX_CTRL_DDMA_LEGACY |
558 COH901318_CX_CTRL_PRDD_SOURCE,
559 },
560 {
561 .number = U300_DMA_MSL_TX_4,
562 .name = "MSL TX 4",
563 .priority_high = 0,
564 .dev_addr = U300_MSL_BASE + 4 * 0x40 + 0x20,
565 .param.config = COH901318_CX_CFG_CH_DISABLE |
566 COH901318_CX_CFG_LCR_DISABLE |
567 COH901318_CX_CFG_TC_IRQ_ENABLE |
568 COH901318_CX_CFG_BE_IRQ_ENABLE,
569 .param.ctrl_lli_chained = 0 |
570 COH901318_CX_CTRL_TC_ENABLE |
571 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
572 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
573 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
574 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
575 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
576 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
577 COH901318_CX_CTRL_TCP_DISABLE |
578 COH901318_CX_CTRL_TC_IRQ_DISABLE |
579 COH901318_CX_CTRL_HSP_ENABLE |
580 COH901318_CX_CTRL_HSS_DISABLE |
581 COH901318_CX_CTRL_DDMA_LEGACY |
582 COH901318_CX_CTRL_PRDD_SOURCE,
583 .param.ctrl_lli = 0 |
584 COH901318_CX_CTRL_TC_ENABLE |
585 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
586 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
587 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
588 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
589 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
590 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
591 COH901318_CX_CTRL_TCP_ENABLE |
592 COH901318_CX_CTRL_TC_IRQ_DISABLE |
593 COH901318_CX_CTRL_HSP_ENABLE |
594 COH901318_CX_CTRL_HSS_DISABLE |
595 COH901318_CX_CTRL_DDMA_LEGACY |
596 COH901318_CX_CTRL_PRDD_SOURCE,
597 .param.ctrl_lli_last = 0 |
598 COH901318_CX_CTRL_TC_ENABLE |
599 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
600 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
601 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
602 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
603 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
604 COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
605 COH901318_CX_CTRL_TCP_ENABLE |
606 COH901318_CX_CTRL_TC_IRQ_ENABLE |
607 COH901318_CX_CTRL_HSP_ENABLE |
608 COH901318_CX_CTRL_HSS_DISABLE |
609 COH901318_CX_CTRL_DDMA_LEGACY |
610 COH901318_CX_CTRL_PRDD_SOURCE,
611 },
612 {
613 .number = U300_DMA_MSL_TX_5,
614 .name = "MSL TX 5",
615 .priority_high = 0,
616 .dev_addr = U300_MSL_BASE + 5 * 0x40 + 0x20,
617 },
618 {
619 .number = U300_DMA_MSL_TX_6,
620 .name = "MSL TX 6",
621 .priority_high = 0,
622 .dev_addr = U300_MSL_BASE + 6 * 0x40 + 0x20,
623 },
624 {
625 .number = U300_DMA_MSL_RX_0,
626 .name = "MSL RX 0",
627 .priority_high = 0,
628 .dev_addr = U300_MSL_BASE + 0 * 0x40 + 0x220,
629 },
630 {
631 .number = U300_DMA_MSL_RX_1,
632 .name = "MSL RX 1",
633 .priority_high = 0,
634 .dev_addr = U300_MSL_BASE + 1 * 0x40 + 0x220,
635 .param.config = COH901318_CX_CFG_CH_DISABLE |
636 COH901318_CX_CFG_LCR_DISABLE |
637 COH901318_CX_CFG_TC_IRQ_ENABLE |
638 COH901318_CX_CFG_BE_IRQ_ENABLE,
639 .param.ctrl_lli_chained = 0 |
640 COH901318_CX_CTRL_TC_ENABLE |
641 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
642 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
643 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
644 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
645 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
646 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
647 COH901318_CX_CTRL_TCP_DISABLE |
648 COH901318_CX_CTRL_TC_IRQ_DISABLE |
649 COH901318_CX_CTRL_HSP_ENABLE |
650 COH901318_CX_CTRL_HSS_DISABLE |
651 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
652 COH901318_CX_CTRL_PRDD_DEST,
653 .param.ctrl_lli = 0,
654 .param.ctrl_lli_last = 0 |
655 COH901318_CX_CTRL_TC_ENABLE |
656 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
657 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
658 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
659 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
660 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
661 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
662 COH901318_CX_CTRL_TCP_DISABLE |
663 COH901318_CX_CTRL_TC_IRQ_ENABLE |
664 COH901318_CX_CTRL_HSP_ENABLE |
665 COH901318_CX_CTRL_HSS_DISABLE |
666 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
667 COH901318_CX_CTRL_PRDD_DEST,
668 },
669 {
670 .number = U300_DMA_MSL_RX_2,
671 .name = "MSL RX 2",
672 .priority_high = 0,
673 .dev_addr = U300_MSL_BASE + 2 * 0x40 + 0x220,
674 .param.config = COH901318_CX_CFG_CH_DISABLE |
675 COH901318_CX_CFG_LCR_DISABLE |
676 COH901318_CX_CFG_TC_IRQ_ENABLE |
677 COH901318_CX_CFG_BE_IRQ_ENABLE,
678 .param.ctrl_lli_chained = 0 |
679 COH901318_CX_CTRL_TC_ENABLE |
680 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
681 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
682 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
683 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
684 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
685 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
686 COH901318_CX_CTRL_TCP_DISABLE |
687 COH901318_CX_CTRL_TC_IRQ_DISABLE |
688 COH901318_CX_CTRL_HSP_ENABLE |
689 COH901318_CX_CTRL_HSS_DISABLE |
690 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
691 COH901318_CX_CTRL_PRDD_DEST,
692 .param.ctrl_lli = 0 |
693 COH901318_CX_CTRL_TC_ENABLE |
694 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
695 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
696 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
697 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
698 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
699 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
700 COH901318_CX_CTRL_TCP_DISABLE |
701 COH901318_CX_CTRL_TC_IRQ_ENABLE |
702 COH901318_CX_CTRL_HSP_ENABLE |
703 COH901318_CX_CTRL_HSS_DISABLE |
704 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
705 COH901318_CX_CTRL_PRDD_DEST,
706 .param.ctrl_lli_last = 0 |
707 COH901318_CX_CTRL_TC_ENABLE |
708 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
709 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
710 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
711 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
712 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
713 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
714 COH901318_CX_CTRL_TCP_DISABLE |
715 COH901318_CX_CTRL_TC_IRQ_ENABLE |
716 COH901318_CX_CTRL_HSP_ENABLE |
717 COH901318_CX_CTRL_HSS_DISABLE |
718 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
719 COH901318_CX_CTRL_PRDD_DEST,
720 },
721 {
722 .number = U300_DMA_MSL_RX_3,
723 .name = "MSL RX 3",
724 .priority_high = 0,
725 .dev_addr = U300_MSL_BASE + 3 * 0x40 + 0x220,
726 .param.config = COH901318_CX_CFG_CH_DISABLE |
727 COH901318_CX_CFG_LCR_DISABLE |
728 COH901318_CX_CFG_TC_IRQ_ENABLE |
729 COH901318_CX_CFG_BE_IRQ_ENABLE,
730 .param.ctrl_lli_chained = 0 |
731 COH901318_CX_CTRL_TC_ENABLE |
732 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
733 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
734 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
735 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
736 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
737 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
738 COH901318_CX_CTRL_TCP_DISABLE |
739 COH901318_CX_CTRL_TC_IRQ_DISABLE |
740 COH901318_CX_CTRL_HSP_ENABLE |
741 COH901318_CX_CTRL_HSS_DISABLE |
742 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
743 COH901318_CX_CTRL_PRDD_DEST,
744 .param.ctrl_lli = 0 |
745 COH901318_CX_CTRL_TC_ENABLE |
746 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
747 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
748 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
749 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
750 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
751 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
752 COH901318_CX_CTRL_TCP_DISABLE |
753 COH901318_CX_CTRL_TC_IRQ_ENABLE |
754 COH901318_CX_CTRL_HSP_ENABLE |
755 COH901318_CX_CTRL_HSS_DISABLE |
756 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
757 COH901318_CX_CTRL_PRDD_DEST,
758 .param.ctrl_lli_last = 0 |
759 COH901318_CX_CTRL_TC_ENABLE |
760 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
761 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
762 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
763 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
764 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
765 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
766 COH901318_CX_CTRL_TCP_DISABLE |
767 COH901318_CX_CTRL_TC_IRQ_ENABLE |
768 COH901318_CX_CTRL_HSP_ENABLE |
769 COH901318_CX_CTRL_HSS_DISABLE |
770 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
771 COH901318_CX_CTRL_PRDD_DEST,
772 },
773 {
774 .number = U300_DMA_MSL_RX_4,
775 .name = "MSL RX 4",
776 .priority_high = 0,
777 .dev_addr = U300_MSL_BASE + 4 * 0x40 + 0x220,
778 .param.config = COH901318_CX_CFG_CH_DISABLE |
779 COH901318_CX_CFG_LCR_DISABLE |
780 COH901318_CX_CFG_TC_IRQ_ENABLE |
781 COH901318_CX_CFG_BE_IRQ_ENABLE,
782 .param.ctrl_lli_chained = 0 |
783 COH901318_CX_CTRL_TC_ENABLE |
784 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
785 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
786 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
787 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
788 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
789 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
790 COH901318_CX_CTRL_TCP_DISABLE |
791 COH901318_CX_CTRL_TC_IRQ_DISABLE |
792 COH901318_CX_CTRL_HSP_ENABLE |
793 COH901318_CX_CTRL_HSS_DISABLE |
794 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
795 COH901318_CX_CTRL_PRDD_DEST,
796 .param.ctrl_lli = 0 |
797 COH901318_CX_CTRL_TC_ENABLE |
798 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
799 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
800 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
801 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
802 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
803 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
804 COH901318_CX_CTRL_TCP_DISABLE |
805 COH901318_CX_CTRL_TC_IRQ_ENABLE |
806 COH901318_CX_CTRL_HSP_ENABLE |
807 COH901318_CX_CTRL_HSS_DISABLE |
808 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
809 COH901318_CX_CTRL_PRDD_DEST,
810 .param.ctrl_lli_last = 0 |
811 COH901318_CX_CTRL_TC_ENABLE |
812 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
813 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
814 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
815 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
816 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
817 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
818 COH901318_CX_CTRL_TCP_DISABLE |
819 COH901318_CX_CTRL_TC_IRQ_ENABLE |
820 COH901318_CX_CTRL_HSP_ENABLE |
821 COH901318_CX_CTRL_HSS_DISABLE |
822 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
823 COH901318_CX_CTRL_PRDD_DEST,
824 },
825 {
826 .number = U300_DMA_MSL_RX_5,
827 .name = "MSL RX 5",
828 .priority_high = 0,
829 .dev_addr = U300_MSL_BASE + 5 * 0x40 + 0x220,
830 .param.config = COH901318_CX_CFG_CH_DISABLE |
831 COH901318_CX_CFG_LCR_DISABLE |
832 COH901318_CX_CFG_TC_IRQ_ENABLE |
833 COH901318_CX_CFG_BE_IRQ_ENABLE,
834 .param.ctrl_lli_chained = 0 |
835 COH901318_CX_CTRL_TC_ENABLE |
836 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
837 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
838 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
839 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
840 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
841 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
842 COH901318_CX_CTRL_TCP_DISABLE |
843 COH901318_CX_CTRL_TC_IRQ_DISABLE |
844 COH901318_CX_CTRL_HSP_ENABLE |
845 COH901318_CX_CTRL_HSS_DISABLE |
846 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
847 COH901318_CX_CTRL_PRDD_DEST,
848 .param.ctrl_lli = 0 |
849 COH901318_CX_CTRL_TC_ENABLE |
850 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
851 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
852 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
853 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
854 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
855 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
856 COH901318_CX_CTRL_TCP_DISABLE |
857 COH901318_CX_CTRL_TC_IRQ_ENABLE |
858 COH901318_CX_CTRL_HSP_ENABLE |
859 COH901318_CX_CTRL_HSS_DISABLE |
860 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
861 COH901318_CX_CTRL_PRDD_DEST,
862 .param.ctrl_lli_last = 0 |
863 COH901318_CX_CTRL_TC_ENABLE |
864 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
865 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
866 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
867 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
868 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
869 COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
870 COH901318_CX_CTRL_TCP_DISABLE |
871 COH901318_CX_CTRL_TC_IRQ_ENABLE |
872 COH901318_CX_CTRL_HSP_ENABLE |
873 COH901318_CX_CTRL_HSS_DISABLE |
874 COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
875 COH901318_CX_CTRL_PRDD_DEST,
876 },
877 {
878 .number = U300_DMA_MSL_RX_6,
879 .name = "MSL RX 6",
880 .priority_high = 0,
881 .dev_addr = U300_MSL_BASE + 6 * 0x40 + 0x220,
882 },
883 /*
884 * Don't set up device address, burst count or size of src
885 * or dst bus for this peripheral - handled by PrimeCell
886 * DMA extension.
887 */
888 {
889 .number = U300_DMA_MMCSD_RX_TX,
890 .name = "MMCSD RX TX",
891 .priority_high = 0,
892 .param.config = COH901318_CX_CFG_CH_DISABLE |
893 COH901318_CX_CFG_LCR_DISABLE |
894 COH901318_CX_CFG_TC_IRQ_ENABLE |
895 COH901318_CX_CFG_BE_IRQ_ENABLE,
896 .param.ctrl_lli_chained = 0 |
897 COH901318_CX_CTRL_TC_ENABLE |
898 COH901318_CX_CTRL_MASTER_MODE_M1RW |
899 COH901318_CX_CTRL_TCP_ENABLE |
900 COH901318_CX_CTRL_TC_IRQ_DISABLE |
901 COH901318_CX_CTRL_HSP_ENABLE |
902 COH901318_CX_CTRL_HSS_DISABLE |
903 COH901318_CX_CTRL_DDMA_LEGACY,
904 .param.ctrl_lli = 0 |
905 COH901318_CX_CTRL_TC_ENABLE |
906 COH901318_CX_CTRL_MASTER_MODE_M1RW |
907 COH901318_CX_CTRL_TCP_ENABLE |
908 COH901318_CX_CTRL_TC_IRQ_DISABLE |
909 COH901318_CX_CTRL_HSP_ENABLE |
910 COH901318_CX_CTRL_HSS_DISABLE |
911 COH901318_CX_CTRL_DDMA_LEGACY,
912 .param.ctrl_lli_last = 0 |
913 COH901318_CX_CTRL_TC_ENABLE |
914 COH901318_CX_CTRL_MASTER_MODE_M1RW |
915 COH901318_CX_CTRL_TCP_DISABLE |
916 COH901318_CX_CTRL_TC_IRQ_ENABLE |
917 COH901318_CX_CTRL_HSP_ENABLE |
918 COH901318_CX_CTRL_HSS_DISABLE |
919 COH901318_CX_CTRL_DDMA_LEGACY,
920
921 },
922 {
923 .number = U300_DMA_MSPRO_TX,
924 .name = "MSPRO TX",
925 .priority_high = 0,
926 },
927 {
928 .number = U300_DMA_MSPRO_RX,
929 .name = "MSPRO RX",
930 .priority_high = 0,
931 },
932 /*
933 * Don't set up device address, burst count or size of src
934 * or dst bus for this peripheral - handled by PrimeCell
935 * DMA extension.
936 */
937 {
938 .number = U300_DMA_UART0_TX,
939 .name = "UART0 TX",
940 .priority_high = 0,
941 .param.config = COH901318_CX_CFG_CH_DISABLE |
942 COH901318_CX_CFG_LCR_DISABLE |
943 COH901318_CX_CFG_TC_IRQ_ENABLE |
944 COH901318_CX_CFG_BE_IRQ_ENABLE,
945 .param.ctrl_lli_chained = 0 |
946 COH901318_CX_CTRL_TC_ENABLE |
947 COH901318_CX_CTRL_MASTER_MODE_M1RW |
948 COH901318_CX_CTRL_TCP_ENABLE |
949 COH901318_CX_CTRL_TC_IRQ_DISABLE |
950 COH901318_CX_CTRL_HSP_ENABLE |
951 COH901318_CX_CTRL_HSS_DISABLE |
952 COH901318_CX_CTRL_DDMA_LEGACY,
953 .param.ctrl_lli = 0 |
954 COH901318_CX_CTRL_TC_ENABLE |
955 COH901318_CX_CTRL_MASTER_MODE_M1RW |
956 COH901318_CX_CTRL_TCP_ENABLE |
957 COH901318_CX_CTRL_TC_IRQ_ENABLE |
958 COH901318_CX_CTRL_HSP_ENABLE |
959 COH901318_CX_CTRL_HSS_DISABLE |
960 COH901318_CX_CTRL_DDMA_LEGACY,
961 .param.ctrl_lli_last = 0 |
962 COH901318_CX_CTRL_TC_ENABLE |
963 COH901318_CX_CTRL_MASTER_MODE_M1RW |
964 COH901318_CX_CTRL_TCP_ENABLE |
965 COH901318_CX_CTRL_TC_IRQ_ENABLE |
966 COH901318_CX_CTRL_HSP_ENABLE |
967 COH901318_CX_CTRL_HSS_DISABLE |
968 COH901318_CX_CTRL_DDMA_LEGACY,
969 },
970 {
971 .number = U300_DMA_UART0_RX,
972 .name = "UART0 RX",
973 .priority_high = 0,
974 .param.config = COH901318_CX_CFG_CH_DISABLE |
975 COH901318_CX_CFG_LCR_DISABLE |
976 COH901318_CX_CFG_TC_IRQ_ENABLE |
977 COH901318_CX_CFG_BE_IRQ_ENABLE,
978 .param.ctrl_lli_chained = 0 |
979 COH901318_CX_CTRL_TC_ENABLE |
980 COH901318_CX_CTRL_MASTER_MODE_M1RW |
981 COH901318_CX_CTRL_TCP_ENABLE |
982 COH901318_CX_CTRL_TC_IRQ_DISABLE |
983 COH901318_CX_CTRL_HSP_ENABLE |
984 COH901318_CX_CTRL_HSS_DISABLE |
985 COH901318_CX_CTRL_DDMA_LEGACY,
986 .param.ctrl_lli = 0 |
987 COH901318_CX_CTRL_TC_ENABLE |
988 COH901318_CX_CTRL_MASTER_MODE_M1RW |
989 COH901318_CX_CTRL_TCP_ENABLE |
990 COH901318_CX_CTRL_TC_IRQ_ENABLE |
991 COH901318_CX_CTRL_HSP_ENABLE |
992 COH901318_CX_CTRL_HSS_DISABLE |
993 COH901318_CX_CTRL_DDMA_LEGACY,
994 .param.ctrl_lli_last = 0 |
995 COH901318_CX_CTRL_TC_ENABLE |
996 COH901318_CX_CTRL_MASTER_MODE_M1RW |
997 COH901318_CX_CTRL_TCP_ENABLE |
998 COH901318_CX_CTRL_TC_IRQ_ENABLE |
999 COH901318_CX_CTRL_HSP_ENABLE |
1000 COH901318_CX_CTRL_HSS_DISABLE |
1001 COH901318_CX_CTRL_DDMA_LEGACY,
1002 },
1003 {
1004 .number = U300_DMA_APEX_TX,
1005 .name = "APEX TX",
1006 .priority_high = 0,
1007 },
1008 {
1009 .number = U300_DMA_APEX_RX,
1010 .name = "APEX RX",
1011 .priority_high = 0,
1012 },
1013 {
1014 .number = U300_DMA_PCM_I2S0_TX,
1015 .name = "PCM I2S0 TX",
1016 .priority_high = 1,
1017 .dev_addr = U300_PCM_I2S0_BASE + 0x14,
1018 .param.config = COH901318_CX_CFG_CH_DISABLE |
1019 COH901318_CX_CFG_LCR_DISABLE |
1020 COH901318_CX_CFG_TC_IRQ_ENABLE |
1021 COH901318_CX_CFG_BE_IRQ_ENABLE,
1022 .param.ctrl_lli_chained = 0 |
1023 COH901318_CX_CTRL_TC_ENABLE |
1024 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1025 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1026 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
1027 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1028 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
1029 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1030 COH901318_CX_CTRL_TCP_DISABLE |
1031 COH901318_CX_CTRL_TC_IRQ_DISABLE |
1032 COH901318_CX_CTRL_HSP_ENABLE |
1033 COH901318_CX_CTRL_HSS_DISABLE |
1034 COH901318_CX_CTRL_DDMA_LEGACY |
1035 COH901318_CX_CTRL_PRDD_SOURCE,
1036 .param.ctrl_lli = 0 |
1037 COH901318_CX_CTRL_TC_ENABLE |
1038 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1039 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1040 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
1041 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1042 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
1043 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1044 COH901318_CX_CTRL_TCP_ENABLE |
1045 COH901318_CX_CTRL_TC_IRQ_DISABLE |
1046 COH901318_CX_CTRL_HSP_ENABLE |
1047 COH901318_CX_CTRL_HSS_DISABLE |
1048 COH901318_CX_CTRL_DDMA_LEGACY |
1049 COH901318_CX_CTRL_PRDD_SOURCE,
1050 .param.ctrl_lli_last = 0 |
1051 COH901318_CX_CTRL_TC_ENABLE |
1052 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1053 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1054 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
1055 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1056 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
1057 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1058 COH901318_CX_CTRL_TCP_ENABLE |
1059 COH901318_CX_CTRL_TC_IRQ_DISABLE |
1060 COH901318_CX_CTRL_HSP_ENABLE |
1061 COH901318_CX_CTRL_HSS_DISABLE |
1062 COH901318_CX_CTRL_DDMA_LEGACY |
1063 COH901318_CX_CTRL_PRDD_SOURCE,
1064 },
1065 {
1066 .number = U300_DMA_PCM_I2S0_RX,
1067 .name = "PCM I2S0 RX",
1068 .priority_high = 1,
1069 .dev_addr = U300_PCM_I2S0_BASE + 0x10,
1070 .param.config = COH901318_CX_CFG_CH_DISABLE |
1071 COH901318_CX_CFG_LCR_DISABLE |
1072 COH901318_CX_CFG_TC_IRQ_ENABLE |
1073 COH901318_CX_CFG_BE_IRQ_ENABLE,
1074 .param.ctrl_lli_chained = 0 |
1075 COH901318_CX_CTRL_TC_ENABLE |
1076 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1077 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1078 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
1079 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1080 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
1081 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1082 COH901318_CX_CTRL_TCP_DISABLE |
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 COH901318_CX_CTRL_PRDD_DEST,
1088 .param.ctrl_lli = 0 |
1089 COH901318_CX_CTRL_TC_ENABLE |
1090 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1091 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1092 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
1093 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1094 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
1095 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1096 COH901318_CX_CTRL_TCP_ENABLE |
1097 COH901318_CX_CTRL_TC_IRQ_DISABLE |
1098 COH901318_CX_CTRL_HSP_ENABLE |
1099 COH901318_CX_CTRL_HSS_DISABLE |
1100 COH901318_CX_CTRL_DDMA_LEGACY |
1101 COH901318_CX_CTRL_PRDD_DEST,
1102 .param.ctrl_lli_last = 0 |
1103 COH901318_CX_CTRL_TC_ENABLE |
1104 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1105 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1106 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
1107 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1108 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
1109 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1110 COH901318_CX_CTRL_TCP_ENABLE |
1111 COH901318_CX_CTRL_TC_IRQ_ENABLE |
1112 COH901318_CX_CTRL_HSP_ENABLE |
1113 COH901318_CX_CTRL_HSS_DISABLE |
1114 COH901318_CX_CTRL_DDMA_LEGACY |
1115 COH901318_CX_CTRL_PRDD_DEST,
1116 },
1117 {
1118 .number = U300_DMA_PCM_I2S1_TX,
1119 .name = "PCM I2S1 TX",
1120 .priority_high = 1,
1121 .dev_addr = U300_PCM_I2S1_BASE + 0x14,
1122 .param.config = COH901318_CX_CFG_CH_DISABLE |
1123 COH901318_CX_CFG_LCR_DISABLE |
1124 COH901318_CX_CFG_TC_IRQ_ENABLE |
1125 COH901318_CX_CFG_BE_IRQ_ENABLE,
1126 .param.ctrl_lli_chained = 0 |
1127 COH901318_CX_CTRL_TC_ENABLE |
1128 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1129 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1130 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
1131 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1132 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
1133 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1134 COH901318_CX_CTRL_TCP_DISABLE |
1135 COH901318_CX_CTRL_TC_IRQ_DISABLE |
1136 COH901318_CX_CTRL_HSP_ENABLE |
1137 COH901318_CX_CTRL_HSS_DISABLE |
1138 COH901318_CX_CTRL_DDMA_LEGACY |
1139 COH901318_CX_CTRL_PRDD_SOURCE,
1140 .param.ctrl_lli = 0 |
1141 COH901318_CX_CTRL_TC_ENABLE |
1142 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1143 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1144 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
1145 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1146 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
1147 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1148 COH901318_CX_CTRL_TCP_ENABLE |
1149 COH901318_CX_CTRL_TC_IRQ_DISABLE |
1150 COH901318_CX_CTRL_HSP_ENABLE |
1151 COH901318_CX_CTRL_HSS_DISABLE |
1152 COH901318_CX_CTRL_DDMA_LEGACY |
1153 COH901318_CX_CTRL_PRDD_SOURCE,
1154 .param.ctrl_lli_last = 0 |
1155 COH901318_CX_CTRL_TC_ENABLE |
1156 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1157 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1158 COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
1159 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1160 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
1161 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1162 COH901318_CX_CTRL_TCP_ENABLE |
1163 COH901318_CX_CTRL_TC_IRQ_ENABLE |
1164 COH901318_CX_CTRL_HSP_ENABLE |
1165 COH901318_CX_CTRL_HSS_DISABLE |
1166 COH901318_CX_CTRL_DDMA_LEGACY |
1167 COH901318_CX_CTRL_PRDD_SOURCE,
1168 },
1169 {
1170 .number = U300_DMA_PCM_I2S1_RX,
1171 .name = "PCM I2S1 RX",
1172 .priority_high = 1,
1173 .dev_addr = U300_PCM_I2S1_BASE + 0x10,
1174 .param.config = COH901318_CX_CFG_CH_DISABLE |
1175 COH901318_CX_CFG_LCR_DISABLE |
1176 COH901318_CX_CFG_TC_IRQ_ENABLE |
1177 COH901318_CX_CFG_BE_IRQ_ENABLE,
1178 .param.ctrl_lli_chained = 0 |
1179 COH901318_CX_CTRL_TC_ENABLE |
1180 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1181 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1182 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
1183 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1184 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
1185 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1186 COH901318_CX_CTRL_TCP_DISABLE |
1187 COH901318_CX_CTRL_TC_IRQ_DISABLE |
1188 COH901318_CX_CTRL_HSP_ENABLE |
1189 COH901318_CX_CTRL_HSS_DISABLE |
1190 COH901318_CX_CTRL_DDMA_LEGACY |
1191 COH901318_CX_CTRL_PRDD_DEST,
1192 .param.ctrl_lli = 0 |
1193 COH901318_CX_CTRL_TC_ENABLE |
1194 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1195 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1196 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
1197 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1198 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
1199 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1200 COH901318_CX_CTRL_TCP_ENABLE |
1201 COH901318_CX_CTRL_TC_IRQ_DISABLE |
1202 COH901318_CX_CTRL_HSP_ENABLE |
1203 COH901318_CX_CTRL_HSS_DISABLE |
1204 COH901318_CX_CTRL_DDMA_LEGACY |
1205 COH901318_CX_CTRL_PRDD_DEST,
1206 .param.ctrl_lli_last = 0 |
1207 COH901318_CX_CTRL_TC_ENABLE |
1208 COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
1209 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
1210 COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
1211 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
1212 COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
1213 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1214 COH901318_CX_CTRL_TCP_ENABLE |
1215 COH901318_CX_CTRL_TC_IRQ_ENABLE |
1216 COH901318_CX_CTRL_HSP_ENABLE |
1217 COH901318_CX_CTRL_HSS_DISABLE |
1218 COH901318_CX_CTRL_DDMA_LEGACY |
1219 COH901318_CX_CTRL_PRDD_DEST,
1220 },
1221 {
1222 .number = U300_DMA_XGAM_CDI,
1223 .name = "XGAM CDI",
1224 .priority_high = 0,
1225 },
1226 {
1227 .number = U300_DMA_XGAM_PDI,
1228 .name = "XGAM PDI",
1229 .priority_high = 0,
1230 },
1231 /*
1232 * Don't set up device address, burst count or size of src
1233 * or dst bus for this peripheral - handled by PrimeCell
1234 * DMA extension.
1235 */
1236 {
1237 .number = U300_DMA_SPI_TX,
1238 .name = "SPI TX",
1239 .priority_high = 0,
1240 .param.config = COH901318_CX_CFG_CH_DISABLE |
1241 COH901318_CX_CFG_LCR_DISABLE |
1242 COH901318_CX_CFG_TC_IRQ_ENABLE |
1243 COH901318_CX_CFG_BE_IRQ_ENABLE,
1244 .param.ctrl_lli_chained = 0 |
1245 COH901318_CX_CTRL_TC_ENABLE |
1246 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1247 COH901318_CX_CTRL_TCP_DISABLE |
1248 COH901318_CX_CTRL_TC_IRQ_DISABLE |
1249 COH901318_CX_CTRL_HSP_ENABLE |
1250 COH901318_CX_CTRL_HSS_DISABLE |
1251 COH901318_CX_CTRL_DDMA_LEGACY,
1252 .param.ctrl_lli = 0 |
1253 COH901318_CX_CTRL_TC_ENABLE |
1254 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1255 COH901318_CX_CTRL_TCP_DISABLE |
1256 COH901318_CX_CTRL_TC_IRQ_ENABLE |
1257 COH901318_CX_CTRL_HSP_ENABLE |
1258 COH901318_CX_CTRL_HSS_DISABLE |
1259 COH901318_CX_CTRL_DDMA_LEGACY,
1260 .param.ctrl_lli_last = 0 |
1261 COH901318_CX_CTRL_TC_ENABLE |
1262 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1263 COH901318_CX_CTRL_TCP_DISABLE |
1264 COH901318_CX_CTRL_TC_IRQ_ENABLE |
1265 COH901318_CX_CTRL_HSP_ENABLE |
1266 COH901318_CX_CTRL_HSS_DISABLE |
1267 COH901318_CX_CTRL_DDMA_LEGACY,
1268 },
1269 {
1270 .number = U300_DMA_SPI_RX,
1271 .name = "SPI RX",
1272 .priority_high = 0,
1273 .param.config = COH901318_CX_CFG_CH_DISABLE |
1274 COH901318_CX_CFG_LCR_DISABLE |
1275 COH901318_CX_CFG_TC_IRQ_ENABLE |
1276 COH901318_CX_CFG_BE_IRQ_ENABLE,
1277 .param.ctrl_lli_chained = 0 |
1278 COH901318_CX_CTRL_TC_ENABLE |
1279 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1280 COH901318_CX_CTRL_TCP_DISABLE |
1281 COH901318_CX_CTRL_TC_IRQ_DISABLE |
1282 COH901318_CX_CTRL_HSP_ENABLE |
1283 COH901318_CX_CTRL_HSS_DISABLE |
1284 COH901318_CX_CTRL_DDMA_LEGACY,
1285 .param.ctrl_lli = 0 |
1286 COH901318_CX_CTRL_TC_ENABLE |
1287 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1288 COH901318_CX_CTRL_TCP_DISABLE |
1289 COH901318_CX_CTRL_TC_IRQ_ENABLE |
1290 COH901318_CX_CTRL_HSP_ENABLE |
1291 COH901318_CX_CTRL_HSS_DISABLE |
1292 COH901318_CX_CTRL_DDMA_LEGACY,
1293 .param.ctrl_lli_last = 0 |
1294 COH901318_CX_CTRL_TC_ENABLE |
1295 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1296 COH901318_CX_CTRL_TCP_DISABLE |
1297 COH901318_CX_CTRL_TC_IRQ_ENABLE |
1298 COH901318_CX_CTRL_HSP_ENABLE |
1299 COH901318_CX_CTRL_HSS_DISABLE |
1300 COH901318_CX_CTRL_DDMA_LEGACY,
1301
1302 },
1303 {
1304 .number = U300_DMA_GENERAL_PURPOSE_0,
1305 .name = "GENERAL 00",
1306 .priority_high = 0,
1307
1308 .param.config = flags_memcpy_config,
1309 .param.ctrl_lli_chained = flags_memcpy_lli_chained,
1310 .param.ctrl_lli = flags_memcpy_lli,
1311 .param.ctrl_lli_last = flags_memcpy_lli_last,
1312 },
1313 {
1314 .number = U300_DMA_GENERAL_PURPOSE_1,
1315 .name = "GENERAL 01",
1316 .priority_high = 0,
1317
1318 .param.config = flags_memcpy_config,
1319 .param.ctrl_lli_chained = flags_memcpy_lli_chained,
1320 .param.ctrl_lli = flags_memcpy_lli,
1321 .param.ctrl_lli_last = flags_memcpy_lli_last,
1322 },
1323 {
1324 .number = U300_DMA_GENERAL_PURPOSE_2,
1325 .name = "GENERAL 02",
1326 .priority_high = 0,
1327
1328 .param.config = flags_memcpy_config,
1329 .param.ctrl_lli_chained = flags_memcpy_lli_chained,
1330 .param.ctrl_lli = flags_memcpy_lli,
1331 .param.ctrl_lli_last = flags_memcpy_lli_last,
1332 },
1333 {
1334 .number = U300_DMA_GENERAL_PURPOSE_3,
1335 .name = "GENERAL 03",
1336 .priority_high = 0,
1337
1338 .param.config = flags_memcpy_config,
1339 .param.ctrl_lli_chained = flags_memcpy_lli_chained,
1340 .param.ctrl_lli = flags_memcpy_lli,
1341 .param.ctrl_lli_last = flags_memcpy_lli_last,
1342 },
1343 {
1344 .number = U300_DMA_GENERAL_PURPOSE_4,
1345 .name = "GENERAL 04",
1346 .priority_high = 0,
1347
1348 .param.config = flags_memcpy_config,
1349 .param.ctrl_lli_chained = flags_memcpy_lli_chained,
1350 .param.ctrl_lli = flags_memcpy_lli,
1351 .param.ctrl_lli_last = flags_memcpy_lli_last,
1352 },
1353 {
1354 .number = U300_DMA_GENERAL_PURPOSE_5,
1355 .name = "GENERAL 05",
1356 .priority_high = 0,
1357
1358 .param.config = flags_memcpy_config,
1359 .param.ctrl_lli_chained = flags_memcpy_lli_chained,
1360 .param.ctrl_lli = flags_memcpy_lli,
1361 .param.ctrl_lli_last = flags_memcpy_lli_last,
1362 },
1363 {
1364 .number = U300_DMA_GENERAL_PURPOSE_6,
1365 .name = "GENERAL 06",
1366 .priority_high = 0,
1367
1368 .param.config = flags_memcpy_config,
1369 .param.ctrl_lli_chained = flags_memcpy_lli_chained,
1370 .param.ctrl_lli = flags_memcpy_lli,
1371 .param.ctrl_lli_last = flags_memcpy_lli_last,
1372 },
1373 {
1374 .number = U300_DMA_GENERAL_PURPOSE_7,
1375 .name = "GENERAL 07",
1376 .priority_high = 0,
1377
1378 .param.config = flags_memcpy_config,
1379 .param.ctrl_lli_chained = flags_memcpy_lli_chained,
1380 .param.ctrl_lli = flags_memcpy_lli,
1381 .param.ctrl_lli_last = flags_memcpy_lli_last,
1382 },
1383 {
1384 .number = U300_DMA_GENERAL_PURPOSE_8,
1385 .name = "GENERAL 08",
1386 .priority_high = 0,
1387
1388 .param.config = flags_memcpy_config,
1389 .param.ctrl_lli_chained = flags_memcpy_lli_chained,
1390 .param.ctrl_lli = flags_memcpy_lli,
1391 .param.ctrl_lli_last = flags_memcpy_lli_last,
1392 },
1393 {
1394 .number = U300_DMA_UART1_TX,
1395 .name = "UART1 TX",
1396 .priority_high = 0,
1397 },
1398 {
1399 .number = U300_DMA_UART1_RX,
1400 .name = "UART1 RX",
1401 .priority_high = 0,
1402 }
1403};
1404
1405
1406static struct coh901318_platform coh901318_platform = {
1407 .chans_slave = dma_slave_channels,
1408 .chans_memcpy = dma_memcpy_channels,
1409 .access_memory_state = coh901318_access_memory_state,
1410 .chan_conf = chan_config,
1411 .max_channels = U300_DMA_CHANNELS,
1412};
1413 329
1414static struct resource pinctrl_resources[] = { 330static struct resource pinctrl_resources[] = {
1415 { 331 {
@@ -1521,7 +437,6 @@ static struct platform_device dma_device = {
1521 .resource = dma_resource, 437 .resource = dma_resource,
1522 .num_resources = ARRAY_SIZE(dma_resource), 438 .num_resources = ARRAY_SIZE(dma_resource),
1523 .dev = { 439 .dev = {
1524 .platform_data = &coh901318_platform,
1525 .coherent_dma_mask = ~0, 440 .coherent_dma_mask = ~0,
1526 }, 441 },
1527}; 442};
@@ -1779,8 +694,7 @@ MACHINE_START(U300, "Ericsson AB U335 S335/B335 Prototype Board")
1779 .map_io = u300_map_io, 694 .map_io = u300_map_io,
1780 .nr_irqs = 0, 695 .nr_irqs = 0,
1781 .init_irq = u300_init_irq, 696 .init_irq = u300_init_irq,
1782 .handle_irq = vic_handle_irq, 697 .init_time = u300_timer_init,
1783 .timer = &u300_timer,
1784 .init_machine = u300_init_machine, 698 .init_machine = u300_init_machine,
1785 .restart = u300_restart, 699 .restart = u300_restart,
1786MACHINE_END 700MACHINE_END
diff --git a/arch/arm/mach-u300/dma_channels.h b/arch/arm/mach-u300/dma_channels.h
deleted file mode 100644
index 4e8a88fbca49..000000000000
--- a/arch/arm/mach-u300/dma_channels.h
+++ /dev/null
@@ -1,60 +0,0 @@
1/*
2 *
3 * arch/arm/mach-u300/include/mach/dma_channels.h
4 *
5 *
6 * Copyright (C) 2007-2012 ST-Ericsson
7 * License terms: GNU General Public License (GPL) version 2
8 * Map file for the U300 dma driver.
9 * Author: Per Friden <per.friden@stericsson.com>
10 */
11
12#ifndef DMA_CHANNELS_H
13#define DMA_CHANNELS_H
14
15#define U300_DMA_MSL_TX_0 0
16#define U300_DMA_MSL_TX_1 1
17#define U300_DMA_MSL_TX_2 2
18#define U300_DMA_MSL_TX_3 3
19#define U300_DMA_MSL_TX_4 4
20#define U300_DMA_MSL_TX_5 5
21#define U300_DMA_MSL_TX_6 6
22#define U300_DMA_MSL_RX_0 7
23#define U300_DMA_MSL_RX_1 8
24#define U300_DMA_MSL_RX_2 9
25#define U300_DMA_MSL_RX_3 10
26#define U300_DMA_MSL_RX_4 11
27#define U300_DMA_MSL_RX_5 12
28#define U300_DMA_MSL_RX_6 13
29#define U300_DMA_MMCSD_RX_TX 14
30#define U300_DMA_MSPRO_TX 15
31#define U300_DMA_MSPRO_RX 16
32#define U300_DMA_UART0_TX 17
33#define U300_DMA_UART0_RX 18
34#define U300_DMA_APEX_TX 19
35#define U300_DMA_APEX_RX 20
36#define U300_DMA_PCM_I2S0_TX 21
37#define U300_DMA_PCM_I2S0_RX 22
38#define U300_DMA_PCM_I2S1_TX 23
39#define U300_DMA_PCM_I2S1_RX 24
40#define U300_DMA_XGAM_CDI 25
41#define U300_DMA_XGAM_PDI 26
42#define U300_DMA_SPI_TX 27
43#define U300_DMA_SPI_RX 28
44#define U300_DMA_GENERAL_PURPOSE_0 29
45#define U300_DMA_GENERAL_PURPOSE_1 30
46#define U300_DMA_GENERAL_PURPOSE_2 31
47#define U300_DMA_GENERAL_PURPOSE_3 32
48#define U300_DMA_GENERAL_PURPOSE_4 33
49#define U300_DMA_GENERAL_PURPOSE_5 34
50#define U300_DMA_GENERAL_PURPOSE_6 35
51#define U300_DMA_GENERAL_PURPOSE_7 36
52#define U300_DMA_GENERAL_PURPOSE_8 37
53#define U300_DMA_UART1_TX 38
54#define U300_DMA_UART1_RX 39
55
56#define U300_DMA_DEVICE_CHANNELS 32
57#define U300_DMA_CHANNELS 40
58
59
60#endif /* DMA_CHANNELS_H */
diff --git a/arch/arm/mach-u300/include/mach/coh901318.h b/arch/arm/mach-u300/include/mach/coh901318.h
deleted file mode 100644
index 7c3b2b2d25b6..000000000000
--- a/arch/arm/mach-u300/include/mach/coh901318.h
+++ /dev/null
@@ -1,267 +0,0 @@
1/*
2 *
3 * include/linux/coh901318.h
4 *
5 *
6 * Copyright (C) 2007-2009 ST-Ericsson
7 * License terms: GNU General Public License (GPL) version 2
8 * DMA driver for COH 901 318
9 * Author: Per Friden <per.friden@stericsson.com>
10 */
11
12#ifndef COH901318_H
13#define COH901318_H
14
15#include <linux/device.h>
16#include <linux/dmaengine.h>
17
18#define MAX_DMA_PACKET_SIZE_SHIFT 11
19#define MAX_DMA_PACKET_SIZE (1 << MAX_DMA_PACKET_SIZE_SHIFT)
20
21/**
22 * struct coh901318_lli - linked list item for DMAC
23 * @control: control settings for DMAC
24 * @src_addr: transfer source address
25 * @dst_addr: transfer destination address
26 * @link_addr: physical address to next lli
27 * @virt_link_addr: virtual address of next lli (only used by pool_free)
28 * @phy_this: physical address of current lli (only used by pool_free)
29 */
30struct coh901318_lli {
31 u32 control;
32 dma_addr_t src_addr;
33 dma_addr_t dst_addr;
34 dma_addr_t link_addr;
35
36 void *virt_link_addr;
37 dma_addr_t phy_this;
38};
39/**
40 * struct coh901318_params - parameters for DMAC configuration
41 * @config: DMA config register
42 * @ctrl_lli_last: DMA control register for the last lli in the list
43 * @ctrl_lli: DMA control register for an lli
44 * @ctrl_lli_chained: DMA control register for a chained lli
45 */
46struct coh901318_params {
47 u32 config;
48 u32 ctrl_lli_last;
49 u32 ctrl_lli;
50 u32 ctrl_lli_chained;
51};
52/**
53 * struct coh_dma_channel - dma channel base
54 * @name: ascii name of dma channel
55 * @number: channel id number
56 * @desc_nbr_max: number of preallocated descriptors
57 * @priority_high: prio of channel, 0 low otherwise high.
58 * @param: configuration parameters
59 * @dev_addr: physical address of periphal connected to channel
60 */
61struct coh_dma_channel {
62 const char name[32];
63 const int number;
64 const int desc_nbr_max;
65 const int priority_high;
66 const struct coh901318_params param;
67 const dma_addr_t dev_addr;
68};
69
70/**
71 * dma_access_memory_state_t - register dma for memory access
72 *
73 * @dev: The dma device
74 * @active: 1 means dma intends to access memory
75 * 0 means dma wont access memory
76 */
77typedef void (*dma_access_memory_state_t)(struct device *dev,
78 bool active);
79
80/**
81 * struct powersave - DMA power save structure
82 * @lock: lock protecting data in this struct
83 * @started_channels: bit mask indicating active dma channels
84 */
85struct powersave {
86 spinlock_t lock;
87 u64 started_channels;
88};
89/**
90 * struct coh901318_platform - platform arch structure
91 * @chans_slave: specifying dma slave channels
92 * @chans_memcpy: specifying dma memcpy channels
93 * @access_memory_state: requesting DMA memory access (on / off)
94 * @chan_conf: dma channel configurations
95 * @max_channels: max number of dma chanenls
96 */
97struct coh901318_platform {
98 const int *chans_slave;
99 const int *chans_memcpy;
100 const dma_access_memory_state_t access_memory_state;
101 const struct coh_dma_channel *chan_conf;
102 const int max_channels;
103};
104
105#ifdef CONFIG_COH901318
106/**
107 * coh901318_filter_id() - DMA channel filter function
108 * @chan: dma channel handle
109 * @chan_id: id of dma channel to be filter out
110 *
111 * In dma_request_channel() it specifies what channel id to be requested
112 */
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
120
121/*
122 * DMA Controller - this access the static mappings of the coh901318 dma.
123 *
124 */
125
126#define COH901318_MOD32_MASK (0x1F)
127#define COH901318_WORD_MASK (0xFFFFFFFF)
128/* INT_STATUS - Interrupt Status Registers 32bit (R/-) */
129#define COH901318_INT_STATUS1 (0x0000)
130#define COH901318_INT_STATUS2 (0x0004)
131/* TC_INT_STATUS - Terminal Count Interrupt Status Registers 32bit (R/-) */
132#define COH901318_TC_INT_STATUS1 (0x0008)
133#define COH901318_TC_INT_STATUS2 (0x000C)
134/* TC_INT_CLEAR - Terminal Count Interrupt Clear Registers 32bit (-/W) */
135#define COH901318_TC_INT_CLEAR1 (0x0010)
136#define COH901318_TC_INT_CLEAR2 (0x0014)
137/* RAW_TC_INT_STATUS - Raw Term Count Interrupt Status Registers 32bit (R/-) */
138#define COH901318_RAW_TC_INT_STATUS1 (0x0018)
139#define COH901318_RAW_TC_INT_STATUS2 (0x001C)
140/* BE_INT_STATUS - Bus Error Interrupt Status Registers 32bit (R/-) */
141#define COH901318_BE_INT_STATUS1 (0x0020)
142#define COH901318_BE_INT_STATUS2 (0x0024)
143/* BE_INT_CLEAR - Bus Error Interrupt Clear Registers 32bit (-/W) */
144#define COH901318_BE_INT_CLEAR1 (0x0028)
145#define COH901318_BE_INT_CLEAR2 (0x002C)
146/* RAW_BE_INT_STATUS - Raw Term Count Interrupt Status Registers 32bit (R/-) */
147#define COH901318_RAW_BE_INT_STATUS1 (0x0030)
148#define COH901318_RAW_BE_INT_STATUS2 (0x0034)
149
150/*
151 * CX_CFG - Channel Configuration Registers 32bit (R/W)
152 */
153#define COH901318_CX_CFG (0x0100)
154#define COH901318_CX_CFG_SPACING (0x04)
155/* Channel enable activates tha dma job */
156#define COH901318_CX_CFG_CH_ENABLE (0x00000001)
157#define COH901318_CX_CFG_CH_DISABLE (0x00000000)
158/* Request Mode */
159#define COH901318_CX_CFG_RM_MASK (0x00000006)
160#define COH901318_CX_CFG_RM_MEMORY_TO_MEMORY (0x0 << 1)
161#define COH901318_CX_CFG_RM_PRIMARY_TO_MEMORY (0x1 << 1)
162#define COH901318_CX_CFG_RM_MEMORY_TO_PRIMARY (0x1 << 1)
163#define COH901318_CX_CFG_RM_PRIMARY_TO_SECONDARY (0x3 << 1)
164#define COH901318_CX_CFG_RM_SECONDARY_TO_PRIMARY (0x3 << 1)
165/* Linked channel request field. RM must == 11 */
166#define COH901318_CX_CFG_LCRF_SHIFT 3
167#define COH901318_CX_CFG_LCRF_MASK (0x000001F8)
168#define COH901318_CX_CFG_LCR_DISABLE (0x00000000)
169/* Terminal Counter Interrupt Request Mask */
170#define COH901318_CX_CFG_TC_IRQ_ENABLE (0x00000200)
171#define COH901318_CX_CFG_TC_IRQ_DISABLE (0x00000000)
172/* Bus Error interrupt Mask */
173#define COH901318_CX_CFG_BE_IRQ_ENABLE (0x00000400)
174#define COH901318_CX_CFG_BE_IRQ_DISABLE (0x00000000)
175
176/*
177 * CX_STAT - Channel Status Registers 32bit (R/-)
178 */
179#define COH901318_CX_STAT (0x0200)
180#define COH901318_CX_STAT_SPACING (0x04)
181#define COH901318_CX_STAT_RBE_IRQ_IND (0x00000008)
182#define COH901318_CX_STAT_RTC_IRQ_IND (0x00000004)
183#define COH901318_CX_STAT_ACTIVE (0x00000002)
184#define COH901318_CX_STAT_ENABLED (0x00000001)
185
186/*
187 * CX_CTRL - Channel Control Registers 32bit (R/W)
188 */
189#define COH901318_CX_CTRL (0x0400)
190#define COH901318_CX_CTRL_SPACING (0x10)
191/* Transfer Count Enable */
192#define COH901318_CX_CTRL_TC_ENABLE (0x00001000)
193#define COH901318_CX_CTRL_TC_DISABLE (0x00000000)
194/* Transfer Count Value 0 - 4095 */
195#define COH901318_CX_CTRL_TC_VALUE_MASK (0x00000FFF)
196/* Burst count */
197#define COH901318_CX_CTRL_BURST_COUNT_MASK (0x0000E000)
198#define COH901318_CX_CTRL_BURST_COUNT_64_BYTES (0x7 << 13)
199#define COH901318_CX_CTRL_BURST_COUNT_48_BYTES (0x6 << 13)
200#define COH901318_CX_CTRL_BURST_COUNT_32_BYTES (0x5 << 13)
201#define COH901318_CX_CTRL_BURST_COUNT_16_BYTES (0x4 << 13)
202#define COH901318_CX_CTRL_BURST_COUNT_8_BYTES (0x3 << 13)
203#define COH901318_CX_CTRL_BURST_COUNT_4_BYTES (0x2 << 13)
204#define COH901318_CX_CTRL_BURST_COUNT_2_BYTES (0x1 << 13)
205#define COH901318_CX_CTRL_BURST_COUNT_1_BYTE (0x0 << 13)
206/* Source bus size */
207#define COH901318_CX_CTRL_SRC_BUS_SIZE_MASK (0x00030000)
208#define COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS (0x2 << 16)
209#define COH901318_CX_CTRL_SRC_BUS_SIZE_16_BITS (0x1 << 16)
210#define COH901318_CX_CTRL_SRC_BUS_SIZE_8_BITS (0x0 << 16)
211/* Source address increment */
212#define COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE (0x00040000)
213#define COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE (0x00000000)
214/* Destination Bus Size */
215#define COH901318_CX_CTRL_DST_BUS_SIZE_MASK (0x00180000)
216#define COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS (0x2 << 19)
217#define COH901318_CX_CTRL_DST_BUS_SIZE_16_BITS (0x1 << 19)
218#define COH901318_CX_CTRL_DST_BUS_SIZE_8_BITS (0x0 << 19)
219/* Destination address increment */
220#define COH901318_CX_CTRL_DST_ADDR_INC_ENABLE (0x00200000)
221#define COH901318_CX_CTRL_DST_ADDR_INC_DISABLE (0x00000000)
222/* Master Mode (Master2 is only connected to MSL) */
223#define COH901318_CX_CTRL_MASTER_MODE_MASK (0x00C00000)
224#define COH901318_CX_CTRL_MASTER_MODE_M2R_M1W (0x3 << 22)
225#define COH901318_CX_CTRL_MASTER_MODE_M1R_M2W (0x2 << 22)
226#define COH901318_CX_CTRL_MASTER_MODE_M2RW (0x1 << 22)
227#define COH901318_CX_CTRL_MASTER_MODE_M1RW (0x0 << 22)
228/* Terminal Count flag to PER enable */
229#define COH901318_CX_CTRL_TCP_ENABLE (0x01000000)
230#define COH901318_CX_CTRL_TCP_DISABLE (0x00000000)
231/* Terminal Count flags to CPU enable */
232#define COH901318_CX_CTRL_TC_IRQ_ENABLE (0x02000000)
233#define COH901318_CX_CTRL_TC_IRQ_DISABLE (0x00000000)
234/* Hand shake to peripheral */
235#define COH901318_CX_CTRL_HSP_ENABLE (0x04000000)
236#define COH901318_CX_CTRL_HSP_DISABLE (0x00000000)
237#define COH901318_CX_CTRL_HSS_ENABLE (0x08000000)
238#define COH901318_CX_CTRL_HSS_DISABLE (0x00000000)
239/* DMA mode */
240#define COH901318_CX_CTRL_DDMA_MASK (0x30000000)
241#define COH901318_CX_CTRL_DDMA_LEGACY (0x0 << 28)
242#define COH901318_CX_CTRL_DDMA_DEMAND_DMA1 (0x1 << 28)
243#define COH901318_CX_CTRL_DDMA_DEMAND_DMA2 (0x2 << 28)
244/* Primary Request Data Destination */
245#define COH901318_CX_CTRL_PRDD_MASK (0x40000000)
246#define COH901318_CX_CTRL_PRDD_DEST (0x1 << 30)
247#define COH901318_CX_CTRL_PRDD_SOURCE (0x0 << 30)
248
249/*
250 * CX_SRC_ADDR - Channel Source Address Registers 32bit (R/W)
251 */
252#define COH901318_CX_SRC_ADDR (0x0404)
253#define COH901318_CX_SRC_ADDR_SPACING (0x10)
254
255/*
256 * CX_DST_ADDR - Channel Destination Address Registers 32bit R/W
257 */
258#define COH901318_CX_DST_ADDR (0x0408)
259#define COH901318_CX_DST_ADDR_SPACING (0x10)
260
261/*
262 * CX_LNK_ADDR - Channel Link Address Registers 32bit (R/W)
263 */
264#define COH901318_CX_LNK_ADDR (0x040C)
265#define COH901318_CX_LNK_ADDR_SPACING (0x10)
266#define COH901318_CX_LNK_LINK_IMMEDIATE (0x00000001)
267#endif /* COH901318_H */
diff --git a/arch/arm/mach-u300/include/mach/uncompress.h b/arch/arm/mach-u300/include/mach/uncompress.h
index 29acb718acf7..783e7e60101b 100644
--- a/arch/arm/mach-u300/include/mach/uncompress.h
+++ b/arch/arm/mach-u300/include/mach/uncompress.h
@@ -43,4 +43,3 @@ static inline void flush(void)
43 * nothing to do 43 * nothing to do
44 */ 44 */
45#define arch_decomp_setup() 45#define arch_decomp_setup()
46#define arch_decomp_wdog()
diff --git a/arch/arm/mach-u300/spi.c b/arch/arm/mach-u300/spi.c
index 02e6659286d5..910698293d64 100644
--- a/arch/arm/mach-u300/spi.c
+++ b/arch/arm/mach-u300/spi.c
@@ -10,9 +10,8 @@
10#include <linux/amba/bus.h> 10#include <linux/amba/bus.h>
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/platform_data/dma-coh901318.h>
13#include <linux/err.h> 14#include <linux/err.h>
14#include <mach/coh901318.h>
15#include "dma_channels.h"
16 15
17/* 16/*
18 * The following is for the actual devices on the SSP/SPI bus 17 * The following is for the actual devices on the SSP/SPI bus
diff --git a/arch/arm/mach-u300/timer.c b/arch/arm/mach-u300/timer.c
index 1da10e20e996..d9e73209c9b8 100644
--- a/arch/arm/mach-u300/timer.c
+++ b/arch/arm/mach-u300/timer.c
@@ -349,7 +349,7 @@ static u32 notrace u300_read_sched_clock(void)
349/* 349/*
350 * This sets up the system timers, clock source and clock event. 350 * This sets up the system timers, clock source and clock event.
351 */ 351 */
352static void __init u300_timer_init(void) 352void __init u300_timer_init(void)
353{ 353{
354 struct clk *clk; 354 struct clk *clk;
355 unsigned long rate; 355 unsigned long rate;
@@ -413,11 +413,3 @@ static void __init u300_timer_init(void)
413 * used by hrtimers! 413 * used by hrtimers!
414 */ 414 */
415} 415}
416
417/*
418 * Very simple system timer that only register the clock event and
419 * clock source.
420 */
421struct sys_timer u300_timer = {
422 .init = u300_timer_init,
423};
diff --git a/arch/arm/mach-u300/timer.h b/arch/arm/mach-u300/timer.h
index b5e9791762e0..d34287bc34f5 100644
--- a/arch/arm/mach-u300/timer.h
+++ b/arch/arm/mach-u300/timer.h
@@ -1 +1 @@
extern struct sys_timer u300_timer; extern void u300_timer_init(void);
diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
index 5dea90636d94..3e5bbd0e5b23 100644
--- a/arch/arm/mach-ux500/Kconfig
+++ b/arch/arm/mach-ux500/Kconfig
@@ -11,6 +11,7 @@ config UX500_SOC_COMMON
11 select COMMON_CLK 11 select COMMON_CLK
12 select PINCTRL 12 select PINCTRL
13 select PINCTRL_NOMADIK 13 select PINCTRL_NOMADIK
14 select PINCTRL_ABX500
14 select PL310_ERRATA_753970 if CACHE_PL310 15 select PL310_ERRATA_753970 if CACHE_PL310
15 16
16config UX500_SOC_DB8500 17config UX500_SOC_DB8500
@@ -18,6 +19,11 @@ config UX500_SOC_DB8500
18 select CPU_FREQ_TABLE if CPU_FREQ 19 select CPU_FREQ_TABLE if CPU_FREQ
19 select MFD_DB8500_PRCMU 20 select MFD_DB8500_PRCMU
20 select PINCTRL_DB8500 21 select PINCTRL_DB8500
22 select PINCTRL_DB8540
23 select PINCTRL_AB8500
24 select PINCTRL_AB8505
25 select PINCTRL_AB9540
26 select PINCTRL_AB8540
21 select REGULATOR 27 select REGULATOR
22 select REGULATOR_DB8500_PRCMU 28 select REGULATOR_DB8500_PRCMU
23 29
diff --git a/arch/arm/mach-ux500/board-mop500-uib.c b/arch/arm/mach-ux500/board-mop500-uib.c
index 1f47d962e3a1..7037d3687e9f 100644
--- a/arch/arm/mach-ux500/board-mop500-uib.c
+++ b/arch/arm/mach-ux500/board-mop500-uib.c
@@ -13,6 +13,7 @@
13 13
14#include <mach/hardware.h> 14#include <mach/hardware.h>
15#include "board-mop500.h" 15#include "board-mop500.h"
16#include "id.h"
16 17
17enum mop500_uib { 18enum mop500_uib {
18 STUIB, 19 STUIB,
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index d453522edb0d..b03457881c4b 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -28,7 +28,7 @@
28#include <linux/mfd/tps6105x.h> 28#include <linux/mfd/tps6105x.h>
29#include <linux/mfd/abx500/ab8500-gpio.h> 29#include <linux/mfd/abx500/ab8500-gpio.h>
30#include <linux/mfd/abx500/ab8500-codec.h> 30#include <linux/mfd/abx500/ab8500-codec.h>
31#include <linux/leds-lp5521.h> 31#include <linux/platform_data/leds-lp55xx.h>
32#include <linux/input.h> 32#include <linux/input.h>
33#include <linux/smsc911x.h> 33#include <linux/smsc911x.h>
34#include <linux/gpio_keys.h> 34#include <linux/gpio_keys.h>
@@ -40,7 +40,6 @@
40 40
41#include <asm/mach-types.h> 41#include <asm/mach-types.h>
42#include <asm/mach/arch.h> 42#include <asm/mach/arch.h>
43#include <asm/hardware/gic.h>
44 43
45#include <mach/hardware.h> 44#include <mach/hardware.h>
46#include <mach/setup.h> 45#include <mach/setup.h>
@@ -90,26 +89,8 @@ static struct platform_device snowball_gpio_en_3v3_regulator_dev = {
90 }, 89 },
91}; 90};
92 91
93static struct ab8500_gpio_platform_data ab8500_gpio_pdata = { 92static struct abx500_gpio_platform_data ab8500_gpio_pdata = {
94 .gpio_base = MOP500_AB8500_PIN_GPIO(1), 93 .gpio_base = MOP500_AB8500_PIN_GPIO(1),
95 .irq_base = MOP500_AB8500_VIR_GPIO_IRQ_BASE,
96 /* config_reg is the initial configuration of ab8500 pins.
97 * The pins can be configured as GPIO or alt functions based
98 * on value present in GpioSel1 to GpioSel6 and AlternatFunction
99 * register. This is the array of 7 configuration settings.
100 * One has to compile time decide these settings. Below is the
101 * explanation of these setting
102 * GpioSel1 = 0x00 => Pins GPIO1 to GPIO8 are not used as GPIO
103 * GpioSel2 = 0x1E => Pins GPIO10 to GPIO13 are configured as GPIO
104 * GpioSel3 = 0x80 => Pin GPIO24 is configured as GPIO
105 * GpioSel4 = 0x01 => Pin GPIo25 is configured as GPIO
106 * GpioSel5 = 0x7A => Pins GPIO34, GPIO36 to GPIO39 are conf as GPIO
107 * GpioSel6 = 0x00 => Pins GPIO41 & GPIo42 are not configured as GPIO
108 * AlternaFunction = 0x00 => If Pins GPIO10 to 13 are not configured
109 * as GPIO then this register selectes the alternate fucntions
110 */
111 .config_reg = {0x00, 0x1E, 0x80, 0x01,
112 0x7A, 0x00, 0x00},
113}; 94};
114 95
115/* ab8500-codec */ 96/* ab8500-codec */
@@ -215,7 +196,7 @@ static struct platform_device snowball_sbnet_dev = {
215 }, 196 },
216}; 197};
217 198
218static struct ab8500_platform_data ab8500_platdata = { 199struct ab8500_platform_data ab8500_platdata = {
219 .irq_base = MOP500_AB8500_IRQ_BASE, 200 .irq_base = MOP500_AB8500_IRQ_BASE,
220 .regulator_reg_init = ab8500_regulator_reg_init, 201 .regulator_reg_init = ab8500_regulator_reg_init,
221 .num_regulator_reg_init = ARRAY_SIZE(ab8500_regulator_reg_init), 202 .num_regulator_reg_init = ARRAY_SIZE(ab8500_regulator_reg_init),
@@ -320,7 +301,7 @@ static struct tc3589x_platform_data mop500_tc35892_data = {
320 .irq_base = MOP500_EGPIO_IRQ_BASE, 301 .irq_base = MOP500_EGPIO_IRQ_BASE,
321}; 302};
322 303
323static struct lp5521_led_config lp5521_pri_led[] = { 304static struct lp55xx_led_config lp5521_pri_led[] = {
324 [0] = { 305 [0] = {
325 .chan_nr = 0, 306 .chan_nr = 0,
326 .led_current = 0x2f, 307 .led_current = 0x2f,
@@ -338,14 +319,14 @@ static struct lp5521_led_config lp5521_pri_led[] = {
338 }, 319 },
339}; 320};
340 321
341static struct lp5521_platform_data __initdata lp5521_pri_data = { 322static struct lp55xx_platform_data __initdata lp5521_pri_data = {
342 .label = "lp5521_pri", 323 .label = "lp5521_pri",
343 .led_config = &lp5521_pri_led[0], 324 .led_config = &lp5521_pri_led[0],
344 .num_channels = 3, 325 .num_channels = 3,
345 .clock_mode = LP5521_CLOCK_EXT, 326 .clock_mode = LP55XX_CLOCK_EXT,
346}; 327};
347 328
348static struct lp5521_led_config lp5521_sec_led[] = { 329static struct lp55xx_led_config lp5521_sec_led[] = {
349 [0] = { 330 [0] = {
350 .chan_nr = 0, 331 .chan_nr = 0,
351 .led_current = 0x2f, 332 .led_current = 0x2f,
@@ -363,11 +344,11 @@ static struct lp5521_led_config lp5521_sec_led[] = {
363 }, 344 },
364}; 345};
365 346
366static struct lp5521_platform_data __initdata lp5521_sec_data = { 347static struct lp55xx_platform_data __initdata lp5521_sec_data = {
367 .label = "lp5521_sec", 348 .label = "lp5521_sec",
368 .led_config = &lp5521_sec_led[0], 349 .led_config = &lp5521_sec_led[0],
369 .num_channels = 3, 350 .num_channels = 3,
370 .clock_mode = LP5521_CLOCK_EXT, 351 .clock_mode = LP55XX_CLOCK_EXT,
371}; 352};
372 353
373static struct i2c_board_info __initdata mop500_i2c0_devices[] = { 354static struct i2c_board_info __initdata mop500_i2c0_devices[] = {
@@ -651,6 +632,7 @@ static void __init mop500_init_machine(void)
651 int i2c0_devs; 632 int i2c0_devs;
652 int i; 633 int i;
653 634
635 platform_device_register(&db8500_prcmu_device);
654 mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR; 636 mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
655 637
656 mop500_pinmaps_init(); 638 mop500_pinmaps_init();
@@ -685,6 +667,7 @@ static void __init snowball_init_machine(void)
685 struct device *parent = NULL; 667 struct device *parent = NULL;
686 int i; 668 int i;
687 669
670 platform_device_register(&db8500_prcmu_device);
688 snowball_pinmaps_init(); 671 snowball_pinmaps_init();
689 parent = u8500_init_devices(&ab8500_platdata); 672 parent = u8500_init_devices(&ab8500_platdata);
690 673
@@ -710,6 +693,7 @@ static void __init hrefv60_init_machine(void)
710 int i2c0_devs; 693 int i2c0_devs;
711 int i; 694 int i;
712 695
696 platform_device_register(&db8500_prcmu_device);
713 /* 697 /*
714 * The HREFv60 board removed a GPIO expander and routed 698 * The HREFv60 board removed a GPIO expander and routed
715 * all these GPIO pins to the internal GPIO controller 699 * all these GPIO pins to the internal GPIO controller
@@ -751,8 +735,7 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
751 .map_io = u8500_map_io, 735 .map_io = u8500_map_io,
752 .init_irq = ux500_init_irq, 736 .init_irq = ux500_init_irq,
753 /* we re-use nomadik timer here */ 737 /* we re-use nomadik timer here */
754 .timer = &ux500_timer, 738 .init_time = ux500_timer_init,
755 .handle_irq = gic_handle_irq,
756 .init_machine = mop500_init_machine, 739 .init_machine = mop500_init_machine,
757 .init_late = ux500_init_late, 740 .init_late = ux500_init_late,
758MACHINE_END 741MACHINE_END
@@ -761,8 +744,7 @@ MACHINE_START(U8520, "ST-Ericsson U8520 Platform HREFP520")
761 .atag_offset = 0x100, 744 .atag_offset = 0x100,
762 .map_io = u8500_map_io, 745 .map_io = u8500_map_io,
763 .init_irq = ux500_init_irq, 746 .init_irq = ux500_init_irq,
764 .timer = &ux500_timer, 747 .init_time = ux500_timer_init,
765 .handle_irq = gic_handle_irq,
766 .init_machine = mop500_init_machine, 748 .init_machine = mop500_init_machine,
767 .init_late = ux500_init_late, 749 .init_late = ux500_init_late,
768MACHINE_END 750MACHINE_END
@@ -772,8 +754,7 @@ MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
772 .smp = smp_ops(ux500_smp_ops), 754 .smp = smp_ops(ux500_smp_ops),
773 .map_io = u8500_map_io, 755 .map_io = u8500_map_io,
774 .init_irq = ux500_init_irq, 756 .init_irq = ux500_init_irq,
775 .timer = &ux500_timer, 757 .init_time = ux500_timer_init,
776 .handle_irq = gic_handle_irq,
777 .init_machine = hrefv60_init_machine, 758 .init_machine = hrefv60_init_machine,
778 .init_late = ux500_init_late, 759 .init_late = ux500_init_late,
779MACHINE_END 760MACHINE_END
@@ -784,8 +765,7 @@ MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
784 .map_io = u8500_map_io, 765 .map_io = u8500_map_io,
785 .init_irq = ux500_init_irq, 766 .init_irq = ux500_init_irq,
786 /* we re-use nomadik timer here */ 767 /* we re-use nomadik timer here */
787 .timer = &ux500_timer, 768 .init_time = ux500_timer_init,
788 .handle_irq = gic_handle_irq,
789 .init_machine = snowball_init_machine, 769 .init_machine = snowball_init_machine,
790 .init_late = NULL, 770 .init_late = NULL,
791MACHINE_END 771MACHINE_END
diff --git a/arch/arm/mach-ux500/cache-l2x0.c b/arch/arm/mach-ux500/cache-l2x0.c
index 75d5b512a3d5..1c1609da76ce 100644
--- a/arch/arm/mach-ux500/cache-l2x0.c
+++ b/arch/arm/mach-ux500/cache-l2x0.c
@@ -10,7 +10,8 @@
10#include <asm/cacheflush.h> 10#include <asm/cacheflush.h>
11#include <asm/hardware/cache-l2x0.h> 11#include <asm/hardware/cache-l2x0.h>
12#include <mach/hardware.h> 12#include <mach/hardware.h>
13#include <mach/id.h> 13
14#include "id.h"
14 15
15static void __iomem *l2x0_base; 16static void __iomem *l2x0_base;
16 17
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index 5b286e06474c..19235cf7bbe3 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -27,7 +27,6 @@
27#include <asm/pmu.h> 27#include <asm/pmu.h>
28#include <asm/mach/map.h> 28#include <asm/mach/map.h>
29#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
30#include <asm/hardware/gic.h>
31 30
32#include <mach/hardware.h> 31#include <mach/hardware.h>
33#include <mach/setup.h> 32#include <mach/setup.h>
@@ -37,7 +36,9 @@
37 36
38#include "devices-db8500.h" 37#include "devices-db8500.h"
39#include "ste-dma40-db8500.h" 38#include "ste-dma40-db8500.h"
39
40#include "board-mop500.h" 40#include "board-mop500.h"
41#include "id.h"
41 42
42/* minimum static i/o mapping required to boot U8500 platforms */ 43/* minimum static i/o mapping required to boot U8500 platforms */
43static struct map_desc u8500_uart_io_desc[] __initdata = { 44static struct map_desc u8500_uart_io_desc[] __initdata = {
@@ -137,14 +138,9 @@ static struct platform_device db8500_pmu_device = {
137 .dev.platform_data = &db8500_pmu_platdata, 138 .dev.platform_data = &db8500_pmu_platdata,
138}; 139};
139 140
140static struct platform_device db8500_prcmu_device = {
141 .name = "db8500-prcmu",
142};
143
144static struct platform_device *platform_devs[] __initdata = { 141static struct platform_device *platform_devs[] __initdata = {
145 &u8500_dma40_device, 142 &u8500_dma40_device,
146 &db8500_pmu_device, 143 &db8500_pmu_device,
147 &db8500_prcmu_device,
148}; 144};
149 145
150static resource_size_t __initdata db8500_gpio_base[] = { 146static resource_size_t __initdata db8500_gpio_base[] = {
@@ -284,8 +280,10 @@ static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
284 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80128000, "nmk-i2c.2", NULL), 280 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80128000, "nmk-i2c.2", NULL),
285 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80110000, "nmk-i2c.3", NULL), 281 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80110000, "nmk-i2c.3", NULL),
286 OF_DEV_AUXDATA("st,nomadik-i2c", 0x8012a000, "nmk-i2c.4", NULL), 282 OF_DEV_AUXDATA("st,nomadik-i2c", 0x8012a000, "nmk-i2c.4", NULL),
283 OF_DEV_AUXDATA("stericsson,db8500-prcmu", 0x80157000, "db8500-prcmu",
284 &db8500_prcmu_pdata),
287 /* Requires device name bindings. */ 285 /* Requires device name bindings. */
288 OF_DEV_AUXDATA("stericsson,nmk_pinctrl", U8500_PRCMU_BASE, 286 OF_DEV_AUXDATA("stericsson,nmk-pinctrl", U8500_PRCMU_BASE,
289 "pinctrl-db8500", NULL), 287 "pinctrl-db8500", NULL),
290 /* Requires clock name and DMA bindings. */ 288 /* Requires clock name and DMA bindings. */
291 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80123000, 289 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80123000,
@@ -341,8 +339,7 @@ DT_MACHINE_START(U8500_DT, "ST-Ericsson Ux5x0 platform (Device Tree Support)")
341 .map_io = u8500_map_io, 339 .map_io = u8500_map_io,
342 .init_irq = ux500_init_irq, 340 .init_irq = ux500_init_irq,
343 /* we re-use nomadik timer here */ 341 /* we re-use nomadik timer here */
344 .timer = &ux500_timer, 342 .init_time = ux500_timer_init,
345 .handle_irq = gic_handle_irq,
346 .init_machine = u8500_init_machine, 343 .init_machine = u8500_init_machine,
347 .init_late = NULL, 344 .init_late = NULL,
348 .dt_compat = stericsson_dt_platform_compat, 345 .dt_compat = stericsson_dt_platform_compat,
diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c
index 721e7b4275f3..537870d3fea8 100644
--- a/arch/arm/mach-ux500/cpu.c
+++ b/arch/arm/mach-ux500/cpu.c
@@ -17,9 +17,10 @@
17#include <linux/of.h> 17#include <linux/of.h>
18#include <linux/of_irq.h> 18#include <linux/of_irq.h>
19#include <linux/irq.h> 19#include <linux/irq.h>
20#include <linux/irqchip.h>
21#include <linux/irqchip/arm-gic.h>
20#include <linux/platform_data/clk-ux500.h> 22#include <linux/platform_data/clk-ux500.h>
21 23
22#include <asm/hardware/gic.h>
23#include <asm/mach/map.h> 24#include <asm/mach/map.h>
24 25
25#include <mach/hardware.h> 26#include <mach/hardware.h>
@@ -27,6 +28,7 @@
27#include <mach/devices.h> 28#include <mach/devices.h>
28 29
29#include "board-mop500.h" 30#include "board-mop500.h"
31#include "id.h"
30 32
31void __iomem *_PRCMU_BASE; 33void __iomem *_PRCMU_BASE;
32 34
@@ -42,11 +44,6 @@ void __iomem *_PRCMU_BASE;
42 * This feels fragile because it depends on the gpio device getting probed 44 * This feels fragile because it depends on the gpio device getting probed
43 * _before_ any device uses the gpio interrupts. 45 * _before_ any device uses the gpio interrupts.
44*/ 46*/
45static const struct of_device_id ux500_dt_irq_match[] = {
46 { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
47 {},
48};
49
50void __init ux500_init_irq(void) 47void __init ux500_init_irq(void)
51{ 48{
52 void __iomem *dist_base; 49 void __iomem *dist_base;
@@ -62,7 +59,7 @@ void __init ux500_init_irq(void)
62 59
63#ifdef CONFIG_OF 60#ifdef CONFIG_OF
64 if (of_have_populated_dt()) 61 if (of_have_populated_dt())
65 of_irq_init(ux500_dt_irq_match); 62 irqchip_init();
66 else 63 else
67#endif 64#endif
68 gic_init(0, 29, dist_base, cpu_base); 65 gic_init(0, 29, dist_base, cpu_base);
@@ -71,13 +68,11 @@ void __init ux500_init_irq(void)
71 * Init clocks here so that they are available for system timer 68 * Init clocks here so that they are available for system timer
72 * initialization. 69 * initialization.
73 */ 70 */
74 if (cpu_is_u8500_family()) 71 if (cpu_is_u8500_family() || cpu_is_u9540())
75 db8500_prcmu_early_init(); 72 db8500_prcmu_early_init();
76 73
77 if (cpu_is_u8500_family()) 74 if (cpu_is_u8500_family() || cpu_is_u9540())
78 u8500_clk_init(); 75 u8500_clk_init();
79 else if (cpu_is_u9540())
80 u9540_clk_init();
81 else if (cpu_is_u8540()) 76 else if (cpu_is_u8540())
82 u8540_clk_init(); 77 u8540_clk_init();
83} 78}
diff --git a/arch/arm/mach-ux500/cpuidle.c b/arch/arm/mach-ux500/cpuidle.c
index b54884bd2549..ce9149302cc3 100644
--- a/arch/arm/mach-ux500/cpuidle.c
+++ b/arch/arm/mach-ux500/cpuidle.c
@@ -40,8 +40,10 @@ static inline int ux500_enter_idle(struct cpuidle_device *dev,
40 goto wfi; 40 goto wfi;
41 41
42 /* decouple the gic from the A9 cores */ 42 /* decouple the gic from the A9 cores */
43 if (prcmu_gic_decouple()) 43 if (prcmu_gic_decouple()) {
44 spin_unlock(&master_lock);
44 goto out; 45 goto out;
46 }
45 47
46 /* If an error occur, we will have to recouple the gic 48 /* If an error occur, we will have to recouple the gic
47 * manually */ 49 * manually */
diff --git a/arch/arm/mach-ux500/devices-db8500.c b/arch/arm/mach-ux500/devices-db8500.c
index 318d49020894..f3d9419f75d3 100644
--- a/arch/arm/mach-ux500/devices-db8500.c
+++ b/arch/arm/mach-ux500/devices-db8500.c
@@ -13,11 +13,13 @@
13#include <linux/amba/bus.h> 13#include <linux/amba/bus.h>
14#include <linux/amba/pl022.h> 14#include <linux/amba/pl022.h>
15#include <linux/platform_data/dma-ste-dma40.h> 15#include <linux/platform_data/dma-ste-dma40.h>
16#include <linux/mfd/dbx500-prcmu.h>
16 17
17#include <mach/hardware.h> 18#include <mach/hardware.h>
18#include <mach/setup.h> 19#include <mach/setup.h>
19#include <mach/irqs.h> 20#include <mach/irqs.h>
20 21
22#include "devices-db8500.h"
21#include "ste-dma40-db8500.h" 23#include "ste-dma40-db8500.h"
22 24
23static struct resource dma40_resources[] = { 25static struct resource dma40_resources[] = {
@@ -194,3 +196,45 @@ struct platform_device u8500_ske_keypad_device = {
194 .num_resources = ARRAY_SIZE(keypad_resources), 196 .num_resources = ARRAY_SIZE(keypad_resources),
195 .resource = keypad_resources, 197 .resource = keypad_resources,
196}; 198};
199
200struct prcmu_pdata db8500_prcmu_pdata = {
201 .ab_platdata = &ab8500_platdata,
202 .version_offset = DB8500_PRCMU_FW_VERSION_OFFSET,
203 .legacy_offset = DB8500_PRCMU_LEGACY_OFFSET,
204};
205
206static struct resource db8500_prcmu_res[] = {
207 {
208 .name = "prcmu",
209 .start = U8500_PRCMU_BASE,
210 .end = U8500_PRCMU_BASE + SZ_8K - 1,
211 .flags = IORESOURCE_MEM,
212 },
213 {
214 .name = "prcmu-tcdm",
215 .start = U8500_PRCMU_TCDM_BASE,
216 .end = U8500_PRCMU_TCDM_BASE + SZ_4K - 1,
217 .flags = IORESOURCE_MEM,
218 },
219 {
220 .name = "irq",
221 .start = IRQ_DB8500_PRCMU1,
222 .end = IRQ_DB8500_PRCMU1,
223 .flags = IORESOURCE_IRQ,
224 },
225 {
226 .name = "prcmu-tcpm",
227 .start = U8500_PRCMU_TCPM_BASE,
228 .end = U8500_PRCMU_TCPM_BASE + SZ_4K - 1,
229 .flags = IORESOURCE_MEM,
230 },
231};
232
233struct platform_device db8500_prcmu_device = {
234 .name = "db8500-prcmu",
235 .resource = db8500_prcmu_res,
236 .num_resources = ARRAY_SIZE(db8500_prcmu_res),
237 .dev = {
238 .platform_data = &db8500_prcmu_pdata,
239 },
240};
diff --git a/arch/arm/mach-ux500/devices-db8500.h b/arch/arm/mach-ux500/devices-db8500.h
index a5e05f6e256f..dbcb35c48f06 100644
--- a/arch/arm/mach-ux500/devices-db8500.h
+++ b/arch/arm/mach-ux500/devices-db8500.h
@@ -14,6 +14,11 @@
14 14
15struct ske_keypad_platform_data; 15struct ske_keypad_platform_data;
16struct pl022_ssp_controller; 16struct pl022_ssp_controller;
17struct platform_device;
18
19extern struct ab8500_platform_data ab8500_platdata;
20extern struct prcmu_pdata db8500_prcmu_pdata;
21extern struct platform_device db8500_prcmu_device;
17 22
18static inline struct platform_device * 23static inline struct platform_device *
19db8500_add_ske_keypad(struct device *parent, 24db8500_add_ske_keypad(struct device *parent,
diff --git a/arch/arm/mach-ux500/id.c b/arch/arm/mach-ux500/id.c
index d1579920139f..9f951842e1e5 100644
--- a/arch/arm/mach-ux500/id.c
+++ b/arch/arm/mach-ux500/id.c
@@ -17,6 +17,8 @@
17#include <mach/hardware.h> 17#include <mach/hardware.h>
18#include <mach/setup.h> 18#include <mach/setup.h>
19 19
20#include "id.h"
21
20struct dbx500_asic_id dbx500_id; 22struct dbx500_asic_id dbx500_id;
21 23
22static unsigned int ux500_read_asicid(phys_addr_t addr) 24static unsigned int ux500_read_asicid(phys_addr_t addr)
diff --git a/arch/arm/mach-ux500/include/mach/id.h b/arch/arm/mach-ux500/id.h
index 9c42642ab168..bcc58a8cccbc 100644
--- a/arch/arm/mach-ux500/include/mach/id.h
+++ b/arch/arm/mach-ux500/id.h
@@ -61,9 +61,14 @@ static inline bool __attribute_const__ cpu_is_u8540(void)
61 return dbx500_partnumber() == 0x8540; 61 return dbx500_partnumber() == 0x8540;
62} 62}
63 63
64static inline bool __attribute_const__ cpu_is_u8580(void)
65{
66 return dbx500_partnumber() == 0x8580;
67}
68
64static inline bool cpu_is_ux540_family(void) 69static inline bool cpu_is_ux540_family(void)
65{ 70{
66 return cpu_is_u9540() || cpu_is_u8540(); 71 return cpu_is_u9540() || cpu_is_u8540() || cpu_is_u8580();
67} 72}
68 73
69/* 74/*
@@ -115,6 +120,20 @@ static inline bool cpu_is_u8500v20_or_later(void)
115 return (cpu_is_u8500() && !cpu_is_u8500v10() && !cpu_is_u8500v11()); 120 return (cpu_is_u8500() && !cpu_is_u8500v10() && !cpu_is_u8500v11());
116} 121}
117 122
123/*
124 * 8540 revisions
125 */
126
127static inline bool __attribute_const__ cpu_is_u8540v10(void)
128{
129 return cpu_is_u8540() && dbx500_revision() == 0xA0;
130}
131
132static inline bool __attribute_const__ cpu_is_u8580v10(void)
133{
134 return cpu_is_u8580() && dbx500_revision() == 0xA0;
135}
136
118static inline bool ux500_is_svp(void) 137static inline bool ux500_is_svp(void)
119{ 138{
120 return false; 139 return false;
diff --git a/arch/arm/mach-ux500/include/mach/hardware.h b/arch/arm/mach-ux500/include/mach/hardware.h
index 28d16e744bfd..5201ddace503 100644
--- a/arch/arm/mach-ux500/include/mach/hardware.h
+++ b/arch/arm/mach-ux500/include/mach/hardware.h
@@ -39,7 +39,6 @@
39 39
40#ifndef __ASSEMBLY__ 40#ifndef __ASSEMBLY__
41 41
42#include <mach/id.h>
43extern void __iomem *_PRCMU_BASE; 42extern void __iomem *_PRCMU_BASE;
44 43
45#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) 44#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
diff --git a/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h b/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h
index 7d34c52798b5..d526dd8e87d3 100644
--- a/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h
+++ b/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h
@@ -38,15 +38,7 @@
38#define MOP500_STMPE1601_IRQ_END \ 38#define MOP500_STMPE1601_IRQ_END \
39 MOP500_STMPE1601_IRQ(STMPE_NR_INTERNAL_IRQS) 39 MOP500_STMPE1601_IRQ(STMPE_NR_INTERNAL_IRQS)
40 40
41/* AB8500 virtual gpio IRQ */ 41#define MOP500_NR_IRQS MOP500_STMPE1601_IRQ_END
42#define AB8500_VIR_GPIO_NR_IRQS 16
43
44#define MOP500_AB8500_VIR_GPIO_IRQ_BASE \
45 MOP500_STMPE1601_IRQ_END
46#define MOP500_AB8500_VIR_GPIO_IRQ_END \
47 (MOP500_AB8500_VIR_GPIO_IRQ_BASE + AB8500_VIR_GPIO_NR_IRQS)
48
49#define MOP500_NR_IRQS MOP500_AB8500_VIR_GPIO_IRQ_END
50 42
51#define MOP500_IRQ_END MOP500_NR_IRQS 43#define MOP500_IRQ_END MOP500_NR_IRQS
52 44
diff --git a/arch/arm/mach-ux500/include/mach/setup.h b/arch/arm/mach-ux500/include/mach/setup.h
index 6be4c4d2ab88..bddce2b49372 100644
--- a/arch/arm/mach-ux500/include/mach/setup.h
+++ b/arch/arm/mach-ux500/include/mach/setup.h
@@ -28,8 +28,7 @@ extern struct device *ux500_soc_device_init(const char *soc_id);
28struct amba_device; 28struct amba_device;
29extern void __init amba_add_devices(struct amba_device *devs[], int num); 29extern void __init amba_add_devices(struct amba_device *devs[], int num);
30 30
31struct sys_timer; 31extern void ux500_timer_init(void);
32extern struct sys_timer ux500_timer;
33 32
34#define __IO_DEV_DESC(x, sz) { \ 33#define __IO_DEV_DESC(x, sz) { \
35 .virtual = IO_ADDRESS(x), \ 34 .virtual = IO_ADDRESS(x), \
diff --git a/arch/arm/mach-ux500/include/mach/uncompress.h b/arch/arm/mach-ux500/include/mach/uncompress.h
index d60ecd1753f0..36969d52e53a 100644
--- a/arch/arm/mach-ux500/include/mach/uncompress.h
+++ b/arch/arm/mach-ux500/include/mach/uncompress.h
@@ -54,6 +54,4 @@ static inline void arch_decomp_setup(void)
54 ux500_uart_base = (void __iomem *)U8500_UART2_BASE; 54 ux500_uart_base = (void __iomem *)U8500_UART2_BASE;
55} 55}
56 56
57#define arch_decomp_wdog() /* nothing to do here */
58
59#endif /* __ASM_ARCH_UNCOMPRESS_H */ 57#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c
index 3db7782f3afb..18f7af339dc9 100644
--- a/arch/arm/mach-ux500/platsmp.c
+++ b/arch/arm/mach-ux500/platsmp.c
@@ -16,14 +16,17 @@
16#include <linux/device.h> 16#include <linux/device.h>
17#include <linux/smp.h> 17#include <linux/smp.h>
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/irqchip/arm-gic.h>
19 20
20#include <asm/cacheflush.h> 21#include <asm/cacheflush.h>
21#include <asm/hardware/gic.h>
22#include <asm/smp_plat.h> 22#include <asm/smp_plat.h>
23#include <asm/smp_scu.h> 23#include <asm/smp_scu.h>
24
24#include <mach/hardware.h> 25#include <mach/hardware.h>
25#include <mach/setup.h> 26#include <mach/setup.h>
26 27
28#include "id.h"
29
27/* This is called from headsmp.S to wakeup the secondary core */ 30/* This is called from headsmp.S to wakeup the secondary core */
28extern void u8500_secondary_startup(void); 31extern void u8500_secondary_startup(void);
29 32
@@ -91,7 +94,7 @@ static int __cpuinit ux500_boot_secondary(unsigned int cpu, struct task_struct *
91 */ 94 */
92 write_pen_release(cpu_logical_map(cpu)); 95 write_pen_release(cpu_logical_map(cpu));
93 96
94 smp_send_reschedule(cpu); 97 arch_send_wakeup_ipi_mask(cpumask_of(cpu));
95 98
96 timeout = jiffies + (1 * HZ); 99 timeout = jiffies + (1 * HZ);
97 while (time_before(jiffies, timeout)) { 100 while (time_before(jiffies, timeout)) {
@@ -155,8 +158,6 @@ static void __init ux500_smp_init_cpus(void)
155 158
156 for (i = 0; i < ncores; i++) 159 for (i = 0; i < ncores; i++)
157 set_cpu_possible(i, true); 160 set_cpu_possible(i, true);
158
159 set_smp_cross_call(gic_raise_softirq);
160} 161}
161 162
162static void __init ux500_smp_prepare_cpus(unsigned int max_cpus) 163static void __init ux500_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-ux500/timer.c b/arch/arm/mach-ux500/timer.c
index 875309acb022..a6af0b8732ba 100644
--- a/arch/arm/mach-ux500/timer.c
+++ b/arch/arm/mach-ux500/timer.c
@@ -17,6 +17,8 @@
17#include <mach/hardware.h> 17#include <mach/hardware.h>
18#include <mach/irqs.h> 18#include <mach/irqs.h>
19 19
20#include "id.h"
21
20#ifdef CONFIG_HAVE_ARM_TWD 22#ifdef CONFIG_HAVE_ARM_TWD
21static DEFINE_TWD_LOCAL_TIMER(u8500_twd_local_timer, 23static DEFINE_TWD_LOCAL_TIMER(u8500_twd_local_timer,
22 U8500_TWD_BASE, IRQ_LOCALTIMER); 24 U8500_TWD_BASE, IRQ_LOCALTIMER);
@@ -46,7 +48,7 @@ const static struct of_device_id prcmu_timer_of_match[] __initconst = {
46 { }, 48 { },
47}; 49};
48 50
49static void __init ux500_timer_init(void) 51void __init ux500_timer_init(void)
50{ 52{
51 void __iomem *mtu_timer_base; 53 void __iomem *mtu_timer_base;
52 void __iomem *prcmu_timer_base; 54 void __iomem *prcmu_timer_base;
@@ -99,14 +101,3 @@ dt_fail:
99 clksrc_dbx500_prcmu_init(prcmu_timer_base); 101 clksrc_dbx500_prcmu_init(prcmu_timer_base);
100 ux500_twd_init(); 102 ux500_twd_init();
101} 103}
102
103static void ux500_timer_reset(void)
104{
105 nmdk_clkevt_reset();
106 nmdk_clksrc_reset();
107}
108
109struct sys_timer ux500_timer = {
110 .init = ux500_timer_init,
111 .resume = ux500_timer_reset,
112};
diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig
index 63d8e9f81b99..1dba3688275f 100644
--- a/arch/arm/mach-versatile/Kconfig
+++ b/arch/arm/mach-versatile/Kconfig
@@ -25,4 +25,9 @@ config MACH_VERSATILE_DT
25 Include support for the ARM(R) Versatile/PB platform, 25 Include support for the ARM(R) Versatile/PB platform,
26 using the device tree for discovery 26 using the device tree for discovery
27 27
28config MACH_VERSATILE_AUTO
29 def_bool y
30 depends on !ARCH_VERSATILE_PB && !MACH_VERSATILE_AB
31 select MACH_VERSATILE_DT
32
28endmenu 33endmenu
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 5d5929450366..25160aeaa3b7 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -32,15 +32,16 @@
32#include <linux/amba/mmci.h> 32#include <linux/amba/mmci.h>
33#include <linux/amba/pl022.h> 33#include <linux/amba/pl022.h>
34#include <linux/io.h> 34#include <linux/io.h>
35#include <linux/irqchip/arm-vic.h>
35#include <linux/irqchip/versatile-fpga.h> 36#include <linux/irqchip/versatile-fpga.h>
36#include <linux/gfp.h> 37#include <linux/gfp.h>
37#include <linux/clkdev.h> 38#include <linux/clkdev.h>
38#include <linux/mtd/physmap.h> 39#include <linux/mtd/physmap.h>
40#include <linux/bitops.h>
39 41
40#include <asm/irq.h> 42#include <asm/irq.h>
41#include <asm/hardware/arm_timer.h> 43#include <asm/hardware/arm_timer.h>
42#include <asm/hardware/icst.h> 44#include <asm/hardware/icst.h>
43#include <asm/hardware/vic.h>
44#include <asm/mach-types.h> 45#include <asm/mach-types.h>
45 46
46#include <asm/mach/arch.h> 47#include <asm/mach/arch.h>
@@ -65,16 +66,28 @@
65#define VA_VIC_BASE __io_address(VERSATILE_VIC_BASE) 66#define VA_VIC_BASE __io_address(VERSATILE_VIC_BASE)
66#define VA_SIC_BASE __io_address(VERSATILE_SIC_BASE) 67#define VA_SIC_BASE __io_address(VERSATILE_SIC_BASE)
67 68
69/* These PIC IRQs are valid in each configuration */
70#define PIC_VALID_ALL BIT(SIC_INT_KMI0) | BIT(SIC_INT_KMI1) | \
71 BIT(SIC_INT_SCI3) | BIT(SIC_INT_UART3) | \
72 BIT(SIC_INT_CLCD) | BIT(SIC_INT_TOUCH) | \
73 BIT(SIC_INT_KEYPAD) | BIT(SIC_INT_DoC) | \
74 BIT(SIC_INT_USB) | BIT(SIC_INT_PCI0) | \
75 BIT(SIC_INT_PCI1) | BIT(SIC_INT_PCI2) | \
76 BIT(SIC_INT_PCI3)
68#if 1 77#if 1
69#define IRQ_MMCI0A IRQ_VICSOURCE22 78#define IRQ_MMCI0A IRQ_VICSOURCE22
70#define IRQ_AACI IRQ_VICSOURCE24 79#define IRQ_AACI IRQ_VICSOURCE24
71#define IRQ_ETH IRQ_VICSOURCE25 80#define IRQ_ETH IRQ_VICSOURCE25
72#define PIC_MASK 0xFFD00000 81#define PIC_MASK 0xFFD00000
82#define PIC_VALID PIC_VALID_ALL
73#else 83#else
74#define IRQ_MMCI0A IRQ_SIC_MMCI0A 84#define IRQ_MMCI0A IRQ_SIC_MMCI0A
75#define IRQ_AACI IRQ_SIC_AACI 85#define IRQ_AACI IRQ_SIC_AACI
76#define IRQ_ETH IRQ_SIC_ETH 86#define IRQ_ETH IRQ_SIC_ETH
77#define PIC_MASK 0 87#define PIC_MASK 0
88#define PIC_VALID PIC_VALID_ALL | BIT(SIC_INT_MMCI0A) | \
89 BIT(SIC_INT_MMCI1A) | BIT(SIC_INT_AACI) | \
90 BIT(SIC_INT_ETH)
78#endif 91#endif
79 92
80/* Lookup table for finding a DT node that represents the vic instance */ 93/* Lookup table for finding a DT node that represents the vic instance */
@@ -102,7 +115,7 @@ void __init versatile_init_irq(void)
102 VERSATILE_SIC_BASE); 115 VERSATILE_SIC_BASE);
103 116
104 fpga_irq_init(VA_SIC_BASE, "SIC", IRQ_SIC_START, 117 fpga_irq_init(VA_SIC_BASE, "SIC", IRQ_SIC_START,
105 IRQ_VICSOURCE31, ~PIC_MASK, np); 118 IRQ_VICSOURCE31, PIC_VALID, np);
106 119
107 /* 120 /*
108 * Interrupts on secondary controller from 0 to 8 are routed to 121 * Interrupts on secondary controller from 0 to 8 are routed to
@@ -114,7 +127,7 @@ void __init versatile_init_irq(void)
114 writel(PIC_MASK, VA_SIC_BASE + SIC_INT_PIC_ENABLE); 127 writel(PIC_MASK, VA_SIC_BASE + SIC_INT_PIC_ENABLE);
115} 128}
116 129
117static struct map_desc versatile_io_desc[] __initdata = { 130static struct map_desc versatile_io_desc[] __initdata __maybe_unused = {
118 { 131 {
119 .virtual = IO_ADDRESS(VERSATILE_SYS_BASE), 132 .virtual = IO_ADDRESS(VERSATILE_SYS_BASE),
120 .pfn = __phys_to_pfn(VERSATILE_SYS_BASE), 133 .pfn = __phys_to_pfn(VERSATILE_SYS_BASE),
@@ -770,7 +783,7 @@ void __init versatile_init(void)
770/* 783/*
771 * Set up timer interrupt, and return the current time in seconds. 784 * Set up timer interrupt, and return the current time in seconds.
772 */ 785 */
773static void __init versatile_timer_init(void) 786void __init versatile_timer_init(void)
774{ 787{
775 u32 val; 788 u32 val;
776 789
@@ -797,8 +810,3 @@ static void __init versatile_timer_init(void)
797 sp804_clocksource_init(TIMER3_VA_BASE, "timer3"); 810 sp804_clocksource_init(TIMER3_VA_BASE, "timer3");
798 sp804_clockevents_init(TIMER0_VA_BASE, IRQ_TIMERINT0_1, "timer0"); 811 sp804_clockevents_init(TIMER0_VA_BASE, IRQ_TIMERINT0_1, "timer0");
799} 812}
800
801struct sys_timer versatile_timer = {
802 .init = versatile_timer_init,
803};
804
diff --git a/arch/arm/mach-versatile/core.h b/arch/arm/mach-versatile/core.h
index 683e60776a85..5c1b87d1da6b 100644
--- a/arch/arm/mach-versatile/core.h
+++ b/arch/arm/mach-versatile/core.h
@@ -29,7 +29,7 @@ extern void __init versatile_init(void);
29extern void __init versatile_init_early(void); 29extern void __init versatile_init_early(void);
30extern void __init versatile_init_irq(void); 30extern void __init versatile_init_irq(void);
31extern void __init versatile_map_io(void); 31extern void __init versatile_map_io(void);
32extern struct sys_timer versatile_timer; 32extern void versatile_timer_init(void);
33extern void versatile_restart(char, const char *); 33extern void versatile_restart(char, const char *);
34extern unsigned int mmc_status(struct device *dev); 34extern unsigned int mmc_status(struct device *dev);
35#ifdef CONFIG_OF 35#ifdef CONFIG_OF
diff --git a/arch/arm/mach-versatile/include/mach/uncompress.h b/arch/arm/mach-versatile/include/mach/uncompress.h
index 3dd0048afb34..986e3d303f3c 100644
--- a/arch/arm/mach-versatile/include/mach/uncompress.h
+++ b/arch/arm/mach-versatile/include/mach/uncompress.h
@@ -43,4 +43,3 @@ static inline void flush(void)
43 * nothing to do 43 * nothing to do
44 */ 44 */
45#define arch_decomp_setup() 45#define arch_decomp_setup()
46#define arch_decomp_wdog()
diff --git a/arch/arm/mach-versatile/pci.c b/arch/arm/mach-versatile/pci.c
index 2f84f4094f13..e92e5e0705bc 100644
--- a/arch/arm/mach-versatile/pci.c
+++ b/arch/arm/mach-versatile/pci.c
@@ -23,6 +23,7 @@
23#include <linux/io.h> 23#include <linux/io.h>
24 24
25#include <mach/hardware.h> 25#include <mach/hardware.h>
26#include <mach/irqs.h>
26#include <asm/irq.h> 27#include <asm/irq.h>
27#include <asm/mach/pci.h> 28#include <asm/mach/pci.h>
28 29
@@ -327,12 +328,12 @@ static int __init versatile_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
327 int irq; 328 int irq;
328 329
329 /* slot, pin, irq 330 /* slot, pin, irq
330 * 24 1 27 331 * 24 1 IRQ_SIC_PCI0
331 * 25 1 28 332 * 25 1 IRQ_SIC_PCI1
332 * 26 1 29 333 * 26 1 IRQ_SIC_PCI2
333 * 27 1 30 334 * 27 1 IRQ_SIC_PCI3
334 */ 335 */
335 irq = 27 + ((slot - 24 + pin - 1) & 3); 336 irq = IRQ_SIC_PCI0 + ((slot - 24 + pin - 1) & 3);
336 337
337 return irq; 338 return irq;
338} 339}
diff --git a/arch/arm/mach-versatile/versatile_ab.c b/arch/arm/mach-versatile/versatile_ab.c
index 98f65493177a..1caef1093793 100644
--- a/arch/arm/mach-versatile/versatile_ab.c
+++ b/arch/arm/mach-versatile/versatile_ab.c
@@ -26,7 +26,6 @@
26 26
27#include <mach/hardware.h> 27#include <mach/hardware.h>
28#include <asm/irq.h> 28#include <asm/irq.h>
29#include <asm/hardware/vic.h>
30#include <asm/mach-types.h> 29#include <asm/mach-types.h>
31 30
32#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
@@ -39,8 +38,7 @@ MACHINE_START(VERSATILE_AB, "ARM-Versatile AB")
39 .map_io = versatile_map_io, 38 .map_io = versatile_map_io,
40 .init_early = versatile_init_early, 39 .init_early = versatile_init_early,
41 .init_irq = versatile_init_irq, 40 .init_irq = versatile_init_irq,
42 .handle_irq = vic_handle_irq, 41 .init_time = versatile_timer_init,
43 .timer = &versatile_timer,
44 .init_machine = versatile_init, 42 .init_machine = versatile_init,
45 .restart = versatile_restart, 43 .restart = versatile_restart,
46MACHINE_END 44MACHINE_END
diff --git a/arch/arm/mach-versatile/versatile_dt.c b/arch/arm/mach-versatile/versatile_dt.c
index ae5ad3c8f3dd..2558f2e957c3 100644
--- a/arch/arm/mach-versatile/versatile_dt.c
+++ b/arch/arm/mach-versatile/versatile_dt.c
@@ -24,7 +24,6 @@
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/of_irq.h> 25#include <linux/of_irq.h>
26#include <linux/of_platform.h> 26#include <linux/of_platform.h>
27#include <asm/hardware/vic.h>
28#include <asm/mach-types.h> 27#include <asm/mach-types.h>
29#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
30 29
@@ -46,8 +45,7 @@ DT_MACHINE_START(VERSATILE_PB, "ARM-Versatile (Device Tree Support)")
46 .map_io = versatile_map_io, 45 .map_io = versatile_map_io,
47 .init_early = versatile_init_early, 46 .init_early = versatile_init_early,
48 .init_irq = versatile_init_irq, 47 .init_irq = versatile_init_irq,
49 .handle_irq = vic_handle_irq, 48 .init_time = versatile_timer_init,
50 .timer = &versatile_timer,
51 .init_machine = versatile_dt_init, 49 .init_machine = versatile_dt_init,
52 .dt_compat = versatile_dt_match, 50 .dt_compat = versatile_dt_match,
53 .restart = versatile_restart, 51 .restart = versatile_restart,
diff --git a/arch/arm/mach-versatile/versatile_pb.c b/arch/arm/mach-versatile/versatile_pb.c
index 19738331bd3d..611d140c8695 100644
--- a/arch/arm/mach-versatile/versatile_pb.c
+++ b/arch/arm/mach-versatile/versatile_pb.c
@@ -27,7 +27,6 @@
27#include <linux/io.h> 27#include <linux/io.h>
28 28
29#include <mach/hardware.h> 29#include <mach/hardware.h>
30#include <asm/hardware/vic.h>
31#include <asm/irq.h> 30#include <asm/irq.h>
32#include <asm/mach-types.h> 31#include <asm/mach-types.h>
33 32
@@ -107,8 +106,7 @@ MACHINE_START(VERSATILE_PB, "ARM-Versatile PB")
107 .map_io = versatile_map_io, 106 .map_io = versatile_map_io,
108 .init_early = versatile_init_early, 107 .init_early = versatile_init_early,
109 .init_irq = versatile_init_irq, 108 .init_irq = versatile_init_irq,
110 .handle_irq = vic_handle_irq, 109 .init_time = versatile_timer_init,
111 .timer = &versatile_timer,
112 .init_machine = versatile_pb_init, 110 .init_machine = versatile_pb_init,
113 .restart = versatile_restart, 111 .restart = versatile_restart,
114MACHINE_END 112MACHINE_END
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c
index 60838ddb8564..6f34497a4245 100644
--- a/arch/arm/mach-vexpress/ct-ca9x4.c
+++ b/arch/arm/mach-vexpress/ct-ca9x4.c
@@ -10,10 +10,10 @@
10#include <linux/amba/clcd.h> 10#include <linux/amba/clcd.h>
11#include <linux/clkdev.h> 11#include <linux/clkdev.h>
12#include <linux/vexpress.h> 12#include <linux/vexpress.h>
13#include <linux/irqchip/arm-gic.h>
13 14
14#include <asm/hardware/arm_timer.h> 15#include <asm/hardware/arm_timer.h>
15#include <asm/hardware/cache-l2x0.h> 16#include <asm/hardware/cache-l2x0.h>
16#include <asm/hardware/gic.h>
17#include <asm/smp_scu.h> 17#include <asm/smp_scu.h>
18#include <asm/smp_twd.h> 18#include <asm/smp_twd.h>
19 19
@@ -182,8 +182,6 @@ static void __init ct_ca9x4_init_cpu_map(void)
182 182
183 for (i = 0; i < ncores; ++i) 183 for (i = 0; i < ncores; ++i)
184 set_cpu_possible(i, true); 184 set_cpu_possible(i, true);
185
186 set_smp_cross_call(gic_raise_softirq);
187} 185}
188 186
189static void __init ct_ca9x4_smp_enable(unsigned int max_cpus) 187static void __init ct_ca9x4_smp_enable(unsigned int max_cpus)
diff --git a/arch/arm/mach-vexpress/platsmp.c b/arch/arm/mach-vexpress/platsmp.c
index c5d70de9bb4e..dc1ace55d557 100644
--- a/arch/arm/mach-vexpress/platsmp.c
+++ b/arch/arm/mach-vexpress/platsmp.c
@@ -16,7 +16,6 @@
16#include <linux/vexpress.h> 16#include <linux/vexpress.h>
17 17
18#include <asm/smp_scu.h> 18#include <asm/smp_scu.h>
19#include <asm/hardware/gic.h>
20#include <asm/mach/map.h> 19#include <asm/mach/map.h>
21 20
22#include <mach/motherboard.h> 21#include <mach/motherboard.h>
@@ -128,8 +127,6 @@ static void __init vexpress_dt_smp_init_cpus(void)
128 127
129 for (i = 0; i < ncores; ++i) 128 for (i = 0; i < ncores; ++i)
130 set_cpu_possible(i, true); 129 set_cpu_possible(i, true);
131
132 set_smp_cross_call(gic_raise_softirq);
133} 130}
134 131
135static void __init vexpress_dt_smp_prepare_cpus(unsigned int max_cpus) 132static void __init vexpress_dt_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index 011661a6c5cb..915683cb67d6 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -7,6 +7,7 @@
7#include <linux/io.h> 7#include <linux/io.h>
8#include <linux/smp.h> 8#include <linux/smp.h>
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/irqchip.h>
10#include <linux/of_address.h> 11#include <linux/of_address.h>
11#include <linux/of_fdt.h> 12#include <linux/of_fdt.h>
12#include <linux/of_irq.h> 13#include <linux/of_irq.h>
@@ -30,7 +31,6 @@
30#include <asm/mach/time.h> 31#include <asm/mach/time.h>
31#include <asm/hardware/arm_timer.h> 32#include <asm/hardware/arm_timer.h>
32#include <asm/hardware/cache-l2x0.h> 33#include <asm/hardware/cache-l2x0.h>
33#include <asm/hardware/gic.h>
34#include <asm/hardware/timer-sp.h> 34#include <asm/hardware/timer-sp.h>
35 35
36#include <mach/ct-ca9x4.h> 36#include <mach/ct-ca9x4.h>
@@ -291,10 +291,6 @@ static void __init v2m_timer_init(void)
291 v2m_sp804_init(ioremap(V2M_TIMER01, SZ_4K), IRQ_V2M_TIMER0); 291 v2m_sp804_init(ioremap(V2M_TIMER01, SZ_4K), IRQ_V2M_TIMER0);
292} 292}
293 293
294static struct sys_timer v2m_timer = {
295 .init = v2m_timer_init,
296};
297
298static void __init v2m_init_early(void) 294static void __init v2m_init_early(void)
299{ 295{
300 if (ct_desc->init_early) 296 if (ct_desc->init_early)
@@ -376,8 +372,7 @@ MACHINE_START(VEXPRESS, "ARM-Versatile Express")
376 .map_io = v2m_map_io, 372 .map_io = v2m_map_io,
377 .init_early = v2m_init_early, 373 .init_early = v2m_init_early,
378 .init_irq = v2m_init_irq, 374 .init_irq = v2m_init_irq,
379 .timer = &v2m_timer, 375 .init_time = v2m_timer_init,
380 .handle_irq = gic_handle_irq,
381 .init_machine = v2m_init, 376 .init_machine = v2m_init,
382 .restart = vexpress_restart, 377 .restart = vexpress_restart,
383MACHINE_END 378MACHINE_END
@@ -434,16 +429,6 @@ void __init v2m_dt_init_early(void)
434 } 429 }
435} 430}
436 431
437static struct of_device_id vexpress_irq_match[] __initdata = {
438 { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
439 {}
440};
441
442static void __init v2m_dt_init_irq(void)
443{
444 of_irq_init(vexpress_irq_match);
445}
446
447static void __init v2m_dt_timer_init(void) 432static void __init v2m_dt_timer_init(void)
448{ 433{
449 struct device_node *node = NULL; 434 struct device_node *node = NULL;
@@ -468,10 +453,6 @@ static void __init v2m_dt_timer_init(void)
468 24000000); 453 24000000);
469} 454}
470 455
471static struct sys_timer v2m_dt_timer = {
472 .init = v2m_dt_timer_init,
473};
474
475static const struct of_device_id v2m_dt_bus_match[] __initconst = { 456static const struct of_device_id v2m_dt_bus_match[] __initconst = {
476 { .compatible = "simple-bus", }, 457 { .compatible = "simple-bus", },
477 { .compatible = "arm,amba-bus", }, 458 { .compatible = "arm,amba-bus", },
@@ -497,9 +478,8 @@ DT_MACHINE_START(VEXPRESS_DT, "ARM-Versatile Express")
497 .smp = smp_ops(vexpress_smp_ops), 478 .smp = smp_ops(vexpress_smp_ops),
498 .map_io = v2m_dt_map_io, 479 .map_io = v2m_dt_map_io,
499 .init_early = v2m_dt_init_early, 480 .init_early = v2m_dt_init_early,
500 .init_irq = v2m_dt_init_irq, 481 .init_irq = irqchip_init,
501 .timer = &v2m_dt_timer, 482 .init_time = v2m_dt_timer_init,
502 .init_machine = v2m_dt_init, 483 .init_machine = v2m_dt_init,
503 .handle_irq = gic_handle_irq,
504 .restart = vexpress_restart, 484 .restart = vexpress_restart,
505MACHINE_END 485MACHINE_END
diff --git a/arch/arm/mach-virt/Kconfig b/arch/arm/mach-virt/Kconfig
new file mode 100644
index 000000000000..8958f0d896bc
--- /dev/null
+++ b/arch/arm/mach-virt/Kconfig
@@ -0,0 +1,10 @@
1config ARCH_VIRT
2 bool "Dummy Virtual Machine" if ARCH_MULTI_V7
3 select ARCH_WANT_OPTIONAL_GPIOLIB
4 select ARM_GIC
5 select ARM_ARCH_TIMER
6 select ARM_PSCI
7 select HAVE_SMP
8 select CPU_V7
9 select SPARSE_IRQ
10 select USE_OF
diff --git a/arch/arm/mach-virt/Makefile b/arch/arm/mach-virt/Makefile
new file mode 100644
index 000000000000..042afc1f8c44
--- /dev/null
+++ b/arch/arm/mach-virt/Makefile
@@ -0,0 +1,6 @@
1#
2# Makefile for the linux kernel.
3#
4
5obj-y := virt.o
6obj-$(CONFIG_SMP) += platsmp.o
diff --git a/arch/arm/mach-virt/platsmp.c b/arch/arm/mach-virt/platsmp.c
new file mode 100644
index 000000000000..8badaabe70a1
--- /dev/null
+++ b/arch/arm/mach-virt/platsmp.c
@@ -0,0 +1,58 @@
1/*
2 * Dummy Virtual Machine - does what it says on the tin.
3 *
4 * Copyright (C) 2012 ARM Ltd
5 * Author: Will Deacon <will.deacon@arm.com>
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 * 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, see <http://www.gnu.org/licenses/>.
18 */
19
20#include <linux/init.h>
21#include <linux/smp.h>
22#include <linux/of.h>
23
24#include <linux/irqchip/arm-gic.h>
25
26#include <asm/psci.h>
27#include <asm/smp_plat.h>
28
29extern void secondary_startup(void);
30
31static void __init virt_smp_init_cpus(void)
32{
33}
34
35static void __init virt_smp_prepare_cpus(unsigned int max_cpus)
36{
37}
38
39static int __cpuinit virt_boot_secondary(unsigned int cpu,
40 struct task_struct *idle)
41{
42 if (psci_ops.cpu_on)
43 return psci_ops.cpu_on(cpu_logical_map(cpu),
44 __pa(secondary_startup));
45 return -ENODEV;
46}
47
48static void __cpuinit virt_secondary_init(unsigned int cpu)
49{
50 gic_secondary_init(0);
51}
52
53struct smp_operations __initdata virt_smp_ops = {
54 .smp_init_cpus = virt_smp_init_cpus,
55 .smp_prepare_cpus = virt_smp_prepare_cpus,
56 .smp_secondary_init = virt_secondary_init,
57 .smp_boot_secondary = virt_boot_secondary,
58};
diff --git a/arch/arm/mach-virt/virt.c b/arch/arm/mach-virt/virt.c
new file mode 100644
index 000000000000..31666f6b4373
--- /dev/null
+++ b/arch/arm/mach-virt/virt.c
@@ -0,0 +1,54 @@
1/*
2 * Dummy Virtual Machine - does what it says on the tin.
3 *
4 * Copyright (C) 2012 ARM Ltd
5 * Authors: Will Deacon <will.deacon@arm.com>,
6 * Marc Zyngier <marc.zyngier@arm.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 version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#include <linux/irqchip.h>
22#include <linux/of_irq.h>
23#include <linux/of_platform.h>
24#include <linux/smp.h>
25
26#include <asm/arch_timer.h>
27#include <asm/mach/arch.h>
28#include <asm/mach/time.h>
29
30static void __init virt_init(void)
31{
32 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
33}
34
35static void __init virt_timer_init(void)
36{
37 WARN_ON(arch_timer_of_register() != 0);
38 WARN_ON(arch_timer_sched_clock_init() != 0);
39}
40
41static const char *virt_dt_match[] = {
42 "linux,dummy-virt",
43 NULL
44};
45
46extern struct smp_operations virt_smp_ops;
47
48DT_MACHINE_START(VIRT, "Dummy Virtual Machine")
49 .init_irq = irqchip_init,
50 .init_time = virt_timer_init,
51 .init_machine = virt_init,
52 .smp = smp_ops(virt_smp_ops),
53 .dt_compat = virt_dt_match,
54MACHINE_END
diff --git a/arch/arm/mach-vt8500/Kconfig b/arch/arm/mach-vt8500/Kconfig
index 2ed0b7d95db6..e3e94b2fa145 100644
--- a/arch/arm/mach-vt8500/Kconfig
+++ b/arch/arm/mach-vt8500/Kconfig
@@ -1,12 +1,34 @@
1config ARCH_VT8500 1config ARCH_VT8500
2 bool "VIA/WonderMedia 85xx" if ARCH_MULTI_V5 2 bool
3 default ARCH_VT8500_SINGLE
4 select ARCH_HAS_CPUFREQ 3 select ARCH_HAS_CPUFREQ
5 select ARCH_REQUIRE_GPIOLIB 4 select ARCH_REQUIRE_GPIOLIB
6 select CLKDEV_LOOKUP 5 select CLKDEV_LOOKUP
7 select CPU_ARM926T 6 select CLKSRC_OF
8 select GENERIC_CLOCKEVENTS 7 select GENERIC_CLOCKEVENTS
9 select GENERIC_GPIO
10 select HAVE_CLK 8 select HAVE_CLK
9 select VT8500_TIMER
11 help 10 help
12 Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip. 11 Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip.
12
13config ARCH_WM8505
14 bool "VIA/Wondermedia 85xx and WM8650"
15 depends on ARCH_MULTI_V5
16 select ARCH_VT8500
17 select CPU_ARM926T
18 help
19
20config ARCH_WM8750
21 bool "WonderMedia WM8750"
22 depends on ARCH_MULTI_V6
23 select ARCH_VT8500
24 select CPU_V6
25 help
26 Support for WonderMedia WM8750 System-on-Chip.
27
28config ARCH_WM8850
29 bool "WonderMedia WM8850"
30 depends on ARCH_MULTI_V7
31 select ARCH_VT8500
32 select CPU_V7
33 help
34 Support for WonderMedia WM8850 System-on-Chip.
diff --git a/arch/arm/mach-vt8500/Makefile b/arch/arm/mach-vt8500/Makefile
index e035251cda48..92ceb2436b60 100644
--- a/arch/arm/mach-vt8500/Makefile
+++ b/arch/arm/mach-vt8500/Makefile
@@ -1 +1 @@
obj-$(CONFIG_ARCH_VT8500) += irq.o timer.o vt8500.o obj-$(CONFIG_ARCH_VT8500) += irq.o vt8500.o
diff --git a/arch/arm/mach-vt8500/common.h b/arch/arm/mach-vt8500/common.h
index 6f2b843115db..77611a6968d6 100644
--- a/arch/arm/mach-vt8500/common.h
+++ b/arch/arm/mach-vt8500/common.h
@@ -18,7 +18,6 @@
18 18
19#include <linux/of.h> 19#include <linux/of.h>
20 20
21void __init vt8500_timer_init(void);
22int __init vt8500_irq_init(struct device_node *node, 21int __init vt8500_irq_init(struct device_node *node,
23 struct device_node *parent); 22 struct device_node *parent);
24 23
diff --git a/arch/arm/mach-vt8500/include/mach/timex.h b/arch/arm/mach-vt8500/include/mach/timex.h
deleted file mode 100644
index 8487e4c690b7..000000000000
--- a/arch/arm/mach-vt8500/include/mach/timex.h
+++ /dev/null
@@ -1,26 +0,0 @@
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
deleted file mode 100644
index e6e81fdaf109..000000000000
--- a/arch/arm/mach-vt8500/include/mach/uncompress.h
+++ /dev/null
@@ -1,37 +0,0 @@
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#define UART0_ADDR(x) *(volatile unsigned char *)(UART0_PHYS + x)
20
21static void putc(const char c)
22{
23 while (UART0_ADDR(0x1c) & 0x2)
24 /* Tx busy, wait and poll */;
25
26 UART0_ADDR(0) = c;
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/timer.c b/arch/arm/mach-vt8500/timer.c
deleted file mode 100644
index 3dd21a47881f..000000000000
--- a/arch/arm/mach-vt8500/timer.c
+++ /dev/null
@@ -1,184 +0,0 @@
1/*
2 * arch/arm/mach-vt8500/timer.c
3 *
4 * Copyright (C) 2012 Tony Prisk <linux@prisktech.co.nz>
5 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22/*
23 * This file is copied and modified from the original timer.c provided by
24 * Alexey Charkov. Minor changes have been made for Device Tree Support.
25 */
26
27#include <linux/io.h>
28#include <linux/irq.h>
29#include <linux/interrupt.h>
30#include <linux/clocksource.h>
31#include <linux/clockchips.h>
32#include <linux/delay.h>
33#include <asm/mach/time.h>
34
35#include <linux/of.h>
36#include <linux/of_address.h>
37#include <linux/of_irq.h>
38
39#define VT8500_TIMER_OFFSET 0x0100
40#define VT8500_TIMER_HZ 3000000
41#define TIMER_MATCH_VAL 0x0000
42#define TIMER_COUNT_VAL 0x0010
43#define TIMER_STATUS_VAL 0x0014
44#define TIMER_IER_VAL 0x001c /* interrupt enable */
45#define TIMER_CTRL_VAL 0x0020
46#define TIMER_AS_VAL 0x0024 /* access status */
47#define TIMER_COUNT_R_ACTIVE (1 << 5) /* not ready for read */
48#define TIMER_COUNT_W_ACTIVE (1 << 4) /* not ready for write */
49#define TIMER_MATCH_W_ACTIVE (1 << 0) /* not ready for write */
50
51#define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t)
52
53static void __iomem *regbase;
54
55static cycle_t vt8500_timer_read(struct clocksource *cs)
56{
57 int loops = msecs_to_loops(10);
58 writel(3, regbase + TIMER_CTRL_VAL);
59 while ((readl((regbase + TIMER_AS_VAL)) & TIMER_COUNT_R_ACTIVE)
60 && --loops)
61 cpu_relax();
62 return readl(regbase + TIMER_COUNT_VAL);
63}
64
65static struct clocksource clocksource = {
66 .name = "vt8500_timer",
67 .rating = 200,
68 .read = vt8500_timer_read,
69 .mask = CLOCKSOURCE_MASK(32),
70 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
71};
72
73static int vt8500_timer_set_next_event(unsigned long cycles,
74 struct clock_event_device *evt)
75{
76 int loops = msecs_to_loops(10);
77 cycle_t alarm = clocksource.read(&clocksource) + cycles;
78 while ((readl(regbase + TIMER_AS_VAL) & TIMER_MATCH_W_ACTIVE)
79 && --loops)
80 cpu_relax();
81 writel((unsigned long)alarm, regbase + TIMER_MATCH_VAL);
82
83 if ((signed)(alarm - clocksource.read(&clocksource)) <= 16)
84 return -ETIME;
85
86 writel(1, regbase + TIMER_IER_VAL);
87
88 return 0;
89}
90
91static void vt8500_timer_set_mode(enum clock_event_mode mode,
92 struct clock_event_device *evt)
93{
94 switch (mode) {
95 case CLOCK_EVT_MODE_RESUME:
96 case CLOCK_EVT_MODE_PERIODIC:
97 break;
98 case CLOCK_EVT_MODE_ONESHOT:
99 case CLOCK_EVT_MODE_UNUSED:
100 case CLOCK_EVT_MODE_SHUTDOWN:
101 writel(readl(regbase + TIMER_CTRL_VAL) | 1,
102 regbase + TIMER_CTRL_VAL);
103 writel(0, regbase + TIMER_IER_VAL);
104 break;
105 }
106}
107
108static struct clock_event_device clockevent = {
109 .name = "vt8500_timer",
110 .features = CLOCK_EVT_FEAT_ONESHOT,
111 .rating = 200,
112 .set_next_event = vt8500_timer_set_next_event,
113 .set_mode = vt8500_timer_set_mode,
114};
115
116static irqreturn_t vt8500_timer_interrupt(int irq, void *dev_id)
117{
118 struct clock_event_device *evt = dev_id;
119 writel(0xf, regbase + TIMER_STATUS_VAL);
120 evt->event_handler(evt);
121
122 return IRQ_HANDLED;
123}
124
125static struct irqaction irq = {
126 .name = "vt8500_timer",
127 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
128 .handler = vt8500_timer_interrupt,
129 .dev_id = &clockevent,
130};
131
132static struct of_device_id vt8500_timer_ids[] = {
133 { .compatible = "via,vt8500-timer" },
134 { }
135};
136
137void __init vt8500_timer_init(void)
138{
139 struct device_node *np;
140 int timer_irq;
141
142 np = of_find_matching_node(NULL, vt8500_timer_ids);
143 if (!np) {
144 pr_err("%s: Timer description missing from Device Tree\n",
145 __func__);
146 return;
147 }
148 regbase = of_iomap(np, 0);
149 if (!regbase) {
150 pr_err("%s: Missing iobase description in Device Tree\n",
151 __func__);
152 of_node_put(np);
153 return;
154 }
155 timer_irq = irq_of_parse_and_map(np, 0);
156 if (!timer_irq) {
157 pr_err("%s: Missing irq description in Device Tree\n",
158 __func__);
159 of_node_put(np);
160 return;
161 }
162
163 writel(1, regbase + TIMER_CTRL_VAL);
164 writel(0xf, regbase + TIMER_STATUS_VAL);
165 writel(~0, regbase + TIMER_MATCH_VAL);
166
167 if (clocksource_register_hz(&clocksource, VT8500_TIMER_HZ))
168 pr_err("%s: vt8500_timer_init: clocksource_register failed for %s\n",
169 __func__, clocksource.name);
170
171 clockevents_calc_mult_shift(&clockevent, VT8500_TIMER_HZ, 4);
172
173 /* copy-pasted from mach-msm; no idea */
174 clockevent.max_delta_ns =
175 clockevent_delta2ns(0xf0000000, &clockevent);
176 clockevent.min_delta_ns = clockevent_delta2ns(4, &clockevent);
177 clockevent.cpumask = cpumask_of(0);
178
179 if (setup_irq(timer_irq, &irq))
180 pr_err("%s: setup_irq failed for %s\n", __func__,
181 clockevent.name);
182 clockevents_register_device(&clockevent);
183}
184
diff --git a/arch/arm/mach-vt8500/vt8500.c b/arch/arm/mach-vt8500/vt8500.c
index 3c66d48ea082..49e80053d828 100644
--- a/arch/arm/mach-vt8500/vt8500.c
+++ b/arch/arm/mach-vt8500/vt8500.c
@@ -18,6 +18,7 @@
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20 20
21#include <linux/clocksource.h>
21#include <linux/io.h> 22#include <linux/io.h>
22#include <linux/pm.h> 23#include <linux/pm.h>
23 24
@@ -175,22 +176,20 @@ static void __init vt8500_init_irq(void)
175 of_irq_init(vt8500_irq_match); 176 of_irq_init(vt8500_irq_match);
176}; 177};
177 178
178static struct sys_timer vt8500_timer = {
179 .init = vt8500_timer_init,
180};
181
182static const char * const vt8500_dt_compat[] = { 179static const char * const vt8500_dt_compat[] = {
183 "via,vt8500", 180 "via,vt8500",
184 "wm,wm8650", 181 "wm,wm8650",
185 "wm,wm8505", 182 "wm,wm8505",
183 "wm,wm8750",
184 "wm,wm8850",
186}; 185};
187 186
188DT_MACHINE_START(WMT_DT, "VIA/Wondermedia SoC (Device Tree Support)") 187DT_MACHINE_START(WMT_DT, "VIA/Wondermedia SoC (Device Tree Support)")
189 .dt_compat = vt8500_dt_compat, 188 .dt_compat = vt8500_dt_compat,
190 .map_io = vt8500_map_io, 189 .map_io = vt8500_map_io,
191 .init_irq = vt8500_init_irq, 190 .init_irq = vt8500_init_irq,
192 .timer = &vt8500_timer,
193 .init_machine = vt8500_init, 191 .init_machine = vt8500_init,
192 .init_time = clocksource_of_init,
194 .restart = vt8500_restart, 193 .restart = vt8500_restart,
195 .handle_irq = vt8500_handle_irq, 194 .handle_irq = vt8500_handle_irq,
196MACHINE_END 195MACHINE_END
diff --git a/arch/arm/mach-w90x900/include/mach/entry-macro.S b/arch/arm/mach-w90x900/include/mach/entry-macro.S
index e286daca6827..0ff612ac95ba 100644
--- a/arch/arm/mach-w90x900/include/mach/entry-macro.S
+++ b/arch/arm/mach-w90x900/include/mach/entry-macro.S
@@ -19,8 +19,8 @@
19 19
20 mov \base, #AIC_BA 20 mov \base, #AIC_BA
21 21
22 ldr \irqnr, [ \base, #AIC_IPER] 22 ldr \irqnr, [\base, #AIC_IPER]
23 ldr \irqnr, [ \base, #AIC_ISNR] 23 ldr \irqnr, [\base, #AIC_ISNR]
24 cmp \irqnr, #0 24 cmp \irqnr, #0
25 25
26 .endm 26 .endm
diff --git a/arch/arm/mach-w90x900/include/mach/uncompress.h b/arch/arm/mach-w90x900/include/mach/uncompress.h
index 03130212ace2..4b7c324ff664 100644
--- a/arch/arm/mach-w90x900/include/mach/uncompress.h
+++ b/arch/arm/mach-w90x900/include/mach/uncompress.h
@@ -24,8 +24,6 @@
24#include <mach/map.h> 24#include <mach/map.h>
25#include <linux/serial_reg.h> 25#include <linux/serial_reg.h>
26 26
27#define arch_decomp_wdog()
28
29#define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE) 27#define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE)
30static volatile u32 * const uart_base = (u32 *)UART0_PA; 28static volatile u32 * const uart_base = (u32 *)UART0_PA;
31 29
diff --git a/arch/arm/mach-w90x900/mach-nuc910evb.c b/arch/arm/mach-w90x900/mach-nuc910evb.c
index b4243e4f1565..92f1c978f35e 100644
--- a/arch/arm/mach-w90x900/mach-nuc910evb.c
+++ b/arch/arm/mach-w90x900/mach-nuc910evb.c
@@ -37,6 +37,6 @@ MACHINE_START(W90P910EVB, "W90P910EVB")
37 .map_io = nuc910evb_map_io, 37 .map_io = nuc910evb_map_io,
38 .init_irq = nuc900_init_irq, 38 .init_irq = nuc900_init_irq,
39 .init_machine = nuc910evb_init, 39 .init_machine = nuc910evb_init,
40 .timer = &nuc900_timer, 40 .init_time = nuc900_timer_init,
41 .restart = nuc9xx_restart, 41 .restart = nuc9xx_restart,
42MACHINE_END 42MACHINE_END
diff --git a/arch/arm/mach-w90x900/mach-nuc950evb.c b/arch/arm/mach-w90x900/mach-nuc950evb.c
index 500fe5932ce9..26f7189056e3 100644
--- a/arch/arm/mach-w90x900/mach-nuc950evb.c
+++ b/arch/arm/mach-w90x900/mach-nuc950evb.c
@@ -40,6 +40,6 @@ MACHINE_START(W90P950EVB, "W90P950EVB")
40 .map_io = nuc950evb_map_io, 40 .map_io = nuc950evb_map_io,
41 .init_irq = nuc900_init_irq, 41 .init_irq = nuc900_init_irq,
42 .init_machine = nuc950evb_init, 42 .init_machine = nuc950evb_init,
43 .timer = &nuc900_timer, 43 .init_time = nuc900_timer_init,
44 .restart = nuc9xx_restart, 44 .restart = nuc9xx_restart,
45MACHINE_END 45MACHINE_END
diff --git a/arch/arm/mach-w90x900/mach-nuc960evb.c b/arch/arm/mach-w90x900/mach-nuc960evb.c
index cbb3adc3db10..9b4e73fe10e5 100644
--- a/arch/arm/mach-w90x900/mach-nuc960evb.c
+++ b/arch/arm/mach-w90x900/mach-nuc960evb.c
@@ -37,6 +37,6 @@ MACHINE_START(W90N960EVB, "W90N960EVB")
37 .map_io = nuc960evb_map_io, 37 .map_io = nuc960evb_map_io,
38 .init_irq = nuc900_init_irq, 38 .init_irq = nuc900_init_irq,
39 .init_machine = nuc960evb_init, 39 .init_machine = nuc960evb_init,
40 .timer = &nuc900_timer, 40 .init_time = nuc900_timer_init,
41 .restart = nuc9xx_restart, 41 .restart = nuc9xx_restart,
42MACHINE_END 42MACHINE_END
diff --git a/arch/arm/mach-w90x900/nuc9xx.h b/arch/arm/mach-w90x900/nuc9xx.h
index 91acb4047793..88ef4b267089 100644
--- a/arch/arm/mach-w90x900/nuc9xx.h
+++ b/arch/arm/mach-w90x900/nuc9xx.h
@@ -15,10 +15,9 @@
15 * 15 *
16 */ 16 */
17struct map_desc; 17struct map_desc;
18struct sys_timer;
19 18
20/* core initialisation functions */ 19/* core initialisation functions */
21 20
22extern void nuc900_init_irq(void); 21extern void nuc900_init_irq(void);
23extern struct sys_timer nuc900_timer; 22extern void nuc900_timer_init(void);
24extern void nuc9xx_restart(char, const char *); 23extern void nuc9xx_restart(char, const char *);
diff --git a/arch/arm/mach-w90x900/time.c b/arch/arm/mach-w90x900/time.c
index fa27c498ac09..30fbca844575 100644
--- a/arch/arm/mach-w90x900/time.c
+++ b/arch/arm/mach-w90x900/time.c
@@ -91,7 +91,6 @@ static int nuc900_clockevent_setnextevent(unsigned long evt,
91 91
92static struct clock_event_device nuc900_clockevent_device = { 92static struct clock_event_device nuc900_clockevent_device = {
93 .name = "nuc900-timer0", 93 .name = "nuc900-timer0",
94 .shift = 32,
95 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 94 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
96 .set_mode = nuc900_clockevent_setmode, 95 .set_mode = nuc900_clockevent_setmode,
97 .set_next_event = nuc900_clockevent_setnextevent, 96 .set_next_event = nuc900_clockevent_setnextevent,
@@ -133,15 +132,10 @@ static void __init nuc900_clockevents_init(void)
133 __raw_writel(RESETINT, REG_TISR); 132 __raw_writel(RESETINT, REG_TISR);
134 setup_irq(IRQ_TIMER0, &nuc900_timer0_irq); 133 setup_irq(IRQ_TIMER0, &nuc900_timer0_irq);
135 134
136 nuc900_clockevent_device.mult = div_sc(rate, NSEC_PER_SEC,
137 nuc900_clockevent_device.shift);
138 nuc900_clockevent_device.max_delta_ns = clockevent_delta2ns(0xffffffff,
139 &nuc900_clockevent_device);
140 nuc900_clockevent_device.min_delta_ns = clockevent_delta2ns(0xf,
141 &nuc900_clockevent_device);
142 nuc900_clockevent_device.cpumask = cpumask_of(0); 135 nuc900_clockevent_device.cpumask = cpumask_of(0);
143 136
144 clockevents_register_device(&nuc900_clockevent_device); 137 clockevents_config_and_register(&nuc900_clockevent_device, rate,
138 0xf, 0xffffffff);
145} 139}
146 140
147static void __init nuc900_clocksource_init(void) 141static void __init nuc900_clocksource_init(void)
@@ -167,12 +161,8 @@ static void __init nuc900_clocksource_init(void)
167 TDR_SHIFT, clocksource_mmio_readl_down); 161 TDR_SHIFT, clocksource_mmio_readl_down);
168} 162}
169 163
170static void __init nuc900_timer_init(void) 164void __init nuc900_timer_init(void)
171{ 165{
172 nuc900_clocksource_init(); 166 nuc900_clocksource_init();
173 nuc900_clockevents_init(); 167 nuc900_clockevents_init();
174} 168}
175
176struct sys_timer nuc900_timer = {
177 .init = nuc900_timer_init,
178};
diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c
index e16d4bed0f7a..5c8983218183 100644
--- a/arch/arm/mach-zynq/common.c
+++ b/arch/arm/mach-zynq/common.c
@@ -24,6 +24,7 @@
24#include <linux/of_irq.h> 24#include <linux/of_irq.h>
25#include <linux/of_platform.h> 25#include <linux/of_platform.h>
26#include <linux/of.h> 26#include <linux/of.h>
27#include <linux/irqchip.h>
27 28
28#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
29#include <asm/mach/map.h> 30#include <asm/mach/map.h>
@@ -31,7 +32,6 @@
31#include <asm/mach-types.h> 32#include <asm/mach-types.h>
32#include <asm/page.h> 33#include <asm/page.h>
33#include <asm/pgtable.h> 34#include <asm/pgtable.h>
34#include <asm/hardware/gic.h>
35#include <asm/hardware/cache-l2x0.h> 35#include <asm/hardware/cache-l2x0.h>
36 36
37#include "common.h" 37#include "common.h"
@@ -55,19 +55,6 @@ static void __init xilinx_init_machine(void)
55 of_platform_bus_probe(NULL, zynq_of_bus_ids, NULL); 55 of_platform_bus_probe(NULL, zynq_of_bus_ids, NULL);
56} 56}
57 57
58static struct of_device_id irq_match[] __initdata = {
59 { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
60 { }
61};
62
63/**
64 * xilinx_irq_init() - Interrupt controller initialization for the GIC.
65 */
66static void __init xilinx_irq_init(void)
67{
68 of_irq_init(irq_match);
69}
70
71#define SCU_PERIPH_PHYS 0xF8F00000 58#define SCU_PERIPH_PHYS 0xF8F00000
72#define SCU_PERIPH_SIZE SZ_8K 59#define SCU_PERIPH_SIZE SZ_8K
73#define SCU_PERIPH_VIRT (VMALLOC_END - SCU_PERIPH_SIZE) 60#define SCU_PERIPH_VIRT (VMALLOC_END - SCU_PERIPH_SIZE)
@@ -90,16 +77,9 @@ static void __init xilinx_zynq_timer_init(void)
90 77
91 xilinx_zynq_clocks_init(slcr); 78 xilinx_zynq_clocks_init(slcr);
92 79
93 xttcpss_timer_init(); 80 xttcps_timer_init();
94} 81}
95 82
96/*
97 * Instantiate and initialize the system timer structure
98 */
99static struct sys_timer xttcpss_sys_timer = {
100 .init = xilinx_zynq_timer_init,
101};
102
103/** 83/**
104 * xilinx_map_io() - Create memory mappings needed for early I/O. 84 * xilinx_map_io() - Create memory mappings needed for early I/O.
105 */ 85 */
@@ -117,9 +97,8 @@ static const char *xilinx_dt_match[] = {
117 97
118MACHINE_START(XILINX_EP107, "Xilinx Zynq Platform") 98MACHINE_START(XILINX_EP107, "Xilinx Zynq Platform")
119 .map_io = xilinx_map_io, 99 .map_io = xilinx_map_io,
120 .init_irq = xilinx_irq_init, 100 .init_irq = irqchip_init,
121 .handle_irq = gic_handle_irq,
122 .init_machine = xilinx_init_machine, 101 .init_machine = xilinx_init_machine,
123 .timer = &xttcpss_sys_timer, 102 .init_time = xilinx_zynq_timer_init,
124 .dt_compat = xilinx_dt_match, 103 .dt_compat = xilinx_dt_match,
125MACHINE_END 104MACHINE_END
diff --git a/arch/arm/mach-zynq/common.h b/arch/arm/mach-zynq/common.h
index 954b91c13c91..8b4dbbaa01cf 100644
--- a/arch/arm/mach-zynq/common.h
+++ b/arch/arm/mach-zynq/common.h
@@ -17,6 +17,6 @@
17#ifndef __MACH_ZYNQ_COMMON_H__ 17#ifndef __MACH_ZYNQ_COMMON_H__
18#define __MACH_ZYNQ_COMMON_H__ 18#define __MACH_ZYNQ_COMMON_H__
19 19
20void __init xttcpss_timer_init(void); 20void __init xttcps_timer_init(void);
21 21
22#endif 22#endif
diff --git a/arch/arm/mach-zynq/timer.c b/arch/arm/mach-zynq/timer.c
index de3df283da74..f9fbc9c1e7a6 100644
--- a/arch/arm/mach-zynq/timer.c
+++ b/arch/arm/mach-zynq/timer.c
@@ -15,39 +15,29 @@
15 * GNU General Public License for more details. 15 * GNU General Public License for more details.
16 */ 16 */
17 17
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/interrupt.h> 18#include <linux/interrupt.h>
21#include <linux/irq.h>
22#include <linux/types.h>
23#include <linux/clocksource.h>
24#include <linux/clockchips.h> 19#include <linux/clockchips.h>
25#include <linux/io.h>
26#include <linux/of.h>
27#include <linux/of_address.h> 20#include <linux/of_address.h>
28#include <linux/of_irq.h> 21#include <linux/of_irq.h>
29#include <linux/slab.h> 22#include <linux/slab.h>
30#include <linux/clk-provider.h> 23#include <linux/clk-provider.h>
31
32#include "common.h" 24#include "common.h"
33 25
34/* 26/*
35 * Timer Register Offset Definitions of Timer 1, Increment base address by 4 27 * Timer Register Offset Definitions of Timer 1, Increment base address by 4
36 * and use same offsets for Timer 2 28 * and use same offsets for Timer 2
37 */ 29 */
38#define XTTCPSS_CLK_CNTRL_OFFSET 0x00 /* Clock Control Reg, RW */ 30#define XTTCPS_CLK_CNTRL_OFFSET 0x00 /* Clock Control Reg, RW */
39#define XTTCPSS_CNT_CNTRL_OFFSET 0x0C /* Counter Control Reg, RW */ 31#define XTTCPS_CNT_CNTRL_OFFSET 0x0C /* Counter Control Reg, RW */
40#define XTTCPSS_COUNT_VAL_OFFSET 0x18 /* Counter Value Reg, RO */ 32#define XTTCPS_COUNT_VAL_OFFSET 0x18 /* Counter Value Reg, RO */
41#define XTTCPSS_INTR_VAL_OFFSET 0x24 /* Interval Count Reg, RW */ 33#define XTTCPS_INTR_VAL_OFFSET 0x24 /* Interval Count Reg, RW */
42#define XTTCPSS_MATCH_1_OFFSET 0x30 /* Match 1 Value Reg, RW */ 34#define XTTCPS_ISR_OFFSET 0x54 /* Interrupt Status Reg, RO */
43#define XTTCPSS_MATCH_2_OFFSET 0x3C /* Match 2 Value Reg, RW */ 35#define XTTCPS_IER_OFFSET 0x60 /* Interrupt Enable Reg, RW */
44#define XTTCPSS_MATCH_3_OFFSET 0x48 /* Match 3 Value Reg, RW */ 36
45#define XTTCPSS_ISR_OFFSET 0x54 /* Interrupt Status Reg, RO */ 37#define XTTCPS_CNT_CNTRL_DISABLE_MASK 0x1
46#define XTTCPSS_IER_OFFSET 0x60 /* Interrupt Enable Reg, RW */ 38
47 39/*
48#define XTTCPSS_CNT_CNTRL_DISABLE_MASK 0x1 40 * Setup the timers to use pre-scaling, using a fixed value for now that will
49
50/* Setup the timers to use pre-scaling, using a fixed value for now that will
51 * work across most input frequency, but it may need to be more dynamic 41 * work across most input frequency, but it may need to be more dynamic
52 */ 42 */
53#define PRESCALE_EXPONENT 11 /* 2 ^ PRESCALE_EXPONENT = PRESCALE */ 43#define PRESCALE_EXPONENT 11 /* 2 ^ PRESCALE_EXPONENT = PRESCALE */
@@ -57,72 +47,73 @@
57#define CNT_CNTRL_RESET (1<<4) 47#define CNT_CNTRL_RESET (1<<4)
58 48
59/** 49/**
60 * struct xttcpss_timer - This definition defines local timer structure 50 * struct xttcps_timer - This definition defines local timer structure
61 * 51 *
62 * @base_addr: Base address of timer 52 * @base_addr: Base address of timer
63 **/ 53 **/
64struct xttcpss_timer { 54struct xttcps_timer {
65 void __iomem *base_addr; 55 void __iomem *base_addr;
66}; 56};
67 57
68struct xttcpss_timer_clocksource { 58struct xttcps_timer_clocksource {
69 struct xttcpss_timer xttc; 59 struct xttcps_timer xttc;
70 struct clocksource cs; 60 struct clocksource cs;
71}; 61};
72 62
73#define to_xttcpss_timer_clksrc(x) \ 63#define to_xttcps_timer_clksrc(x) \
74 container_of(x, struct xttcpss_timer_clocksource, cs) 64 container_of(x, struct xttcps_timer_clocksource, cs)
75 65
76struct xttcpss_timer_clockevent { 66struct xttcps_timer_clockevent {
77 struct xttcpss_timer xttc; 67 struct xttcps_timer xttc;
78 struct clock_event_device ce; 68 struct clock_event_device ce;
79 struct clk *clk; 69 struct clk *clk;
80}; 70};
81 71
82#define to_xttcpss_timer_clkevent(x) \ 72#define to_xttcps_timer_clkevent(x) \
83 container_of(x, struct xttcpss_timer_clockevent, ce) 73 container_of(x, struct xttcps_timer_clockevent, ce)
84 74
85/** 75/**
86 * xttcpss_set_interval - Set the timer interval value 76 * xttcps_set_interval - Set the timer interval value
87 * 77 *
88 * @timer: Pointer to the timer instance 78 * @timer: Pointer to the timer instance
89 * @cycles: Timer interval ticks 79 * @cycles: Timer interval ticks
90 **/ 80 **/
91static void xttcpss_set_interval(struct xttcpss_timer *timer, 81static void xttcps_set_interval(struct xttcps_timer *timer,
92 unsigned long cycles) 82 unsigned long cycles)
93{ 83{
94 u32 ctrl_reg; 84 u32 ctrl_reg;
95 85
96 /* Disable the counter, set the counter value and re-enable counter */ 86 /* Disable the counter, set the counter value and re-enable counter */
97 ctrl_reg = __raw_readl(timer->base_addr + XTTCPSS_CNT_CNTRL_OFFSET); 87 ctrl_reg = __raw_readl(timer->base_addr + XTTCPS_CNT_CNTRL_OFFSET);
98 ctrl_reg |= XTTCPSS_CNT_CNTRL_DISABLE_MASK; 88 ctrl_reg |= XTTCPS_CNT_CNTRL_DISABLE_MASK;
99 __raw_writel(ctrl_reg, timer->base_addr + XTTCPSS_CNT_CNTRL_OFFSET); 89 __raw_writel(ctrl_reg, timer->base_addr + XTTCPS_CNT_CNTRL_OFFSET);
100 90
101 __raw_writel(cycles, timer->base_addr + XTTCPSS_INTR_VAL_OFFSET); 91 __raw_writel(cycles, timer->base_addr + XTTCPS_INTR_VAL_OFFSET);
102 92
103 /* Reset the counter (0x10) so that it starts from 0, one-shot 93 /*
104 mode makes this needed for timing to be right. */ 94 * Reset the counter (0x10) so that it starts from 0, one-shot
95 * mode makes this needed for timing to be right.
96 */
105 ctrl_reg |= CNT_CNTRL_RESET; 97 ctrl_reg |= CNT_CNTRL_RESET;
106 ctrl_reg &= ~XTTCPSS_CNT_CNTRL_DISABLE_MASK; 98 ctrl_reg &= ~XTTCPS_CNT_CNTRL_DISABLE_MASK;
107 __raw_writel(ctrl_reg, timer->base_addr + XTTCPSS_CNT_CNTRL_OFFSET); 99 __raw_writel(ctrl_reg, timer->base_addr + XTTCPS_CNT_CNTRL_OFFSET);
108} 100}
109 101
110/** 102/**
111 * xttcpss_clock_event_interrupt - Clock event timer interrupt handler 103 * xttcps_clock_event_interrupt - Clock event timer interrupt handler
112 * 104 *
113 * @irq: IRQ number of the Timer 105 * @irq: IRQ number of the Timer
114 * @dev_id: void pointer to the xttcpss_timer instance 106 * @dev_id: void pointer to the xttcps_timer instance
115 * 107 *
116 * returns: Always IRQ_HANDLED - success 108 * returns: Always IRQ_HANDLED - success
117 **/ 109 **/
118static irqreturn_t xttcpss_clock_event_interrupt(int irq, void *dev_id) 110static irqreturn_t xttcps_clock_event_interrupt(int irq, void *dev_id)
119{ 111{
120 struct xttcpss_timer_clockevent *xttce = dev_id; 112 struct xttcps_timer_clockevent *xttce = dev_id;
121 struct xttcpss_timer *timer = &xttce->xttc; 113 struct xttcps_timer *timer = &xttce->xttc;
122 114
123 /* Acknowledge the interrupt and call event handler */ 115 /* Acknowledge the interrupt and call event handler */
124 __raw_writel(__raw_readl(timer->base_addr + XTTCPSS_ISR_OFFSET), 116 __raw_readl(timer->base_addr + XTTCPS_ISR_OFFSET);
125 timer->base_addr + XTTCPSS_ISR_OFFSET);
126 117
127 xttce->ce.event_handler(&xttce->ce); 118 xttce->ce.event_handler(&xttce->ce);
128 119
@@ -136,46 +127,46 @@ static irqreturn_t xttcpss_clock_event_interrupt(int irq, void *dev_id)
136 **/ 127 **/
137static cycle_t __xttc_clocksource_read(struct clocksource *cs) 128static cycle_t __xttc_clocksource_read(struct clocksource *cs)
138{ 129{
139 struct xttcpss_timer *timer = &to_xttcpss_timer_clksrc(cs)->xttc; 130 struct xttcps_timer *timer = &to_xttcps_timer_clksrc(cs)->xttc;
140 131
141 return (cycle_t)__raw_readl(timer->base_addr + 132 return (cycle_t)__raw_readl(timer->base_addr +
142 XTTCPSS_COUNT_VAL_OFFSET); 133 XTTCPS_COUNT_VAL_OFFSET);
143} 134}
144 135
145/** 136/**
146 * xttcpss_set_next_event - Sets the time interval for next event 137 * xttcps_set_next_event - Sets the time interval for next event
147 * 138 *
148 * @cycles: Timer interval ticks 139 * @cycles: Timer interval ticks
149 * @evt: Address of clock event instance 140 * @evt: Address of clock event instance
150 * 141 *
151 * returns: Always 0 - success 142 * returns: Always 0 - success
152 **/ 143 **/
153static int xttcpss_set_next_event(unsigned long cycles, 144static int xttcps_set_next_event(unsigned long cycles,
154 struct clock_event_device *evt) 145 struct clock_event_device *evt)
155{ 146{
156 struct xttcpss_timer_clockevent *xttce = to_xttcpss_timer_clkevent(evt); 147 struct xttcps_timer_clockevent *xttce = to_xttcps_timer_clkevent(evt);
157 struct xttcpss_timer *timer = &xttce->xttc; 148 struct xttcps_timer *timer = &xttce->xttc;
158 149
159 xttcpss_set_interval(timer, cycles); 150 xttcps_set_interval(timer, cycles);
160 return 0; 151 return 0;
161} 152}
162 153
163/** 154/**
164 * xttcpss_set_mode - Sets the mode of timer 155 * xttcps_set_mode - Sets the mode of timer
165 * 156 *
166 * @mode: Mode to be set 157 * @mode: Mode to be set
167 * @evt: Address of clock event instance 158 * @evt: Address of clock event instance
168 **/ 159 **/
169static void xttcpss_set_mode(enum clock_event_mode mode, 160static void xttcps_set_mode(enum clock_event_mode mode,
170 struct clock_event_device *evt) 161 struct clock_event_device *evt)
171{ 162{
172 struct xttcpss_timer_clockevent *xttce = to_xttcpss_timer_clkevent(evt); 163 struct xttcps_timer_clockevent *xttce = to_xttcps_timer_clkevent(evt);
173 struct xttcpss_timer *timer = &xttce->xttc; 164 struct xttcps_timer *timer = &xttce->xttc;
174 u32 ctrl_reg; 165 u32 ctrl_reg;
175 166
176 switch (mode) { 167 switch (mode) {
177 case CLOCK_EVT_MODE_PERIODIC: 168 case CLOCK_EVT_MODE_PERIODIC:
178 xttcpss_set_interval(timer, 169 xttcps_set_interval(timer,
179 DIV_ROUND_CLOSEST(clk_get_rate(xttce->clk), 170 DIV_ROUND_CLOSEST(clk_get_rate(xttce->clk),
180 PRESCALE * HZ)); 171 PRESCALE * HZ));
181 break; 172 break;
@@ -183,17 +174,17 @@ static void xttcpss_set_mode(enum clock_event_mode mode,
183 case CLOCK_EVT_MODE_UNUSED: 174 case CLOCK_EVT_MODE_UNUSED:
184 case CLOCK_EVT_MODE_SHUTDOWN: 175 case CLOCK_EVT_MODE_SHUTDOWN:
185 ctrl_reg = __raw_readl(timer->base_addr + 176 ctrl_reg = __raw_readl(timer->base_addr +
186 XTTCPSS_CNT_CNTRL_OFFSET); 177 XTTCPS_CNT_CNTRL_OFFSET);
187 ctrl_reg |= XTTCPSS_CNT_CNTRL_DISABLE_MASK; 178 ctrl_reg |= XTTCPS_CNT_CNTRL_DISABLE_MASK;
188 __raw_writel(ctrl_reg, 179 __raw_writel(ctrl_reg,
189 timer->base_addr + XTTCPSS_CNT_CNTRL_OFFSET); 180 timer->base_addr + XTTCPS_CNT_CNTRL_OFFSET);
190 break; 181 break;
191 case CLOCK_EVT_MODE_RESUME: 182 case CLOCK_EVT_MODE_RESUME:
192 ctrl_reg = __raw_readl(timer->base_addr + 183 ctrl_reg = __raw_readl(timer->base_addr +
193 XTTCPSS_CNT_CNTRL_OFFSET); 184 XTTCPS_CNT_CNTRL_OFFSET);
194 ctrl_reg &= ~XTTCPSS_CNT_CNTRL_DISABLE_MASK; 185 ctrl_reg &= ~XTTCPS_CNT_CNTRL_DISABLE_MASK;
195 __raw_writel(ctrl_reg, 186 __raw_writel(ctrl_reg,
196 timer->base_addr + XTTCPSS_CNT_CNTRL_OFFSET); 187 timer->base_addr + XTTCPS_CNT_CNTRL_OFFSET);
197 break; 188 break;
198 } 189 }
199} 190}
@@ -201,7 +192,7 @@ static void xttcpss_set_mode(enum clock_event_mode mode,
201static void __init zynq_ttc_setup_clocksource(struct device_node *np, 192static void __init zynq_ttc_setup_clocksource(struct device_node *np,
202 void __iomem *base) 193 void __iomem *base)
203{ 194{
204 struct xttcpss_timer_clocksource *ttccs; 195 struct xttcps_timer_clocksource *ttccs;
205 struct clk *clk; 196 struct clk *clk;
206 int err; 197 int err;
207 u32 reg; 198 u32 reg;
@@ -230,11 +221,11 @@ static void __init zynq_ttc_setup_clocksource(struct device_node *np,
230 ttccs->cs.mask = CLOCKSOURCE_MASK(16); 221 ttccs->cs.mask = CLOCKSOURCE_MASK(16);
231 ttccs->cs.flags = CLOCK_SOURCE_IS_CONTINUOUS; 222 ttccs->cs.flags = CLOCK_SOURCE_IS_CONTINUOUS;
232 223
233 __raw_writel(0x0, ttccs->xttc.base_addr + XTTCPSS_IER_OFFSET); 224 __raw_writel(0x0, ttccs->xttc.base_addr + XTTCPS_IER_OFFSET);
234 __raw_writel(CLK_CNTRL_PRESCALE | CLK_CNTRL_PRESCALE_EN, 225 __raw_writel(CLK_CNTRL_PRESCALE | CLK_CNTRL_PRESCALE_EN,
235 ttccs->xttc.base_addr + XTTCPSS_CLK_CNTRL_OFFSET); 226 ttccs->xttc.base_addr + XTTCPS_CLK_CNTRL_OFFSET);
236 __raw_writel(CNT_CNTRL_RESET, 227 __raw_writel(CNT_CNTRL_RESET,
237 ttccs->xttc.base_addr + XTTCPSS_CNT_CNTRL_OFFSET); 228 ttccs->xttc.base_addr + XTTCPS_CNT_CNTRL_OFFSET);
238 229
239 err = clocksource_register_hz(&ttccs->cs, clk_get_rate(clk) / PRESCALE); 230 err = clocksource_register_hz(&ttccs->cs, clk_get_rate(clk) / PRESCALE);
240 if (WARN_ON(err)) 231 if (WARN_ON(err))
@@ -244,7 +235,7 @@ static void __init zynq_ttc_setup_clocksource(struct device_node *np,
244static void __init zynq_ttc_setup_clockevent(struct device_node *np, 235static void __init zynq_ttc_setup_clockevent(struct device_node *np,
245 void __iomem *base) 236 void __iomem *base)
246{ 237{
247 struct xttcpss_timer_clockevent *ttcce; 238 struct xttcps_timer_clockevent *ttcce;
248 int err, irq; 239 int err, irq;
249 u32 reg; 240 u32 reg;
250 241
@@ -272,17 +263,18 @@ static void __init zynq_ttc_setup_clockevent(struct device_node *np,
272 263
273 ttcce->ce.name = np->name; 264 ttcce->ce.name = np->name;
274 ttcce->ce.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT; 265 ttcce->ce.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT;
275 ttcce->ce.set_next_event = xttcpss_set_next_event; 266 ttcce->ce.set_next_event = xttcps_set_next_event;
276 ttcce->ce.set_mode = xttcpss_set_mode; 267 ttcce->ce.set_mode = xttcps_set_mode;
277 ttcce->ce.rating = 200; 268 ttcce->ce.rating = 200;
278 ttcce->ce.irq = irq; 269 ttcce->ce.irq = irq;
270 ttcce->ce.cpumask = cpu_possible_mask;
279 271
280 __raw_writel(0x23, ttcce->xttc.base_addr + XTTCPSS_CNT_CNTRL_OFFSET); 272 __raw_writel(0x23, ttcce->xttc.base_addr + XTTCPS_CNT_CNTRL_OFFSET);
281 __raw_writel(CLK_CNTRL_PRESCALE | CLK_CNTRL_PRESCALE_EN, 273 __raw_writel(CLK_CNTRL_PRESCALE | CLK_CNTRL_PRESCALE_EN,
282 ttcce->xttc.base_addr + XTTCPSS_CLK_CNTRL_OFFSET); 274 ttcce->xttc.base_addr + XTTCPS_CLK_CNTRL_OFFSET);
283 __raw_writel(0x1, ttcce->xttc.base_addr + XTTCPSS_IER_OFFSET); 275 __raw_writel(0x1, ttcce->xttc.base_addr + XTTCPS_IER_OFFSET);
284 276
285 err = request_irq(irq, xttcpss_clock_event_interrupt, IRQF_TIMER, 277 err = request_irq(irq, xttcps_clock_event_interrupt, IRQF_TIMER,
286 np->name, ttcce); 278 np->name, ttcce);
287 if (WARN_ON(err)) 279 if (WARN_ON(err))
288 return; 280 return;
@@ -301,12 +293,12 @@ static const __initconst struct of_device_id zynq_ttc_match[] = {
301}; 293};
302 294
303/** 295/**
304 * xttcpss_timer_init - Initialize the timer 296 * xttcps_timer_init - Initialize the timer
305 * 297 *
306 * Initializes the timer hardware and register the clock source and clock event 298 * Initializes the timer hardware and register the clock source and clock event
307 * timers with Linux kernal timer framework 299 * timers with Linux kernal timer framework
308 **/ 300 **/
309void __init xttcpss_timer_init(void) 301void __init xttcps_timer_init(void)
310{ 302{
311 struct device_node *np; 303 struct device_node *np;
312 304
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 8defd638c79e..cb812a13e299 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -636,8 +636,9 @@ config ARM_THUMBEE
636 make use of it. Say N for code that can run on CPUs without ThumbEE. 636 make use of it. Say N for code that can run on CPUs without ThumbEE.
637 637
638config ARM_VIRT_EXT 638config ARM_VIRT_EXT
639 bool "Native support for the ARM Virtualization Extensions" 639 bool
640 depends on MMU && CPU_V7 640 depends on MMU
641 default y if CPU_V7
641 help 642 help
642 Enable the kernel to make use of the ARM Virtualization 643 Enable the kernel to make use of the ARM Virtualization
643 Extensions to install hypervisors without run-time firmware 644 Extensions to install hypervisors without run-time firmware
@@ -647,11 +648,6 @@ config ARM_VIRT_EXT
647 use of this feature. Refer to Documentation/arm/Booting for 648 use of this feature. Refer to Documentation/arm/Booting for
648 details. 649 details.
649 650
650 It is safe to enable this option even if the kernel may not be
651 booted in HYP mode, may not have support for the
652 virtualization extensions, or may be booted with a
653 non-compliant bootloader.
654
655config SWP_EMULATE 651config SWP_EMULATE
656 bool "Emulate SWP/SWPB instructions" 652 bool "Emulate SWP/SWPB instructions"
657 depends on !CPU_USE_DOMAINS && CPU_V7 653 depends on !CPU_USE_DOMAINS && CPU_V7
diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile
index 8a9c4cb50a93..4e333fa2756f 100644
--- a/arch/arm/mm/Makefile
+++ b/arch/arm/mm/Makefile
@@ -6,7 +6,7 @@ obj-y := dma-mapping.o extable.o fault.o init.o \
6 iomap.o 6 iomap.o
7 7
8obj-$(CONFIG_MMU) += fault-armv.o flush.o idmap.o ioremap.o \ 8obj-$(CONFIG_MMU) += fault-armv.o flush.o idmap.o ioremap.o \
9 mmap.o pgd.o mmu.o vmregion.o 9 mmap.o pgd.o mmu.o
10 10
11ifneq ($(CONFIG_MMU),y) 11ifneq ($(CONFIG_MMU),y)
12obj-y += nommu.o 12obj-y += nommu.o
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
index feeb3eaccb1c..6f4585b89078 100644
--- a/arch/arm/mm/alignment.c
+++ b/arch/arm/mm/alignment.c
@@ -749,7 +749,6 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
749 unsigned long instr = 0, instrptr; 749 unsigned long instr = 0, instrptr;
750 int (*handler)(unsigned long addr, unsigned long instr, struct pt_regs *regs); 750 int (*handler)(unsigned long addr, unsigned long instr, struct pt_regs *regs);
751 unsigned int type; 751 unsigned int type;
752 mm_segment_t fs;
753 unsigned int fault; 752 unsigned int fault;
754 u16 tinstr = 0; 753 u16 tinstr = 0;
755 int isize = 4; 754 int isize = 4;
@@ -760,16 +759,15 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
760 759
761 instrptr = instruction_pointer(regs); 760 instrptr = instruction_pointer(regs);
762 761
763 fs = get_fs();
764 set_fs(KERNEL_DS);
765 if (thumb_mode(regs)) { 762 if (thumb_mode(regs)) {
766 fault = __get_user(tinstr, (u16 *)(instrptr & ~1)); 763 u16 *ptr = (u16 *)(instrptr & ~1);
764 fault = probe_kernel_address(ptr, tinstr);
767 if (!fault) { 765 if (!fault) {
768 if (cpu_architecture() >= CPU_ARCH_ARMv7 && 766 if (cpu_architecture() >= CPU_ARCH_ARMv7 &&
769 IS_T32(tinstr)) { 767 IS_T32(tinstr)) {
770 /* Thumb-2 32-bit */ 768 /* Thumb-2 32-bit */
771 u16 tinst2 = 0; 769 u16 tinst2 = 0;
772 fault = __get_user(tinst2, (u16 *)(instrptr+2)); 770 fault = probe_kernel_address(ptr + 1, tinst2);
773 instr = (tinstr << 16) | tinst2; 771 instr = (tinstr << 16) | tinst2;
774 thumb2_32b = 1; 772 thumb2_32b = 1;
775 } else { 773 } else {
@@ -778,8 +776,7 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
778 } 776 }
779 } 777 }
780 } else 778 } else
781 fault = __get_user(instr, (u32 *)instrptr); 779 fault = probe_kernel_address(instrptr, instr);
782 set_fs(fs);
783 780
784 if (fault) { 781 if (fault) {
785 type = TYPE_FAULT; 782 type = TYPE_FAULT;
diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S
index 7539ec275065..15451ee4acc8 100644
--- a/arch/arm/mm/cache-v7.S
+++ b/arch/arm/mm/cache-v7.S
@@ -19,6 +19,52 @@
19#include "proc-macros.S" 19#include "proc-macros.S"
20 20
21/* 21/*
22 * The secondary kernel init calls v7_flush_dcache_all before it enables
23 * the L1; however, the L1 comes out of reset in an undefined state, so
24 * the clean + invalidate performed by v7_flush_dcache_all causes a bunch
25 * of cache lines with uninitialized data and uninitialized tags to get
26 * written out to memory, which does really unpleasant things to the main
27 * processor. We fix this by performing an invalidate, rather than a
28 * clean + invalidate, before jumping into the kernel.
29 *
30 * This function is cloned from arch/arm/mach-tegra/headsmp.S, and needs
31 * to be called for both secondary cores startup and primary core resume
32 * procedures.
33 */
34ENTRY(v7_invalidate_l1)
35 mov r0, #0
36 mcr p15, 2, r0, c0, c0, 0
37 mrc p15, 1, r0, c0, c0, 0
38
39 ldr r1, =0x7fff
40 and r2, r1, r0, lsr #13
41
42 ldr r1, =0x3ff
43
44 and r3, r1, r0, lsr #3 @ NumWays - 1
45 add r2, r2, #1 @ NumSets
46
47 and r0, r0, #0x7
48 add r0, r0, #4 @ SetShift
49
50 clz r1, r3 @ WayShift
51 add r4, r3, #1 @ NumWays
521: sub r2, r2, #1 @ NumSets--
53 mov r3, r4 @ Temp = NumWays
542: subs r3, r3, #1 @ Temp--
55 mov r5, r3, lsl r1
56 mov r6, r2, lsl r0
57 orr r5, r5, r6 @ Reg = (Temp<<WayShift)|(NumSets<<SetShift)
58 mcr p15, 0, r5, c7, c6, 2
59 bgt 2b
60 cmp r2, #0
61 bgt 1b
62 dsb
63 isb
64 mov pc, lr
65ENDPROC(v7_invalidate_l1)
66
67/*
22 * v7_flush_icache_all() 68 * v7_flush_icache_all()
23 * 69 *
24 * Flush the whole I-cache. 70 * Flush the whole I-cache.
diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c
index bc4a5e9ebb78..7a0511191f6b 100644
--- a/arch/arm/mm/context.c
+++ b/arch/arm/mm/context.c
@@ -34,6 +34,9 @@
34 * The ASID is used to tag entries in the CPU caches and TLBs. 34 * The ASID is used to tag entries in the CPU caches and TLBs.
35 * The context ID is used by debuggers and trace logic, and 35 * The context ID is used by debuggers and trace logic, and
36 * should be unique within all running processes. 36 * should be unique within all running processes.
37 *
38 * In big endian operation, the two 32 bit words are swapped if accesed by
39 * non 64-bit operations.
37 */ 40 */
38#define ASID_FIRST_VERSION (1ULL << ASID_BITS) 41#define ASID_FIRST_VERSION (1ULL << ASID_BITS)
39#define NUM_USER_ASIDS (ASID_FIRST_VERSION - 1) 42#define NUM_USER_ASIDS (ASID_FIRST_VERSION - 1)
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 076c26d43864..c7e3759f16d3 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -186,13 +186,24 @@ static u64 get_coherent_dma_mask(struct device *dev)
186 186
187static void __dma_clear_buffer(struct page *page, size_t size) 187static void __dma_clear_buffer(struct page *page, size_t size)
188{ 188{
189 void *ptr;
190 /* 189 /*
191 * Ensure that the allocated pages are zeroed, and that any data 190 * Ensure that the allocated pages are zeroed, and that any data
192 * lurking in the kernel direct-mapped region is invalidated. 191 * lurking in the kernel direct-mapped region is invalidated.
193 */ 192 */
194 ptr = page_address(page); 193 if (PageHighMem(page)) {
195 if (ptr) { 194 phys_addr_t base = __pfn_to_phys(page_to_pfn(page));
195 phys_addr_t end = base + size;
196 while (size > 0) {
197 void *ptr = kmap_atomic(page);
198 memset(ptr, 0, PAGE_SIZE);
199 dmac_flush_range(ptr, ptr + PAGE_SIZE);
200 kunmap_atomic(ptr);
201 page++;
202 size -= PAGE_SIZE;
203 }
204 outer_flush_range(base, end);
205 } else {
206 void *ptr = page_address(page);
196 memset(ptr, 0, size); 207 memset(ptr, 0, size);
197 dmac_flush_range(ptr, ptr + size); 208 dmac_flush_range(ptr, ptr + size);
198 outer_flush_range(__pa(ptr), __pa(ptr) + size); 209 outer_flush_range(__pa(ptr), __pa(ptr) + size);
@@ -243,7 +254,8 @@ static void __dma_free_buffer(struct page *page, size_t size)
243#endif 254#endif
244 255
245static void *__alloc_from_contiguous(struct device *dev, size_t size, 256static void *__alloc_from_contiguous(struct device *dev, size_t size,
246 pgprot_t prot, struct page **ret_page); 257 pgprot_t prot, struct page **ret_page,
258 const void *caller);
247 259
248static void *__alloc_remap_buffer(struct device *dev, size_t size, gfp_t gfp, 260static void *__alloc_remap_buffer(struct device *dev, size_t size, gfp_t gfp,
249 pgprot_t prot, struct page **ret_page, 261 pgprot_t prot, struct page **ret_page,
@@ -346,10 +358,11 @@ static int __init atomic_pool_init(void)
346 goto no_pages; 358 goto no_pages;
347 359
348 if (IS_ENABLED(CONFIG_CMA)) 360 if (IS_ENABLED(CONFIG_CMA))
349 ptr = __alloc_from_contiguous(NULL, pool->size, prot, &page); 361 ptr = __alloc_from_contiguous(NULL, pool->size, prot, &page,
362 atomic_pool_init);
350 else 363 else
351 ptr = __alloc_remap_buffer(NULL, pool->size, GFP_KERNEL, prot, 364 ptr = __alloc_remap_buffer(NULL, pool->size, GFP_KERNEL, prot,
352 &page, NULL); 365 &page, atomic_pool_init);
353 if (ptr) { 366 if (ptr) {
354 int i; 367 int i;
355 368
@@ -542,27 +555,41 @@ static int __free_from_pool(void *start, size_t size)
542} 555}
543 556
544static void *__alloc_from_contiguous(struct device *dev, size_t size, 557static void *__alloc_from_contiguous(struct device *dev, size_t size,
545 pgprot_t prot, struct page **ret_page) 558 pgprot_t prot, struct page **ret_page,
559 const void *caller)
546{ 560{
547 unsigned long order = get_order(size); 561 unsigned long order = get_order(size);
548 size_t count = size >> PAGE_SHIFT; 562 size_t count = size >> PAGE_SHIFT;
549 struct page *page; 563 struct page *page;
564 void *ptr;
550 565
551 page = dma_alloc_from_contiguous(dev, count, order); 566 page = dma_alloc_from_contiguous(dev, count, order);
552 if (!page) 567 if (!page)
553 return NULL; 568 return NULL;
554 569
555 __dma_clear_buffer(page, size); 570 __dma_clear_buffer(page, size);
556 __dma_remap(page, size, prot);
557 571
572 if (PageHighMem(page)) {
573 ptr = __dma_alloc_remap(page, size, GFP_KERNEL, prot, caller);
574 if (!ptr) {
575 dma_release_from_contiguous(dev, page, count);
576 return NULL;
577 }
578 } else {
579 __dma_remap(page, size, prot);
580 ptr = page_address(page);
581 }
558 *ret_page = page; 582 *ret_page = page;
559 return page_address(page); 583 return ptr;
560} 584}
561 585
562static void __free_from_contiguous(struct device *dev, struct page *page, 586static void __free_from_contiguous(struct device *dev, struct page *page,
563 size_t size) 587 void *cpu_addr, size_t size)
564{ 588{
565 __dma_remap(page, size, pgprot_kernel); 589 if (PageHighMem(page))
590 __dma_free_remap(cpu_addr, size);
591 else
592 __dma_remap(page, size, pgprot_kernel);
566 dma_release_from_contiguous(dev, page, size >> PAGE_SHIFT); 593 dma_release_from_contiguous(dev, page, size >> PAGE_SHIFT);
567} 594}
568 595
@@ -583,9 +610,9 @@ static inline pgprot_t __get_dma_pgprot(struct dma_attrs *attrs, pgprot_t prot)
583#define __get_dma_pgprot(attrs, prot) __pgprot(0) 610#define __get_dma_pgprot(attrs, prot) __pgprot(0)
584#define __alloc_remap_buffer(dev, size, gfp, prot, ret, c) NULL 611#define __alloc_remap_buffer(dev, size, gfp, prot, ret, c) NULL
585#define __alloc_from_pool(size, ret_page) NULL 612#define __alloc_from_pool(size, ret_page) NULL
586#define __alloc_from_contiguous(dev, size, prot, ret) NULL 613#define __alloc_from_contiguous(dev, size, prot, ret, c) NULL
587#define __free_from_pool(cpu_addr, size) 0 614#define __free_from_pool(cpu_addr, size) 0
588#define __free_from_contiguous(dev, page, size) do { } while (0) 615#define __free_from_contiguous(dev, page, cpu_addr, size) do { } while (0)
589#define __dma_free_remap(cpu_addr, size) do { } while (0) 616#define __dma_free_remap(cpu_addr, size) do { } while (0)
590 617
591#endif /* CONFIG_MMU */ 618#endif /* CONFIG_MMU */
@@ -640,12 +667,12 @@ static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,
640 667
641 if (is_coherent || nommu()) 668 if (is_coherent || nommu())
642 addr = __alloc_simple_buffer(dev, size, gfp, &page); 669 addr = __alloc_simple_buffer(dev, size, gfp, &page);
643 else if (gfp & GFP_ATOMIC) 670 else if (!(gfp & __GFP_WAIT))
644 addr = __alloc_from_pool(size, &page); 671 addr = __alloc_from_pool(size, &page);
645 else if (!IS_ENABLED(CONFIG_CMA)) 672 else if (!IS_ENABLED(CONFIG_CMA))
646 addr = __alloc_remap_buffer(dev, size, gfp, prot, &page, caller); 673 addr = __alloc_remap_buffer(dev, size, gfp, prot, &page, caller);
647 else 674 else
648 addr = __alloc_from_contiguous(dev, size, prot, &page); 675 addr = __alloc_from_contiguous(dev, size, prot, &page, caller);
649 676
650 if (addr) 677 if (addr)
651 *handle = pfn_to_dma(dev, page_to_pfn(page)); 678 *handle = pfn_to_dma(dev, page_to_pfn(page));
@@ -739,7 +766,7 @@ static void __arm_dma_free(struct device *dev, size_t size, void *cpu_addr,
739 * Non-atomic allocations cannot be freed with IRQs disabled 766 * Non-atomic allocations cannot be freed with IRQs disabled
740 */ 767 */
741 WARN_ON(irqs_disabled()); 768 WARN_ON(irqs_disabled());
742 __free_from_contiguous(dev, page, size); 769 __free_from_contiguous(dev, page, cpu_addr, size);
743 } 770 }
744} 771}
745 772
@@ -1002,6 +1029,9 @@ static inline dma_addr_t __alloc_iova(struct dma_iommu_mapping *mapping,
1002 unsigned int count, start; 1029 unsigned int count, start;
1003 unsigned long flags; 1030 unsigned long flags;
1004 1031
1032 if (order > CONFIG_ARM_DMA_IOMMU_ALIGNMENT)
1033 order = CONFIG_ARM_DMA_IOMMU_ALIGNMENT;
1034
1005 count = ((PAGE_ALIGN(size) >> PAGE_SHIFT) + 1035 count = ((PAGE_ALIGN(size) >> PAGE_SHIFT) +
1006 (1 << mapping->order) - 1) >> mapping->order; 1036 (1 << mapping->order) - 1) >> mapping->order;
1007 1037
@@ -1068,12 +1098,17 @@ static struct page **__iommu_alloc_buffer(struct device *dev, size_t size,
1068 return pages; 1098 return pages;
1069 } 1099 }
1070 1100
1101 /*
1102 * IOMMU can map any pages, so himem can also be used here
1103 */
1104 gfp |= __GFP_NOWARN | __GFP_HIGHMEM;
1105
1071 while (count) { 1106 while (count) {
1072 int j, order = __fls(count); 1107 int j, order = __fls(count);
1073 1108
1074 pages[i] = alloc_pages(gfp | __GFP_NOWARN, order); 1109 pages[i] = alloc_pages(gfp, order);
1075 while (!pages[i] && order) 1110 while (!pages[i] && order)
1076 pages[i] = alloc_pages(gfp | __GFP_NOWARN, --order); 1111 pages[i] = alloc_pages(gfp, --order);
1077 if (!pages[i]) 1112 if (!pages[i])
1078 goto error; 1113 goto error;
1079 1114
@@ -1257,11 +1292,11 @@ err_mapping:
1257 return NULL; 1292 return NULL;
1258} 1293}
1259 1294
1260static void __iommu_free_atomic(struct device *dev, struct page **pages, 1295static void __iommu_free_atomic(struct device *dev, void *cpu_addr,
1261 dma_addr_t handle, size_t size) 1296 dma_addr_t handle, size_t size)
1262{ 1297{
1263 __iommu_remove_mapping(dev, handle, size); 1298 __iommu_remove_mapping(dev, handle, size);
1264 __free_from_pool(page_address(pages[0]), size); 1299 __free_from_pool(cpu_addr, size);
1265} 1300}
1266 1301
1267static void *arm_iommu_alloc_attrs(struct device *dev, size_t size, 1302static void *arm_iommu_alloc_attrs(struct device *dev, size_t size,
@@ -1344,7 +1379,7 @@ void arm_iommu_free_attrs(struct device *dev, size_t size, void *cpu_addr,
1344 } 1379 }
1345 1380
1346 if (__in_atomic_pool(cpu_addr, size)) { 1381 if (__in_atomic_pool(cpu_addr, size)) {
1347 __iommu_free_atomic(dev, pages, handle, size); 1382 __iommu_free_atomic(dev, cpu_addr, handle, size);
1348 return; 1383 return;
1349 } 1384 }
1350 1385
@@ -1732,6 +1767,8 @@ struct dma_map_ops iommu_ops = {
1732 .unmap_sg = arm_iommu_unmap_sg, 1767 .unmap_sg = arm_iommu_unmap_sg,
1733 .sync_sg_for_cpu = arm_iommu_sync_sg_for_cpu, 1768 .sync_sg_for_cpu = arm_iommu_sync_sg_for_cpu,
1734 .sync_sg_for_device = arm_iommu_sync_sg_for_device, 1769 .sync_sg_for_device = arm_iommu_sync_sg_for_device,
1770
1771 .set_dma_mask = arm_dma_set_mask,
1735}; 1772};
1736 1773
1737struct dma_map_ops iommu_coherent_ops = { 1774struct dma_map_ops iommu_coherent_ops = {
@@ -1745,6 +1782,8 @@ struct dma_map_ops iommu_coherent_ops = {
1745 1782
1746 .map_sg = arm_coherent_iommu_map_sg, 1783 .map_sg = arm_coherent_iommu_map_sg,
1747 .unmap_sg = arm_coherent_iommu_unmap_sg, 1784 .unmap_sg = arm_coherent_iommu_unmap_sg,
1785
1786 .set_dma_mask = arm_dma_set_mask,
1748}; 1787};
1749 1788
1750/** 1789/**
@@ -1799,6 +1838,7 @@ err2:
1799err: 1838err:
1800 return ERR_PTR(err); 1839 return ERR_PTR(err);
1801} 1840}
1841EXPORT_SYMBOL_GPL(arm_iommu_create_mapping);
1802 1842
1803static void release_iommu_mapping(struct kref *kref) 1843static void release_iommu_mapping(struct kref *kref)
1804{ 1844{
@@ -1815,6 +1855,7 @@ void arm_iommu_release_mapping(struct dma_iommu_mapping *mapping)
1815 if (mapping) 1855 if (mapping)
1816 kref_put(&mapping->kref, release_iommu_mapping); 1856 kref_put(&mapping->kref, release_iommu_mapping);
1817} 1857}
1858EXPORT_SYMBOL_GPL(arm_iommu_release_mapping);
1818 1859
1819/** 1860/**
1820 * arm_iommu_attach_device 1861 * arm_iommu_attach_device
@@ -1843,5 +1884,32 @@ int arm_iommu_attach_device(struct device *dev,
1843 pr_debug("Attached IOMMU controller to %s device.\n", dev_name(dev)); 1884 pr_debug("Attached IOMMU controller to %s device.\n", dev_name(dev));
1844 return 0; 1885 return 0;
1845} 1886}
1887EXPORT_SYMBOL_GPL(arm_iommu_attach_device);
1888
1889/**
1890 * arm_iommu_detach_device
1891 * @dev: valid struct device pointer
1892 *
1893 * Detaches the provided device from a previously attached map.
1894 * This voids the dma operations (dma_map_ops pointer)
1895 */
1896void arm_iommu_detach_device(struct device *dev)
1897{
1898 struct dma_iommu_mapping *mapping;
1899
1900 mapping = to_dma_iommu_mapping(dev);
1901 if (!mapping) {
1902 dev_warn(dev, "Not attached\n");
1903 return;
1904 }
1905
1906 iommu_detach_device(mapping->domain, dev);
1907 kref_put(&mapping->kref, release_iommu_mapping);
1908 mapping = NULL;
1909 set_dma_ops(dev, NULL);
1910
1911 pr_debug("Detached IOMMU controller from %s device.\n", dev_name(dev));
1912}
1913EXPORT_SYMBOL_GPL(arm_iommu_detach_device);
1846 1914
1847#endif 1915#endif
diff --git a/arch/arm/mm/idmap.c b/arch/arm/mm/idmap.c
index 99db769307ec..2dffc010cc41 100644
--- a/arch/arm/mm/idmap.c
+++ b/arch/arm/mm/idmap.c
@@ -1,4 +1,6 @@
1#include <linux/module.h>
1#include <linux/kernel.h> 2#include <linux/kernel.h>
3#include <linux/slab.h>
2 4
3#include <asm/cputype.h> 5#include <asm/cputype.h>
4#include <asm/idmap.h> 6#include <asm/idmap.h>
@@ -6,6 +8,7 @@
6#include <asm/pgtable.h> 8#include <asm/pgtable.h>
7#include <asm/sections.h> 9#include <asm/sections.h>
8#include <asm/system_info.h> 10#include <asm/system_info.h>
11#include <asm/virt.h>
9 12
10pgd_t *idmap_pgd; 13pgd_t *idmap_pgd;
11 14
@@ -59,11 +62,17 @@ static void idmap_add_pud(pgd_t *pgd, unsigned long addr, unsigned long end,
59 } while (pud++, addr = next, addr != end); 62 } while (pud++, addr = next, addr != end);
60} 63}
61 64
62static void identity_mapping_add(pgd_t *pgd, unsigned long addr, unsigned long end) 65static void identity_mapping_add(pgd_t *pgd, const char *text_start,
66 const char *text_end, unsigned long prot)
63{ 67{
64 unsigned long prot, next; 68 unsigned long addr, end;
69 unsigned long next;
70
71 addr = virt_to_phys(text_start);
72 end = virt_to_phys(text_end);
73
74 prot |= PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_AF;
65 75
66 prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_AF;
67 if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ && !cpu_is_xscale()) 76 if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ && !cpu_is_xscale())
68 prot |= PMD_BIT4; 77 prot |= PMD_BIT4;
69 78
@@ -74,28 +83,52 @@ static void identity_mapping_add(pgd_t *pgd, unsigned long addr, unsigned long e
74 } while (pgd++, addr = next, addr != end); 83 } while (pgd++, addr = next, addr != end);
75} 84}
76 85
86#if defined(CONFIG_ARM_VIRT_EXT) && defined(CONFIG_ARM_LPAE)
87pgd_t *hyp_pgd;
88
89extern char __hyp_idmap_text_start[], __hyp_idmap_text_end[];
90
91static int __init init_static_idmap_hyp(void)
92{
93 hyp_pgd = kzalloc(PTRS_PER_PGD * sizeof(pgd_t), GFP_KERNEL);
94 if (!hyp_pgd)
95 return -ENOMEM;
96
97 pr_info("Setting up static HYP identity map for 0x%p - 0x%p\n",
98 __hyp_idmap_text_start, __hyp_idmap_text_end);
99 identity_mapping_add(hyp_pgd, __hyp_idmap_text_start,
100 __hyp_idmap_text_end, PMD_SECT_AP1);
101
102 return 0;
103}
104#else
105static int __init init_static_idmap_hyp(void)
106{
107 return 0;
108}
109#endif
110
77extern char __idmap_text_start[], __idmap_text_end[]; 111extern char __idmap_text_start[], __idmap_text_end[];
78 112
79static int __init init_static_idmap(void) 113static int __init init_static_idmap(void)
80{ 114{
81 phys_addr_t idmap_start, idmap_end; 115 int ret;
82 116
83 idmap_pgd = pgd_alloc(&init_mm); 117 idmap_pgd = pgd_alloc(&init_mm);
84 if (!idmap_pgd) 118 if (!idmap_pgd)
85 return -ENOMEM; 119 return -ENOMEM;
86 120
87 /* Add an identity mapping for the physical address of the section. */ 121 pr_info("Setting up static identity map for 0x%p - 0x%p\n",
88 idmap_start = virt_to_phys((void *)__idmap_text_start); 122 __idmap_text_start, __idmap_text_end);
89 idmap_end = virt_to_phys((void *)__idmap_text_end); 123 identity_mapping_add(idmap_pgd, __idmap_text_start,
124 __idmap_text_end, 0);
90 125
91 pr_info("Setting up static identity map for 0x%llx - 0x%llx\n", 126 ret = init_static_idmap_hyp();
92 (long long)idmap_start, (long long)idmap_end);
93 identity_mapping_add(idmap_pgd, idmap_start, idmap_end);
94 127
95 /* Flush L1 for the hardware to see this page table content */ 128 /* Flush L1 for the hardware to see this page table content */
96 flush_cache_louis(); 129 flush_cache_louis();
97 130
98 return 0; 131 return ret;
99} 132}
100early_initcall(init_static_idmap); 133early_initcall(init_static_idmap);
101 134
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 88fd86cf3d9a..04d9006eab1f 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -39,6 +39,70 @@
39#include <asm/mach/pci.h> 39#include <asm/mach/pci.h>
40#include "mm.h" 40#include "mm.h"
41 41
42
43LIST_HEAD(static_vmlist);
44
45static struct static_vm *find_static_vm_paddr(phys_addr_t paddr,
46 size_t size, unsigned int mtype)
47{
48 struct static_vm *svm;
49 struct vm_struct *vm;
50
51 list_for_each_entry(svm, &static_vmlist, list) {
52 vm = &svm->vm;
53 if (!(vm->flags & VM_ARM_STATIC_MAPPING))
54 continue;
55 if ((vm->flags & VM_ARM_MTYPE_MASK) != VM_ARM_MTYPE(mtype))
56 continue;
57
58 if (vm->phys_addr > paddr ||
59 paddr + size - 1 > vm->phys_addr + vm->size - 1)
60 continue;
61
62 return svm;
63 }
64
65 return NULL;
66}
67
68struct static_vm *find_static_vm_vaddr(void *vaddr)
69{
70 struct static_vm *svm;
71 struct vm_struct *vm;
72
73 list_for_each_entry(svm, &static_vmlist, list) {
74 vm = &svm->vm;
75
76 /* static_vmlist is ascending order */
77 if (vm->addr > vaddr)
78 break;
79
80 if (vm->addr <= vaddr && vm->addr + vm->size > vaddr)
81 return svm;
82 }
83
84 return NULL;
85}
86
87void __init add_static_vm_early(struct static_vm *svm)
88{
89 struct static_vm *curr_svm;
90 struct vm_struct *vm;
91 void *vaddr;
92
93 vm = &svm->vm;
94 vm_area_add_early(vm);
95 vaddr = vm->addr;
96
97 list_for_each_entry(curr_svm, &static_vmlist, list) {
98 vm = &curr_svm->vm;
99
100 if (vm->addr > vaddr)
101 break;
102 }
103 list_add_tail(&svm->list, &curr_svm->list);
104}
105
42int ioremap_page(unsigned long virt, unsigned long phys, 106int ioremap_page(unsigned long virt, unsigned long phys,
43 const struct mem_type *mtype) 107 const struct mem_type *mtype)
44{ 108{
@@ -197,13 +261,14 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
197 const struct mem_type *type; 261 const struct mem_type *type;
198 int err; 262 int err;
199 unsigned long addr; 263 unsigned long addr;
200 struct vm_struct * area; 264 struct vm_struct *area;
265 phys_addr_t paddr = __pfn_to_phys(pfn);
201 266
202#ifndef CONFIG_ARM_LPAE 267#ifndef CONFIG_ARM_LPAE
203 /* 268 /*
204 * High mappings must be supersection aligned 269 * High mappings must be supersection aligned
205 */ 270 */
206 if (pfn >= 0x100000 && (__pfn_to_phys(pfn) & ~SUPERSECTION_MASK)) 271 if (pfn >= 0x100000 && (paddr & ~SUPERSECTION_MASK))
207 return NULL; 272 return NULL;
208#endif 273#endif
209 274
@@ -219,24 +284,16 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
219 /* 284 /*
220 * Try to reuse one of the static mapping whenever possible. 285 * Try to reuse one of the static mapping whenever possible.
221 */ 286 */
222 read_lock(&vmlist_lock); 287 if (size && !(sizeof(phys_addr_t) == 4 && pfn >= 0x100000)) {
223 for (area = vmlist; area; area = area->next) { 288 struct static_vm *svm;
224 if (!size || (sizeof(phys_addr_t) == 4 && pfn >= 0x100000)) 289
225 break; 290 svm = find_static_vm_paddr(paddr, size, mtype);
226 if (!(area->flags & VM_ARM_STATIC_MAPPING)) 291 if (svm) {
227 continue; 292 addr = (unsigned long)svm->vm.addr;
228 if ((area->flags & VM_ARM_MTYPE_MASK) != VM_ARM_MTYPE(mtype)) 293 addr += paddr - svm->vm.phys_addr;
229 continue; 294 return (void __iomem *) (offset + addr);
230 if (__phys_to_pfn(area->phys_addr) > pfn || 295 }
231 __pfn_to_phys(pfn) + size-1 > area->phys_addr + area->size-1)
232 continue;
233 /* we can drop the lock here as we know *area is static */
234 read_unlock(&vmlist_lock);
235 addr = (unsigned long)area->addr;
236 addr += __pfn_to_phys(pfn) - area->phys_addr;
237 return (void __iomem *) (offset + addr);
238 } 296 }
239 read_unlock(&vmlist_lock);
240 297
241 /* 298 /*
242 * Don't allow RAM to be mapped - this causes problems with ARMv6+ 299 * Don't allow RAM to be mapped - this causes problems with ARMv6+
@@ -248,21 +305,21 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
248 if (!area) 305 if (!area)
249 return NULL; 306 return NULL;
250 addr = (unsigned long)area->addr; 307 addr = (unsigned long)area->addr;
251 area->phys_addr = __pfn_to_phys(pfn); 308 area->phys_addr = paddr;
252 309
253#if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE) 310#if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE)
254 if (DOMAIN_IO == 0 && 311 if (DOMAIN_IO == 0 &&
255 (((cpu_architecture() >= CPU_ARCH_ARMv6) && (get_cr() & CR_XP)) || 312 (((cpu_architecture() >= CPU_ARCH_ARMv6) && (get_cr() & CR_XP)) ||
256 cpu_is_xsc3()) && pfn >= 0x100000 && 313 cpu_is_xsc3()) && pfn >= 0x100000 &&
257 !((__pfn_to_phys(pfn) | size | addr) & ~SUPERSECTION_MASK)) { 314 !((paddr | size | addr) & ~SUPERSECTION_MASK)) {
258 area->flags |= VM_ARM_SECTION_MAPPING; 315 area->flags |= VM_ARM_SECTION_MAPPING;
259 err = remap_area_supersections(addr, pfn, size, type); 316 err = remap_area_supersections(addr, pfn, size, type);
260 } else if (!((__pfn_to_phys(pfn) | size | addr) & ~PMD_MASK)) { 317 } else if (!((paddr | size | addr) & ~PMD_MASK)) {
261 area->flags |= VM_ARM_SECTION_MAPPING; 318 area->flags |= VM_ARM_SECTION_MAPPING;
262 err = remap_area_sections(addr, pfn, size, type); 319 err = remap_area_sections(addr, pfn, size, type);
263 } else 320 } else
264#endif 321#endif
265 err = ioremap_page_range(addr, addr + size, __pfn_to_phys(pfn), 322 err = ioremap_page_range(addr, addr + size, paddr,
266 __pgprot(type->prot_pte)); 323 __pgprot(type->prot_pte));
267 324
268 if (err) { 325 if (err) {
@@ -346,34 +403,28 @@ __arm_ioremap_exec(unsigned long phys_addr, size_t size, bool cached)
346void __iounmap(volatile void __iomem *io_addr) 403void __iounmap(volatile void __iomem *io_addr)
347{ 404{
348 void *addr = (void *)(PAGE_MASK & (unsigned long)io_addr); 405 void *addr = (void *)(PAGE_MASK & (unsigned long)io_addr);
349 struct vm_struct *vm; 406 struct static_vm *svm;
407
408 /* If this is a static mapping, we must leave it alone */
409 svm = find_static_vm_vaddr(addr);
410 if (svm)
411 return;
350 412
351 read_lock(&vmlist_lock);
352 for (vm = vmlist; vm; vm = vm->next) {
353 if (vm->addr > addr)
354 break;
355 if (!(vm->flags & VM_IOREMAP))
356 continue;
357 /* If this is a static mapping we must leave it alone */
358 if ((vm->flags & VM_ARM_STATIC_MAPPING) &&
359 (vm->addr <= addr) && (vm->addr + vm->size > addr)) {
360 read_unlock(&vmlist_lock);
361 return;
362 }
363#if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE) 413#if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE)
414 {
415 struct vm_struct *vm;
416
417 vm = find_vm_area(addr);
418
364 /* 419 /*
365 * If this is a section based mapping we need to handle it 420 * If this is a section based mapping we need to handle it
366 * specially as the VM subsystem does not know how to handle 421 * specially as the VM subsystem does not know how to handle
367 * such a beast. 422 * such a beast.
368 */ 423 */
369 if ((vm->addr == addr) && 424 if (vm && (vm->flags & VM_ARM_SECTION_MAPPING))
370 (vm->flags & VM_ARM_SECTION_MAPPING)) {
371 unmap_area_sections((unsigned long)vm->addr, vm->size); 425 unmap_area_sections((unsigned long)vm->addr, vm->size);
372 break;
373 }
374#endif
375 } 426 }
376 read_unlock(&vmlist_lock); 427#endif
377 428
378 vunmap(addr); 429 vunmap(addr);
379} 430}
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h
index a8ee92da3544..d5a4e9ad8f0f 100644
--- a/arch/arm/mm/mm.h
+++ b/arch/arm/mm/mm.h
@@ -1,4 +1,6 @@
1#ifdef CONFIG_MMU 1#ifdef CONFIG_MMU
2#include <linux/list.h>
3#include <linux/vmalloc.h>
2 4
3/* the upper-most page table pointer */ 5/* the upper-most page table pointer */
4extern pmd_t *top_pmd; 6extern pmd_t *top_pmd;
@@ -65,6 +67,16 @@ extern void __flush_dcache_page(struct address_space *mapping, struct page *page
65/* consistent regions used by dma_alloc_attrs() */ 67/* consistent regions used by dma_alloc_attrs() */
66#define VM_ARM_DMA_CONSISTENT 0x20000000 68#define VM_ARM_DMA_CONSISTENT 0x20000000
67 69
70
71struct static_vm {
72 struct vm_struct vm;
73 struct list_head list;
74};
75
76extern struct list_head static_vmlist;
77extern struct static_vm *find_static_vm_vaddr(void *vaddr);
78extern __init void add_static_vm_early(struct static_vm *svm);
79
68#endif 80#endif
69 81
70#ifdef CONFIG_ZONE_DMA 82#ifdef CONFIG_ZONE_DMA
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 7c347bcc9421..c6d45c87540e 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -57,6 +57,9 @@ static unsigned int cachepolicy __initdata = CPOLICY_WRITEBACK;
57static unsigned int ecc_mask __initdata = 0; 57static unsigned int ecc_mask __initdata = 0;
58pgprot_t pgprot_user; 58pgprot_t pgprot_user;
59pgprot_t pgprot_kernel; 59pgprot_t pgprot_kernel;
60pgprot_t pgprot_hyp_device;
61pgprot_t pgprot_s2;
62pgprot_t pgprot_s2_device;
60 63
61EXPORT_SYMBOL(pgprot_user); 64EXPORT_SYMBOL(pgprot_user);
62EXPORT_SYMBOL(pgprot_kernel); 65EXPORT_SYMBOL(pgprot_kernel);
@@ -66,34 +69,46 @@ struct cachepolicy {
66 unsigned int cr_mask; 69 unsigned int cr_mask;
67 pmdval_t pmd; 70 pmdval_t pmd;
68 pteval_t pte; 71 pteval_t pte;
72 pteval_t pte_s2;
69}; 73};
70 74
75#ifdef CONFIG_ARM_LPAE
76#define s2_policy(policy) policy
77#else
78#define s2_policy(policy) 0
79#endif
80
71static struct cachepolicy cache_policies[] __initdata = { 81static struct cachepolicy cache_policies[] __initdata = {
72 { 82 {
73 .policy = "uncached", 83 .policy = "uncached",
74 .cr_mask = CR_W|CR_C, 84 .cr_mask = CR_W|CR_C,
75 .pmd = PMD_SECT_UNCACHED, 85 .pmd = PMD_SECT_UNCACHED,
76 .pte = L_PTE_MT_UNCACHED, 86 .pte = L_PTE_MT_UNCACHED,
87 .pte_s2 = s2_policy(L_PTE_S2_MT_UNCACHED),
77 }, { 88 }, {
78 .policy = "buffered", 89 .policy = "buffered",
79 .cr_mask = CR_C, 90 .cr_mask = CR_C,
80 .pmd = PMD_SECT_BUFFERED, 91 .pmd = PMD_SECT_BUFFERED,
81 .pte = L_PTE_MT_BUFFERABLE, 92 .pte = L_PTE_MT_BUFFERABLE,
93 .pte_s2 = s2_policy(L_PTE_S2_MT_UNCACHED),
82 }, { 94 }, {
83 .policy = "writethrough", 95 .policy = "writethrough",
84 .cr_mask = 0, 96 .cr_mask = 0,
85 .pmd = PMD_SECT_WT, 97 .pmd = PMD_SECT_WT,
86 .pte = L_PTE_MT_WRITETHROUGH, 98 .pte = L_PTE_MT_WRITETHROUGH,
99 .pte_s2 = s2_policy(L_PTE_S2_MT_WRITETHROUGH),
87 }, { 100 }, {
88 .policy = "writeback", 101 .policy = "writeback",
89 .cr_mask = 0, 102 .cr_mask = 0,
90 .pmd = PMD_SECT_WB, 103 .pmd = PMD_SECT_WB,
91 .pte = L_PTE_MT_WRITEBACK, 104 .pte = L_PTE_MT_WRITEBACK,
105 .pte_s2 = s2_policy(L_PTE_S2_MT_WRITEBACK),
92 }, { 106 }, {
93 .policy = "writealloc", 107 .policy = "writealloc",
94 .cr_mask = 0, 108 .cr_mask = 0,
95 .pmd = PMD_SECT_WBWA, 109 .pmd = PMD_SECT_WBWA,
96 .pte = L_PTE_MT_WRITEALLOC, 110 .pte = L_PTE_MT_WRITEALLOC,
111 .pte_s2 = s2_policy(L_PTE_S2_MT_WRITEBACK),
97 } 112 }
98}; 113};
99 114
@@ -327,6 +342,7 @@ static void __init build_mem_type_table(void)
327 struct cachepolicy *cp; 342 struct cachepolicy *cp;
328 unsigned int cr = get_cr(); 343 unsigned int cr = get_cr();
329 pteval_t user_pgprot, kern_pgprot, vecs_pgprot; 344 pteval_t user_pgprot, kern_pgprot, vecs_pgprot;
345 pteval_t hyp_device_pgprot, s2_pgprot, s2_device_pgprot;
330 int cpu_arch = cpu_architecture(); 346 int cpu_arch = cpu_architecture();
331 int i; 347 int i;
332 348
@@ -438,6 +454,8 @@ static void __init build_mem_type_table(void)
438 */ 454 */
439 cp = &cache_policies[cachepolicy]; 455 cp = &cache_policies[cachepolicy];
440 vecs_pgprot = kern_pgprot = user_pgprot = cp->pte; 456 vecs_pgprot = kern_pgprot = user_pgprot = cp->pte;
457 s2_pgprot = cp->pte_s2;
458 hyp_device_pgprot = s2_device_pgprot = mem_types[MT_DEVICE].prot_pte;
441 459
442 /* 460 /*
443 * ARMv6 and above have extended page tables. 461 * ARMv6 and above have extended page tables.
@@ -461,6 +479,7 @@ static void __init build_mem_type_table(void)
461 user_pgprot |= L_PTE_SHARED; 479 user_pgprot |= L_PTE_SHARED;
462 kern_pgprot |= L_PTE_SHARED; 480 kern_pgprot |= L_PTE_SHARED;
463 vecs_pgprot |= L_PTE_SHARED; 481 vecs_pgprot |= L_PTE_SHARED;
482 s2_pgprot |= L_PTE_SHARED;
464 mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_S; 483 mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_S;
465 mem_types[MT_DEVICE_WC].prot_pte |= L_PTE_SHARED; 484 mem_types[MT_DEVICE_WC].prot_pte |= L_PTE_SHARED;
466 mem_types[MT_DEVICE_CACHED].prot_sect |= PMD_SECT_S; 485 mem_types[MT_DEVICE_CACHED].prot_sect |= PMD_SECT_S;
@@ -515,6 +534,9 @@ static void __init build_mem_type_table(void)
515 pgprot_user = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | user_pgprot); 534 pgprot_user = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | user_pgprot);
516 pgprot_kernel = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | 535 pgprot_kernel = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG |
517 L_PTE_DIRTY | kern_pgprot); 536 L_PTE_DIRTY | kern_pgprot);
537 pgprot_s2 = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | s2_pgprot);
538 pgprot_s2_device = __pgprot(s2_device_pgprot);
539 pgprot_hyp_device = __pgprot(hyp_device_pgprot);
518 540
519 mem_types[MT_LOW_VECTORS].prot_l1 |= ecc_mask; 541 mem_types[MT_LOW_VECTORS].prot_l1 |= ecc_mask;
520 mem_types[MT_HIGH_VECTORS].prot_l1 |= ecc_mask; 542 mem_types[MT_HIGH_VECTORS].prot_l1 |= ecc_mask;
@@ -774,21 +796,24 @@ void __init iotable_init(struct map_desc *io_desc, int nr)
774{ 796{
775 struct map_desc *md; 797 struct map_desc *md;
776 struct vm_struct *vm; 798 struct vm_struct *vm;
799 struct static_vm *svm;
777 800
778 if (!nr) 801 if (!nr)
779 return; 802 return;
780 803
781 vm = early_alloc_aligned(sizeof(*vm) * nr, __alignof__(*vm)); 804 svm = early_alloc_aligned(sizeof(*svm) * nr, __alignof__(*svm));
782 805
783 for (md = io_desc; nr; md++, nr--) { 806 for (md = io_desc; nr; md++, nr--) {
784 create_mapping(md); 807 create_mapping(md);
808
809 vm = &svm->vm;
785 vm->addr = (void *)(md->virtual & PAGE_MASK); 810 vm->addr = (void *)(md->virtual & PAGE_MASK);
786 vm->size = PAGE_ALIGN(md->length + (md->virtual & ~PAGE_MASK)); 811 vm->size = PAGE_ALIGN(md->length + (md->virtual & ~PAGE_MASK));
787 vm->phys_addr = __pfn_to_phys(md->pfn); 812 vm->phys_addr = __pfn_to_phys(md->pfn);
788 vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING; 813 vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING;
789 vm->flags |= VM_ARM_MTYPE(md->type); 814 vm->flags |= VM_ARM_MTYPE(md->type);
790 vm->caller = iotable_init; 815 vm->caller = iotable_init;
791 vm_area_add_early(vm++); 816 add_static_vm_early(svm++);
792 } 817 }
793} 818}
794 819
@@ -796,13 +821,16 @@ void __init vm_reserve_area_early(unsigned long addr, unsigned long size,
796 void *caller) 821 void *caller)
797{ 822{
798 struct vm_struct *vm; 823 struct vm_struct *vm;
824 struct static_vm *svm;
825
826 svm = early_alloc_aligned(sizeof(*svm), __alignof__(*svm));
799 827
800 vm = early_alloc_aligned(sizeof(*vm), __alignof__(*vm)); 828 vm = &svm->vm;
801 vm->addr = (void *)addr; 829 vm->addr = (void *)addr;
802 vm->size = size; 830 vm->size = size;
803 vm->flags = VM_IOREMAP | VM_ARM_EMPTY_MAPPING; 831 vm->flags = VM_IOREMAP | VM_ARM_EMPTY_MAPPING;
804 vm->caller = caller; 832 vm->caller = caller;
805 vm_area_add_early(vm); 833 add_static_vm_early(svm);
806} 834}
807 835
808#ifndef CONFIG_ARM_LPAE 836#ifndef CONFIG_ARM_LPAE
@@ -827,14 +855,13 @@ static void __init pmd_empty_section_gap(unsigned long addr)
827 855
828static void __init fill_pmd_gaps(void) 856static void __init fill_pmd_gaps(void)
829{ 857{
858 struct static_vm *svm;
830 struct vm_struct *vm; 859 struct vm_struct *vm;
831 unsigned long addr, next = 0; 860 unsigned long addr, next = 0;
832 pmd_t *pmd; 861 pmd_t *pmd;
833 862
834 /* we're still single threaded hence no lock needed here */ 863 list_for_each_entry(svm, &static_vmlist, list) {
835 for (vm = vmlist; vm; vm = vm->next) { 864 vm = &svm->vm;
836 if (!(vm->flags & (VM_ARM_STATIC_MAPPING | VM_ARM_EMPTY_MAPPING)))
837 continue;
838 addr = (unsigned long)vm->addr; 865 addr = (unsigned long)vm->addr;
839 if (addr < next) 866 if (addr < next)
840 continue; 867 continue;
@@ -874,19 +901,12 @@ static void __init fill_pmd_gaps(void)
874#if defined(CONFIG_PCI) && !defined(CONFIG_NEED_MACH_IO_H) 901#if defined(CONFIG_PCI) && !defined(CONFIG_NEED_MACH_IO_H)
875static void __init pci_reserve_io(void) 902static void __init pci_reserve_io(void)
876{ 903{
877 struct vm_struct *vm; 904 struct static_vm *svm;
878 unsigned long addr;
879 905
880 /* we're still single threaded hence no lock needed here */ 906 svm = find_static_vm_vaddr((void *)PCI_IO_VIRT_BASE);
881 for (vm = vmlist; vm; vm = vm->next) { 907 if (svm)
882 if (!(vm->flags & VM_ARM_STATIC_MAPPING)) 908 return;
883 continue;
884 addr = (unsigned long)vm->addr;
885 addr &= ~(SZ_2M - 1);
886 if (addr == PCI_IO_VIRT_BASE)
887 return;
888 909
889 }
890 vm_reserve_area_early(PCI_IO_VIRT_BASE, SZ_2M, pci_reserve_io); 910 vm_reserve_area_early(PCI_IO_VIRT_BASE, SZ_2M, pci_reserve_io);
891} 911}
892#else 912#else
diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S
index eb6aa73bc8b7..f9a0aa725ea9 100644
--- a/arch/arm/mm/proc-macros.S
+++ b/arch/arm/mm/proc-macros.S
@@ -38,9 +38,14 @@
38 38
39/* 39/*
40 * mmid - get context id from mm pointer (mm->context.id) 40 * mmid - get context id from mm pointer (mm->context.id)
41 * note, this field is 64bit, so in big-endian the two words are swapped too.
41 */ 42 */
42 .macro mmid, rd, rn 43 .macro mmid, rd, rn
44#ifdef __ARMEB__
45 ldr \rd, [\rn, #MM_CONTEXT_ID + 4 ]
46#else
43 ldr \rd, [\rn, #MM_CONTEXT_ID] 47 ldr \rd, [\rn, #MM_CONTEXT_ID]
48#endif
44 .endm 49 .endm
45 50
46/* 51/*
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index 09c5233f4dfc..bcaaa8de9325 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -101,7 +101,7 @@ ENTRY(cpu_v6_dcache_clean_area)
101ENTRY(cpu_v6_switch_mm) 101ENTRY(cpu_v6_switch_mm)
102#ifdef CONFIG_MMU 102#ifdef CONFIG_MMU
103 mov r2, #0 103 mov r2, #0
104 ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id 104 mmid r1, r1 @ get mm->context.id
105 ALT_SMP(orr r0, r0, #TTB_FLAGS_SMP) 105 ALT_SMP(orr r0, r0, #TTB_FLAGS_SMP)
106 ALT_UP(orr r0, r0, #TTB_FLAGS_UP) 106 ALT_UP(orr r0, r0, #TTB_FLAGS_UP)
107 mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB 107 mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB
diff --git a/arch/arm/mm/proc-v7-2level.S b/arch/arm/mm/proc-v7-2level.S
index 6d98c13ab827..78f520bc0e99 100644
--- a/arch/arm/mm/proc-v7-2level.S
+++ b/arch/arm/mm/proc-v7-2level.S
@@ -40,7 +40,7 @@
40ENTRY(cpu_v7_switch_mm) 40ENTRY(cpu_v7_switch_mm)
41#ifdef CONFIG_MMU 41#ifdef CONFIG_MMU
42 mov r2, #0 42 mov r2, #0
43 ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id 43 mmid r1, r1 @ get mm->context.id
44 ALT_SMP(orr r0, r0, #TTB_FLAGS_SMP) 44 ALT_SMP(orr r0, r0, #TTB_FLAGS_SMP)
45 ALT_UP(orr r0, r0, #TTB_FLAGS_UP) 45 ALT_UP(orr r0, r0, #TTB_FLAGS_UP)
46#ifdef CONFIG_ARM_ERRATA_430973 46#ifdef CONFIG_ARM_ERRATA_430973
diff --git a/arch/arm/mm/proc-v7-3level.S b/arch/arm/mm/proc-v7-3level.S
index 7b56386f9496..50bf1dafc9ea 100644
--- a/arch/arm/mm/proc-v7-3level.S
+++ b/arch/arm/mm/proc-v7-3level.S
@@ -47,7 +47,7 @@
47 */ 47 */
48ENTRY(cpu_v7_switch_mm) 48ENTRY(cpu_v7_switch_mm)
49#ifdef CONFIG_MMU 49#ifdef CONFIG_MMU
50 ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id 50 mmid r1, r1 @ get mm->context.id
51 and r3, r1, #0xff 51 and r3, r1, #0xff
52 mov r3, r3, lsl #(48 - 32) @ ASID 52 mov r3, r3, lsl #(48 - 32) @ ASID
53 mcrr p15, 0, r0, r3, c2 @ set TTB 0 53 mcrr p15, 0, r0, r3, c2 @ set TTB 0
diff --git a/arch/arm/mm/vmregion.c b/arch/arm/mm/vmregion.c
deleted file mode 100644
index a631016e1f8f..000000000000
--- a/arch/arm/mm/vmregion.c
+++ /dev/null
@@ -1,205 +0,0 @@
1#include <linux/fs.h>
2#include <linux/spinlock.h>
3#include <linux/list.h>
4#include <linux/proc_fs.h>
5#include <linux/seq_file.h>
6#include <linux/slab.h>
7
8#include "vmregion.h"
9
10/*
11 * VM region handling support.
12 *
13 * This should become something generic, handling VM region allocations for
14 * vmalloc and similar (ioremap, module space, etc).
15 *
16 * I envisage vmalloc()'s supporting vm_struct becoming:
17 *
18 * struct vm_struct {
19 * struct vmregion region;
20 * unsigned long flags;
21 * struct page **pages;
22 * unsigned int nr_pages;
23 * unsigned long phys_addr;
24 * };
25 *
26 * get_vm_area() would then call vmregion_alloc with an appropriate
27 * struct vmregion head (eg):
28 *
29 * struct vmregion vmalloc_head = {
30 * .vm_list = LIST_HEAD_INIT(vmalloc_head.vm_list),
31 * .vm_start = VMALLOC_START,
32 * .vm_end = VMALLOC_END,
33 * };
34 *
35 * However, vmalloc_head.vm_start is variable (typically, it is dependent on
36 * the amount of RAM found at boot time.) I would imagine that get_vm_area()
37 * would have to initialise this each time prior to calling vmregion_alloc().
38 */
39
40struct arm_vmregion *
41arm_vmregion_alloc(struct arm_vmregion_head *head, size_t align,
42 size_t size, gfp_t gfp, const void *caller)
43{
44 unsigned long start = head->vm_start, addr = head->vm_end;
45 unsigned long flags;
46 struct arm_vmregion *c, *new;
47
48 if (head->vm_end - head->vm_start < size) {
49 printk(KERN_WARNING "%s: allocation too big (requested %#x)\n",
50 __func__, size);
51 goto out;
52 }
53
54 new = kmalloc(sizeof(struct arm_vmregion), gfp);
55 if (!new)
56 goto out;
57
58 new->caller = caller;
59
60 spin_lock_irqsave(&head->vm_lock, flags);
61
62 addr = rounddown(addr - size, align);
63 list_for_each_entry_reverse(c, &head->vm_list, vm_list) {
64 if (addr >= c->vm_end)
65 goto found;
66 addr = rounddown(c->vm_start - size, align);
67 if (addr < start)
68 goto nospc;
69 }
70
71 found:
72 /*
73 * Insert this entry after the one we found.
74 */
75 list_add(&new->vm_list, &c->vm_list);
76 new->vm_start = addr;
77 new->vm_end = addr + size;
78 new->vm_active = 1;
79
80 spin_unlock_irqrestore(&head->vm_lock, flags);
81 return new;
82
83 nospc:
84 spin_unlock_irqrestore(&head->vm_lock, flags);
85 kfree(new);
86 out:
87 return NULL;
88}
89
90static struct arm_vmregion *__arm_vmregion_find(struct arm_vmregion_head *head, unsigned long addr)
91{
92 struct arm_vmregion *c;
93
94 list_for_each_entry(c, &head->vm_list, vm_list) {
95 if (c->vm_active && c->vm_start == addr)
96 goto out;
97 }
98 c = NULL;
99 out:
100 return c;
101}
102
103struct arm_vmregion *arm_vmregion_find(struct arm_vmregion_head *head, unsigned long addr)
104{
105 struct arm_vmregion *c;
106 unsigned long flags;
107
108 spin_lock_irqsave(&head->vm_lock, flags);
109 c = __arm_vmregion_find(head, addr);
110 spin_unlock_irqrestore(&head->vm_lock, flags);
111 return c;
112}
113
114struct arm_vmregion *arm_vmregion_find_remove(struct arm_vmregion_head *head, unsigned long addr)
115{
116 struct arm_vmregion *c;
117 unsigned long flags;
118
119 spin_lock_irqsave(&head->vm_lock, flags);
120 c = __arm_vmregion_find(head, addr);
121 if (c)
122 c->vm_active = 0;
123 spin_unlock_irqrestore(&head->vm_lock, flags);
124 return c;
125}
126
127void arm_vmregion_free(struct arm_vmregion_head *head, struct arm_vmregion *c)
128{
129 unsigned long flags;
130
131 spin_lock_irqsave(&head->vm_lock, flags);
132 list_del(&c->vm_list);
133 spin_unlock_irqrestore(&head->vm_lock, flags);
134
135 kfree(c);
136}
137
138#ifdef CONFIG_PROC_FS
139static int arm_vmregion_show(struct seq_file *m, void *p)
140{
141 struct arm_vmregion *c = list_entry(p, struct arm_vmregion, vm_list);
142
143 seq_printf(m, "0x%08lx-0x%08lx %7lu", c->vm_start, c->vm_end,
144 c->vm_end - c->vm_start);
145 if (c->caller)
146 seq_printf(m, " %pS", (void *)c->caller);
147 seq_putc(m, '\n');
148 return 0;
149}
150
151static void *arm_vmregion_start(struct seq_file *m, loff_t *pos)
152{
153 struct arm_vmregion_head *h = m->private;
154 spin_lock_irq(&h->vm_lock);
155 return seq_list_start(&h->vm_list, *pos);
156}
157
158static void *arm_vmregion_next(struct seq_file *m, void *p, loff_t *pos)
159{
160 struct arm_vmregion_head *h = m->private;
161 return seq_list_next(p, &h->vm_list, pos);
162}
163
164static void arm_vmregion_stop(struct seq_file *m, void *p)
165{
166 struct arm_vmregion_head *h = m->private;
167 spin_unlock_irq(&h->vm_lock);
168}
169
170static const struct seq_operations arm_vmregion_ops = {
171 .start = arm_vmregion_start,
172 .stop = arm_vmregion_stop,
173 .next = arm_vmregion_next,
174 .show = arm_vmregion_show,
175};
176
177static int arm_vmregion_open(struct inode *inode, struct file *file)
178{
179 struct arm_vmregion_head *h = PDE(inode)->data;
180 int ret = seq_open(file, &arm_vmregion_ops);
181 if (!ret) {
182 struct seq_file *m = file->private_data;
183 m->private = h;
184 }
185 return ret;
186}
187
188static const struct file_operations arm_vmregion_fops = {
189 .open = arm_vmregion_open,
190 .read = seq_read,
191 .llseek = seq_lseek,
192 .release = seq_release,
193};
194
195int arm_vmregion_create_proc(const char *path, struct arm_vmregion_head *h)
196{
197 proc_create_data(path, S_IRUSR, NULL, &arm_vmregion_fops, h);
198 return 0;
199}
200#else
201int arm_vmregion_create_proc(const char *path, struct arm_vmregion_head *h)
202{
203 return 0;
204}
205#endif
diff --git a/arch/arm/mm/vmregion.h b/arch/arm/mm/vmregion.h
deleted file mode 100644
index 0f5a5f2a2c7b..000000000000
--- a/arch/arm/mm/vmregion.h
+++ /dev/null
@@ -1,31 +0,0 @@
1#ifndef VMREGION_H
2#define VMREGION_H
3
4#include <linux/spinlock.h>
5#include <linux/list.h>
6
7struct page;
8
9struct arm_vmregion_head {
10 spinlock_t vm_lock;
11 struct list_head vm_list;
12 unsigned long vm_start;
13 unsigned long vm_end;
14};
15
16struct arm_vmregion {
17 struct list_head vm_list;
18 unsigned long vm_start;
19 unsigned long vm_end;
20 int vm_active;
21 const void *caller;
22};
23
24struct arm_vmregion *arm_vmregion_alloc(struct arm_vmregion_head *, size_t, size_t, gfp_t, const void *);
25struct arm_vmregion *arm_vmregion_find(struct arm_vmregion_head *, unsigned long);
26struct arm_vmregion *arm_vmregion_find_remove(struct arm_vmregion_head *, unsigned long);
27void arm_vmregion_free(struct arm_vmregion_head *, struct arm_vmregion *);
28
29int arm_vmregion_create_proc(const char *, struct arm_vmregion_head *);
30
31#endif
diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c
index a34f1e214116..6828ef6ce80e 100644
--- a/arch/arm/net/bpf_jit_32.c
+++ b/arch/arm/net/bpf_jit_32.c
@@ -341,10 +341,17 @@ static void emit_load_be16(u8 cond, u8 r_res, u8 r_addr, struct jit_ctx *ctx)
341 341
342static inline void emit_swap16(u8 r_dst, u8 r_src, struct jit_ctx *ctx) 342static inline void emit_swap16(u8 r_dst, u8 r_src, struct jit_ctx *ctx)
343{ 343{
344 emit(ARM_LSL_R(ARM_R1, r_src, 8), ctx); 344 /* r_dst = (r_src << 8) | (r_src >> 8) */
345 emit(ARM_ORR_S(r_dst, ARM_R1, r_src, SRTYPE_LSL, 8), ctx); 345 emit(ARM_LSL_I(ARM_R1, r_src, 8), ctx);
346 emit(ARM_LSL_I(r_dst, r_dst, 8), ctx); 346 emit(ARM_ORR_S(r_dst, ARM_R1, r_src, SRTYPE_LSR, 8), ctx);
347 emit(ARM_LSL_R(r_dst, r_dst, 8), ctx); 347
348 /*
349 * we need to mask out the bits set in r_dst[23:16] due to
350 * the first shift instruction.
351 *
352 * note that 0x8ff is the encoded immediate 0x00ff0000.
353 */
354 emit(ARM_BIC_I(r_dst, r_dst, 0x8ff), ctx);
348} 355}
349 356
350#else /* ARMv6+ */ 357#else /* ARMv6+ */
diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c
index cbfbbe461788..837a2d52e9db 100644
--- a/arch/arm/plat-iop/time.c
+++ b/arch/arm/plat-iop/time.c
@@ -156,14 +156,9 @@ void __init iop_init_time(unsigned long tick_rate)
156 write_tmr0(timer_ctl & ~IOP_TMR_EN); 156 write_tmr0(timer_ctl & ~IOP_TMR_EN);
157 write_tisr(1); 157 write_tisr(1);
158 setup_irq(IRQ_IOP_TIMER0, &iop_timer_irq); 158 setup_irq(IRQ_IOP_TIMER0, &iop_timer_irq);
159 clockevents_calc_mult_shift(&iop_clockevent,
160 tick_rate, IOP_MIN_RANGE);
161 iop_clockevent.max_delta_ns =
162 clockevent_delta2ns(0xfffffffe, &iop_clockevent);
163 iop_clockevent.min_delta_ns =
164 clockevent_delta2ns(0xf, &iop_clockevent);
165 iop_clockevent.cpumask = cpumask_of(0); 159 iop_clockevent.cpumask = cpumask_of(0);
166 clockevents_register_device(&iop_clockevent); 160 clockevents_config_and_register(&iop_clockevent, tick_rate,
161 0xf, 0xfffffffe);
167 162
168 /* 163 /*
169 * Set up free-running clocksource timer 1. 164 * Set up free-running clocksource timer 1.
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index 665870dce3c8..ce66eb9be481 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -5,36 +5,6 @@ menu "TI OMAP Common Features"
5config ARCH_OMAP_OTG 5config ARCH_OMAP_OTG
6 bool 6 bool
7 7
8choice
9 prompt "OMAP System Type"
10 default ARCH_OMAP2PLUS
11
12config ARCH_OMAP1
13 bool "TI OMAP1"
14 select CLKDEV_LOOKUP
15 select CLKSRC_MMIO
16 select GENERIC_IRQ_CHIP
17 select HAVE_IDE
18 select IRQ_DOMAIN
19 select NEED_MACH_IO_H if PCCARD
20 select NEED_MACH_MEMORY_H
21 help
22 "Systems based on omap7xx, omap15xx or omap16xx"
23
24config ARCH_OMAP2PLUS
25 bool "TI OMAP2/3/4"
26 select CLKDEV_LOOKUP
27 select GENERIC_IRQ_CHIP
28 select OMAP_DM_TIMER
29 select PINCTRL
30 select PROC_DEVICETREE if PROC_FS
31 select SPARSE_IRQ
32 select USE_OF
33 help
34 "Systems based on OMAP2, OMAP3, OMAP4 or OMAP5"
35
36endchoice
37
38comment "OMAP Feature Selections" 8comment "OMAP Feature Selections"
39 9
40config OMAP_DEBUG_DEVICES 10config OMAP_DEBUG_DEVICES
@@ -118,7 +88,7 @@ config OMAP_MUX_WARNINGS
118 88
119config OMAP_MBOX_FWK 89config OMAP_MBOX_FWK
120 tristate "Mailbox framework support" 90 tristate "Mailbox framework support"
121 depends on ARCH_OMAP 91 depends on ARCH_OMAP && !ARCH_MULTIPLATFORM
122 help 92 help
123 Say Y here if you want to use OMAP Mailbox framework support for 93 Say Y here if you want to use OMAP Mailbox framework support for
124 DSP, IVA1.0 and IVA2 in OMAP1/2/3. 94 DSP, IVA1.0 and IVA2 in OMAP1/2/3.
@@ -177,15 +147,6 @@ config OMAP3_L2_AUX_SECURE_SERVICE_SET_ID
177 help 147 help
178 PPA routine service ID for setting L2 auxiliary control register. 148 PPA routine service ID for setting L2 auxiliary control register.
179 149
180config OMAP_32K_TIMER_HZ
181 int "Kernel internal timer frequency for 32KHz timer"
182 range 32 1024
183 depends on OMAP_32K_TIMER
184 default "128"
185 help
186 Kernel internal timer frequency should be a divisor of 32768,
187 such as 64 or 128.
188
189config OMAP_DM_TIMER 150config OMAP_DM_TIMER
190 bool "Use dual-mode timer" 151 bool "Use dual-mode timer"
191 depends on ARCH_OMAP16XX || ARCH_OMAP2PLUS 152 depends on ARCH_OMAP16XX || ARCH_OMAP2PLUS
diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile
index a14a78a2f149..31199417b56a 100644
--- a/arch/arm/plat-omap/Makefile
+++ b/arch/arm/plat-omap/Makefile
@@ -2,6 +2,8 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/arch/arm/plat-omap/include
6
5# Common support 7# Common support
6obj-y := sram.o dma.o counter_32k.o 8obj-y := sram.o dma.o counter_32k.o
7obj-m := 9obj-m :=
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 4136b20cba3c..e06c34bdc34a 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -2019,7 +2019,7 @@ static int omap_system_dma_probe(struct platform_device *pdev)
2019 errata = p->errata; 2019 errata = p->errata;
2020 2020
2021 if ((d->dev_caps & RESERVE_CHANNEL) && omap_dma_reserve_channels 2021 if ((d->dev_caps & RESERVE_CHANNEL) && omap_dma_reserve_channels
2022 && (omap_dma_reserve_channels <= dma_lch_count)) 2022 && (omap_dma_reserve_channels < d->lch_count))
2023 d->lch_count = omap_dma_reserve_channels; 2023 d->lch_count = omap_dma_reserve_channels;
2024 2024
2025 dma_lch_count = d->lch_count; 2025 dma_lch_count = d->lch_count;
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 7b433f3bddca..a0daa2fb5de6 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -808,11 +808,9 @@ static int omap_dm_timer_probe(struct platform_device *pdev)
808 return -ENOMEM; 808 return -ENOMEM;
809 } 809 }
810 810
811 timer->io_base = devm_request_and_ioremap(dev, mem); 811 timer->io_base = devm_ioremap_resource(dev, mem);
812 if (!timer->io_base) { 812 if (IS_ERR(timer->io_base))
813 dev_err(dev, "%s: region already claimed.\n", __func__); 813 return PTR_ERR(timer->io_base);
814 return -ENOMEM;
815 }
816 814
817 if (dev->of_node) { 815 if (dev->of_node) {
818 if (of_find_property(dev->of_node, "ti,timer-alwon", NULL)) 816 if (of_find_property(dev->of_node, "ti,timer-alwon", NULL))
diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c
index f9df624d108c..58213d9714cd 100644
--- a/arch/arm/plat-omap/i2c.c
+++ b/arch/arm/plat-omap/i2c.c
@@ -68,7 +68,7 @@ __setup("i2c_bus=", omap_i2c_bus_setup);
68 * Register busses defined in command line but that are not registered with 68 * Register busses defined in command line but that are not registered with
69 * omap_register_i2c_bus from board initialization code. 69 * omap_register_i2c_bus from board initialization code.
70 */ 70 */
71static int __init omap_register_i2c_bus_cmdline(void) 71int __init omap_register_i2c_bus_cmdline(void)
72{ 72{
73 int i, err = 0; 73 int i, err = 0;
74 74
@@ -83,7 +83,6 @@ static int __init omap_register_i2c_bus_cmdline(void)
83out: 83out:
84 return err; 84 return err;
85} 85}
86subsys_initcall(omap_register_i2c_bus_cmdline);
87 86
88/** 87/**
89 * omap_register_i2c_bus - register I2C bus with device descriptors 88 * omap_register_i2c_bus - register I2C bus with device descriptors
diff --git a/arch/arm/plat-omap/include/plat/i2c.h b/arch/arm/plat-omap/include/plat/i2c.h
index 7a9028cb5a75..810629d79668 100644
--- a/arch/arm/plat-omap/include/plat/i2c.h
+++ b/arch/arm/plat-omap/include/plat/i2c.h
@@ -32,6 +32,7 @@ int omap_i2c_add_bus(struct omap_i2c_bus_platform_data *i2c_pdata,
32extern int omap_register_i2c_bus(int bus_id, u32 clkrate, 32extern int omap_register_i2c_bus(int bus_id, u32 clkrate,
33 struct i2c_board_info const *info, 33 struct i2c_board_info const *info,
34 unsigned len); 34 unsigned len);
35extern int omap_register_i2c_bus_cmdline(void);
35#else 36#else
36static inline int omap_register_i2c_bus(int bus_id, u32 clkrate, 37static inline int omap_register_i2c_bus(int bus_id, u32 clkrate,
37 struct i2c_board_info const *info, 38 struct i2c_board_info const *info,
@@ -39,6 +40,11 @@ static inline int omap_register_i2c_bus(int bus_id, u32 clkrate,
39{ 40{
40 return 0; 41 return 0;
41} 42}
43
44static inline int omap_register_i2c_bus_cmdline(void)
45{
46 return 0;
47}
42#endif 48#endif
43 49
44struct omap_hwmod; 50struct omap_hwmod;
diff --git a/arch/arm/plat-omap/include/plat/timex.h b/arch/arm/plat-omap/include/plat/timex.h
index 6d35767bc48f..e27d2daa7790 100644
--- a/arch/arm/plat-omap/include/plat/timex.h
+++ b/arch/arm/plat-omap/include/plat/timex.h
@@ -28,14 +28,6 @@
28#if !defined(__ASM_ARCH_OMAP_TIMEX_H) 28#if !defined(__ASM_ARCH_OMAP_TIMEX_H)
29#define __ASM_ARCH_OMAP_TIMEX_H 29#define __ASM_ARCH_OMAP_TIMEX_H
30 30
31/*
32 * OMAP 32KHz timer updates time one jiffie at a time from a secondary timer,
33 * and that's why the CLOCK_TICK_RATE is not 32768.
34 */
35#ifdef CONFIG_OMAP_32K_TIMER
36#define CLOCK_TICK_RATE (CONFIG_OMAP_32K_TIMER_HZ)
37#else
38#define CLOCK_TICK_RATE (HZ * 100000UL) 31#define CLOCK_TICK_RATE (HZ * 100000UL)
39#endif
40 32
41#endif /* __ASM_ARCH_OMAP_TIMEX_H */ 33#endif /* __ASM_ARCH_OMAP_TIMEX_H */
diff --git a/arch/arm/plat-orion/mpp.c b/arch/arm/plat-orion/mpp.c
index e686fe76a96b..7310bcfb299f 100644
--- a/arch/arm/plat-orion/mpp.c
+++ b/arch/arm/plat-orion/mpp.c
@@ -49,7 +49,7 @@ void __init orion_mpp_conf(unsigned int *mpp_list, unsigned int variant_mask,
49 "number (%u)\n", num); 49 "number (%u)\n", num);
50 continue; 50 continue;
51 } 51 }
52 if (variant_mask & !(*mpp_list & variant_mask)) { 52 if (variant_mask && !(*mpp_list & variant_mask)) {
53 printk(KERN_WARNING 53 printk(KERN_WARNING
54 "orion_mpp_conf: requested MPP%u config " 54 "orion_mpp_conf: requested MPP%u config "
55 "unavailable on this hardware\n", num); 55 "unavailable on this hardware\n", num);
diff --git a/arch/arm/plat-orion/time.c b/arch/arm/plat-orion/time.c
index 0f4fa863dd55..5d5ac0f05422 100644
--- a/arch/arm/plat-orion/time.c
+++ b/arch/arm/plat-orion/time.c
@@ -156,7 +156,6 @@ orion_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev)
156static struct clock_event_device orion_clkevt = { 156static struct clock_event_device orion_clkevt = {
157 .name = "orion_tick", 157 .name = "orion_tick",
158 .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC, 158 .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC,
159 .shift = 32,
160 .rating = 300, 159 .rating = 300,
161 .set_next_event = orion_clkevt_next_event, 160 .set_next_event = orion_clkevt_next_event,
162 .set_mode = orion_clkevt_mode, 161 .set_mode = orion_clkevt_mode,
@@ -221,9 +220,6 @@ orion_time_init(void __iomem *_bridge_base, u32 _bridge_timer1_clr_mask,
221 * Setup clockevent timer (interrupt-driven). 220 * Setup clockevent timer (interrupt-driven).
222 */ 221 */
223 setup_irq(irq, &orion_timer_irq); 222 setup_irq(irq, &orion_timer_irq);
224 orion_clkevt.mult = div_sc(tclk, NSEC_PER_SEC, orion_clkevt.shift);
225 orion_clkevt.max_delta_ns = clockevent_delta2ns(0xfffffffe, &orion_clkevt);
226 orion_clkevt.min_delta_ns = clockevent_delta2ns(1, &orion_clkevt);
227 orion_clkevt.cpumask = cpumask_of(0); 223 orion_clkevt.cpumask = cpumask_of(0);
228 clockevents_register_device(&orion_clkevt); 224 clockevents_config_and_register(&orion_clkevt, tclk, 1, 0xfffffffe);
229} 225}
diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig
deleted file mode 100644
index eef3b6a2f8a8..000000000000
--- a/arch/arm/plat-s3c24xx/Kconfig
+++ /dev/null
@@ -1,116 +0,0 @@
1# Copyright 2007 Simtec Electronics
2#
3# Licensed under GPLv2
4
5config PLAT_S3C24XX
6 bool
7 depends on ARCH_S3C24XX
8 default y
9 select ARCH_REQUIRE_GPIOLIB
10 select NO_IOPORT
11 select S3C_DEV_NAND
12 help
13 Base platform code for any Samsung S3C24XX device
14
15if PLAT_S3C24XX
16
17# low-level serial option nodes
18
19config CPU_LLSERIAL_S3C2410_ONLY
20 bool
21 default y if CPU_LLSERIAL_S3C2410 && !CPU_LLSERIAL_S3C2440
22
23config CPU_LLSERIAL_S3C2440_ONLY
24 bool
25 default y if CPU_LLSERIAL_S3C2440 && !CPU_LLSERIAL_S3C2410
26
27config CPU_LLSERIAL_S3C2410
28 bool
29 help
30 Selected if there is an S3C2410 (or register compatible) serial
31 low-level implementation needed
32
33config CPU_LLSERIAL_S3C2440
34 bool
35 help
36 Selected if there is an S3C2440 (or register compatible) serial
37 low-level implementation needed
38
39# code that is shared between a number of the s3c24xx implementations
40
41config S3C2410_CLOCK
42 bool
43 help
44 Clock code for the S3C2410, and similar processors which
45 is currently includes the S3C2410, S3C2440, S3C2442.
46
47config S3C24XX_DCLK
48 bool
49 help
50 Clock code for supporting DCLK/CLKOUT on S3C24XX architectures
51
52# gpio configurations
53
54config S3C24XX_GPIO_EXTRA
55 int
56 default 128 if S3C24XX_GPIO_EXTRA128
57 default 64 if S3C24XX_GPIO_EXTRA64
58 default 16 if ARCH_H1940
59 default 0
60
61config S3C24XX_GPIO_EXTRA64
62 bool
63 help
64 Add an extra 64 gpio numbers to the available GPIO pool. This is
65 available for boards that need extra gpios for external devices.
66
67config S3C24XX_GPIO_EXTRA128
68 bool
69 help
70 Add an extra 128 gpio numbers to the available GPIO pool. This is
71 available for boards that need extra gpios for external devices.
72
73config S3C24XX_DMA
74 bool "S3C2410 DMA support"
75 depends on ARCH_S3C24XX
76 select S3C_DMA
77 help
78 S3C2410 DMA support. This is needed for drivers like sound which
79 use the S3C2410's DMA system to move data to and from the
80 peripheral blocks.
81
82config S3C2410_DMA_DEBUG
83 bool "S3C2410 DMA support debug"
84 depends on ARCH_S3C24XX && S3C2410_DMA
85 help
86 Enable debugging output for the DMA code. This option sends info
87 to the kernel log, at priority KERN_DEBUG.
88
89# common code for s3c24xx based machines, such as the SMDKs.
90
91# cpu frequency items common between s3c2410 and s3c2440/s3c2442
92
93config S3C2410_IOTIMING
94 bool
95 depends on CPU_FREQ_S3C24XX
96 help
97 Internal node to select io timing code that is common to the s3c2410
98 and s3c2440/s3c2442 cpu frequency support.
99
100config S3C2410_CPUFREQ_UTILS
101 bool
102 depends on CPU_FREQ_S3C24XX
103 help
104 Internal node to select timing code that is common to the s3c2410
105 and s3c2440/s3c244 cpu frequency support.
106
107# cpu frequency support common to s3c2412, s3c2413 and s3c2442
108
109config S3C2412_IOTIMING
110 bool
111 depends on CPU_FREQ_S3C24XX && (CPU_S3C2412 || CPU_S3C2443)
112 help
113 Intel node to select io timing code that is common to the s3c2412
114 and the s3c2443.
115
116endif
diff --git a/arch/arm/plat-s3c24xx/Makefile b/arch/arm/plat-s3c24xx/Makefile
deleted file mode 100644
index 9f60549c8da1..000000000000
--- a/arch/arm/plat-s3c24xx/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
1# arch/arm/plat-s3c24xx/Makefile
2#
3# Copyright 2007 Simtec Electronics
4#
5# Licensed under GPLv2
6
7obj-y :=
8obj-m :=
9obj-n :=
10obj- :=
11
12
13# Core files
14
15obj-y += irq.o
16obj-$(CONFIG_S3C24XX_DCLK) += clock-dclk.o
17
18obj-$(CONFIG_CPU_FREQ_S3C24XX) += cpu-freq.o
19obj-$(CONFIG_CPU_FREQ_S3C24XX_DEBUGFS) += cpu-freq-debugfs.o
20
21# Architecture dependent builds
22
23obj-$(CONFIG_S3C2410_CLOCK) += s3c2410-clock.o
24obj-$(CONFIG_S3C24XX_DMA) += dma.o
25obj-$(CONFIG_S3C2410_IOTIMING) += s3c2410-iotiming.o
26obj-$(CONFIG_S3C2412_IOTIMING) += s3c2412-iotiming.o
27obj-$(CONFIG_S3C2410_CPUFREQ_UTILS) += s3c2410-cpufreq-utils.o
diff --git a/arch/arm/plat-s3c24xx/irq.c b/arch/arm/plat-s3c24xx/irq.c
deleted file mode 100644
index fe57bbbf166b..000000000000
--- a/arch/arm/plat-s3c24xx/irq.c
+++ /dev/null
@@ -1,676 +0,0 @@
1/* linux/arch/arm/plat-s3c24xx/irq.c
2 *
3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
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/init.h>
22#include <linux/module.h>
23#include <linux/interrupt.h>
24#include <linux/ioport.h>
25#include <linux/device.h>
26#include <linux/syscore_ops.h>
27
28#include <asm/irq.h>
29#include <asm/mach/irq.h>
30
31#include <plat/regs-irqtype.h>
32
33#include <plat/cpu.h>
34#include <plat/pm.h>
35#include <plat/irq.h>
36
37static void
38s3c_irq_mask(struct irq_data *data)
39{
40 unsigned int irqno = data->irq - IRQ_EINT0;
41 unsigned long mask;
42
43 mask = __raw_readl(S3C2410_INTMSK);
44 mask |= 1UL << irqno;
45 __raw_writel(mask, S3C2410_INTMSK);
46}
47
48static inline void
49s3c_irq_ack(struct irq_data *data)
50{
51 unsigned long bitval = 1UL << (data->irq - IRQ_EINT0);
52
53 __raw_writel(bitval, S3C2410_SRCPND);
54 __raw_writel(bitval, S3C2410_INTPND);
55}
56
57static inline void
58s3c_irq_maskack(struct irq_data *data)
59{
60 unsigned long bitval = 1UL << (data->irq - IRQ_EINT0);
61 unsigned long mask;
62
63 mask = __raw_readl(S3C2410_INTMSK);
64 __raw_writel(mask|bitval, S3C2410_INTMSK);
65
66 __raw_writel(bitval, S3C2410_SRCPND);
67 __raw_writel(bitval, S3C2410_INTPND);
68}
69
70
71static void
72s3c_irq_unmask(struct irq_data *data)
73{
74 unsigned int irqno = data->irq;
75 unsigned long mask;
76
77 if (irqno != IRQ_TIMER4 && irqno != IRQ_EINT8t23)
78 irqdbf2("s3c_irq_unmask %d\n", irqno);
79
80 irqno -= IRQ_EINT0;
81
82 mask = __raw_readl(S3C2410_INTMSK);
83 mask &= ~(1UL << irqno);
84 __raw_writel(mask, S3C2410_INTMSK);
85}
86
87struct irq_chip s3c_irq_level_chip = {
88 .name = "s3c-level",
89 .irq_ack = s3c_irq_maskack,
90 .irq_mask = s3c_irq_mask,
91 .irq_unmask = s3c_irq_unmask,
92 .irq_set_wake = s3c_irq_wake
93};
94
95struct irq_chip s3c_irq_chip = {
96 .name = "s3c",
97 .irq_ack = s3c_irq_ack,
98 .irq_mask = s3c_irq_mask,
99 .irq_unmask = s3c_irq_unmask,
100 .irq_set_wake = s3c_irq_wake
101};
102
103static void
104s3c_irqext_mask(struct irq_data *data)
105{
106 unsigned int irqno = data->irq - EXTINT_OFF;
107 unsigned long mask;
108
109 mask = __raw_readl(S3C24XX_EINTMASK);
110 mask |= ( 1UL << irqno);
111 __raw_writel(mask, S3C24XX_EINTMASK);
112}
113
114static void
115s3c_irqext_ack(struct irq_data *data)
116{
117 unsigned long req;
118 unsigned long bit;
119 unsigned long mask;
120
121 bit = 1UL << (data->irq - EXTINT_OFF);
122
123 mask = __raw_readl(S3C24XX_EINTMASK);
124
125 __raw_writel(bit, S3C24XX_EINTPEND);
126
127 req = __raw_readl(S3C24XX_EINTPEND);
128 req &= ~mask;
129
130 /* not sure if we should be acking the parent irq... */
131
132 if (data->irq <= IRQ_EINT7) {
133 if ((req & 0xf0) == 0)
134 s3c_irq_ack(irq_get_irq_data(IRQ_EINT4t7));
135 } else {
136 if ((req >> 8) == 0)
137 s3c_irq_ack(irq_get_irq_data(IRQ_EINT8t23));
138 }
139}
140
141static void
142s3c_irqext_unmask(struct irq_data *data)
143{
144 unsigned int irqno = data->irq - EXTINT_OFF;
145 unsigned long mask;
146
147 mask = __raw_readl(S3C24XX_EINTMASK);
148 mask &= ~(1UL << irqno);
149 __raw_writel(mask, S3C24XX_EINTMASK);
150}
151
152int
153s3c_irqext_type(struct irq_data *data, unsigned int type)
154{
155 void __iomem *extint_reg;
156 void __iomem *gpcon_reg;
157 unsigned long gpcon_offset, extint_offset;
158 unsigned long newvalue = 0, value;
159
160 if ((data->irq >= IRQ_EINT0) && (data->irq <= IRQ_EINT3)) {
161 gpcon_reg = S3C2410_GPFCON;
162 extint_reg = S3C24XX_EXTINT0;
163 gpcon_offset = (data->irq - IRQ_EINT0) * 2;
164 extint_offset = (data->irq - IRQ_EINT0) * 4;
165 } else if ((data->irq >= IRQ_EINT4) && (data->irq <= IRQ_EINT7)) {
166 gpcon_reg = S3C2410_GPFCON;
167 extint_reg = S3C24XX_EXTINT0;
168 gpcon_offset = (data->irq - (EXTINT_OFF)) * 2;
169 extint_offset = (data->irq - (EXTINT_OFF)) * 4;
170 } else if ((data->irq >= IRQ_EINT8) && (data->irq <= IRQ_EINT15)) {
171 gpcon_reg = S3C2410_GPGCON;
172 extint_reg = S3C24XX_EXTINT1;
173 gpcon_offset = (data->irq - IRQ_EINT8) * 2;
174 extint_offset = (data->irq - IRQ_EINT8) * 4;
175 } else if ((data->irq >= IRQ_EINT16) && (data->irq <= IRQ_EINT23)) {
176 gpcon_reg = S3C2410_GPGCON;
177 extint_reg = S3C24XX_EXTINT2;
178 gpcon_offset = (data->irq - IRQ_EINT8) * 2;
179 extint_offset = (data->irq - IRQ_EINT16) * 4;
180 } else {
181 return -1;
182 }
183
184 /* Set the GPIO to external interrupt mode */
185 value = __raw_readl(gpcon_reg);
186 value = (value & ~(3 << gpcon_offset)) | (0x02 << gpcon_offset);
187 __raw_writel(value, gpcon_reg);
188
189 /* Set the external interrupt to pointed trigger type */
190 switch (type)
191 {
192 case IRQ_TYPE_NONE:
193 printk(KERN_WARNING "No edge setting!\n");
194 break;
195
196 case IRQ_TYPE_EDGE_RISING:
197 newvalue = S3C2410_EXTINT_RISEEDGE;
198 break;
199
200 case IRQ_TYPE_EDGE_FALLING:
201 newvalue = S3C2410_EXTINT_FALLEDGE;
202 break;
203
204 case IRQ_TYPE_EDGE_BOTH:
205 newvalue = S3C2410_EXTINT_BOTHEDGE;
206 break;
207
208 case IRQ_TYPE_LEVEL_LOW:
209 newvalue = S3C2410_EXTINT_LOWLEV;
210 break;
211
212 case IRQ_TYPE_LEVEL_HIGH:
213 newvalue = S3C2410_EXTINT_HILEV;
214 break;
215
216 default:
217 printk(KERN_ERR "No such irq type %d", type);
218 return -1;
219 }
220
221 value = __raw_readl(extint_reg);
222 value = (value & ~(7 << extint_offset)) | (newvalue << extint_offset);
223 __raw_writel(value, extint_reg);
224
225 return 0;
226}
227
228static struct irq_chip s3c_irqext_chip = {
229 .name = "s3c-ext",
230 .irq_mask = s3c_irqext_mask,
231 .irq_unmask = s3c_irqext_unmask,
232 .irq_ack = s3c_irqext_ack,
233 .irq_set_type = s3c_irqext_type,
234 .irq_set_wake = s3c_irqext_wake
235};
236
237static struct irq_chip s3c_irq_eint0t4 = {
238 .name = "s3c-ext0",
239 .irq_ack = s3c_irq_ack,
240 .irq_mask = s3c_irq_mask,
241 .irq_unmask = s3c_irq_unmask,
242 .irq_set_wake = s3c_irq_wake,
243 .irq_set_type = s3c_irqext_type,
244};
245
246/* mask values for the parent registers for each of the interrupt types */
247
248#define INTMSK_UART0 (1UL << (IRQ_UART0 - IRQ_EINT0))
249#define INTMSK_UART1 (1UL << (IRQ_UART1 - IRQ_EINT0))
250#define INTMSK_UART2 (1UL << (IRQ_UART2 - IRQ_EINT0))
251#define INTMSK_ADCPARENT (1UL << (IRQ_ADCPARENT - IRQ_EINT0))
252
253
254/* UART0 */
255
256static void
257s3c_irq_uart0_mask(struct irq_data *data)
258{
259 s3c_irqsub_mask(data->irq, INTMSK_UART0, 7);
260}
261
262static void
263s3c_irq_uart0_unmask(struct irq_data *data)
264{
265 s3c_irqsub_unmask(data->irq, INTMSK_UART0);
266}
267
268static void
269s3c_irq_uart0_ack(struct irq_data *data)
270{
271 s3c_irqsub_maskack(data->irq, INTMSK_UART0, 7);
272}
273
274static struct irq_chip s3c_irq_uart0 = {
275 .name = "s3c-uart0",
276 .irq_mask = s3c_irq_uart0_mask,
277 .irq_unmask = s3c_irq_uart0_unmask,
278 .irq_ack = s3c_irq_uart0_ack,
279};
280
281/* UART1 */
282
283static void
284s3c_irq_uart1_mask(struct irq_data *data)
285{
286 s3c_irqsub_mask(data->irq, INTMSK_UART1, 7 << 3);
287}
288
289static void
290s3c_irq_uart1_unmask(struct irq_data *data)
291{
292 s3c_irqsub_unmask(data->irq, INTMSK_UART1);
293}
294
295static void
296s3c_irq_uart1_ack(struct irq_data *data)
297{
298 s3c_irqsub_maskack(data->irq, INTMSK_UART1, 7 << 3);
299}
300
301static struct irq_chip s3c_irq_uart1 = {
302 .name = "s3c-uart1",
303 .irq_mask = s3c_irq_uart1_mask,
304 .irq_unmask = s3c_irq_uart1_unmask,
305 .irq_ack = s3c_irq_uart1_ack,
306};
307
308/* UART2 */
309
310static void
311s3c_irq_uart2_mask(struct irq_data *data)
312{
313 s3c_irqsub_mask(data->irq, INTMSK_UART2, 7 << 6);
314}
315
316static void
317s3c_irq_uart2_unmask(struct irq_data *data)
318{
319 s3c_irqsub_unmask(data->irq, INTMSK_UART2);
320}
321
322static void
323s3c_irq_uart2_ack(struct irq_data *data)
324{
325 s3c_irqsub_maskack(data->irq, INTMSK_UART2, 7 << 6);
326}
327
328static struct irq_chip s3c_irq_uart2 = {
329 .name = "s3c-uart2",
330 .irq_mask = s3c_irq_uart2_mask,
331 .irq_unmask = s3c_irq_uart2_unmask,
332 .irq_ack = s3c_irq_uart2_ack,
333};
334
335/* ADC and Touchscreen */
336
337static void
338s3c_irq_adc_mask(struct irq_data *d)
339{
340 s3c_irqsub_mask(d->irq, INTMSK_ADCPARENT, 3 << 9);
341}
342
343static void
344s3c_irq_adc_unmask(struct irq_data *d)
345{
346 s3c_irqsub_unmask(d->irq, INTMSK_ADCPARENT);
347}
348
349static void
350s3c_irq_adc_ack(struct irq_data *d)
351{
352 s3c_irqsub_ack(d->irq, INTMSK_ADCPARENT, 3 << 9);
353}
354
355static struct irq_chip s3c_irq_adc = {
356 .name = "s3c-adc",
357 .irq_mask = s3c_irq_adc_mask,
358 .irq_unmask = s3c_irq_adc_unmask,
359 .irq_ack = s3c_irq_adc_ack,
360};
361
362/* irq demux for adc */
363static void s3c_irq_demux_adc(unsigned int irq,
364 struct irq_desc *desc)
365{
366 unsigned int subsrc, submsk;
367 unsigned int offset = 9;
368
369 /* read the current pending interrupts, and the mask
370 * for what it is available */
371
372 subsrc = __raw_readl(S3C2410_SUBSRCPND);
373 submsk = __raw_readl(S3C2410_INTSUBMSK);
374
375 subsrc &= ~submsk;
376 subsrc >>= offset;
377 subsrc &= 3;
378
379 if (subsrc != 0) {
380 if (subsrc & 1) {
381 generic_handle_irq(IRQ_TC);
382 }
383 if (subsrc & 2) {
384 generic_handle_irq(IRQ_ADC);
385 }
386 }
387}
388
389static void s3c_irq_demux_uart(unsigned int start)
390{
391 unsigned int subsrc, submsk;
392 unsigned int offset = start - IRQ_S3CUART_RX0;
393
394 /* read the current pending interrupts, and the mask
395 * for what it is available */
396
397 subsrc = __raw_readl(S3C2410_SUBSRCPND);
398 submsk = __raw_readl(S3C2410_INTSUBMSK);
399
400 irqdbf2("s3c_irq_demux_uart: start=%d (%d), subsrc=0x%08x,0x%08x\n",
401 start, offset, subsrc, submsk);
402
403 subsrc &= ~submsk;
404 subsrc >>= offset;
405 subsrc &= 7;
406
407 if (subsrc != 0) {
408 if (subsrc & 1)
409 generic_handle_irq(start);
410
411 if (subsrc & 2)
412 generic_handle_irq(start+1);
413
414 if (subsrc & 4)
415 generic_handle_irq(start+2);
416 }
417}
418
419/* uart demux entry points */
420
421static void
422s3c_irq_demux_uart0(unsigned int irq,
423 struct irq_desc *desc)
424{
425 irq = irq;
426 s3c_irq_demux_uart(IRQ_S3CUART_RX0);
427}
428
429static void
430s3c_irq_demux_uart1(unsigned int irq,
431 struct irq_desc *desc)
432{
433 irq = irq;
434 s3c_irq_demux_uart(IRQ_S3CUART_RX1);
435}
436
437static void
438s3c_irq_demux_uart2(unsigned int irq,
439 struct irq_desc *desc)
440{
441 irq = irq;
442 s3c_irq_demux_uart(IRQ_S3CUART_RX2);
443}
444
445static void
446s3c_irq_demux_extint8(unsigned int irq,
447 struct irq_desc *desc)
448{
449 unsigned long eintpnd = __raw_readl(S3C24XX_EINTPEND);
450 unsigned long eintmsk = __raw_readl(S3C24XX_EINTMASK);
451
452 eintpnd &= ~eintmsk;
453 eintpnd &= ~0xff; /* ignore lower irqs */
454
455 /* we may as well handle all the pending IRQs here */
456
457 while (eintpnd) {
458 irq = __ffs(eintpnd);
459 eintpnd &= ~(1<<irq);
460
461 irq += (IRQ_EINT4 - 4);
462 generic_handle_irq(irq);
463 }
464
465}
466
467static void
468s3c_irq_demux_extint4t7(unsigned int irq,
469 struct irq_desc *desc)
470{
471 unsigned long eintpnd = __raw_readl(S3C24XX_EINTPEND);
472 unsigned long eintmsk = __raw_readl(S3C24XX_EINTMASK);
473
474 eintpnd &= ~eintmsk;
475 eintpnd &= 0xff; /* only lower irqs */
476
477 /* we may as well handle all the pending IRQs here */
478
479 while (eintpnd) {
480 irq = __ffs(eintpnd);
481 eintpnd &= ~(1<<irq);
482
483 irq += (IRQ_EINT4 - 4);
484
485 generic_handle_irq(irq);
486 }
487}
488
489#ifdef CONFIG_FIQ
490/**
491 * s3c24xx_set_fiq - set the FIQ routing
492 * @irq: IRQ number to route to FIQ on processor.
493 * @on: Whether to route @irq to the FIQ, or to remove the FIQ routing.
494 *
495 * Change the state of the IRQ to FIQ routing depending on @irq and @on. If
496 * @on is true, the @irq is checked to see if it can be routed and the
497 * interrupt controller updated to route the IRQ. If @on is false, the FIQ
498 * routing is cleared, regardless of which @irq is specified.
499 */
500int s3c24xx_set_fiq(unsigned int irq, bool on)
501{
502 u32 intmod;
503 unsigned offs;
504
505 if (on) {
506 offs = irq - FIQ_START;
507 if (offs > 31)
508 return -EINVAL;
509
510 intmod = 1 << offs;
511 } else {
512 intmod = 0;
513 }
514
515 __raw_writel(intmod, S3C2410_INTMOD);
516 return 0;
517}
518
519EXPORT_SYMBOL_GPL(s3c24xx_set_fiq);
520#endif
521
522
523/* s3c24xx_init_irq
524 *
525 * Initialise S3C2410 IRQ system
526*/
527
528void __init s3c24xx_init_irq(void)
529{
530 unsigned long pend;
531 unsigned long last;
532 int irqno;
533 int i;
534
535#ifdef CONFIG_FIQ
536 init_FIQ(FIQ_START);
537#endif
538
539 irqdbf("s3c2410_init_irq: clearing interrupt status flags\n");
540
541 /* first, clear all interrupts pending... */
542
543 last = 0;
544 for (i = 0; i < 4; i++) {
545 pend = __raw_readl(S3C24XX_EINTPEND);
546
547 if (pend == 0 || pend == last)
548 break;
549
550 __raw_writel(pend, S3C24XX_EINTPEND);
551 printk("irq: clearing pending ext status %08x\n", (int)pend);
552 last = pend;
553 }
554
555 last = 0;
556 for (i = 0; i < 4; i++) {
557 pend = __raw_readl(S3C2410_INTPND);
558
559 if (pend == 0 || pend == last)
560 break;
561
562 __raw_writel(pend, S3C2410_SRCPND);
563 __raw_writel(pend, S3C2410_INTPND);
564 printk("irq: clearing pending status %08x\n", (int)pend);
565 last = pend;
566 }
567
568 last = 0;
569 for (i = 0; i < 4; i++) {
570 pend = __raw_readl(S3C2410_SUBSRCPND);
571
572 if (pend == 0 || pend == last)
573 break;
574
575 printk("irq: clearing subpending status %08x\n", (int)pend);
576 __raw_writel(pend, S3C2410_SUBSRCPND);
577 last = pend;
578 }
579
580 /* register the main interrupts */
581
582 irqdbf("s3c2410_init_irq: registering s3c2410 interrupt handlers\n");
583
584 for (irqno = IRQ_EINT4t7; irqno <= IRQ_ADCPARENT; irqno++) {
585 /* set all the s3c2410 internal irqs */
586
587 switch (irqno) {
588 /* deal with the special IRQs (cascaded) */
589
590 case IRQ_EINT4t7:
591 case IRQ_EINT8t23:
592 case IRQ_UART0:
593 case IRQ_UART1:
594 case IRQ_UART2:
595 case IRQ_ADCPARENT:
596 irq_set_chip_and_handler(irqno, &s3c_irq_level_chip,
597 handle_level_irq);
598 break;
599
600 case IRQ_RESERVED6:
601 case IRQ_RESERVED24:
602 /* no IRQ here */
603 break;
604
605 default:
606 //irqdbf("registering irq %d (s3c irq)\n", irqno);
607 irq_set_chip_and_handler(irqno, &s3c_irq_chip,
608 handle_edge_irq);
609 set_irq_flags(irqno, IRQF_VALID);
610 }
611 }
612
613 /* setup the cascade irq handlers */
614
615 irq_set_chained_handler(IRQ_EINT4t7, s3c_irq_demux_extint4t7);
616 irq_set_chained_handler(IRQ_EINT8t23, s3c_irq_demux_extint8);
617
618 irq_set_chained_handler(IRQ_UART0, s3c_irq_demux_uart0);
619 irq_set_chained_handler(IRQ_UART1, s3c_irq_demux_uart1);
620 irq_set_chained_handler(IRQ_UART2, s3c_irq_demux_uart2);
621 irq_set_chained_handler(IRQ_ADCPARENT, s3c_irq_demux_adc);
622
623 /* external interrupts */
624
625 for (irqno = IRQ_EINT0; irqno <= IRQ_EINT3; irqno++) {
626 irqdbf("registering irq %d (ext int)\n", irqno);
627 irq_set_chip_and_handler(irqno, &s3c_irq_eint0t4,
628 handle_edge_irq);
629 set_irq_flags(irqno, IRQF_VALID);
630 }
631
632 for (irqno = IRQ_EINT4; irqno <= IRQ_EINT23; irqno++) {
633 irqdbf("registering irq %d (extended s3c irq)\n", irqno);
634 irq_set_chip_and_handler(irqno, &s3c_irqext_chip,
635 handle_edge_irq);
636 set_irq_flags(irqno, IRQF_VALID);
637 }
638
639 /* register the uart interrupts */
640
641 irqdbf("s3c2410: registering external interrupts\n");
642
643 for (irqno = IRQ_S3CUART_RX0; irqno <= IRQ_S3CUART_ERR0; irqno++) {
644 irqdbf("registering irq %d (s3c uart0 irq)\n", irqno);
645 irq_set_chip_and_handler(irqno, &s3c_irq_uart0,
646 handle_level_irq);
647 set_irq_flags(irqno, IRQF_VALID);
648 }
649
650 for (irqno = IRQ_S3CUART_RX1; irqno <= IRQ_S3CUART_ERR1; irqno++) {
651 irqdbf("registering irq %d (s3c uart1 irq)\n", irqno);
652 irq_set_chip_and_handler(irqno, &s3c_irq_uart1,
653 handle_level_irq);
654 set_irq_flags(irqno, IRQF_VALID);
655 }
656
657 for (irqno = IRQ_S3CUART_RX2; irqno <= IRQ_S3CUART_ERR2; irqno++) {
658 irqdbf("registering irq %d (s3c uart2 irq)\n", irqno);
659 irq_set_chip_and_handler(irqno, &s3c_irq_uart2,
660 handle_level_irq);
661 set_irq_flags(irqno, IRQF_VALID);
662 }
663
664 for (irqno = IRQ_TC; irqno <= IRQ_ADC; irqno++) {
665 irqdbf("registering irq %d (s3c adc irq)\n", irqno);
666 irq_set_chip_and_handler(irqno, &s3c_irq_adc, handle_edge_irq);
667 set_irq_flags(irqno, IRQF_VALID);
668 }
669
670 irqdbf("s3c2410: registered interrupt handlers\n");
671}
672
673struct syscore_ops s3c24xx_irq_syscore_ops = {
674 .suspend = s3c24xx_irq_suspend,
675 .resume = s3c24xx_irq_resume,
676};
diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c
index 2d676ab50f73..ca07cb1b155a 100644
--- a/arch/arm/plat-samsung/adc.c
+++ b/arch/arm/plat-samsung/adc.c
@@ -386,11 +386,9 @@ static int s3c_adc_probe(struct platform_device *pdev)
386 return -ENXIO; 386 return -ENXIO;
387 } 387 }
388 388
389 adc->regs = devm_request_and_ioremap(dev, regs); 389 adc->regs = devm_ioremap_resource(dev, regs);
390 if (!adc->regs) { 390 if (IS_ERR(adc->regs))
391 dev_err(dev, "failed to map registers\n"); 391 return PTR_ERR(adc->regs);
392 return -ENXIO;
393 }
394 392
395 ret = regulator_enable(adc->vdd); 393 ret = regulator_enable(adc->vdd);
396 if (ret) 394 if (ret)
diff --git a/arch/arm/plat-samsung/dma-ops.c b/arch/arm/plat-samsung/dma-ops.c
index d088afa034e8..71d58ddea9c1 100644
--- a/arch/arm/plat-samsung/dma-ops.c
+++ b/arch/arm/plat-samsung/dma-ops.c
@@ -19,7 +19,8 @@
19#include <mach/dma.h> 19#include <mach/dma.h>
20 20
21static unsigned samsung_dmadev_request(enum dma_ch dma_ch, 21static unsigned samsung_dmadev_request(enum dma_ch dma_ch,
22 struct samsung_dma_req *param) 22 struct samsung_dma_req *param,
23 struct device *dev, char *ch_name)
23{ 24{
24 dma_cap_mask_t mask; 25 dma_cap_mask_t mask;
25 void *filter_param; 26 void *filter_param;
@@ -33,7 +34,12 @@ static unsigned samsung_dmadev_request(enum dma_ch dma_ch,
33 */ 34 */
34 filter_param = (dma_ch == DMACH_DT_PROP) ? 35 filter_param = (dma_ch == DMACH_DT_PROP) ?
35 (void *)param->dt_dmach_prop : (void *)dma_ch; 36 (void *)param->dt_dmach_prop : (void *)dma_ch;
36 return (unsigned)dma_request_channel(mask, pl330_filter, filter_param); 37
38 if (dev->of_node)
39 return (unsigned)dma_request_slave_channel(dev, ch_name);
40 else
41 return (unsigned)dma_request_channel(mask, pl330_filter,
42 filter_param);
37} 43}
38 44
39static int samsung_dmadev_release(unsigned ch, void *param) 45static int samsung_dmadev_release(unsigned ch, void *param)
diff --git a/arch/arm/plat-samsung/include/plat/adc.h b/arch/arm/plat-samsung/include/plat/adc.h
index b258a08de591..2fc89315553f 100644
--- a/arch/arm/plat-samsung/include/plat/adc.h
+++ b/arch/arm/plat-samsung/include/plat/adc.h
@@ -15,6 +15,7 @@
15#define __ASM_PLAT_ADC_H __FILE__ 15#define __ASM_PLAT_ADC_H __FILE__
16 16
17struct s3c_adc_client; 17struct s3c_adc_client;
18struct platform_device;
18 19
19extern int s3c_adc_start(struct s3c_adc_client *client, 20extern int s3c_adc_start(struct s3c_adc_client *client,
20 unsigned int channel, unsigned int nr_samples); 21 unsigned int channel, unsigned int nr_samples);
diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h
index b69e11dc679d..37703ef6dfc7 100644
--- a/arch/arm/plat-samsung/include/plat/cpu.h
+++ b/arch/arm/plat-samsung/include/plat/cpu.h
@@ -194,8 +194,7 @@ extern void s3c24xx_init_uartdevs(char *name,
194 194
195/* timer for 2410/2440 */ 195/* timer for 2410/2440 */
196 196
197struct sys_timer; 197extern void s3c24xx_timer_init(void);
198extern struct sys_timer s3c24xx_timer;
199 198
200extern struct syscore_ops s3c2410_pm_syscore_ops; 199extern struct syscore_ops s3c2410_pm_syscore_ops;
201extern struct syscore_ops s3c2412_pm_syscore_ops; 200extern struct syscore_ops s3c2412_pm_syscore_ops;
diff --git a/arch/arm/plat-samsung/include/plat/debug-macro.S b/arch/arm/plat-samsung/include/plat/debug-macro.S
index 207e275362a8..f3a9cff6d5d4 100644
--- a/arch/arm/plat-samsung/include/plat/debug-macro.S
+++ b/arch/arm/plat-samsung/include/plat/debug-macro.S
@@ -14,12 +14,12 @@
14/* The S5PV210/S5PC110 implementations are as belows. */ 14/* The S5PV210/S5PC110 implementations are as belows. */
15 15
16 .macro fifo_level_s5pv210 rd, rx 16 .macro fifo_level_s5pv210 rd, rx
17 ldr \rd, [ \rx, # S3C2410_UFSTAT ] 17 ldr \rd, [\rx, # S3C2410_UFSTAT]
18 and \rd, \rd, #S5PV210_UFSTAT_TXMASK 18 and \rd, \rd, #S5PV210_UFSTAT_TXMASK
19 .endm 19 .endm
20 20
21 .macro fifo_full_s5pv210 rd, rx 21 .macro fifo_full_s5pv210 rd, rx
22 ldr \rd, [ \rx, # S3C2410_UFSTAT ] 22 ldr \rd, [\rx, # S3C2410_UFSTAT]
23 tst \rd, #S5PV210_UFSTAT_TXFULL 23 tst \rd, #S5PV210_UFSTAT_TXFULL
24 .endm 24 .endm
25 25
@@ -27,7 +27,7 @@
27 * most widely re-used */ 27 * most widely re-used */
28 28
29 .macro fifo_level_s3c2440 rd, rx 29 .macro fifo_level_s3c2440 rd, rx
30 ldr \rd, [ \rx, # S3C2410_UFSTAT ] 30 ldr \rd, [\rx, # S3C2410_UFSTAT]
31 and \rd, \rd, #S3C2440_UFSTAT_TXMASK 31 and \rd, \rd, #S3C2440_UFSTAT_TXMASK
32 .endm 32 .endm
33 33
@@ -36,7 +36,7 @@
36#endif 36#endif
37 37
38 .macro fifo_full_s3c2440 rd, rx 38 .macro fifo_full_s3c2440 rd, rx
39 ldr \rd, [ \rx, # S3C2410_UFSTAT ] 39 ldr \rd, [\rx, # S3C2410_UFSTAT]
40 tst \rd, #S3C2440_UFSTAT_TXFULL 40 tst \rd, #S3C2440_UFSTAT_TXFULL
41 .endm 41 .endm
42 42
@@ -45,11 +45,11 @@
45#endif 45#endif
46 46
47 .macro senduart,rd,rx 47 .macro senduart,rd,rx
48 strb \rd, [\rx, # S3C2410_UTXH ] 48 strb \rd, [\rx, # S3C2410_UTXH]
49 .endm 49 .endm
50 50
51 .macro busyuart, rd, rx 51 .macro busyuart, rd, rx
52 ldr \rd, [ \rx, # S3C2410_UFCON ] 52 ldr \rd, [\rx, # S3C2410_UFCON]
53 tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled? 53 tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
54 beq 1001f @ 54 beq 1001f @
55 @ FIFO enabled... 55 @ FIFO enabled...
@@ -60,7 +60,7 @@
60 60
611001: 611001:
62 @ busy waiting for non fifo 62 @ busy waiting for non fifo
63 ldr \rd, [ \rx, # S3C2410_UTRSTAT ] 63 ldr \rd, [\rx, # S3C2410_UTRSTAT]
64 tst \rd, #S3C2410_UTRSTAT_TXFE 64 tst \rd, #S3C2410_UTRSTAT_TXFE
65 beq 1001b 65 beq 1001b
66 66
@@ -68,7 +68,7 @@
68 .endm 68 .endm
69 69
70 .macro waituart,rd,rx 70 .macro waituart,rd,rx
71 ldr \rd, [ \rx, # S3C2410_UFCON ] 71 ldr \rd, [\rx, # S3C2410_UFCON]
72 tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled? 72 tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
73 beq 1001f @ 73 beq 1001f @
74 @ FIFO enabled... 74 @ FIFO enabled...
@@ -79,7 +79,7 @@
79 b 1002f 79 b 1002f
801001: 801001:
81 @ idle waiting for non fifo 81 @ idle waiting for non fifo
82 ldr \rd, [ \rx, # S3C2410_UTRSTAT ] 82 ldr \rd, [\rx, # S3C2410_UTRSTAT]
83 tst \rd, #S3C2410_UTRSTAT_TXFE 83 tst \rd, #S3C2410_UTRSTAT_TXFE
84 beq 1001b 84 beq 1001b
85 85
diff --git a/arch/arm/plat-samsung/include/plat/dma-ops.h b/arch/arm/plat-samsung/include/plat/dma-ops.h
index f5144cdd3001..114178268b75 100644
--- a/arch/arm/plat-samsung/include/plat/dma-ops.h
+++ b/arch/arm/plat-samsung/include/plat/dma-ops.h
@@ -39,7 +39,8 @@ struct samsung_dma_config {
39}; 39};
40 40
41struct samsung_dma_ops { 41struct samsung_dma_ops {
42 unsigned (*request)(enum dma_ch ch, struct samsung_dma_req *param); 42 unsigned (*request)(enum dma_ch ch, struct samsung_dma_req *param,
43 struct device *dev, char *ch_name);
43 int (*release)(unsigned ch, void *param); 44 int (*release)(unsigned ch, void *param);
44 int (*config)(unsigned ch, struct samsung_dma_config *param); 45 int (*config)(unsigned ch, struct samsung_dma_config *param);
45 int (*prepare)(unsigned ch, struct samsung_dma_prep *param); 46 int (*prepare)(unsigned ch, struct samsung_dma_prep *param);
diff --git a/arch/arm/plat-samsung/include/plat/fimc-core.h b/arch/arm/plat-samsung/include/plat/fimc-core.h
index 945a99d59563..1d6cb2b8b094 100644
--- a/arch/arm/plat-samsung/include/plat/fimc-core.h
+++ b/arch/arm/plat-samsung/include/plat/fimc-core.h
@@ -43,6 +43,8 @@ static inline void s3c_fimc_setname(int id, char *name)
43 s5p_device_fimc3.name = name; 43 s5p_device_fimc3.name = name;
44 break; 44 break;
45#endif 45#endif
46 default:
47 break;
46 } 48 }
47} 49}
48 50
diff --git a/arch/arm/plat-samsung/include/plat/gpio-core.h b/arch/arm/plat-samsung/include/plat/gpio-core.h
index f7a3ea2c498a..cf5aae5b0975 100644
--- a/arch/arm/plat-samsung/include/plat/gpio-core.h
+++ b/arch/arm/plat-samsung/include/plat/gpio-core.h
@@ -106,7 +106,18 @@ static inline struct samsung_gpio_chip *samsung_gpiolib_getchip(unsigned int chi
106#else 106#else
107/* machine specific code should provide samsung_gpiolib_getchip */ 107/* machine specific code should provide samsung_gpiolib_getchip */
108 108
109#include <mach/gpio-track.h> 109extern struct samsung_gpio_chip s3c24xx_gpios[];
110
111static inline struct samsung_gpio_chip *samsung_gpiolib_getchip(unsigned int pin)
112{
113 struct samsung_gpio_chip *chip;
114
115 if (pin > S3C_GPIO_END)
116 return NULL;
117
118 chip = &s3c24xx_gpios[pin/32];
119 return ((pin - chip->chip.base) < chip->chip.ngpio) ? chip : NULL;
120}
110 121
111static inline void s3c_gpiolib_track(struct samsung_gpio_chip *chip) { } 122static inline void s3c_gpiolib_track(struct samsung_gpio_chip *chip) { }
112#endif 123#endif
diff --git a/arch/arm/plat-samsung/include/plat/gpio-fns.h b/arch/arm/plat-samsung/include/plat/gpio-fns.h
deleted file mode 100644
index d1ecef0e38e0..000000000000
--- a/arch/arm/plat-samsung/include/plat/gpio-fns.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <plat/gpio-cfg.h>
diff --git a/arch/arm/plat-samsung/include/plat/pm.h b/arch/arm/plat-samsung/include/plat/pm.h
index 887a0c954379..f6fcadeee969 100644
--- a/arch/arm/plat-samsung/include/plat/pm.h
+++ b/arch/arm/plat-samsung/include/plat/pm.h
@@ -109,17 +109,11 @@ extern void s3c_pm_do_restore_core(struct sleep_save *ptr, int count);
109#ifdef CONFIG_PM 109#ifdef CONFIG_PM
110extern int s3c_irq_wake(struct irq_data *data, unsigned int state); 110extern int s3c_irq_wake(struct irq_data *data, unsigned int state);
111extern int s3c_irqext_wake(struct irq_data *data, unsigned int state); 111extern int s3c_irqext_wake(struct irq_data *data, unsigned int state);
112extern int s3c24xx_irq_suspend(void);
113extern void s3c24xx_irq_resume(void);
114#else 112#else
115#define s3c_irq_wake NULL 113#define s3c_irq_wake NULL
116#define s3c_irqext_wake NULL 114#define s3c_irqext_wake NULL
117#define s3c24xx_irq_suspend NULL
118#define s3c24xx_irq_resume NULL
119#endif 115#endif
120 116
121extern struct syscore_ops s3c24xx_irq_syscore_ops;
122
123/* PM debug functions */ 117/* PM debug functions */
124 118
125#ifdef CONFIG_SAMSUNG_PM_DEBUG 119#ifdef CONFIG_SAMSUNG_PM_DEBUG
diff --git a/arch/arm/plat-samsung/include/plat/s3c2416.h b/arch/arm/plat-samsung/include/plat/s3c2416.h
index 7178e338e25e..f27399a3c68d 100644
--- a/arch/arm/plat-samsung/include/plat/s3c2416.h
+++ b/arch/arm/plat-samsung/include/plat/s3c2416.h
@@ -25,6 +25,7 @@ extern int s3c2416_baseclk_add(void);
25 25
26extern void s3c2416_restart(char mode, const char *cmd); 26extern void s3c2416_restart(char mode, const char *cmd);
27 27
28extern void s3c2416_init_irq(void);
28extern struct syscore_ops s3c2416_irq_syscore_ops; 29extern struct syscore_ops s3c2416_irq_syscore_ops;
29 30
30#else 31#else
diff --git a/arch/arm/plat-samsung/include/plat/s3c2443.h b/arch/arm/plat-samsung/include/plat/s3c2443.h
index a5b794ff838b..71b88ec48956 100644
--- a/arch/arm/plat-samsung/include/plat/s3c2443.h
+++ b/arch/arm/plat-samsung/include/plat/s3c2443.h
@@ -25,6 +25,8 @@ extern void s3c2443_init_clocks(int xtal);
25extern int s3c2443_baseclk_add(void); 25extern int s3c2443_baseclk_add(void);
26 26
27extern void s3c2443_restart(char mode, const char *cmd); 27extern void s3c2443_restart(char mode, const char *cmd);
28
29extern void s3c2443_init_irq(void);
28#else 30#else
29#define s3c2443_init_clocks NULL 31#define s3c2443_init_clocks NULL
30#define s3c2443_init_uarts NULL 32#define s3c2443_init_uarts NULL
diff --git a/arch/arm/plat-samsung/include/plat/s5p-time.h b/arch/arm/plat-samsung/include/plat/s5p-time.h
index 3a70aebc9205..9c96f3586ce0 100644
--- a/arch/arm/plat-samsung/include/plat/s5p-time.h
+++ b/arch/arm/plat-samsung/include/plat/s5p-time.h
@@ -36,5 +36,5 @@ struct s5p_timer_source {
36 36
37extern void __init s5p_set_timer_source(enum s5p_timer_mode event, 37extern void __init s5p_set_timer_source(enum s5p_timer_mode event,
38 enum s5p_timer_mode source); 38 enum s5p_timer_mode source);
39extern struct sys_timer s5p_timer; 39extern void s5p_timer_init(void);
40#endif /* __ASM_PLAT_S5P_TIME_H */ 40#endif /* __ASM_PLAT_S5P_TIME_H */
diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-samsung/include/plat/sdhci.h
index 151cc9195cf6..9b87f38fc4f4 100644
--- a/arch/arm/plat-samsung/include/plat/sdhci.h
+++ b/arch/arm/plat-samsung/include/plat/sdhci.h
@@ -374,6 +374,8 @@ static inline void s3c_sdhci_setname(int id, char *name)
374 s3c_device_hsmmc3.name = name; 374 s3c_device_hsmmc3.name = name;
375 break; 375 break;
376#endif 376#endif
377 default:
378 break;
377 } 379 }
378} 380}
379 381
diff --git a/arch/arm/plat-samsung/include/plat/uncompress.h b/arch/arm/plat-samsung/include/plat/uncompress.h
index 7e068d182c3d..438b24846e7f 100644
--- a/arch/arm/plat-samsung/include/plat/uncompress.h
+++ b/arch/arm/plat-samsung/include/plat/uncompress.h
@@ -97,33 +97,6 @@ static inline void flush(void)
97 *((volatile unsigned int __force *)(ad)) = (d); \ 97 *((volatile unsigned int __force *)(ad)) = (d); \
98 } while (0) 98 } while (0)
99 99
100/* CONFIG_S3C_BOOT_WATCHDOG
101 *
102 * Simple boot-time watchdog setup, to reboot the system if there is
103 * any problem with the boot process
104*/
105
106#ifdef CONFIG_S3C_BOOT_WATCHDOG
107
108#define WDOG_COUNT (0xff00)
109
110static inline void arch_decomp_wdog(void)
111{
112 __raw_writel(WDOG_COUNT, S3C2410_WTCNT);
113}
114
115static void arch_decomp_wdog_start(void)
116{
117 __raw_writel(WDOG_COUNT, S3C2410_WTDAT);
118 __raw_writel(WDOG_COUNT, S3C2410_WTCNT);
119 __raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x80), S3C2410_WTCON);
120}
121
122#else
123#define arch_decomp_wdog_start()
124#define arch_decomp_wdog()
125#endif
126
127#ifdef CONFIG_S3C_BOOT_ERROR_RESET 100#ifdef CONFIG_S3C_BOOT_ERROR_RESET
128 101
129static void arch_decomp_error(const char *x) 102static void arch_decomp_error(const char *x)
@@ -173,7 +146,6 @@ arch_decomp_setup(void)
173 */ 146 */
174 147
175 arch_detect_cpu(); 148 arch_detect_cpu();
176 arch_decomp_wdog_start();
177 149
178 /* Enable the UART FIFOs if they where not enabled and our 150 /* Enable the UART FIFOs if they where not enabled and our
179 * configuration says we should turn them on. 151 * configuration says we should turn them on.
diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c
index 15070284343e..002b1472293b 100644
--- a/arch/arm/plat-samsung/pm.c
+++ b/arch/arm/plat-samsung/pm.c
@@ -51,7 +51,7 @@ void s3c_pm_dbg(const char *fmt, ...)
51 char buff[256]; 51 char buff[256];
52 52
53 va_start(va, fmt); 53 va_start(va, fmt);
54 vsprintf(buff, fmt, va); 54 vsnprintf(buff, sizeof(buff), fmt, va);
55 va_end(va); 55 va_end(va);
56 56
57 printascii(buff); 57 printascii(buff);
@@ -243,6 +243,7 @@ int (*pm_cpu_sleep)(unsigned long);
243 243
244static int s3c_pm_enter(suspend_state_t state) 244static int s3c_pm_enter(suspend_state_t state)
245{ 245{
246 int ret;
246 /* ensure the debug is initialised (if enabled) */ 247 /* ensure the debug is initialised (if enabled) */
247 248
248 s3c_pm_debug_init(); 249 s3c_pm_debug_init();
@@ -300,7 +301,9 @@ static int s3c_pm_enter(suspend_state_t state)
300 * we resume as it saves its own register state and restores it 301 * we resume as it saves its own register state and restores it
301 * during the resume. */ 302 * during the resume. */
302 303
303 cpu_suspend(0, pm_cpu_sleep); 304 ret = cpu_suspend(0, pm_cpu_sleep);
305 if (ret)
306 return ret;
304 307
305 /* restore the system state */ 308 /* restore the system state */
306 309
diff --git a/arch/arm/plat-samsung/s3c-dma-ops.c b/arch/arm/plat-samsung/s3c-dma-ops.c
index f99448c48d30..0cc40aea3f5a 100644
--- a/arch/arm/plat-samsung/s3c-dma-ops.c
+++ b/arch/arm/plat-samsung/s3c-dma-ops.c
@@ -36,7 +36,8 @@ static void s3c_dma_cb(struct s3c2410_dma_chan *channel, void *param,
36} 36}
37 37
38static unsigned s3c_dma_request(enum dma_ch dma_ch, 38static unsigned s3c_dma_request(enum dma_ch dma_ch,
39 struct samsung_dma_req *param) 39 struct samsung_dma_req *param,
40 struct device *dev, char *ch_name)
40{ 41{
41 struct cb_data *data; 42 struct cb_data *data;
42 43
diff --git a/arch/arm/plat-samsung/s5p-irq-eint.c b/arch/arm/plat-samsung/s5p-irq-eint.c
index 33bd3f3d20f5..faa651602780 100644
--- a/arch/arm/plat-samsung/s5p-irq-eint.c
+++ b/arch/arm/plat-samsung/s5p-irq-eint.c
@@ -15,8 +15,7 @@
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/device.h> 16#include <linux/device.h>
17#include <linux/gpio.h> 17#include <linux/gpio.h>
18 18#include <linux/irqchip/arm-vic.h>
19#include <asm/hardware/vic.h>
20 19
21#include <plat/regs-irqtype.h> 20#include <plat/regs-irqtype.h>
22 21
diff --git a/arch/arm/plat-samsung/s5p-irq.c b/arch/arm/plat-samsung/s5p-irq.c
index dfb47d638f03..103e371f5e35 100644
--- a/arch/arm/plat-samsung/s5p-irq.c
+++ b/arch/arm/plat-samsung/s5p-irq.c
@@ -13,8 +13,7 @@
13#include <linux/interrupt.h> 13#include <linux/interrupt.h>
14#include <linux/irq.h> 14#include <linux/irq.h>
15#include <linux/io.h> 15#include <linux/io.h>
16 16#include <linux/irqchip/arm-vic.h>
17#include <asm/hardware/vic.h>
18 17
19#include <mach/map.h> 18#include <mach/map.h>
20#include <plat/regs-timer.h> 19#include <plat/regs-timer.h>
diff --git a/arch/arm/plat-samsung/s5p-time.c b/arch/arm/plat-samsung/s5p-time.c
index 028b6e877eb9..e92510cf82ee 100644
--- a/arch/arm/plat-samsung/s5p-time.c
+++ b/arch/arm/plat-samsung/s5p-time.c
@@ -274,15 +274,8 @@ static void __init s5p_clockevent_init(void)
274 clock_rate = clk_get_rate(tin_event); 274 clock_rate = clk_get_rate(tin_event);
275 clock_count_per_tick = clock_rate / HZ; 275 clock_count_per_tick = clock_rate / HZ;
276 276
277 clockevents_calc_mult_shift(&time_event_device,
278 clock_rate, S5PTIMER_MIN_RANGE);
279 time_event_device.max_delta_ns =
280 clockevent_delta2ns(-1, &time_event_device);
281 time_event_device.min_delta_ns =
282 clockevent_delta2ns(1, &time_event_device);
283
284 time_event_device.cpumask = cpumask_of(0); 277 time_event_device.cpumask = cpumask_of(0);
285 clockevents_register_device(&time_event_device); 278 clockevents_config_and_register(&time_event_device, clock_rate, 1, -1);
286 279
287 irq_number = timer_source.event_id + IRQ_TIMER0; 280 irq_number = timer_source.event_id + IRQ_TIMER0;
288 setup_irq(irq_number, &s5p_clock_event_irq); 281 setup_irq(irq_number, &s5p_clock_event_irq);
@@ -393,13 +386,9 @@ static void __init s5p_timer_resources(void)
393 clk_enable(tin_source); 386 clk_enable(tin_source);
394} 387}
395 388
396static void __init s5p_timer_init(void) 389void __init s5p_timer_init(void)
397{ 390{
398 s5p_timer_resources(); 391 s5p_timer_resources();
399 s5p_clockevent_init(); 392 s5p_clockevent_init();
400 s5p_clocksource_init(); 393 s5p_clocksource_init();
401} 394}
402
403struct sys_timer s5p_timer = {
404 .init = s5p_timer_init,
405};
diff --git a/arch/arm/plat-samsung/time.c b/arch/arm/plat-samsung/time.c
index 60552e22f22e..73defd00c3e4 100644
--- a/arch/arm/plat-samsung/time.c
+++ b/arch/arm/plat-samsung/time.c
@@ -27,6 +27,7 @@
27#include <linux/clk.h> 27#include <linux/clk.h>
28#include <linux/io.h> 28#include <linux/io.h>
29#include <linux/platform_device.h> 29#include <linux/platform_device.h>
30#include <linux/syscore_ops.h>
30 31
31#include <asm/mach-types.h> 32#include <asm/mach-types.h>
32 33
@@ -95,7 +96,7 @@ static inline unsigned long timer_ticks_to_usec(unsigned long ticks)
95 * IRQs are disabled before entering here from do_gettimeofday() 96 * IRQs are disabled before entering here from do_gettimeofday()
96 */ 97 */
97 98
98static unsigned long s3c2410_gettimeoffset (void) 99static u32 s3c2410_gettimeoffset(void)
99{ 100{
100 unsigned long tdone; 101 unsigned long tdone;
101 unsigned long tval; 102 unsigned long tval;
@@ -120,7 +121,7 @@ static unsigned long s3c2410_gettimeoffset (void)
120 tdone += timer_startval; 121 tdone += timer_startval;
121 } 122 }
122 123
123 return timer_ticks_to_usec(tdone); 124 return timer_ticks_to_usec(tdone) * 1000;
124} 125}
125 126
126 127
@@ -271,15 +272,16 @@ static void __init s3c2410_timer_resources(void)
271 clk_enable(tin); 272 clk_enable(tin);
272} 273}
273 274
274static void __init s3c2410_timer_init(void) 275static struct syscore_ops s3c24xx_syscore_ops = {
276 .resume = s3c2410_timer_setup,
277};
278
279void __init s3c24xx_timer_init(void)
275{ 280{
281 arch_gettimeoffset = s3c2410_gettimeoffset;
282
276 s3c2410_timer_resources(); 283 s3c2410_timer_resources();
277 s3c2410_timer_setup(); 284 s3c2410_timer_setup();
278 setup_irq(IRQ_TIMER4, &s3c2410_timer_irq); 285 setup_irq(IRQ_TIMER4, &s3c2410_timer_irq);
286 register_syscore_ops(&s3c24xx_syscore_ops);
279} 287}
280
281struct sys_timer s3c24xx_timer = {
282 .init = s3c2410_timer_init,
283 .offset = s3c2410_gettimeoffset,
284 .resume = s3c2410_timer_setup
285};
diff --git a/arch/arm/plat-spear/Kconfig b/arch/arm/plat-spear/Kconfig
index 87dbd81bdf51..739d016eb273 100644
--- a/arch/arm/plat-spear/Kconfig
+++ b/arch/arm/plat-spear/Kconfig
@@ -10,6 +10,7 @@ choice
10 10
11config ARCH_SPEAR13XX 11config ARCH_SPEAR13XX
12 bool "ST SPEAr13xx with Device Tree" 12 bool "ST SPEAr13xx with Device Tree"
13 select ARCH_HAVE_CPUFREQ
13 select ARM_GIC 14 select ARM_GIC
14 select CPU_V7 15 select CPU_V7
15 select GPIO_SPEAR_SPICS 16 select GPIO_SPEAR_SPICS
diff --git a/arch/arm/plat-spear/include/plat/uncompress.h b/arch/arm/plat-spear/include/plat/uncompress.h
index 2ce6cb17a98b..51b2dc93e4da 100644
--- a/arch/arm/plat-spear/include/plat/uncompress.h
+++ b/arch/arm/plat-spear/include/plat/uncompress.h
@@ -38,6 +38,5 @@ static inline void flush(void)
38 * nothing to do 38 * nothing to do
39 */ 39 */
40#define arch_decomp_setup() 40#define arch_decomp_setup()
41#define arch_decomp_wdog()
42 41
43#endif /* __PLAT_UNCOMPRESS_H */ 42#endif /* __PLAT_UNCOMPRESS_H */
diff --git a/arch/arm/plat-spear/restart.c b/arch/arm/plat-spear/restart.c
index 4f990115b1bd..7d4616d5df11 100644
--- a/arch/arm/plat-spear/restart.c
+++ b/arch/arm/plat-spear/restart.c
@@ -11,8 +11,8 @@
11 * warranty of any kind, whether express or implied. 11 * warranty of any kind, whether express or implied.
12 */ 12 */
13#include <linux/io.h> 13#include <linux/io.h>
14#include <linux/amba/sp810.h>
14#include <asm/system_misc.h> 15#include <asm/system_misc.h>
15#include <asm/hardware/sp810.h>
16#include <mach/spear.h> 16#include <mach/spear.h>
17#include <mach/generic.h> 17#include <mach/generic.h>
18 18
diff --git a/arch/arm/plat-spear/time.c b/arch/arm/plat-spear/time.c
index 03321af5de9f..bd5c53cd6962 100644
--- a/arch/arm/plat-spear/time.c
+++ b/arch/arm/plat-spear/time.c
@@ -186,15 +186,9 @@ static void __init spear_clockevent_init(int irq)
186 tick_rate = clk_get_rate(gpt_clk); 186 tick_rate = clk_get_rate(gpt_clk);
187 tick_rate >>= CTRL_PRESCALER16; 187 tick_rate >>= CTRL_PRESCALER16;
188 188
189 clockevents_calc_mult_shift(&clkevt, tick_rate, SPEAR_MIN_RANGE);
190
191 clkevt.max_delta_ns = clockevent_delta2ns(0xfff0,
192 &clkevt);
193 clkevt.min_delta_ns = clockevent_delta2ns(3, &clkevt);
194
195 clkevt.cpumask = cpumask_of(0); 189 clkevt.cpumask = cpumask_of(0);
196 190
197 clockevents_register_device(&clkevt); 191 clockevents_config_and_register(&clkevt, tick_rate, 3, 0xfff0);
198 192
199 setup_irq(irq, &spear_timer_irq); 193 setup_irq(irq, &spear_timer_irq);
200} 194}
diff --git a/arch/arm/plat-versatile/platsmp.c b/arch/arm/plat-versatile/platsmp.c
index 04ca4937d8ca..f2ac15561778 100644
--- a/arch/arm/plat-versatile/platsmp.c
+++ b/arch/arm/plat-versatile/platsmp.c
@@ -14,10 +14,10 @@
14#include <linux/device.h> 14#include <linux/device.h>
15#include <linux/jiffies.h> 15#include <linux/jiffies.h>
16#include <linux/smp.h> 16#include <linux/smp.h>
17#include <linux/irqchip/arm-gic.h>
17 18
18#include <asm/cacheflush.h> 19#include <asm/cacheflush.h>
19#include <asm/smp_plat.h> 20#include <asm/smp_plat.h>
20#include <asm/hardware/gic.h>
21 21
22/* 22/*
23 * Write pen_release in a way that is guaranteed to be visible to all 23 * Write pen_release in a way that is guaranteed to be visible to all
@@ -79,7 +79,7 @@ int __cpuinit versatile_boot_secondary(unsigned int cpu, struct task_struct *idl
79 * the boot monitor to read the system wide flags register, 79 * the boot monitor to read the system wide flags register,
80 * and branch to the address found there. 80 * and branch to the address found there.
81 */ 81 */
82 gic_raise_softirq(cpumask_of(cpu), 0); 82 arch_send_wakeup_ipi_mask(cpumask_of(cpu));
83 83
84 timeout = jiffies + (1 * HZ); 84 timeout = jiffies + (1 * HZ);
85 while (time_before(jiffies, timeout)) { 85 while (time_before(jiffies, timeout)) {
diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
index dd5e56f95f3f..8d10dc8a1e17 100644
--- a/arch/arm/vfp/vfphw.S
+++ b/arch/arm/vfp/vfphw.S
@@ -22,12 +22,14 @@
22 .macro DBGSTR, str 22 .macro DBGSTR, str
23#ifdef DEBUG 23#ifdef DEBUG
24 stmfd sp!, {r0-r3, ip, lr} 24 stmfd sp!, {r0-r3, ip, lr}
25 add r0, pc, #4 25 ldr r0, =1f
26 bl printk 26 bl printk
27 b 1f 27 ldmfd sp!, {r0-r3, ip, lr}
28 .asciz KERN_DEBUG "VFP: \str\n" 28
29 .balign 4 29 .pushsection .rodata, "a"
301: ldmfd sp!, {r0-r3, ip, lr} 301: .ascii KERN_DEBUG "VFP: \str\n"
31 .byte 0
32 .previous
31#endif 33#endif
32 .endm 34 .endm
33 35
@@ -35,12 +37,14 @@
35#ifdef DEBUG 37#ifdef DEBUG
36 stmfd sp!, {r0-r3, ip, lr} 38 stmfd sp!, {r0-r3, ip, lr}
37 mov r1, \arg 39 mov r1, \arg
38 add r0, pc, #4 40 ldr r0, =1f
39 bl printk 41 bl printk
40 b 1f 42 ldmfd sp!, {r0-r3, ip, lr}
41 .asciz KERN_DEBUG "VFP: \str\n" 43
42 .balign 4 44 .pushsection .rodata, "a"
431: ldmfd sp!, {r0-r3, ip, lr} 451: .ascii KERN_DEBUG "VFP: \str\n"
46 .byte 0
47 .previous
44#endif 48#endif
45 .endm 49 .endm
46 50
@@ -50,12 +54,14 @@
50 mov r3, \arg3 54 mov r3, \arg3
51 mov r2, \arg2 55 mov r2, \arg2
52 mov r1, \arg1 56 mov r1, \arg1
53 add r0, pc, #4 57 ldr r0, =1f
54 bl printk 58 bl printk
55 b 1f 59 ldmfd sp!, {r0-r3, ip, lr}
56 .asciz KERN_DEBUG "VFP: \str\n" 60
57 .balign 4 61 .pushsection .rodata, "a"
581: ldmfd sp!, {r0-r3, ip, lr} 621: .ascii KERN_DEBUG "VFP: \str\n"
63 .byte 0
64 .previous
59#endif 65#endif
60 .endm 66 .endm
61 67
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 3b44e0dd0a93..5dfbb0b8e7f4 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -413,7 +413,7 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs)
413 * If there isn't a second FP instruction, exit now. Note that 413 * If there isn't a second FP instruction, exit now. Note that
414 * the FPEXC.FP2V bit is valid only if FPEXC.EX is 1. 414 * the FPEXC.FP2V bit is valid only if FPEXC.EX is 1.
415 */ 415 */
416 if (fpexc ^ (FPEXC_EX | FPEXC_FP2V)) 416 if ((fpexc & (FPEXC_EX | FPEXC_FP2V)) != (FPEXC_EX | FPEXC_FP2V))
417 goto exit; 417 goto exit;
418 418
419 /* 419 /*
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index 7a32976fa2a3..8dc0605a9ce9 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -59,14 +59,16 @@ static int map_foreign_page(unsigned long lpfn, unsigned long fgmfn,
59 }; 59 };
60 xen_ulong_t idx = fgmfn; 60 xen_ulong_t idx = fgmfn;
61 xen_pfn_t gpfn = lpfn; 61 xen_pfn_t gpfn = lpfn;
62 int err = 0;
62 63
63 set_xen_guest_handle(xatp.idxs, &idx); 64 set_xen_guest_handle(xatp.idxs, &idx);
64 set_xen_guest_handle(xatp.gpfns, &gpfn); 65 set_xen_guest_handle(xatp.gpfns, &gpfn);
66 set_xen_guest_handle(xatp.errs, &err);
65 67
66 rc = HYPERVISOR_memory_op(XENMEM_add_to_physmap_range, &xatp); 68 rc = HYPERVISOR_memory_op(XENMEM_add_to_physmap_range, &xatp);
67 if (rc) { 69 if (rc || err) {
68 pr_warn("Failed to map pfn to mfn rc:%d pfn:%lx mfn:%lx\n", 70 pr_warn("Failed to map pfn to mfn rc:%d:%d pfn:%lx mfn:%lx\n",
69 rc, lpfn, fgmfn); 71 rc, err, lpfn, fgmfn);
70 return 1; 72 return 1;
71 } 73 }
72 return 0; 74 return 0;